Life of a Geek Admin

The Daily adventures of a true geek administrator

Life of a Geek Admin - The Daily adventures of a true geek administrator

Installing Win32 Codecs on Linux

The following is an example way to install the “all” pack as root and will work on Ubuntu and Fedora.

cd /tmp
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20100303.tar.bz2
tar -jxvf all-20100303.tar.bz2
su -c 'mkdir -p /usr/local/lib/codecs'
su -c 'cp all-20100303/* /usr/local/lib/codecs'
rm -rf /tmp/all-20100303*

Remote Desktop to Windows PC’s from Linux

Being a Systems Administrator for a living there is always the need to have to connect to Windows servers and systems to work. At work this is easy because of using a Windows XP workstation, at home it is a bit different since a majority of the systems are Linux. There is a solution for the issue and that is tsclient aka: Terminal Server Client or Remote Desktop.

Installation is easy:
Ubuntu
$ sudo apt-get install tsclient

Fedora
$ sudo yum install tsclient

Once the installation is complete you will have an entry in Gnome under Internet > Terminal Server Client.
Now that we have it open lets connect to a system.

Click Add Connection > Windows Terminal Server
Under General Section give the connection a name, usually the server name. In the Details section for host insert the ip of the system or the name of the host if you have DNS name resolution. Enter in the name and password to connect to the system and Domain if the server resides and your id are in the domain, if you want to keep the connection in the list for future use then click the Add to Favorites box in the General section. Click OK to connect.

The connection will come up in Full screen mode by default, if for some reason you need it in Windowed Mode then click Ctrl+Alt+Enter. When you are done just logoff and the session will terminate.

You can also use tsclient to connect many other protocols.

Enabling APC UPS on Ubuntu 9.10

After several years of using an APC UPS I had to replace the system. Previously I never used the plug to the USB from the UPS to my Linux Server. Being the tinkerer that I am I decided it was time to get it to work on the server. Fortunately this was not a hard task.

Install APCUPSD by typing
$ sudo apt-get install apcupsd apcupsd-cgi

Once installation is completed you must configure it and start it up.

The apcupsd software has no menu entry. Using the Gnome desktop, open your terminal. Applications>Accessories>Terminal.
Now type:
$sudo gedit /etc/apcupsd/apcupsd.conf

A text editor opens up. Please note that the examples shown below are from my computer and you need to adapt them to your computer. Scroll down very slightly until you reach this section:

# UPSCABLE
# Defines the type of cable connecting the UPS to your computer.
#
# Possible generic choices for are:
# simple, smart, ether, usb
#
# Or a specific cable model number may be used:
# 940-0119A, 940-0127A, 940-0128A, 940-0020B,
# 940-0020C, 940-0023A, 940-0024B, 940-0024C,
# 940-1524C, 940-0024G, 940-0095A, 940-0095B,
# 940-0095C, M-04-02-2000
#
UPSCABLE usb
Change the UPSCABLE to the one that matches your particular battery backup, in this and most cases change it to usb.

Scroll down to the next section:
# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPS’s, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character device,
# appropriate for SmartUPS models using
# a serial cable (not USB).
#
# usb Most new UPS’s are USB.
# A blank DEVICE setting enables
# autodetection, which is th best choice
# for most installations.
#
# net hostname:port Network link to a master apcupsd
# through apcupsd’s Network Information
# Server. This is used if you don’t have
# a UPS directly connected to your computer.
#
# snmp hostname:port:vendor:community
# SNMP Network link to an SNMP-enabled
# UPS device. Vendor is the MIB used by
# the UPS device: can be “APC”, “APC_NOTRAP”
# or “RFC” where APC is the powernet MIB,
# “APC_NOTRAP” is powernet with SNMP trap
# catching disabled, and RFC is the IETF’s
# rfc1628 UPS-MIB. Port is usually 161.
# Community is “private”.
#
# dumb /dev/tty** Old serial character device for use
# with simple-signaling UPSes.
#
UPSTYPE usb
DEVICE

Again select the right options for your ups unit
Also, note that “# usb” is not literal, so don’t type just leave a blank space.

Now click the save button in the text editor and then close it.

Now keeping your terminal open type:
$sudo gedit /etc/default/apcupsd

# Apcupsd-devel internal configuration

APCACCESS=/sbin/apcaccess
ISCONFIGURED=yes

See the “ISCONFIGURED=no”. Change the no to yes just like in my example.

Now click the save button in the text editor and then close the editor.

Keeping your terminal open type:
$sudo /etc/init.d/apcupsd restart

Look for any errors, if you don’t see anything great.

Keeping your terminal open type:
root@tardis:/etc/init.d# tail -f /var/log/apcupsd.events
Sat Jun 12 11:32:31 EDT 2010 apcupsd 3.14.6 (16 May 2009) debian startup succeeded

By editing the two configuration files you can change various parameters. Don’t be shy to open them up and explore!

Disable IPV6 on Ubuntu 10.04

Ran into an issue on Ubuntu the other day in which network functions were having issues. Through a little PD found that IPV6 was the culprit. Here is a tip on how to disable IPV6 on Ubuntu 10.04.

To check if IPv6 is disabled, run the following command:

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

0 means it’s enabled and 1 – disabled.

To disable IPv6, you have to add the following lines to /etc/sysctl.conf:

#disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

To do it from the command line, paste this in a terminal:

echo "#disable ipv6" | sudo tee -a /etc/sysctl.conf

echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf

Then reboot and check if IPv6 has been disabled with the command in the beginning of this post.

Switch to our mobile site