Friday, November 18, 2011

Automatically fix rotation of images

My camera stores the orientation of the images in the header, but this is not recognized by most programs.
To automatically fix the image rotations I use:

jhead -autorot

And to recursively rotate all images:

find . -name "*.JPG" -exec jhead -autorot -exonly {} \;

Monday, November 14, 2011

GoDaddy domains with webfaction hosting

In your GoDaddy account select Set Nameservers and then I have specific nameservers for my domains (Documented here)


Enter webfaction's domain name servers (Documented here):
ns1.webfaction.com
ns2.webfaction.com
ns3.webfaction.com
ns4.webfaction.com 


Wait an hour

Thursday, November 10, 2011

Downloading data from GAE

As documented here you can download your data into a blob:

appcfg.py download_data --application=[app-id] --filename=[output dump file] --url=http://[app-id].appspot.com/_ah/remote_api

And then upload to another app:
appcfg.py upload_data --application=[app-id] --kind=[kind] --filename=[input dump file]


Or to work with structured data.

First generate the bulkloader file:

appcfg.py create_bulkloader_config --filename=bulkloader.yaml --url=http://[app-id].appspot.com/_ah/remote_api

Set the connectors to CSV

Download the data:

appcfg.py download_data --application=[app-id] --config_file=bulkloader.yaml --filename=[csv file] --db_filename=progress.sql --kind=[which entity]
--db_filename is important for large uploads to avoid re-uploading the same data

Deploying code with rsync

I use rsync to deploy code to my web server:

rsync --recursive --compress \
        --verbose --progress --stats \
        --times --perms --delete \
        --exclude "*~" --exclude "*.pyc"  \
        . login@server:path

This command will transfer the current directory and all sub-directories and files to my server, but only transfer modified files to save time and bandwidth.
verbose, progress, and stats display useful output
times / perms ensure the file timestamps / permissions are the same on my server
delete will delete remote files when deleted locally
exclude temporary files

Sunday, November 6, 2011

Convert DVD to AVI

I tried a few programs to burn a DVD and found acidrip works best.

Remember:
  • set size to around 1000 for each hour
  • turn scale off
  • detect the correct crop size
  • preview results

Code syntax highlighting

I use this when I need to syntax highlight code snippets:
http://tohtml.com

Wednesday, November 2, 2011

Writing in Korean

Install ibus, ibus-m17n, ibus-hangul

Restart - I couldn't use ibus in Chrome or choose the Romaji keyboard option until restarting

Ctrl-Space to activate language. Change keyboard to Romaji for English keyboard.

Scim also has a Korean package but I couldn't get it to activate reliably.