Wednesday, 28 August 2013

Sync Files With rsync

rsync can be used for remote backups and syncing files. It is efficient in that it copies only changes in subsequent updates.
For using rsync from windows, install cwRsync. cwRsync works well with cmd than with cygwin bash or similar terminals under windows.
rsync -zvr -e 'ssh -p 2222' sourceDir user@ip:/home/user/dir
-z compress
-v verbose
-r recusive
-e remote shell, -p can be used if ssh runs on a different port.

Friday, 9 August 2013

Fun with OSAScript

osascript in OS X executes AppleScripts and other Open Scripting Architecture (OSA) language scripts. This allows AppleScripts to be executed from the terminal as well.
The below command will tell Finder to display a dialog with the given message.
osascript -e 'tell app "Finder" to display dialog "Hi! From OS X. Steve Jobs is watching you."'
Since we can do this using a terminal, with a bit of creativity we can have pranks. :D

SSH into Maemo

1. Install roosh (if you have not already).
2. Install OpenSSH (both server and client).
3. Next we have to set a password for the default user.
sudo gainroot
passwd user #user is the username of the default account
#enter your password when prompted
4. Start the ssh server
/etc/init.d/ssh restart #in case if it's already running
Access the phone remotely using ssh as user@the-ip-of-the-phone. You can find the IP address using the ifconfig command.