Skip to main content

Posts

Showing posts from June, 2008

Prevent Linux (/Unix) console from getting garbled

If you cat some binary files for instance, it corrupts the shell, the entire window gets garbled and you need to close it.

Its a known issue and has been a known issue for ages.Sometimes people accidentally do it when coding for instance, you accidentally cat your binary instead of your output.

Solution is to reset the terminal.
$ reset
source : http://brainstorm.ubuntu.com/idea/4972/

Encrypting a file in linux

To encrypt single file, use command gpg as follows:

$ gpg -c filename

To encrypt myfinancial.info file, type the command:

$ gpg -c myfinancial.info

Output:

Enter passphrase:
Repeat passphrase:

This will create a myfinancial.info.gpg file.

Option: -c : Encrypt with symmetric cipher.

Caution if you ever forgot your password aka passphrase, you cannot recover the data as it use very strong encryption.

Task: decrypt file

To decrypt file use gpg command:

$ gpg myfinancial.info.gpg

Output:

gpg myfinancial.info.gpg
gpg: CAST5 encrypted data
Enter passphrase:

Decrypt file and write output to file vivek.info.txt you can run command:

$ gpg myfinancial.info.gpg –o vivek.info.txt

Remember if file extension is .asc, it is a ASCII encrypted file and if file extension is .gpg, it is a binary encrypted file.

Mathematica problem in Linux (Hardy)

1. Backspace or delete working until i turn numlock off.

This is an old mathematica bug fised in recent versions. The Mod2 key is probably mapped to your Num Lock key. If the Mod2 keysym is mapped to Num Lock, hit the Num Lock key to turn it off.

Depressing Mod2 turns on an undocumented feature of the X front end - global selection. When global selection is activated, the mouse pointer will change from an I-beam to a hand. You cannot place a text edit cursor within a cell in this mode, but if you select a cell of a given style, then all cells of that style will be selected.

To avoid this situation in the future, simply remap Mod2 to another key using xmodmap or some other keyboard configuration utility.
Notes

It appears that by default Mandrake Linux 8 sets the Num Lock key on and maps it to Mod2. Therefore, it is suggested that you remap Mod2 to another key as described above.

source : http://support.wolfram.com/mathematica/systems/linux/general/configurenumlock.html

If you want to configur…

Kane and Abel by Jeffrey Archer

Today I finished reading Kane and Abel by Jeffrey Archer. It is a good book. But I believe it is 200 pages too long. Only the beginning 100 pages where Abel fights desperately for freedom from Russian prison camps and the last 100 pages where the lifelong feud between Kane and Abel comes to a dramatic conclusion are gripping and the rest of the book is long and tiresome.
It also has sequel The ProdigalDaughter. I think I would skip it after the painful hours of reading this book.