Archive

Archive for the ‘Linux’ Category

SNMP on Tomato

I just published some instructions for getting SNMP running on Tomato so it can be monitored from something like cacti.

The complete instructions are here.

Categories: Linux, Tech Tip

Linux vs. Microsoft: It’s over…

April 6, 2011 Leave a comment

Linux Foundation Executive Director Jim Zemlin said in a recent interview that Microsoft is increasingly irrelevant. “I think we just don’t care that much [about Microsoft] anymore … They used to be our big rival, but now it’s kind of like kicking a puppy.”

Zemlin points out that Linux is dominant in every sector except the Desktop. And while the desktop is certainly not an insignificant portion of the market, this is also likely to change dramatically over the next 5  years as mobile devices start to replace laptops and desktops.

Think of it this way, is your next purchase likely to be another $1000 home computer with windows, or with some other device like a $300 tablet? There is no longer any compelling reason to buy a home computer with Windows so the trend is inevitably away from desktop PCs.

It won’t happen overnight but I’ll bet that sometime over the next couple years you’ll cast your gaze over to your home PC and realize it has a layer of dust on it. At that point you’ll realize that your beloved PC, the one that you thought you could never live without hasn’t even been turned on for weeks.

Categories: Linux, Microsoft, Trends

Starting a command in a new TTY

December 28, 2010 Leave a comment

Here is a nifty tip. If you want to run a command but have all its output displayed on a diferent console, just use openvt. For example, here is how to run top in tty9:

# openvt -c 9 top
Categories: Linux, Tech Tip

Using udev to automount devices

December 13, 2010 Leave a comment

геоложки проучванияMost desktop Linux systems now auto-mount any removable media by sending a trigger to the Window-manager (KDE or Gnome for example). But in some cases you might want to do the auto-mounting using udev instead (for example on a server where you don’t have x-windows installed).

This can be done quite easily using udev and there are a variety of great examples on the udev wiki. Here is one I modified slightly which could act as a simple way to do backups to an external USB device without having to manually mount the device each time.

Create the file “/etc/udev/rules.d/11-backup-auto-mount.rules"

--start--
KERNEL!="sd[a-z][0-9]", GOTO="backup_auto_mount_end"

# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"

# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"

# Mount the device
ACTION=="add", RUN+="/bin/mount -o $env{mount_options} /dev/%k /backup"

# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /backup"

# Exit
LABEL="backup_auto_mount_end"

--end--

Categories: Linux, Tech Tip

ntp on virtual machines

November 23, 2010 Leave a comment

If you’ve ever run a virtual machine you’ve no doubt encountered a problem with the clock skewing badly to the point where you can be hours out of date in only a few days.

On non-visualized systems minor clock skew is also a problem that is easily solved using ntp (network time protocol). Unfortunately the default behavior of ntp causes it to give up if the clock gets too far out. In ntp.log you’ll see a message such as:

 ntpd[16182]: time correction of -1135 seconds exceeds sanity limit (1000)

The solution to this problem is to tell ntp not to “panic” and give up no matter how bad the clock gets.

At the top of ntp.conf just add the line:

tinker panic 0

ntp will not give up no matter how badly the clock skews. Also, make sure that the startup options for ntp include the “-g” flag. On most modern Linux distributions you’ll find the options in /etc/sysconfig/ntp. e.g.:

NTPD_OPTIONS="-g -u ntp:ntp"

update: corrected to say "setvar panic 0". was "panic 0".
update#2: ok, this is frustrating but the config command is actually "tinker panic 0". There is also a document from VMWare on this topic.
Categories: Linux

Mounting disks by label; A cautionary tale

July 21, 2010 Leave a comment

I was migrating some data to some new disks and since the drive letters would be changing once the old disks were removed, I partitioned them and then gave them label names so they could be mounted by label.

The original disks had labels like:
boot
srv
tmp

On the new disks I thought good names would be:
/boot
/srv
/tmp

(I think Redhat actually names things this way by default?)

Anyhow, to make a long story short, mount by label ignores the leading slash. When the system rebooted, as predicted the drives came up in a different order so a “mount LABEL=srv” will actually mount the first disk named either “/srv” or “srv”.

Moral of the story; it’s probably a good idea not to use any strange characters when naming disks.

Categories: Linux, Tech Tip

UPS Monitoring with SUSE. Quick & Dirty

December 7, 2009 1 comment

I recently had the need to query a bunch of UPSes to gather their current statistics using openSUSE. The Network UPS Tools packages (NUT for short) are available for openSUSE and that’s all you need (assuming your UPS is one of the supported ones).

# zypper install nut

Next you need to edit /etc/ups/ups.conf and make an entry for your UPS driver and serial port.

[myups]
driver = bcmxcp
port = /dev/ttyUSB0
desc = “Local UPS”

Next I started the UPS driver manually in debug mode so I could see what was going on. The nice thing about this driver is it will auto-discover the UPS serial port speed.

# /usr/lib/ups/driver/bcmxcp -a myups -D

In a separate terminal window, start upsd.

# upsd

Now you should be able to query the UPS:

# upsc myups@localhost

Because I was just collecting statistics, I wasn’t interested in using upsd to automatically shutdown servers or anything fancy but that is possible.

Categories: Linux, SUSE, Tech Tip

SUSE 11.2 Tweak – Show all tasks on Gnome Panel

November 16, 2009 2 comments

The Gnome desktop in OpenSUSE 11.2 is beautiful (much nicer than the clunky KDE IMHO), but there are a few things that I don’t like about the default settings. I use 8 virtual desktops to keep my desktop organized but I like the taskbar to show all tasks. By default, the gnome panel’s task bar shows only the windows in the current workspace and for some reason you can’t just right-click the panel to change this setting.

Instead, it’s buried in the Gnome Configuration Editor which makes it really hard to find so here are the steps to fix this:

1) Computer -> More Applications

2) System -> Gnome Configuration Editor

The setting that needs to be changed is:

3) /apps/panel/applets/window_list_screen0/prefs/display_all_workspaces

You can navigate down the tree or use the “Find” function.

That’s it! Have a lot of fun!

Update: see the first comment for an equally obscure but perhaps easier method.

Categories: Linux, SUSE, Tech Tip

SUSE Studio – First impression… WOW!

October 7, 2009 1 comment

Someone finally took pity on me and sent me an invite for  SUSE Studio. My first impression – Wow!

SUSE Studio lets you build your own custom linux distribution using SUSE as the starting point. The process requires only a few mouse clicks and is so fast and simple any Geeko can do it ;)

Step 1: choose a starting point for your build. Options range from bare-bones (Just Enough OS) OpenSUSE 11, to a full blown SUSE Enterprise Server.

Step 2: Add additional packages. Of course the full SUSE package list is available which includes everything you would normally find on the DVD. But, you can add any repository from the internet including your own custom ones either uploaded as an RPM or downloaded automatically from your own site.

But the goodness doesn’t end there… All of the respositories from the SUSE build service are also avaialble. You’ll be hard pressed to find a package that isn’t already available in Studio giving unprecidented flexability for building custom appliances.

Step 3: Next you configure some basic options such as Language, Timezone, Networking, and the default users and groups.

Step 4: Overylay files. If you need to add some files to your distro, just tar them up and they will be automatically un-tared in the directory specified.

Step 5: Create your applicance. You can pick one of 4 target formats. USB/Disk image, ISO, VMWare/VirtualBox, or XEN. Then click “Build”.

It typically takes less than 5 minutes to build the appliance and when you’re done you are presented with 2 options: Test Drive, or Download.

Test drive is really neat. Your appliance launches right in your browser window. You can watch it boot up, login, and test things out. The full desktop is there! Really cool! You can go back at any time and make changes.

Once you’re satisfied with your appliance click the download link and you’re done!

SUSE Studio is truly amazing.

I have only one small dissapointment; it only supports x86 archetectures and I had wanted to use it to build a PPC appliance that would run on the Sony PS3. I suspect they’ll add support for other CPUs in the future. Afterall, most small appliances don’t run full blown processors.

Categories: Cool Tech, Linux, SUSE

Is Redhat giving Linux a bad name?

September 4, 2009 Leave a comment

RedHat put out a new release this week. Redhat Enterprise 5.4. Here is a summary of the important changes:

- Nothing

About all they could muster in their press release was driver updates and something about KVM replacing XEN. Yawn… KVM is arguable a backwards step over XEN at this point so my guess is the change has more to do with Citrix buying XEN than any real technical advantage.

Setting aside the KVM vs. XEN argument; When is RedHat going to do a major update on its “look & feel” ? The biggest difference from RH4 to RH5? The background color changed from blue to red. wow.

In fact, RedHat has not changed in any significant way since before RHEL 4. It still has the same horrendous system admin tools and awful menu layout. It is now been way surpassed by its competition, SUSE Linux Enterprise Server 11 (which has improved leaps and bounds since SLES 9), and upstarts like Ubuntu.

On top of that, the anaconda installer is a dog and I’m fairly certain FEMA could come up with a better “rescue mode” than the one on the RH5 media.

And the desktop? Come on Redhat! You’ve got to step up! You’re giving Linux a bad name. As a Linux advocate, I’d be flat-out embarrassed to put RedHat beside Windows7 or Mac OSX.

Yes it’s still Linux and yes it’s still stable and great in many ways, but Redhat must do better. Much much better.

Categories: Linux, Redhat
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: