Posts Tagged bash

Auto Backup using Dropbox in Linux/Mac

I had some folders on my disk which I wanted to keep a copy online as a backup and for viewing from other places. Its not always possible to save all the essentials in the drop box folder itself to be auto backed up. Thus I wrote a very small script which does this for me. All it does is read all the folders which needs to be backed up from the text file “dropboxFolders.txt” and copy them to dropbox folder. The rest is done by dropbox scripts. Hence I expect the dropbox program to be running always in the background. So here is the script:

#!/bin/sh
foldersInfo="dropboxFolders.txt"
dropboxFolder="/home/<user>/Dropbox/"
while read line
do
from=`echo "$line" | cut -d":" -f1`
to=`echo "$line" | cut  -d":" -f2`
echo $from" to "$to
mkdir -p "$dropboxFolder$to"
cp -R "$from" "$dropboxFolder$to"
done <$foldersInfo

The file dropboxFolders.txt should be in the format :. Here is an example of the file:

/home/<user>/WorkingCode:WorkingCode

Continue reading “Auto Backup using Dropbox in Linux/Mac” »


, ,

No Comments

Automatic Command Archive

The default command storing size of ubuntu is 500 commands. It stores the commands in home folder in the file “.bash_history” .
The problem is 500 commands is too short of a size.
One method is to increase the command size to a large value by changing the $HISTFILESIZE variable using the following command

Continue reading “Automatic Command Archive” »


, , , , , , , ,

2 Comments

BSNL Dataone Auto Downloader

Bsnl(India) provides an account that has 2am to 8am unlimited download. It was not easy to wake up at 2am and switch on the computer and sleep again. So I tried to find a method to switch on the computer automatically at 2am and download and shutdown at 8am. Although the I thought the idea was foolish, I found out that there actually is a method for doing it. “ACPI Alarm” was introduced in 1999 or so (Even my old PC had it).

Continue reading “BSNL Dataone Auto Downloader” »


, , , , , , , , ,

6 Comments

Script for Auto Copying of Cds/Dvds

Here is a script that i created for automatically copying all the files in cd to a folder and ejecting and waiting for the next cd.
So here is how it works.
You need to change the folder names and paths accordingly. And the shell script as

Continue reading “Script for Auto Copying of Cds/Dvds” »


, , , , , , , ,

No Comments

Copy in Linux with Ui

The program here is an UI for cp command. I have used cp in the background but over that I am just monitoring the files copied and speed of copying.
It’s not a perfected program. It’s quick one but works fine.
Execution:
Create a file named copy and insert the following code and give execute permission

Continue reading “Copy in Linux with Ui” »


, , , ,

1 Comment

Automatic Desktop Wallpaper Changer for Linux

I have a lot of wallpaper that I wanted to switch automatically. After a lot of search i found that there a command way to control all the gnome settings. So I the command I used is “gconftool-2“.
So code is like:

Continue reading “Automatic Desktop Wallpaper Changer for Linux” »


, , , , , , , ,

4 Comments

Find Invisible Users In Gmail

Finding who is invisible is something that I always wanted to do.It’s always fun to ping a person who feels none can see him/her online. While studying XMPP protocol I found out that even when the person is offline the chat client knows that person is online.
The Chat Client should know who all are really online at any given time.This is because even when the person is invisible he/she should have a buddy list showing online users.

Continue reading “Find Invisible Users In Gmail” »


, , , , , , ,

130 Comments

Restoring the Grub after reinstalling Windows

After reinstalling windows or fixing MBR(Master Boot Record) you always loose your grub and you cannot boot to your linux. So this post is about the methods of restoring the grub. There are three methods I use. I will explain all three.

Continue reading “Restoring the Grub after reinstalling Windows” »


, , , , , , , , ,

10 Comments