Skip to main content

Posts

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 http://www.michaelminn.com/index.php?linux/notebooks/toshiba-m35x.htmlThe 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
Workaround to the VLC cracking sound
There are two options either wait till there is an updated build of VLC or try this workaround to get rid of the cracking sound in VLC.Go to Applications —> Sound & Video —> VLC Media Player.Then click on Settings —> Preferences.Expand the Audio preferences. Click on Output Modules and check the Advanced Options checkbox.Select the Audio Output module as Linux OSS audio output.Save and restart VLC. You will not hear the cracking sound anymore.Now open the videos in VLC. You will never hear the cracking sound again.

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.


%%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
(<<) cvx exec /Tumble (true) cvx exec (>>) cvx exec
systemdict /setpagedevice get exec
%%EndFeature
%%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
======================================================