Skip to main content

Posts

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/

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

Rip DVDs in Linux

DVD burning Source : http://ubuntuforums.org/showthread.php?t=133642 Is there a command available to install something in ubuntu that decrypts dvd's so I can back-up my dvd movies? Install dvdbackup from the repository. Then insert your DVD movie in the drive and type this in the terminal: dvdbackup -i /dev/dvd -M -o dir/ This will backup the whole DVD movie with extras and menus, etc. You might want to have a Dual layer burner for this too. It will put the backup in the directory that you put in place of dir/. example: dvdbackup -i /dev/dvd -M -o backupmovie/ After it finishes this then insert your blank DVD disc into the drive and type from terminal: growisofs -speed 1 -dvd-compat -Z /dev/dvdrw -dvd-video dir/ example using the backupmovie/ directory that contained my backup would be: growisofs -speed 1 -dvd-compat -Z /dev/dvdrw -dvd-video backupmovie/ The dvdbackup command will put into the backupmovie/ subdirectory the disc title of the movie. So be sure to include that at the ...

Make your Firefox extensions work

Many times we run across Firefox extensions which are are not compatible with the version that we are using. But there's always a workaround. Two of them actually. The first one - Type about:config into Firefox 's address bar and click the "I'll be careful, I promise!" button. Right-click anywhere. Choose New>Boolean . Make the name of your new config value extensions.checkCompatibility and set it to false . Make another new boolean pair called extensions.checkUpdateSecurity and set the value to false . Restart Firefox . The second one - Download the *.jar , *.xpi file. Open the file with WinRAR . Look for the file install.rdf . It contains the information about which versions of Firefox it is compatible with. Edit the file in Notepad . For that you may have to copy the file to hard disk, edit it,save it, then copy it back to the file with WinRAR . Change the x.0.0.* in em:maxVersion > x.0.0.* to 4.0.0.* or any higher number that you think fit....

Removing the Language Toolbar in Windows XP

Click the Start Button. Select Control Panel option. Double-Click the Regional and Language Options icon. Click on the Languages tab. Click the Details button. Click the Language Bar button. Remove the checkmark from the Show Language Bar option. Click OK. source : http://www.dtdn.com/blog/2004/12/removing-language-toolbar-in-windows.htm

xmms problem: xmms not playing songs

This is actually a SElinux issue. SElinux prevents laoding of xmms shared libraries *.so in memory. I found a fix in the site http://www.michaelminn.com/index.php?linux/notebooks/toshiba-m35x.html The fix is as follows. SELinux Issues : When I compiled and ran the open source media player at XMMS , I got the following error: are compilation issues with contemporary distributions /usr/local/lib/xmms/Input/libmpg123.so: cannot restore segment prot after reloc: Permission denied The problem is caused by SELinux restricting the loading of dynamic libraries by programs. (reference) (reference) It's easy to fix by changing the security context of the XMMS libraries: chcon -t texrel_shlib_t /usr/local/lib/xmms/*/*.so The problem will also occur with Mozilla plugins and can be fixed with the same command Alternatively, since this problem may appear for other packages, you can disable SELinux by changing a line in the /etc/sysconfig/selinux file to: SELINUX=disabled

Reverse alternate pages in prinouts

Most of the times while printing landscape in duplex mode all the alternate pages comes out to be flipped. I couldn't find a command in linux or ps-tools that takes care of this problem. Photoshop , however has an option to reverse alternate pages before sending it top the printer. In terminal, this can achieved by manually editing the .ps file. Just open the file in any text editor like vim and find Tumble(false) and change it to Tumble(true) . The .ps file when opened in vim would look something like the following. Just, change the one which is highlighted. %%BeginSetup %% Pagedevice definitions: countdictstack % Push our own mark, since there can be several PS marks pushed depending % where the failure really occured. /a2ps_mark { %%BeginFeature: * Tumble True ( Tumble (true) cvx exec (>>) cvx exec systemdict /setpagedevice get exec %%EndFeature %%BeginFeature: *Duplex True ( >) cvx exec systemdict /setpagedevice get exec %%EndFeature } stopped

Grep Tricks

====================================================== Grep Tricks #1 How to select multiple lines with grep before and after the matched pattern . grep -B1 -A2 "DMA" message.txt B[n]          n lines before matched pattern A[n]          n lines after matched pattern Grep Tricks #2 How to display(print) the line numbers of the matched pattern with grep. grep -n "DMA" message.txt n              prints line no ======================================================