Broadcast your shell thru port 5000

2010-11-20 1 min read bash Fedora Linux
Broadcast your shell thru port 5000 1 <td> <div class="text codecolorer"> mkfifo /tmp/fifo;(nc -q0 -l 5000 < /tmp/fifo &);script -f /tmp/fifo </div> </td> </tr> run 1 <td> <div class="text codecolorer"> nc yourip 5000 </div> </td> </tr> elsewhere will produce an exact same mirror of your shell. This is handy when you want to show someone else some amazing stuff in your shell without giving them control over it. * View this command to comment, vote or add to favourites * View all commands by clvv Continue reading

Quick tip on zipping logs in real time.

2010-10-13 1 min read bash Learning Linux
Sometimes, some small things that we don’t actually think can be useful are such useful. I faced this couple of days back when I was working on something and the amount of logs getting generated and the files getting rotated was too fast. If I had to use this for sometime, I needed some script, application or something to make sure that the logs are zipped every few seconds. Finding an application for this would take time and what good is bash if we need to find applications for this. Continue reading

Use the last command\’s output as input to a command without piping and bind to it to a key sequence in bash.

2010-09-01 1 min read Fedora Linux Uncategorized
Use the last command&#8217;s output as input to a command without piping and bind to it to a key sequence in <a class="zem_slink" title="Bash (Unix shell)" rel="homepage" href="http://tiswww.case.edu/php/chet/bash/bashtop.html">bash. 1 <td> <div class="bash codecolorer"> &nbsp;<span class="kw3">bind</span> <span class="co3">\'</span><span class="st0">"\\C-h"</span>: <span class="st0">"\\<span class="es5">`fc\\ \\-s\\`</span>"</span><span class="co3">\'</span> </div> </td> </tr> My comment : fc is the fix command of the bash builtin. This is similar to using `!!` or In bash 4.1 it seems you can bind directly to a shell command, but I&#8217;m Continue reading

Getting your wordpress self hosted stats on your console with bash script.

2010-06-29 3 min read bash Learning
Some time back I wrote a blog on how to get your site stats using curl in <a class="zem_slink freebase/en/bash" title="Bash" rel="homepage" href="http://tiswww.case.edu/php/chet/bash/bashtop.html">bash shell. Today we will use the same script to get the stats every few seconds on the terminal on the same line, similar to progress meter. Here is the script and the description: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 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

Script to add all the partitions to the fstab.

2010-06-24 5 min read bash Fedora
I wrote a simple script today to get all the partitions on all the disks and then create <a class="zem_slink freebase/en/fstab" title="Fstab" rel="wikipedia" href="http://en.wikipedia.org/wiki/Fstab">fstab entry with them. The script also gets the <a class="zem_slink freebase/en/universally_unique_identifier" title="Universally Unique Identifier" rel="wikipedia" href="http://en.wikipedia.org/wiki/Universally_Unique_Identifier">UUID and uses the same to make the entry 🙂 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Continue reading
Older posts Newer posts