Thursday, May 28, 2009

iPod Touch

For the economically minded consumer who doesn't need the phone, cell phone camera or gps, but has wi-fi and just needs a solid pda get the ipod touch 8GB 2nd generation. I got a refurbished one for $179.00, and for my chinese work, it is amazing. It does chinese stroke recognition, there are free chinese dictionary apps, skype is came out with a free app as well.


However to use skype you need a microphone for your ipod touch. The charger that comes with it charges off of your computer so if you go on vacation you will need a wall and/or car charger. You will also want to get an audio/video cable set so you can project videos onto your tv set.

JVC Everio

The JVC Everio offers several models. Probably one of the most appealing thing about the everio is that it records to MPEG2 (uncompressed DVD) instead of MPEG4 (highly compressed like a digital camera's video). Its resolution is also DVD resolution 720x480, however it is more like tv quality (interlaced video) and less like digital HD.

It is offering a JVC Everio GZ-MS100 model right now for $180, which is really nice, considering that flash memory will continue to get cheaper. So instead of paying $350 for a hard drive camcorder... get a flash based one, and get a 2GB SD card. In a few years 8GB and 16GB SDHC cards will be cheap, and you can just use that for your camcorder.

For accessories it might be a good idea to get an extra JVC Everio battery. Because even if you have space to record 4 hours of video on your SD card, it doesn't mean your video camera battery will last that long

Tuesday, May 26, 2009

nohup command

nohup ./>log_myscript.log 2>&1 &
tail -f log_myscript.log

nohup ./>log_myscript_`date +%Y%m%d`.log 2>&1 &
tail -f log_myscript_`date +%Y%m%d`.log

`date +%Y%m%d` - grabs current date, inserts it into filename
nohup - script run even after terminal/ssh session ends
>log_myscri... - captures output to log file named log_myscr..
2>&1 - outputs stderr to stdout
& - makes it run in the background
tail -f - watches log, CTRL-C will not stop script

Sunday, May 24, 2009

rsync windows to linux

Scenario: windows has your user data and linux is your backup server.

1. compile cygwin... use the following, place them in your path
(c:\windows\system32 or c:\server\bin\)

2. on the windows machine, run ssh-keygen at the command promptit will create a file
C:\Documents and Settings\user\.ssh\

3. copy C:\Documents and Settings\user\.ssh\ to the linux machine... then authorize it:
mkdir ~/.ssh
cat >>~/.ssh/authorized_keys2
mkdir ~/backups

4. If you want to rsync F:\apps\myfolder then save the following as... backup.bat
cd \apps
"c:\server\bin\rsync.exe" -arv -e "c:\server\bin\ssh.exe" myfolder user@linux:/home/user/backups/

Tuesday, May 19, 2009

gpg crontab

1. executing in crontab provides a different set of environment variables, so the --homedir is needed to specify which keyring to use. In the example below, we use root's keyring.
2. --batch is necessary for crontabs because it tells gpg there is no user to interact with
3. 2>&1 is useful because it redirects stderr to stdout so you can better debug any errors you may be having
4. -d is for decrypt. in this case we are decrypting on a cron job

/usr/bin/gpg --batch --homedir /root/.gnupg --passphrase mypassphrase -o /home/output.csv -d /home/input.csv.gpg 2>&1