intercept stdout/stderr of another process or disowned process

2010-11-23 1 min read Bash Fedora Linux

The command is definately going to save your day if you have disowned the process by mistake. Only uses strace so might as well work on Solaris also, though not tried it.

intercept stdout/stderr of another process or disowned process

  <td>
    <div class="text codecolorer">
      strace -e write=1,2 -p $PID 2>&1 | sed -un "/^ |/p" | sed -ue "s/^.{9 }(.{50}).+/1/g" -e 's/ //g' | xxd -r -p
    </div>
  </td>
</tr>
1

Useful to recover a output(stdout and stderr) “disown”ed or “nohup“ep process of other instance of ssh.

Continue reading

Broadcast your shell thru port 5000

2010-11-20 1 min read Bash Fedora Linux

Broadcast your shell thru port 5000

  <td>
    <div class="text codecolorer">
      mkfifo /tmp/fifo;(nc -q0 -l 5000 < /tmp/fifo &);script -f /tmp/fifo
    </div>
  </td>
</tr>
1

run

  <td>
    <div class="text codecolorer">
      nc yourip 5000
    </div>
  </td>
</tr>
1

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.

Continue reading

Print all environment variables, including hidden ones

2010-11-09 2 min read Bash Fedora Linux

Print all environment variables, including hidden ones

  <td>
    <div class="text codecolorer">
      for _a in {A..Z} {a..z};do _z=${!${_a}*};for _i in `eval echo "${_z}"`;do echo -e "$_i: ${!_i}";done;done|cat -Tsv
    </div>
  </td>
</tr>
1

This uses some tricks I found while reading the bash man page to enumerate and display all the current environment variables, including those not listed by the ‘env‘ command which according to the bash docs are more for internal use by BASH. The main trick is the way bash will list all environment variable names when performing expansion on ${!A*}. Then the eval builtin makes it work in a loop.

Continue reading

Announcing the release of Fedora 14 and upgrade procedure.

2010-11-03 4 min read Fedora

Before you read the release announcement, you can update/upgrade to F14 with :

  <td>
    <div class="text codecolorer">
      &nbsp;sudo yum upgrade --releasever=14
    </div>
  </td>
</tr>
1

Note : You might get some un-resolvable dependencies, you can remove those pakages and continue and it should be a smooth migration.

It’s here! It’s here! It’s really here! Fedora 14 has been officially released! Fedora is a leading edge, free and open source operating system that continues to deliver innovative features to many users, with a new release approximately every six months.

Continue reading

Photo Editing with nice border and preparing for print.

2010-11-02 3 min read Fedora Photo

Working with photos in Linux is very easy with lots of viewers/editors/managers and what not. Not that there are not many options in Windows but most of them are not free. BEST case scenario is that you might get a evaluation version (i.e. if you do not use pirated/cracked version) of software‘s. Me, being completely against pirated and cracked version or evaluation version (if not, planning to buy the same) like the freedom of choice with Linux.

Continue reading

taskcoach – one of the best approach to manage your tasks

2010-10-22 1 min read Fedora Linux

Task coach is task planner with reminder, subtask and time tracking, simply put. More elaborate description :

Task Coach is a simple open source todo manager to manage personal tasks and todo lists. It grew out of a frustration that well-known task managers, such as those provided with Outlook or Lotus Notes, do not provide facilities for composite tasks. Often, tasks and other things todo consist of several activities.  Task Coach is designed to deal with composite tasks.

Continue reading

List all the rpms by size – quick way to find out what is eating your disk space in root partition

2010-10-13 1 min read Bash Fedora

Here is a quick command to check the list of installed packages by their size in reverse order. Very useful if you want to remove unwanted rpms just to clean up some space on your disk:

  <td>
    <div class="text codecolorer">
      rpm -q -a --qf "%10{SIZE}\t%{NAME}\n" | sort -k1,1nr |more
    </div>
  </td>
</tr>
1

Sample output:

78070452    kernel
78060477    kernel
50708634    jre
50316408    libgcj
48581593    wireshark
47778643    gimp
47674675    jre
47303084    qt-x11
45838912    otrs
45657248    chromium-libs
42070128    wxPython

Continue reading
Older posts Newer posts