Check all vim colorschemes for minor issues

2013-10-10 2 min read bash Vim Tips
Here is script that checks all the colorschemes in the current directory and corrects them if possible (Processing of the file is done with simple commands like sed, grep) Checks that the color_name is same as Filename Here is the script: #!/bin/bash - #=============================================================================== # # FILE: # # USAGE: ./ # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka), # REVISION: --- #=============================================================================== cd ~/. Continue reading

Compare files excluding certain lines.

2011-10-18 1 min read bash Fedora Learning Linux
Quick tip, you can use any expression for the sed commands in the (). With this trick you can redirect the stdout of 2 commands to the diff command. This might become very useful, if you want to compare 2 files, excluding the first line. diff <(sed '1d' file) <(sed '1d' file2) More interesting example is where the string ABC is converted to abc before comparing in the second file with the following command: 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

Script to get yourself some conkyrc files

2011-10-08 1 min read Fedora Learning Linux
Continuing from where we left, here is a script that can do all this for you 🙂 curl\&page=$i | sed -n '/\\/pr/ p'| sed '// d'| sed 's##\n-----------------------------------\n\n\n#' >conkyrc dos2unix conkyrc cp conkyrc .test while [ $(wc -l .test|sed 's/[^0-9]//g') != 0 ] do sed -n '1,/------------------------/ p' .test|sed '$d' >conkyrc.$count diff .test conkyrc.$count |sed 's/^<.//'|sed '1, /---------------------/ d;2d'>.test ((count++)) done This will create couple of conkyrc.files in the current directory. 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

bash one liner to change/remove test pattern from config file or text file.

2010-06-25 1 min read bash Fedora Learning Linux
Problem: I had a directory with a lot of config files in the ini file format, i.e. name and value separated by equals. Some/all of these contained some directory names and other values which had to be replaced. But there were other place where I should not not replace them, if there was no exact match. I also needed to have a backup copy of the file that I was modifying. Continue reading
Older posts