Friday, January 28, 2011

Sorting IP addresses

Where input_file contains one IP address per line.

sort -u -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n input_file

Wikimedia : preventing new account creation

In LocalSettings.php, add this :

# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;

Source

Tuesday, January 25, 2011

Exercises to stop snoring

- Repeat each vowel (a,e,i,o,u) out loud for three minutes throughout day.
- Place the tip of your tongue behind your top front teeth. Slide your tongue backwards for 3 minutes a day.
- Close your mouth and purse your lips. Hold for 30 seconds.
- With mouth open, move jaw to the right and hold for 30 seconds. Repeat on left side.

Source

Tuesday, January 18, 2011

Mac switching between windows like windows alt-tab

For switching between applications : Command+Tab
For switching between windows of a single application : Command + ~(tilda)

Monday, January 17, 2011

SVN Status Simple Cheat Sheet

Source

SVN Status Simple Cheat Sheet

svn status cheat sheet

svn adding/deleting new/missing files from command line

Source

Deleting missing files :
svn st | grep ^! | awk '{print $2}' | xargs svn delete

Adding new files
svn st | grep ^? | awk '{print $2}' | xargs svn add

Friday, January 14, 2011

Wednesday, January 12, 2011

svn on hostmonster

Source
wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-deps-1.4.6.tar.bz2
tar xjf subversion-1.4.6.tar.bz2
tar xjf subversion-deps-1.4.6.tar.bz2
mkdir svn
cd subversion-1.4.6
./configure --prefix=$HOME/svn --with-expat=builtin --with-pic --with-ssl
make
make install
vim ~/.bashrc (add svn/bin to the path)

Making terminal vim the default text editor on Mac

Making terminal vim the default text editor on Mac

Firefox : Mac : keyboard shortcut for going to address bar

Command + L - source

Firefox : Mac : keyboard shortcut for going to address bar

Command + L - source

Mac book pro : Page up/down


While holding down the fn key, use the up and down arrows to achieve page up and page down. - source

Mac book pro : Page up/down

While holding down the fn key, use the up and down arrows to achieve page up and page down. - source

Sunday, January 9, 2011

Mysql Create new user

CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> WITH GRANT OPTION;
mysql> CREATE USER 'admin'@'localhost';
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> CREATE USER 'dummy'@'localhost';

Blog Archive