get the contents of whole site like some wiki or wikia

2014-02-24 1 min read Learning Uncategorized

For wikis and wikia, generally if you are trying to get some url mirror, then websucker.py is an excellent option. This script is in the python sources so, to get this tool,

yumdownloader --source python

Install the rpm downloaded in current directory and then go to ~/rpmbuild/SOUURCES.  You should find a Python-*.tar.xz file here, just extract with

tar xvf Python*.tar.xz

and there you go, you should find the tool in Tools/webchecker/websucker.py.

Continue reading

debug call function() to debug a function in vim

2011-09-04 1 min read Vim Tips

Drawn in Autosketch + pasting in words from Excel
Image via Wikipedia

Have you ever wished that you could either see what is going on initially at the vim startup like you could do with C program in the gdm mode, but really did not want to go through gdb. Or rather you sometime felt that some function defined by some plugin is causing some issue and you wanted to debug just that function. Well you need not wish anymore, the functionality is already there.

Continue reading

prints line numbers

2010-05-27 1 min read Bash

$ nl

others:
perl -ne ’print ”$. – $_”’ $1
grep -n . $1
perl -pe ’print ”$. ”’ $1
cat -n $1

  • <a href="http://www.commandlinefu.com/commands/view/4273/prints-line-numbers">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/solarislackware">View all commands by <a href="http://feeds2.feedburner.com/commands/by/solarislackware">solarislackware

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="" align="bottom" />

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/0/di" alt="" align="bottom" />
<a href="http://feedads.g.doubleclick.net/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/1/di" alt="" align="bottom" />

<img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/L6W6GZj7Dl8" alt="" width="1" height="1" align="bottom" />

Continue reading

Solved -- Errors with afraid-dyndns in Goddard (Fedora 13)

2010-05-06 2 min read Fedora Learning Linux

Since I updated to the <a class="zem_slink freebase/en/fedora" title="Fedora" rel="homepage" href="http://fedoraproject.org/">Fedora 13, I was getting error from the <a class="zem_slink freebase/en/dynamic_dns" title="Dynamic DNS" rel="wikipedia" href="http://en.wikipedia.org/wiki/Dynamic_DNS">Dynamic DNS client for afraid. I was not getting enough time to fix this, so finally I decided to fix this in the night itself 🙂

Problem:
On running

afraid-dyndns

I was getting the error:

Entity: line 100: <a class="zem_slink freebase/en/parsing" title="Parsing" rel="wikipedia" href="http://en.wikipedia.org/wiki/Parsing">parser error : Opening and ending tag mismatch: br line 99 and div

Continue reading

Calculations

2009-11-17 1 min read Fedora Learning Linux

<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 reading