Category: Tricks


Some webradios provide mono stream while listening online.

To emulate a stereo stream, you just have to add some options to mplayer.

For instance :

[fool@localhost:~]$ mplayer  -af extrastereo=0,volume=5 -vo null -playlist mms://*

For more information about these options in MPlayer :


Tweaking audio channels with mplayer

 

 

 

If you want the home directory of a user to be created at the first login, you probably use the PAM’s module pam_oddjob_mkhomedir to do that job. This operation is done for users not locally registered on the server.

You may have encounter this error after trying to log in for the first time. The authentication has worked well but the user does not have its own home directory.

org.freedesktop.DBus.Error.ServiceUnknown: The name com.redhat.oddjob_mkhomedir was not provided by any .service files
Could not chdir to home directory /home/CONCUR/$USER: No such file or directory

This is because a service called oddjobd,  is not started on your server.

root@localhost:~#service oddjobd start

Make sure that this service will be available at boot time.

root@localhost:~#chkconfig –level 2345 oddjobd on

Some web-based management tools use Java applets to perform configuration tasks. Within Debian Squeeze, you have two JRE available : openjdk-6-jre and sun-java6-jre. Concerning web browsers, two kinds of Java plug-ins can be installed : the official Oracle Java plug-in from the sun-java6-plugin package and the alternative Icedtea plug-in  from the icedtea6-plugin package.

The Oracle Java Plug-in is better suited for its integration within web browsers. To install it :

root@localhost:~#apt-get install sun-java6-plugin

To use one implementation of Java (either OpenJDK or Oracle java), make sure that your environment is properly configured. update-java-alternatives (utility from the java-common package) can be used for this purpose.

To list the existing Java environments :

root@localhost:~# update-java-alternatives -l
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun

To force the use of one given environment :

root@localhost:~#update-java-alternatives -s java-6-sun

To make sure that your installed applications only use the Oracle Java 6, check the output of update-alternatives -l . You should have the following output :

root@localhost:~#update-alternatives -l |grep java

update-alternatives –get-selections |grep java
appletviewer                   manual   /usr/lib/jvm/java-6-sun/bin/appletviewer
apt                            manual   /usr/lib/jvm/java-6-sun/bin/apt
ControlPanel                   manual   /usr/lib/jvm/java-6-sun/jre/bin/ControlPanel
extcheck                       manual   /usr/lib/jvm/java-6-sun/bin/extcheck
firefox-javaplugin.so          manual   /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so
HtmlConverter                  manual   /usr/lib/jvm/java-6-sun/bin/HtmlConverter
iceape-javaplugin.so           manual   /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so
iceweasel-javaplugin.so        manual   /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so
idlj                           manual   /usr/lib/jvm/java-6-sun/bin/idlj
jar                            manual   /usr/lib/jvm/java-6-sun/bin/jar
jarsigner                      manual   /usr/lib/jvm/java-6-sun/bin/jarsigner
java                           manual   /usr/lib/jvm/java-6-sun/jre/bin/java
javac                          manual   /usr/lib/jvm/java-6-sun/bin/javac
javadoc                        manual   /usr/lib/jvm/java-6-sun/bin/javadoc
javah                          manual   /usr/lib/jvm/java-6-sun/bin/javah
javap                          manual   /usr/lib/jvm/java-6-sun/bin/javap
java_vm                        manual   /usr/lib/jvm/java-6-sun/jre/bin/java_vm
javaws                         manual   /usr/lib/jvm/java-6-sun/jre/bin/javaws
jconsole                       manual   /usr/lib/jvm/java-6-sun/bin/jconsole
jcontrol                       manual   /usr/lib/jvm/java-6-sun/jre/bin/jcontrol
jdb                            manual   /usr/lib/jvm/java-6-sun/bin/jdb
jexec                          manual   /usr/lib/jvm/java-6-sun/jre/lib/jexec
jhat                           manual   /usr/lib/jvm/java-6-sun/bin/jhat
jinfo                          manual   /usr/lib/jvm/java-6-sun/bin/jinfo
jmap                           manual   /usr/lib/jvm/java-6-sun/bin/jmap
jps                            manual   /usr/lib/jvm/java-6-sun/bin/jps
jrunscript                     manual   /usr/lib/jvm/java-6-sun/bin/jrunscript
jsadebugd                      manual   /usr/lib/jvm/java-6-sun/bin/jsadebugd
jstack                         manual   /usr/lib/jvm/java-6-sun/bin/jstack
jstat                          manual   /usr/lib/jvm/java-6-sun/bin/jstat
jstatd                         manual   /usr/lib/jvm/java-6-sun/bin/jstatd
keytool                        manual   /usr/lib/jvm/java-6-sun/jre/bin/keytool
midbrowser-javaplugin.so       manual   /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so
mozilla-javaplugin.so          manual   /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so
native2ascii                   manual   /usr/lib/jvm/java-6-sun/bin/native2ascii
orbd                           manual   /usr/lib/jvm/java-6-sun/jre/bin/orbd
pack200                        manual   /usr/lib/jvm/java-6-sun/jre/bin/pack200
pluginappletviewer             auto     /usr/lib/jvm/java-6-openjdk/jre/bin/pluginappletviewer
policytool                     manual   /usr/lib/jvm/java-6-sun/jre/bin/policytool
rmic                           manual   /usr/lib/jvm/java-6-sun/bin/rmic
rmid                           manual   /usr/lib/jvm/java-6-sun/jre/bin/rmid
rmiregistry                    manual   /usr/lib/jvm/java-6-sun/jre/bin/rmiregistry
schemagen                      manual   /usr/lib/jvm/java-6-sun/bin/schemagen
serialver                      manual   /usr/lib/jvm/java-6-sun/bin/serialver
servertool                     manual   /usr/lib/jvm/java-6-sun/jre/bin/servertool
tnameserv                      manual   /usr/lib/jvm/java-6-sun/jre/bin/tnameserv
unpack200                      manual   /usr/lib/jvm/java-6-sun/jre/bin/unpack200
wsgen                          manual   /usr/lib/jvm/java-6-sun/bin/wsgen
wsimport                       manual   /usr/lib/jvm/java-6-sun/bin/wsimport
xjc                            manual   /usr/lib/jvm/java-6-sun/bin/xjc
xulrunner-1.9-javaplugin.so    manual   /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so
xulrunner-javaplugin.so        manual   /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so

For Iceweasel,you can check that your Java plug-in is configured by typing about:plugins in the address bar.

After installing RHEL6.3 on a server, the next step is to register your server as a new asset in your local inventory (in Satellite for instance) or at https://access.redhat.com

Registering and giving the right subscriptions to your server can be done with subscription-manager command line utility. If you want to do the both steps in one time, just type :

root@localhost:~#subscription-manager register –autosubscribe

If you want to know the registration and subscription state of your server :

root@localhost:~# subscription-manager list

You may have the following output :

+——————————————-+
Installed Product Status
+——————————————-+
Product Name:             Red Hat Enterprise Linux Server
Product ID:               69
Version:                  6.3
Arch:                     x86_64
Status:                   Not Subscribed           
Starts:
Expires:  

In the web console, you may have the following message looking at your server’s page :

Status  : “System is not properly subscribed”

For the moment, the only workaround found to change this state and make your server properly subscribed is to look at the pool id of one of your subscriptions for an already declared server. (Both servers must be similar in terms of subscriptions).

root@localhost:~#subscription-manager list –available |grep -A3 -w ‘Red Hat Enterprise Linux Server’
Product Name:             Red Hat Enterprise Linux Server, Standard (1-2 sockets) (Up
                        to 1 guest) with Smart Management
Product Id:               RH0184831                
Pool Id:                  8a85f984356102f801356202921d190b

Product Name:             Red Hat Enterprise Linux Server, Standard (1-2 sockets) (Up
                        to 1 guest) with Smart Management
Product Id:               RH0184831RN              
Pool Id:                  8a85f984356102f80135620294061945

Product Name:             Red Hat Enterprise Linux Server, Standard (1-2 sockets) (Up
                        to 1 guest) with Smart Management
Product Id:               RH0184831RN              
Pool Id:                  8a85f984356102f801356202a51b1952

And now, for the server in error, just manually add a subscription to it :

root@localhost:~#subscription-manager subscribe –pool=your_chosen_pool_id

To check after this fresh modification :

root@localhost:~#subscription-manager list
+——————————————-+
Installed Product Status
+——————————————-+
Product Name:             Red Hat Enterprise Linux Server
Product ID:               69
Version:                  6.3
Arch:                     x86_64                   
Status:                   Subscribed               
Starts:                   12/15/11
Expires:                  07/27/13 

 

 

 

If you have to join a Linux server to a Windows domain managed by Active Directory and add this server into a defined OU, here is what you have to type : (Supposing your Samba version is later than 3.0.23)

root@your_server:#  net ads join -U admin_account@YOUR_COMPANY.ORG createcomputer=”/Computers/Servers/Your_office”

following this  : “OU=Your_office,OU=Servers,OU=Computers,DC=YOUR_COMPANY,DC=ORG”

where admin_account is the login name of a Windows administrator part of the “YOUR_COMPANY.ORG” domain with enough privileges. Pay attention to createcomputer option and its syntax.

Android CB message

If your actual handset is an Android-based smartphone, you might have already received some strange SMS messages containing numbers. These messages are CB messages which stand for Cell Broadcast messages.

Cell Broadcast  is a technology which has been developed to address the largest number of people in emergency cases for instance regardless of the mobile operator.

To (des)activate it, the option can be found in the “messages settings” and then “CB messages” option can be found. The way you can modify it depends on your smartphone model and on your Android OS version.

More about Cell Broadcast : Wikipedia Cell Broadcast page

If you follow people or organizations on Twitter, please note that their RSS feed urls have changed.

Previously, it was :

https://twitter.com/statuses/user_timeline/account_followed.rss

Now, you need to update to :

https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=account_followed
where account_followed is one of the twitter’s account name you follow.

If you are dealing with a long program file, it might be interesting to hide part(s) of it to make it more readable for instance. VIM provides these features : folding for hiding sections of text and unfolding for  printing texts again.

Here are the basic VIM keyboard shortcuts to type in normal mode :

zfa} : create a fold within two brackets. the cursor is located after the opening bracket and the second one is indicated by }

zc : close the current fold

zo : open the current fold

zd : delete the fold at the cursor

[z : move to start of open fold

z] : move to end of open fold

You can create folders as many as you want within your current file. If you exit from your VIM editor, you will lose all of them.

For more details about folding/unfolding commands in VIM :

VIM folding

If you have a slow SSH connection to a server with the following message :

debug1: An invalid name was supplied
Cannot determine realm for numeric host address

Make sure that the server you try to reach has a well-configured reverse DNS. Then, you can desactivate GSSAPI authentication by adding the following line to your ssh client configuration file :

fool@localhost:~$echo “GSSAPIAuthentication no” >> $HOME/.ssh/config

You should be able to connect to your server through SSH quicker.

 

Follow

Get every new post delivered to your Inbox.