Three Quick and Dirty Fixes

Three little tips and tricks I’ve had occasion to use recently or have known about for a while and felt I would share. These are just quick and dirty explanations so “your mileage may vary” , “use at own risk” etc.

Commands are shown in bold and system responses are shown in italics.

Setting Ethernet Interface Link Speed with mii-tool

You can use mii-tool to show you what speed ( and duplexing ) your NIC is running at. You need to do this as root or use sudo.

To see the current settings, assuming your interface is called eth0

sudo mii-tool eth0
eth0: 100 Mbit, full duplex, link ok

If that was only half duplex or only 10MB you can force your media to be 100FD:-

sudo mii-tool -F 100baseTx-FD eth0

To find out what modes your interface and your switch support us the -v flag

sudo mii-tool -v eth0
eth0: 100 Mbit, full duplex, link ok
product info: vendor 00:10:18, model 54 rev 0
basic mode: 100 Mbit, full duplex
basic status: link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-HD

To force this at boot maybe try adding mii-tool -F 100baseTx-FD eth0 to /etc/rc.local (no need for the sudo in this file).

Realplayer has no sound in KDE

If you run KDE and your realplayer seems to play but there is no sound go into KControl and look at the Sound & Multimedia settings.

On the Hardware tab there is a option for Select Audio device. If this is set to autodetect I’ve found it can give problems.

From the drop down choose ALSA ( Or OSS depending on what you run).

The sound system will restart and you may find your realplayer works again.

Viewing Output from man commands in vi

This is perhaps one for other Unixes than linux but is still useful.

If you use the man command and don’t want to have to use that interface to search about for what you want, or you want to make use of the text output somewhere else, you might be tempted to run

man some_command > /tmp/man.txt

However depending on your terminal settings you may find then you come to edit the file /tmp/man.txt it is full of screen control characters. You can strip these out using:

man mii-tool | col -b> /tmp/man.txt

The col command filters out reverse line feeds and the -b option removes backspaces as well leaving you a much cleaner output.

If you want to know more try the following :o)

man col

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s