Skip to main content

Posts

Rsync multiple files, folders

Needed to rsync the 3 folders. So the script to do that is as follows ("rsync_backup") It requires the key named "23.pub" to be appended in "~/.ssh/authorized_keys" and in crontab -e "*/1 * * * * /var/www/repositories/rsync_backup" It will backup every minute /*********************************************************************/ #!/bin/sh RSYNC=/usr/bin/rsync SSH=/usr/bin/ssh KEY=/home/quickstart/.ssh/23 RUSER=quickstart RHOST=172.20.1.139 RPATH1=/var/www/repositories/ LPATH1=/var/www/repositories/repos/ RPATH2=/var/www/icode/ LPATH2=/var/www/repositories/icode/ RPATH3=/home/git/repositories/ LPATH3=/var/www/repositories/git/ $RSYNC -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH1 $LPATH1 $RSYNC -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH2 $LPATH2 $RSYNC -az -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH3 $LPATH3

automatic repo commit

The whole idea of computing is that the computer should work more than the man. I realized this when I had to manually add origin and commit, push every repository that I downloaded. So here's the script that does the job for me. <?php  echo exec('git init');  echo exec('touch readme');  echo exec('git remote rm origin');  echo exec('git add .');  echo exec('git remote add origin git@localhost:'.$argv[1].'.git');   echo exec('git commit -a -m "some message"');  echo exec('git push origin master');  ?>

Copying a MySQL table with schema and keys, but not data!

I wanted to clone the schema of my table "aitossne-icode.sshkey" into a new table "kaydir.keytab". Here's what I did : mysql> use keydir Database changed mysql> CREATE table keytab LIKE aitossne_icode.sshkey; Query OK, 0 rows affected (0.06 sec) mysql> show tables     -> ; +------------------+ | Tables_in_keydir | +------------------+ | keytab           | +------------------+ 1 row in set (0.00 sec)

वक़्त का दरिया

कितना वक़्त  खोया  मैंने , खोने  को  और  पाने  को , काश  की  ये  वक़्त  मिल  जाता , फिर  से  मुझे  बिताने  को  ... फ़रियाद  किया ,याद  किया , कितना  वक़्त  बर्बाद  किया , हँसा -रोया -गाया , पर  आवाज़  नहीं  पहुंची  मेरी , जाता  रहा  मूरत  के  आगे  घंटी  मगर  बजाने  को .. जज्बातों  की  तपिश  में  चमका  करता  था , एक  हलकी  सी  बारिश  में  सब  कुछ  बह  गया , किसने कहा  था  मुझे , रेत  का  घर  बनाने  को .. कभी  रिश्तों  का  नाम  दिया  था  जिनको  मैंने , आज  सब  किश्तों  में  अदा  करता  जाता  हूँ  मैं , मेरे  बदले  कौन आएगा  मेरा  क़र्ज़  चुकाने  को .. अभिनेता ...

Solution: Password for ‘(null)’ GNOME keyring

Solution: Password for ‘(null)’ GNOME keyring December 14, 2010 selvamanisampath Uncategorized 1 Comment You can commit you project using subversion as follows: svn commit -m “Your comment here for your modification on the project” –username <gmailusername> Then the following prompt should be opened for commiting your project successfully… Password for ‘<gmailusername>’ : For this password, you should give your code.google.com password assigned to you while hosting your project. First time commiting project using svn commit will work properly. If you are commiting your project next time, you can get the prompt like Password for ‘(null)’ GNOME keyring: which means, Multiple keyrings are present on a users system. All users will have a default keyring, and another which is only stored in memory. For each commit, gnome-keyring stores the user details in another keyring. To disable this, open th...

Hidden user account in windows 7

Run  Registry Editor  (RegEdit.exe). Navigate to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList Note: If  SpecialAccounts  and  UserList  is not found, create new sub-key and name them accordingly. Select  UserList , and in the right pane, right click on any blank space, and point to  New  ->  DWORD (32-bit) Value . Name the new DWORD registry value name as the exact same name that match the name of the user account to be hidden. For example, if the user ID of the user account is "Prince", the name the registry value as Prince. Double click on DWORD registry value, and set the value data to 0 in oder to hide the account from Welcome Screen. Tip: To display the user account on Welcome Screen again so that it’s visible again, delete the registry entry, or set the value data to 1. Exit Registry Editor. Log off or restart computer to make ...

configure ini like files in PHP

<? ///////////////////////////////////////////////////////////////////////// // // class.INIFile.php3 - implements a simple INIFile Parser // /// Author : Mo // // Description: // I just wandered how to sawe simple parameters not in a database but in a file // So starting every time from scratch isn't comfortable and I desided to write this // small unit for workin with ini like files // Some Examples: // // $ini = new INIFile("./ini.ini"); // //Read entire group in an associative array // $grp = $ini->read_group("MAIN"); // //prints the variables in the group // if ($grp) // for(reset($grp); $key=key($grp); next($grp)) // { // echo "GROUP ".$key."=".$grp[$key]."<br>"; // } // //set a variable to a value // $ini->set_var("NEW","USER","JOHN"); // //Save the file // $ini->save_data(); class INIFile { var $INI_FILE_NAME = ""; var $ERROR = "...

Jocks vs Nerds

Michael Jordan having "retired," with $40 million in endorsements, makes $178,100 a day, working or not. If he sleeps 7 hours a night, he makes $52,000 every night while visions of sugarplums dance in his head. If he goes to see a movie, it'll cost him $7.00, but he'll make $18,550 while he's there. If he decides to have a 5-minute egg, he'll make $618 while boiling it. He makes $7,415/hr more than minimum wage. He'll make $3,710 while watching each episode of Friends. If he wanted to save up for a new Acura NSX ($90,000) it would take him a whole 12 hours. If someone were to hand him his salary and endorsement money, they would have to do it at the rate of $2.00 every second. He'll probably pay around $200 for a nice round of golf, but will be reimbursed $33,390 for that round. Assuming he puts the federal maximum of 15% of his income into a tax deferred account (401k), his contributions will hit the federal cap of $9500 at 8:30 a.m....