Using file partially for filenames

2012-02-12 1 min read bash Learning
There are some commands that take file name and there are some case where you need to give file name. But there are some cases where you want to modify the file before passing it to the command. What do you do in these case’s? I had a file containing huge amount of data and for some testing I wanted to pass only the first few lines of the file and not the complete file. Continue reading

g flag in :s useless in vim

2011-11-05 1 min read Vim Tips
Some time back there was a post on vim_use list about the “/g” flag for the search and replace functionality of the vim. And the response of “Tim Chase” on the same was very elaborate and interesting. I always knew that “/g” is only for replacing multiple occurrences on the same line, but here are few things that I did not know. :0/this/s//that This one will only replace the first occurrence of this in the whole file. Continue reading

Cont: Get yourself some more conkyrc files.

2011-10-12 1 min read bash Learning Linux
Last time we got ourselves some conkyrc files from the ubuntu forums. But that scripts gets the files only from the First page of the thread. Lets extend this further and get the script to get all the conkyrc files. There are some 1048 pages in the thread, I am showing pages 1 to 3 but you can change 3 to whatever number you want 🙂 count=0 for i in {1. Continue reading

Get yourself some conkyrc files.

2011-10-05 2 min read Fedora Linux
If you are looking for some nice conkyrc files, then you can head over to : Ubuntu Forums In this thread you can see some very nice conkyrc files with screenshots. You can browse through the thread and get the one that you like. But if you are like me and would like to download all of them to see the features and commands in each of them then you would need to copy each of these files and paste them separately. Continue reading

Some pictures from Burj Khalifa

2011-08-01 1 min read Photo
{.shutterset_} [php] $file = ‘/var/chroot/home/content/02/6377202/html/wp/wp-content/uploads/copper_albums/Parks_Dubai/orig_DSC_5287.jpg’; $exif = exif_read_data(“$file”, 0, true); $key=”EXIF“; $exif = exif_read_data(“$file”, “$key”); echo “[table border=”1”]”; //foreach ($exif as $key => $section) { //similar_text($section, ‘EXIF’, $p); //if ( $p == 0 ) //{ foreach ($exif as $name => $val) { echo “[tr]”; echo “$key.$name ”; echo “$val ”; echo “[/tr]”; } //} //} echo “[/table]”; [/php] Related articles Burj Khalifa tower (hazimiai.wordpress.com) A Better Finder Attributes 5.05 features new EXIF Engine (themactrack. Continue reading

mysql output to an array for easy parsing.

2011-05-11 2 min read bash Database
Today I was looking for some way to put the output of the mysql output in an array in a bash script. Quick google search yeilded to results something like this: 1 <td> <div class="text codecolorer"> output=$(mysql -e "select * from table") </div> </td> </tr> The problem with the above approach is that all the words go into separate index. So if you have a line that has space then that is split into multiple index’s. Continue reading

analyze debug queries output for wordpress

2011-02-09 2 min read Wordpress
Some time back, my website became too slow and I started getting timeout response for quite a lot of my pages. When I analyzed things, I found the issue was with the DB queries taking a lot of time. So, I thought of getting my hands dirty and started with installing the plugin “Debug Queries”. Just in case, you don’t know about the plugin, it lists all the queries to DB along with the time taken for the query when a Admin user visits any page. Continue reading
Older posts Newer posts