Monday, February 21, 2011

Printing out all the strings in the binary

Use the strings command


Mounting Remote machine using ssh

sshfs :/home/zakir/ /mnt

Using netcat for chatting and file transfer


At server
nc -l 1234

At client
nc 1234

Start chatting

For file transfer
nc -vv -l 5678 > dump.mp3

nc -vv -l 5678 < dump.mp3

Using Zenity to create the dialog boxes

Zenity is a tool that help you to create a common functional GTK+ dialogs. It have various dialogs that each of them have different ways of presenting data and acquire data from user input.

We have introduce how to make use of GUI dialog box in Using GUI dialog box, where we give an example of how zenity create a question dialog box. Besides question dialog box, zenity can create more than that, such as calendar, entry, error, info, file selection, list, notification, progress, warning, scale and text info. In this tutorial, we would like to illustrate how to create every single zenity dialog by examples.

zenity --warning --text "Could you please tell me who you are"

How to create zenity calendar dialog?
You are allow to specify the initial selection of date in calendar dialog, specified with options –day –month –year. The default selection will be today’s date. Zenity will returns the date selected by user.

Squeeze multiple blank lines to one

Documents like RFCs may contain many blank-line blocks.

To save the trees, i always squeeze multiple blank lines down to single blank line, before printing.

Once I did this manually (yes, it’s like hell), but now I use cat -s:

cat -s rfc2324.txt | tr -d '\\f' | lpr

I use tr -d to remove any form feed character, and lpr will submit the document for printing.