Skip to main content


Showing posts from February, 2008

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 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/ 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 toTumble(true). The .ps file when opened in vim would look something like the following. Just, change the one which is highlighted.

%% Pagedevice definitions:
% Push our own mark, since there can be several PS marks pushed depending
% where the failure really occured.
%%BeginFeature: *Tumble True
(<<) cvx exec /Tumble (true) cvx exec (>>) cvx exec
systemdict /setpagedevice get exec
%%BeginFeature: *Duplex True
(<<) cvx exec /Duplex (true) cvx exec (>>) cvx exec
systemdict /setpagedevice get…

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