String and Array Creation

2010-04-28 0 min read Learning Linux Perl
\"Perl\"
Image via Wikipedia

<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 fourth part of a nine-part article on famous <a class="zem_slink freebase/en/perl" title="Perl" rel="homepage" href="http://www.perl.org/">Perl one-liners. In this part I will create various one-liners for string and array creation. 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.

Continue reading

vim search multiple files

2010-03-25 1 min read Linux Vim Tips

Searching some pattern in multiple files is something that is required very often. There are multiple ways to do it, like <a class="zem_slink freebase/en/grep" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep, <a class="zem_slink freebase/guid/9202a8c04000641f8000000006b66ec6" title="Ack (command-line utility)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Ack_%28command-line_utility%29">ack, find and so on so forth. But if your editor already has the capability to do that, then why leave your favourite vi and go to shell. I will point you to some scripts and some wiki pages on how to do this 🙂

Continue reading

phpMyEdit – Mysql table viewer, editor and php code generator.

2009-10-01 1 min read Database Linux

As a developer, whenever you want to write the php code to get the data from the MySQL database, sometimes it becomes tiresome and time taking. And what if you had to do it dynamically. Well I have not generated the code dynamically using <a href="http://www.phpmyedit.org/">phpMyEdit, but I believe that should be pretty much doable.

But what you would definately like this open source php code to view, edit and generate php code, saving you some time to concentrate on better and interesting things. The official website has this description:

Continue reading

Get you ip address like whatismyip.com

2008-11-30 2 min read Bash Uncategorized

For last couple of days, I was thinking of putting this. I was thinking of some way to get the IP address of the client directly rather than going through some site or parsing the content. So <a href="http://amit-agarwal.co.in/mystuff/getip.php" target="_blank">here it is.

Now the trick here is simple. There are two ways to get the IP address of the client in the php script and thus a simple script like the below would capture both of them.

Continue reading
Newer posts