Execute mysql command from shell

2010-02-04 1 min read Database
phpMyAdmin is a very slow application if you want to execute a query on your database. If you know the name of the database then any GUI tool is an overhead. So I have written a one liner shell script to do that for me 🙂 Here’s the script: echo ”select * from table where field like ”%$1%””|mysql -h doamin.com -u amit -p -D amit -r –password=hello When run with one argument it will execute the sql query directly without asking for password also. Continue reading

shell — one liner to selectively change case

2010-01-07 2 min read bash
Today I had a hard time, I had a herculian task of converting the case of file to upper case. Well that’s not difficult :), I know. What made it difficult was the fact that not the whole file had to be converted but only selective lines containing the work important. Okay now that too is not so difficult, I thought. But again the file size was huge, it had some 9 million lines. Continue reading

feh – versatile image viewer works from command line too.

2009-11-21 2 min read Fedora Linux
To install : sudo yum install feh From the info for the feh package: feh – versatile image viewer works from command line too premier image file handling library. feh has many features, from simple single file viewing, to multiple file modes using a slideshow or multiple windows. feh supports the creation of montages as index prints with many user-configurable options. One of the reasons, I install feh as one of the first packages on any installation is the reason that it can open multiple images like in stack. Continue reading
Newer posts