COPYRIGHT RESERVED 2009 BY MAX TSAI



Visit Max Tsai at Facebook | Twitter | atom

Showing posts with label Systems. Show all posts
Showing posts with label Systems. Show all posts

Sunday, April 27, 2008

RSYNC via SSH in CRON jobs

This is my new favor thing to do .. rsync (http://samba.anu.edu.au/rsync/) through ssh!

1. Set up SSH key pair between the same login at two hosts:
  1. At the Source Host (copy from):
    1. Do a ssh-keygen -t rsa to generate the private/public key pair
    2. It is commonly to save it under ~/.ssh as id_rsa and id_rsa.pub
    3. I would now do a sftp the public key file (id_rsa.pub) to my Target Host and save it under .ssh as authorized_keys2. At the same time, you can add the host key.
  2. Test it at the Source Host
    ssh TargetHost (no User ID required assuming the same account is used on both hosts).
  3. Working? Good!
2. Samples for RSYNC
  1. #rsync -ave ssh TargetHost:/export/test/ /export/test/
    sync'ing from Tager Host to Local Disk
  2. #rsync -ave ssh /export/test/ TargetHost:/export/test/
    sync'ing from Tager Host to Local Disk
  3. with Delete option to remove old deleted files
    #rsync -ave ssh --delete TargetHost:/export/test/ /export/test/

Sunday, March 9, 2008

UNIX date -- it is easier than you think!

So, if you need a past or future date from today, UNIX date command makes it a piece of cake. I was asked by a friend on this:

28 days ago

Linux:
date --date='28 days ago' +%Y%m%d

OS X:
date -r $((`date +%s` - 2419200)) +%Y%m%d

I have not tried it, but it should work on FreeBSD:
date -v -28d +%Y%m%d

Wednesday, April 19, 2006

Apple Boot Camp - Test out!

Actually, I am working on a Mac Mini (Dore Duo) porject for making it a Live Casting portable machine. I think it is a real good fit! However, since having this oppertunity, I am tetsing out the Apple Boot Camp as well .. why not! Only 10G space..

The process is pretty easy on the OS X side:
1. Update OS X to the most recent - that is what users should do anyway.
2. Download the Fireware upgrade. This is a little tricky if you do not read the instruction carefully. Download -> Install -> Shutdown (yes. it means shutdown; so, you have to power it on - this could be some inconvience for PC users) -> Power On, BUT make sure to HOLD the power button until the power lite flashing - that means the fireware upgrade is taking place.
3. Download Apple Boot Camp 'software.' Yes, you need to download and install it. Once that is done, you will then click on the Boot Camp utility to start installation of Windows XP. - I forgot where it asks to repartition, but somewhere is the process. By the way, do not forget to make a Mac Drive CD when it asks if you do not have one yet.
4. For XP users, the installation is the same as on PCs.

Lessons learnt:
1. No 64bit XP yet. Tried, but rejected.
2. Thinking of XP Media Center. I would think that should work since it is XP based. NO - there are TWO installation CDs. It is not supported. Why????
So far,

I still want to try Vista (32bit) and Linux when my time allows....