Saturday, August 13, 2011

ghostscript to compress or reduce a pdf file

ghostscript allows you to do amazing things with pdf's etc from the command line. this:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

compresses a large pdf into a manageble size for (eg) email. Replace your file names output.pdf and input.pdf files with your file names.

example: a 17 page scan at 300dpi colour = 135mb - after running it through gs with the settings at 'SCREEN' gives a low quality (just about good enough for screen reading) pdf of 800kb. 'EBOOK' setting gives a nice quality 3.5mb version (recommended).

Other quality settings:

-dPDFSETTINGS=/screen (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook (low quality, 150 dpi images)
-dPDFSETTINGS=/printer (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default (almost identical to /screen)


These tips from: http://www.ubuntugeek.com/ubuntu-tiphowto-reduce-adobe-acrobat-file-size-from-command-line.html and http://milan.kupcevic.net/ghostscript-ps-pdf/ Thanks.

Saturday, June 18, 2011

adding more than just the primary calendar account of a google apps user to iphone/ipad

Private google calendars, which have been shared with select other users:
In IOS, these are added: Settings --> Mail, Contacts, Calendars --> Add Account --> Other --> Add CalDav Account

server= calendar.google.com
username=  your own gmail username (ie your email address)
password= go figure
description= Calendar Description of your choosing

If this is your own primary google-cal,  (default) cal for an account, you're done. (These are referred to by that users email address)

If it's an additional (non-primary) calendar account, of your own or another persons primary/additional:

go to 'advanced settings' section of the calendar account.

Nb. Stupidy in newer ios you can't edit 'advanced settings' til you've created the new calendar, so the only thing I could see to do was save it with your own primary calendar email address, then re-edit and insert the calendar ID of the 3rd primary/secondary calendar ID in the url field:

The google ID is to be found in the googlecal 'calendar details' section of main google apps website.

https://www.google.com/calendar/dav/ [ your Google Calendar ID ] /user

This used to look fine in older ios but in newer (ipad?) it creates another level of calendar account which shows in the list. Confusingly when you go to advanced settings now it doesn't show the ID url as older ios used to - BUT they do work!

Public 'view only' cals ('subscribed' calendars)
Settings --> Mail, Contacts, Calendars --> Add Account --> Other -->Add subscribed calendar
(you'll need to cut and paste in the url: they end in .ics)

BTW you don't need to do any of this in Android!

Wednesday, April 20, 2011

WorshipTracker MySQL

login to remote host:
#:~$ mysql -h hostIP -u username -p databasename

Tuesday, February 15, 2011

samba troubleshooting

suddenly all users except markp could not access users within the 'shares' (shared) folder.

Tools to test:

see log on the server at /var/log/samba/log.smbd

see if the access problem exists on the server, as well as the windows client;

smbclient //localhost/share_to_test -U annet

problem in my instance (Feb 2011) was that the group name of the /home/shares folder had changed from 'john' to 'users'
Probably caused by Unison sync foulup at my end (user 1000 at home overwrote user 100 at TC).

Saturday, February 12, 2011

using NFSv4 exports for linux

about the permissions: Have setup using the ubuntu guide for NFSv4, as per here: https://help.ubuntu.com/community/NFSv4Howto
I note that the settings in /etc/exports mean that the owner and group of the server folders can only be accessed by a user on the client machine of the same name...

Monday, January 24, 2011

mp3 and flac

Jan 2011. Here's what i'm doing with my music:

flacs go in flac folder; mp3s in their own folder.

1. Rip to flac with rythymbox, google for album art and place in flac folder, per album.
2. Update flac tags with the piccy using easytag
3. use Soundconvertor to convert to MP3, tags incl piccy seem to transfer OK.

nb. best to simply plnk the MP3s in the original flac folder, then duplicate and then copy the MP3s with their parent folders to the master MP3 folder.

things that didn't work:
1. trying (different ways) to create AAC from the flac, tag track number problem.
2. using the create folders option in Soundconvertor to plank the MP3s directly, duplicated the album name.
3. change messy names, creates underscore under every space.

Use MP3 folder in itunes, use flac folder for mythtv.

Saturday, September 18, 2010

VCN: 2nd (and subsequent) ubuntu gnome desktops

Often when remote accessing the gnome desktop of a linux machine, the physical desktop of the local machine is not necessarily the one that you want use. eg there is already a user on that desktop, or the resolution of the local monitor is often too large for comfortable vnc use.

So: in addition to using the gnome 'remote desktop' feature (which uses vinagre btw), install in addition vnc4server:
apt-get install vnc4server
when using a vnc viewer, the default display (:0) will be accessed when you run:
vncviewer
when vnc4server is additionally installed running the command
vncserver
will start up a 2nd desktop accessible thus:
vncviewer 192.168.1.1:1
each time the command is run another desktop is set running; the desktop number increments each time, as does the port number (desktop:0 starts at 5900 by default)
The type of desktop is setup in the file: ~/user/.vnc/xstartup and by default the twm type desktop is not much help.
To edit the xstartup file (using nano) so that it will start up a regular gnome desktop add this:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

#[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

unset SESSION_MANAGER
sh /etc/X11/xinit/xinitrc

If you've just edited the above and had previously set a desktop:1 running, stop it with:
vncserver -kill :1
then start the server again. When accessing this time you should have a regular gnome desktop.

Sometimes I've had trouble using the gnome desktop over VNC, whereby the menus don't show/dropdown on the client machine. Changing the 'appearance' setting to visual enhancements = none (under system-> preferences) on the server side has usually sorted this.