Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Monday, July 15, 2013

rsync - a tool for synchronizing files

Rsync is a powerful Unix-type command line tool. I use it to backup my data. The rsync in Mac OX S is version 2.69. Today I upgrade it to version 3.09.

1. Download rsync source file rsync-3.0.9.tar.gz, extract and install:
    $ tar xzvf rsync-3.0.9.tar.gz
    $ cd rsync-3.0.9
    $ ./configure
    $ make 
    $ sudo make install
    It install rsync to /usr/local/bin, so need make a symbolic link:
    $ sudo mv /usr/bin/rsync rsync.old (change old rsync name)
    $ sudo ln -s /usr/local/bin/rsync /usr/bin/rsync

    Monday, July 1, 2013

    Fortune Cookie

    Fortune cookie is an interesting program in Unix-like system. I used it when install Slackware Linux in my PC more than 15 years ago. Today I re-install it in my iMac and used with cowsay and lolcat.
    1. Install Xcode command line tools. (its size is much smaller than Xcode)
    2. Install Homebrew
    3. terminal--->brew install fortune-mod cowsay
    4. Add rainbow effect with lolcat. Install it with gem.


    More fancy staffs can be added to .profile to change the cow file randomly when you start terminal.
    COWDIR=/usr/local/Cellar/cowsay/3.03/share/cows/
    COWNUM=$[$[RANDOM%$(ls $COWDIR | wc -l)]+1]
    COWFILE=$(ls $COWDIR | sed -n ''$COWNUM'p')
    fortune | cowsay -f $COWFILE| lolcat