Add current date and time in vim
Last few days I was quite busy. So this time very quick tip π
Add the following to the ~/.vimrc file
imap dt :r! dateA
And now whenever you type dt in the insert mode in vi, date will be inserted.
Last few days I was quite busy. So this time very quick tip π
Add the following to the ~/.vimrc file
imap dt :r! dateA
And now whenever you type dt in the insert mode in vi, date will be inserted.
I was looking at a log file and needed to highlight multiple search items to make the logs more readable. I got into multiple threads suggesting various cryptic vim commands but I was in no mood to remember them. So, I finally hit <a href="http://www.vim.org/scripts/script.php?script_id=479" target="_blank">this.
This is a cool vim script which you can use to highlight multiple search patter. You can simply add a search term by doing
Continue reading<img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/perl-one-liners.jpg" alt="Perl One Liners" align="bottom" />This is the third part of a seven-part article on famous Perl one-liners. In this part I will create various one-liners for calculations. See <a href="http://www.catonmat.net/blog/perl-one-liners-explained-part-one/">part one for introduction of the series.
Famous Perl one-liners is my attempt to create βperl1line.txtβ that is similar to β<a href="http://www.catonmat.net/blog/awk-one-liners-explained-part-one/">awk1line.txtβ and β<a href="http://www.catonmat.net/blog/sed-one-liners-explained-part-one/">sed1line.txtβ that have been so popular among Awk and Sed programmers.
The article on famous Perl one-liners will consist of at least seven parts:
Continue readingYou can use, <a href="http://chat.aka-photo.com/">http://chat.aka-photo.com/.
I just installed it to keep my self connected with the other friends of mine. Does not store the data for long and no need to create a username if you dont want to .. just enter any name in the username and press enter. Ask the other person to join the same room and that’s it.
Oh, BTW, I bought this domain to lauch another <a href="http://eshop.aka-photos.com">e-shop or at <a href="http://shop.aka-photos.com">shop. Aha, do let me know which one looks better.
Continue readingSome time back I wrote about <a href="http://blog.amit-agarwal.co.in/2009/03/07/" target="_blank">how to use a live distro without CD or VM. Today that experiment saved my day.
My RAM went bad couple of days without my knowledge and I kept using the system finally causing the ”/usr” to be completed unusable.Β And that is when I was able to still login to the system, as I still had that Nimble X installed on the HDD without actually installing it. Now I need to re-install the OS but at least for the time being I am able to use my system. π
Continue readingif you want to open any document with the default document handler from the bash prompt or command prompt in linux then the simplest way to do that is use ”xdg-open”.
This can also be used in bash scripts to allow users to select which document to open without worrying about if a particular application is installed or not. Example could be where you have list of documents in the current directory (same kind or of different format.) and you want the user to select the document. In such a scenario you can take the user input for the filename and user ”xdg-open filename” to open the file irrespective of the file type or worrying about if xpdf is installed or abiword is installed or not.
Continue reading<a href="http://www.cyberciti.biz/faq/bash-shell-check-for-any-mp3-files-in-directory/">Use BASH nullglob To Verify *.c Files Exists or Not In a Directory has a nice explanation on nullglob and dotglob.