Apr 1

Perhaps many of you wonder how to change the default font for your MPlayer under linux.

The default fonts the player uses are the system ones. Unfortunately, they do not recognize some special characters that every non-english language has.

In order to make it work, you need to change the default font the player uses.

Here are the steps you need to take:

1. Download the proper fonts for your language.

Here are some default fonts from the site of MPlayer:

http://www1.mplayerhq.hu/MPlayer/releases/fonts/

The font type should be as the ones there and should have the same number/type of files.

2. Make sure you are logged to Terminal with the user that you will use the MPlayer with and go to:
cd ~/.mplayer

3. mkdir fonts

4. Copy the fonts to this folder.

5. Restart the MPlayer.

Note: You have to select the proper encoding for the subtitles in order to make them work.

Mar 21

There is a built-in bug connected to the DiskUsage function of cPanel. It allows you to list folders which should not be seen by unauthorized users.
It simply needs you to submit the Url in browser:

http://www.example.com:2082/frontend/x/diskusage/index.html?showtree=/etc

Now you will see the folders only which is inside /etc

exapmle :

Directory Space Used:
etc/Pegasus 0.00 Meg
etc/X11 0.07 Meg
etc/X11/applnk 0.00 Meg
etc/X11/fs 0.00 Meg
etc/X11/serverconfig 0.00 Meg
etc/X11/starthere 0.03 Meg
etc/X11/sysconfig 0.00 Meg

other example to see the folders in /var :

http://www.example.com:2082/frontend/x/diskusage/index.html?showtree=/var

that will shows you folders inside /var , like :

var/www/cgi-bin 0.00 Meg
var/www/error 0.19 Meg
var/www/error/include 0.01 Meg
var/www/html 0.00 Meg
var/www/icons 0.89 Meg
var/www/icons/small 0.25 Meg
var/yp 0.02 Meg
var/yp/binding 0.00 Meg

…etc

another example, you can see the folders which is been protected by a deny rule or authentication for password protected folders,
for example if you type :

http://www.example.com:2082/frontend/x/diskusage/index.html?showtree=/home/user/.htpasswds

You will see all the folders inside although you are not supposed to.

example:

home/user/.htpasswds/public_html 0.01 Meg
home/user/.htpasswds/public_html/admin 0.00 Meg
home/user/.htpasswds/public_html/admin/login 0.00 Meg


tested on / cPanel version 11.18.3

Solution:
/var/cpanel/features/default is the file that handles the features of the cpanel.

Add to it:
diskusageviewer="0"

Then restart the cPanel:
/etc/init.d/cpanel restart

This way you will disable the option since it is not THAT important but is a huge security hole.

Mar 21

Many Ubuntu users have problems with their wireless adapter.

Here is the ultimate solution for the problem:

The key application is called wicd.

Before you install it, make sure you have no automated settings for your network interfaces:

sudo vi /etc/network/interfaces

Make sure the only entries are:

auto lo
iface lo inet loopback

After you have set them - you are ready to start!

First you need to add the repository of the wicd to the sources list of the apt-get.

There are two ways to do it:

1. sudo vi /etc/apt/sources.list

Enter inside:

deb http://apt.wicd.net gutsy extras

Save it and type:

sudo apt-get update

Afterwards:

sudo apt-get install wicd

It will completed the installation for you and you can find the wicd application under the Applications - Internet.

Just start it and you will find a very easy to use wireless manager.

2. Select: Settings > Repositories > Third Party Software > Add

Add to it:

deb http://apt.wicd.net gutsy extras

Then, click Reload. After the packages are updated, select wicd and right click on it - Install. Then click Apply and you are ready.

It will completed the installation for you and you can find the wicd application under the Applications - Internet.

Just start it and you will find a very easy to use wireless manager.

Mar 20

As you might already know, there is a testing version of K Desktop Environment 4 released.

It is as expected full with bugs and problems to solve. Here is one:

After you install the KDE4, try to change the wallpaper by selecting a new desktop from the ones available with the installation. For some reason it will show them properly and will allow you to save them even though they do not exist.

When you logout and restart the KDE session, you will see the Plasma Workspace application segmentation fault. It will not allow you to even view anything.

Here is a fast solution. Use the default X Desktop Environment (KDE or GNOME) or simply console to navigate to:

/home/username/.kde4/share/config

Edit or remove the file plasma-appletsrc. This is the file that is responsible for the KDE variables like wallpaper and many other. If you are not sure what to change, you can delete it - the KDE will create a new one shortly after you change any other option.

Feb 7

Top Solution of the day:

SSH keys are very useful for people who work with multiple servers every day.

How do keys work:

Simply, you generate yourself a key:

ssh-keygen -t dsa -C "Comment-goes-here"

The ssh-keygen is an application that generates and manages authentication keys.

You can see the full manual here.

The -t means type of the key, and the -C is the comment, which in most cases is your Name. This way people will know whom does the key belong to.

Afterwards, you will see a request where to have the file saved.

Generating public/private dsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_dsa):

The default location is the id_dsa file under the home folder of the account inside .ssh folder. Then you need the password for the key:

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

You will see the key generated and the information:

Your identification has been saved in /home/user/test.
Your public key has been saved in /home/user/test.pub.
The key fingerprint is:
47:66:a5:86:56:6c:93:9f:d4:d4:9d:60:0a:1b:7e:9a test

Then you have a key pair (public and private keys). The private key has no extension and the public key has the .pub extension. The private key is used by you and the public one has to be imported in the /root/.ssh/authorized_keys file of the servers you are connecting to. It is advised that you import the key without any text editors but with the following command:

cat id_dsa.pub >> .ssh/authorized_keys

Note: you need to upload the file to the server first, or e-mail it to the administrator.

The next part is for advanced users and requires basic knowledge of ssh-agent and ssh-add.

Automatization of SSH keys and Identity Addition:

Provided that you already have the key installed, you need to make your terminal work with it. Here the common tutorials advise that you add it everytime you create a new terminal. This is really annoying when you have to open over 10 terminals per hour.

Solution:

Make sure you have expect installed. If not, you can install it using some automation tool like apt-get for Ubuntu:

apt-get install expect
apt-get install expect-tcl8.3

Add the following lines to your .bashrc or .profile (depending on the distribution you use):

export SSH_AUTH_SOCK=/tmp/.ssh-socket
ssh-add -l 2>&1 >/dev/null
if [ $? = 2 ]; then
ssh-agent -a $SSH_AUTH_SOCK >/tmp/.ssh-script
. /tmp/.ssh-script
echo $SSH_AGENT_PID >/tmp/.ssh-agent-pid
fi
expect /home/user/.ssh/addem

Afterwards, create the file /home/user/.ssh/addem and write in it:

#!/usr/bin/expect
log_user 0
spawn ssh-add /home/user/.ssh/id_dsa [lindex $argv 0]
expect "Enter passphrase for /user/user/.ssh/id_dsa: "
send "password\r"
expect eof

Explanation:

Every time you start a new terminal / konsole you skip typing the ssh-agent, the lines for it and ssh-add and the identity key.

The .bashrc script starts the ssh-agent for you. Afterwards, the expect script is called to add the identity and provide the password for it. Everything is muted and you will get no spam in the terminal.

Variables of the scripts:

  • change ‘user’ with your username everywhere in the scripts.
  • change the path to the identity file in the /home/user/.ssh/addem file.
  • change the password in the /home/user/.ssh/addem file.

Hosted by TMDHosting.com
linux top solutions : programming top solutions