Skip to main content

Posts

Showing posts from January, 2009

Fun With Mail Headers

Microsoft Outlook looks for a special email header, X-Message-Flag, and if found, will display a message to the user in the message dialog along with a red flag. If you mail client (MUA) permits the creation of custom headers, you can create an X-Message-Flag header and assign some arbitrary text string to it. Only users of Microsoft's Outlook will see the message.

Some of the messages are funny, some pro-Linux, some anti-Microsoft, some informative, some just stupid. A few example messages are:

Warning: Outlook transmits Viruses! Upgrade to Linux Now!
Using Microsoft software might be a security risk.
If you can read this, you're too close!
Message text blocked: VIOLATION OF US 1201(a)(3)
Warning: message not sent with a DRM-Certified client User-Agent.Warning: Your mail program does not comply with RFC 1855.
Magic 8-Ball says Outlook Not Good.
Outlook : A program designed to spread viri, but it can do mail too.Linux : The choice of a GNU generation.OUTLOOK
ERROR: Large chicken feath…

pci.ids and usb.ids lists

You know that there are lists of PCI and USB devices that Linux uses to identify those devices? The files containing the lists are named pci.ids and usb.ids.


It seems that I have some hardware on my Linux box that is "unknown". How does that get fixed or changed? Over time, those devices will get added to a list that Linux uses to identify devices.

Here's how to add new hardware to the list and how to get the most current lists to drop in you own Linux box.

PCI

The list is maintained by The PCI ID Repository. You can download the most current file from there or submit new devices or discuss changing old entries.

Download it with:

wget -nd http://pci-ids.ucw.cz/v2.2/pci.ids

To locate where on your system the files are located, use the find command and then copy the new files to that location. This works on my system:

sudo mv pci.ids /usr/share/


USB

The USB list lives at Linux-USB.Org. You can download the most current file from there or submit new devices or discuss changin…

Grokking Linux Modules

A lot of the functionality of Linux is contained in the kernel modules. These small pieces of software link the Linux kernel to your hardware, but it's not all that easy to get information about them if you are having trouble with a particular module.


The command lsmod will list all currently loaded modules.

The command modinfo will list general information about a particular module.

The command get_module will list specific information about a particular module as loaded in your kernel.

My system was generating an error message about the shpchp module. To see what other modules might be associated with it:

# lsmod | grep shpchp
shpchp 33556 0
pci_hotplug 29476 1 shpchp

To get the general information about the module:

# modinfo shpchp
filename: /lib/modules/2.6.27.5-desktop-2mnb/kernel/drivers/pci/hotplug/shpchp.ko.gz
license: GPL
description: Standard Hot Plug PCI Controller Driver
author: Dan Zink , Greg Kroah-Hartman , Dely S…

Trusted Platform Module

TPM, or Trusted Platform Module can be used to authenticate computer hardware or protect encrypted disks. A HOWTO can be found here. The Wikipedia entry is here.

TPM is supported only on devices that have TPM hardware support and is typically enabled in the BIOS. A guide to actually using TPM is included in the references. 

It's mentioned here only because I was curious about it.I stumbled upon this while looking at the parameters for the libata module. It has an option named allow_tpm which, when enabled (it's disabled by default) permits the use of the TPM modules and functions. It can be enabled with an entry in /etc/modprobe.conf as:

option libata allow_tpm=1

Do you have TPM support in your Linux kernel? If so, the modules will be listed with the command:

# ls -la /lib/modules/`uname -r`/kernel/drivers/char/tpm

If you are using TPM to secure your hard drive, it makes sense to use a bootloader that can access it. That bootloader would be TrustedGRUB, a modification of GRUB t…

Sharing an Internet Connection on Mandriva 2009.0

Sadly and frustratingly, the Mandriva Linux wizard intended to set up Internet sharing, drakgw, is broken* and has not been well maintained. Until they fix it, here's how to do it by hand, assuming that ppp0 is your Internet-facing connection and eth0 connects to your local LAN. Thanks in part to mheanre and the folks at TWUUG.



1. Mandriva uses shorewall as the default firewall. It needs to be told to pass the data we want to allow. Edit the contents of /etc/shorewall/policy to look like this:

loc net ACCEPT
fw loc ACCEPT
fw net ACCEPT
net all DROP info
all all REJECT info
loc $FW ACCEPT -


2. Set up ip-masquerade in the kernel:

# echo 1 > /proc/sys/net/ipv4/ip_forward

To make this permanent, add the following to /etc/sysctl.conf:

net.ipv4.conf.default.forwarding = 1


3. Tell iptables to use NAT:

# /sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

I found that I needed to add that line to the end of /etc/rc.d/rc.local for it t…