Awk Introduction Tutorial – 7 Awk Print Examples

2010-05-19 0 min read Bash Fedora Linux
\"LAS
Image by Getty Images via Daylife

awk examples

Awk Introduction Tutorial – 7 Awk Print Examples This is the first article on the new awk tutorial series. We’ll be posting several articles on awk in the upcoming weeks that will cover all features of awk with practical examples. In this article, let us review the fundamental awk working methodology along with 7 practical awk print examples. Note: Make sure you review our earlier […]

Continue reading

vim – get names of the scripts and the details from the command line

2010-05-19 1 min read Learning Linux Vim Tips

For the below commands either you can set the two variables in bold and then run the scripts or change the following in the commands and run the scripts.

If you have html2text installed then you can use this:

wget -o /dev/null -O $script_id_file ’http://www.vim.org/scripts/script.php?script_id=’$script_id |html2text

If you dont have html2text installed then you can use:

wget -o /dev/null -O $script_id_file &#8217;http://www.vim.org/scripts/script.php?script_id=&#8217;$script_id<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.inquisitr.com/55496/twilight-eclipse-script-allegedly-leaked/">Twilight Eclipse Script Allegedly Leaked (inquisitr.com) <li class="zemanta-article-ul-li"><a href="http://huddledmasses.org/powershell-script-club-in-rochester-on-wednesday/">PowerShell Script Club in Rochester on Wednesday (huddledmasses.org) <li class="zemanta-article-ul-li"><a href="http://blogs.adobe.com/acrolaw/2010/02/add_a_flatten_document_menu_item.html">Add a Flatten Document Menu Item to Acrobat (blogs.adobe.com) <li class="zemanta-article-ul-li"><a href="http://codebetter.com/blogs/james.kovacs/archive/2010/02/25/the-exec-problem.aspx">The Exec Problem (codebetter.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/d25e9b6c-aca3-4008-9a3c-3403140d32e0/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e38.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

Continue reading

Disk identification by UUID in Fedora.

2010-05-19 2 min read GNOME Linux

Yesterday I managed to delete my complete /usr directory and thus had to re-install my OS but I learned something new yesterday which I didn&#8217;t know earlier or actually never bothered to find out.br /br /All the partitions are mounted by udev using the UUID or label now. Finding the label of setting the label is easy but that was not the case with UUID (at least till you dont know how to do it). So finally I set my foot to search it. Heres some of the things that I found:br /br /bblkid/b – Gives you a list like below for all your partitions:br //dev/sda6: UUID=&#8221;8D8A-6CF1&#8221; TYPE=&#8221;vfat&#8221; LABEL=&#8221;Backup&#8221; br /So this is sufficient to modify your fstab to refer to the UUID or label instead of the drive. So whats the change in fstab. If the earlier entry looks likebr //dev/sdb6nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; /media/Bkup3nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; vfatnbsp;nbsp;nbsp; uid=500,nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; 0 0br /then you can change this to :br /UUID=&#8221;8D8A-6CF1&#8221;nbsp;nbsp; /media/Bkup3nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; vfatnbsp;nbsp;nbsp; uid=500,nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; 0 0br /What is the benifit:br /———————br /When you re-format your Hard Disk there is a likely possibility that the dev name could well change and thus completely changing the mount points for all your fstab entries. This is really a pain if you have 10 or more partitions like the way I have. So if you use label or UUID then they never change and your mount points remain the same.br /br /Effective use: Use autofs package to automatically mount all your partitions. Autofs mounts the package at /media/LABEL, so before you hit to start your autofs label all your disks.br /br /Other ways to find the disk labels and UUID&#8217;s:br /ls /dev/disk/by-uuid –gt; simplest way. :)br /br /Will get back to this later with more details.br /br /

Continue reading

Auto Adjust Photo color and contrast in Windows, Mac and Linux.

2010-05-19 1 min read Photo

<a href="http://log69.com/aaphoto_en.html" target="_blank">Auto Adjust Photo is a tool that is very helpful if you are looking at quickly adjusting the photo. This tool does a good job of automatically doing color correction. Here is example:

<img class="size-full wp-image-624" title="before" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/dscf5768_new.jpg" alt="Before" width="697" height="522" />

<img class="size-full wp-image-625" title="After" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/dscf5768_new_new.jpg" alt="After" width="697" height="522" />

There is definately a scope of improvement in the processed photo, but if you have a couple of hundred photo&#8217;s and you can get this effect in one liner then nothing like it. Here&#8217;s the one liner

Continue reading

Mirror or download a website with a tool much better than wget

2010-05-19 1 min read Bash Fedora Linux

If you want to mirror a <a class="zem_slink freebase/en/website" title="Website" rel="wikipedia" href="http://en.wikipedia.org/wiki/Website">website, the simplest tool I know if is <a class="zem_slink freebase/en/wget" title="Wget" rel="homepage" href="http://www.gnu.org/software/wget/">wget. Once you have used wget, you know the troubles associated with it. You also get added couple of files as search html files, which are useless and wastage of bandwidth for you as well as the <a class="zem_slink freebase/en/web_server" title="Web server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_server">webserver.

lftp -e &#8221;mirror -c&#8221; 

Continue reading

How to write a Linux virus – well or a trojan.

2010-05-18 2 min read Fedora Linux

<a href="http://www.geekzone.co.nz/foobar/6229" target="_blank">How to write a Linux virus

and the folloup thereof

<a href="http://www.geekzone.co.nz/foobar/6236" target="_blank">Follow up: How to write a Linux virus

Thats quite a lot of discussion and an interesting one too. I too liked the point that the authour is trying to make, that is Linux too is not completely safe. I would rather like to put it as not &#8221;Fool Proof&#8221;.

But no one is fool. Its just the matter of time when you do something foolish. People do keep thinking about various things and keep working. That being the case, it is not too difficult that someone would actually run the program. But the caveat is that the program/virus/trojan would still show up at some places. So you need to do few more things for this to work. If you are keen on doing this, then you need to atleast add these:

Continue reading

Linux EBook

2010-05-18 1 min read Linux

My own book.. Though not too good but might be useful.

<a class="aligncenter" title="Ebook" href="http://amit-agarwal.co.in/mystuff/LinuxBook.pdf.bz2">Free Ebook

Leave a comment or send a mail to wordpress@amit-agarwal.co.in to get the password

Older posts Newer posts