Open Source

SOLVED: Halp, “screen” is broken on CentOS on my Linode instance!

1

So while migrating some content to a Linode instance, I attempted to fire up screen ran face first into a brick wall. For context, this was on an up-to-date CentOS 5.5 instance running screen-4.0.3-3.el5. Steps to reproduce:

  • logged in as my normal user
  • typed in “screen” and hit enter
  • console went blank for 5 seconds
  • previous content returned, along with “[screen is terminating]” and my normal command prompt.

Screen didn’t work for any regular users, however it did work for root.

I reinstalled the package, compared it to another centOS server, compared configs checked strace, etc. I could find no reason for this behavior.

Eventually I noticed I was using ttyp0 rather than pts/0 for my TTY; It was the only difference I could see between the two CentOS servers. Since I’d never seen ttyp (that I recall), it struck me as weird. I wasn’t sure if this was related to the fact that the broken instance was a xen guest or what.

It turns out, when Linode builds their CentOS image, they cut the following line out of /etc/fstab:

/dev/ptmx /dev/pts devpts defaults 0 0

That prevents pts from existing, causing you to fall back to the older ttyp, which is apparently incompatible with screen.

once I got that puppy mounted, everything was good.

Humble Bundle #2

0

So this year I managed to snag the Humble Bundle package;  If you’re not familiar with it, it’s a pack of Indie Games bundled together. There are five good reasons why you should consider getting it:

  • Name your own price ($5000 or $0.01 – your call)
  • You choose who the money goes to (charities and/or developers)
  • If you pay more than the average donation, you get Humble Bundle #1 from last year.
  • All games work on Windows, Mac and Linux
  • No DRM

Our Christmas funds were already drained, but Jackie and I agreed that we could spare $15.  I’m going through and trying the games now and thought I’d write up my notes on them:

Osmos

You’re a little bubble that propels itself by ejecting some of it’s mass in a given direction; the more mass you eject, the faster you go. As you float around, you see other blobs- some smaller, some larger. When one blob touches another, the smaller of the two is absorbed by the larger, bur as your mass grows, velocity slows. It becomes a balancing act of launching yourself to get blobs slightly smaller than yourself; if you eject too much, when you hit your target, you’ll be smaller and will be absorbed by your target (and thus dying).

There are two different types of play; “become the biggest” “absorb the ___”. Become the Biggest is played in a square or round sandbox, or it may be orbiting a massive blob; each has it’s own challenges.  Absorb the ___ involves trying to absorb moving targets- other AI blobs or repulsers (runs away from you). There may be more modes of gameplay, but I haven’t gotten to them yet.

I’ve only dug into it a bit, but it’s very addictive from what I’ve played. The only issue I’ve had is it occasionally freezes;  I have to alt-tab out of it and kill it when it happens.  It’s only happened twice, so it’s not that bad. I am grateful that the devs decided to package it as a .deb file so installing it is as simple as doing a sudo dpkg -i. Overall it’s an excellent game and easily worth $15 by itself. I could also see it ending up on the Wii due to it’s simplicity and controls.

Braid

Braid is one of those horrible horrible games like Tetris or Columns where the gameplay sinks into your brain and your start envisioning it everywhere you go.  The crux of the game is that your character can rewind time;  while it appears to be a side-scrolling platformer, you can’t actually die; so it’s closer to a puzzle game despite the running and jumping.

Each level you open up unlocks a new “feature” items that sparkle green ignore the reverse flow of time; even though you run backwards, the badguys keep moving, or the key stays where you left it. purple sparkles cause a shadow version of you to re-perform the actions you just performed; if you need to get in a gate but the purple lever is too far away and the gate closes before you get there, you can run to the gate, run to the lever, then pull it; rewind until you’re back to the gate and watch the shadow you run over and pull the lever. while he’s doing that, you can run through the gate.

I haven’t gotten very far, but the storyline is very interesting; we all wish we could rewind time and undo our mistakes, but eventually you will become a prisoner of other people’s expectations. Very fun, and again, easily worth $15. The controls are a little funky on my laptop, but this would be a great xbox arcade game. They just have a bin file which creates a dir on your system; it woulda been nicer if it had a .deb file so I could track it.

World of Goo

I’ve heard a lot about this game, but this is the first time I’ve seen it. It was actually part of Humble Bundle #1, but since I paid over the average ($7.53 at the time I purchased it), I got HB#1 as well. It’s a basic physics/building game; think tinkertoys made out of jello. The goal is to get these little goo balls into a tube; usually this is done by building some type of bridge or tower that the gooballs can climb. when you place a gooball near an existing structure, it forms a goo strut; if it only connects to one, it’ll flop like a joint. if you place it next to two, it’ll form a triangle which is relatively sturdy.

There are many different types of goo; some that drip like snot, some that can only be placed on a structure once, some that can’t form structures, etc. To top it off, if you build an awkward tower out of the gooball, the struts will bend and give way, causing the tower to collapse.

It’s a fun game, broken into many levels and chapters, but not really as enthralling as Braid. I could see this on the Wii for $15 or so by itself.

Revenge of the Titans

Revenge of the Titans is a simple tower defense game based around an alien invasion; the graphics are stylized  but simple, and the gameplay is nothing special. I’ve played probably close to 50 or so tower defense games;  It’s a little more fast paced than most and seems to just be one solid, continual wave.  It’s a well made and decent game, but I’m sorta burned out on the genre.

Samorost2

Samorost2 is a Myst-like puzzle game. Unlike the others so far, this one was flash based. The story revolves around a guy living on a small planet with his dog. When aliens stop to steal his pears and kidnap his dog, he follows them back to their base to rescue him. Each phase of gameplay involves a static screen with minor animations; you identify something on the screen that’s interactive, like a flower or ladder, and when you click on it, it triggers an animation. The gameplay is based on trying different combinations of events and timings. I was able to beat it in around an hour and a half, which makes it the shortest of the games so far. The artwork is great, but in the end it’s “just a flash game.”

Still worth a play for the artwork alone.

Lugaru HD

Lugaru appears to be a single-player  3rd person RPG, similar to WoW. The graphics are a bit rough, but it looks interesting nonetheless. Unfortunately, the controls aren’t great on a laptop, but if I had a mouse I’d probably be more interested in it. Walking through the tutorial, I got a feel for the combat, which seems crazy and fun. I’ll have to spend more time on it later.

So thats just a quick sample of what’s in the pack- I haven’t had time to play the other games. This pack is easily worth $15 several times over, and I sorta feel like I.  If you haven’t heard of the Humble Bundle, now is your chance to check it out. Hurry though, it’s not available after Christmas day.

Raw WinXP Virtualbox Partitions on a Thinkpad

27

New job, new laptop. Many utilities here are windows only, so it requires a bit of… effort… to get myself up and running efficiently. The solution to the windows problem is VirtualBox. I had set this up on my last laptop with little effort, but this time around required a bit more effort. Hopefully the instructions below will help others get up and running quickly.

Disclaimer– your laptop may catch on fire and explode (or worse) if you attempt this… or something.

We’ll be presuming that you’ve already resized your windows partition and have both a working Windows and Linux partition.

In Windows

Log into XP, grab MergeIDE.zip from Virtualbox’s site, extract and run it. It should be a quick flash and be done. (Note: I am not 100% sure this step is needed)

Create a new hardware profile and name it virtualbox. Make sure to set it as a choice during boot. Try rebooting into native windows once to ensure that it does offer you profile options.

In Linux

You’ll need the following packages installed (May differ for non-ubuntu systems):
mbr, virtualbox-ose, virtualbox-ose-qt

Create a stand-alone mbr file to use for booting (yes, you need the force flag):

install-mbr ~/.VirtualBox/WindowsXP.mbr --force

We’re presuming that your windows partition is /dev/sda1. In the below command, we are defining

  • a vmdk file (WindowsXP.vmdk)
  • which raw disk to read (/dev/sda)
  • which partition (1)
  • the new MBR file we just created

VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/WindowsXP.vmdk -rawdisk /dev/sda -partitions 1 -mbr ~/.VirtualBox/WindowsXP.mbr -relative -register

Note that you’ll need read/write access to that drive as your user, so you may want to figure out a cleaner/securer way to implement this, rather than adding your user to the disk group (which is very dumb and insecure). I would, but it’s working and I have more important things to do at the moment.

Another issue- apparently thinkpads report the drive heads and cylinders oddly (T410 for me and T60p in article), so we have to add some vmdk settings before virtualbox creates them incorrectly. Open ~/.VirtualBox/WindowsXP.vmdk and add the following at the bottom:

ddb.geometry.biosCylinders="1024"
ddb.geometry.biosHeads="240"
ddb.geometry.biosSectors="63"

The biosHeads appears to be the magic value- it seems to work if it’s set to 240, but the default is 255 (which fails).

Once you add those, start up virtualbox and check the virtual media manager, your new vmdk should be listed there. Once it’s confirmed, create a new virtual machine. Rather than creating a disk, select your vmdk as an existing disk.

After you finish, go the the VM settings->system and make sure the motherboard tab as io-apic  enabled (I also had PAE/NX enabled under processor and VT-x enabled under Acceleration).

Start the VM

There are several errors that could pop up. I’m sure there are plenty more that I stumbled across, but these were the two big ones:

  • a disk read error occurred, press ctrl+alt+del to restart – Caused by incorrect biosHeads- check and make sure it’s set to 240 (this was the fix for me, results may vary).
  • Complaint about kvm/vmx – Virtualbox does not like kvm. Uninstall qemu-kvm.

If things go well, it should flicker mbr in the corner, then go to the hardware profile selection screen. Select the virtualbox profile, and continue, then log in.

What follows is a half-hour of installing generic drivers and dealing with hardware specific auto start apps complaining that they won’t work on this installation. Windows will warn that the new drivers are not blessed, so be forewarned.

Once completed, at the top of the VM windows select Devices-> Install Guest Additions. This will download and mount an ISO, and windows will pop open a folder with the addition executables. Select the one best for you and run the installer. It will prompt you for video and mouse drivers (and trust me, you want them).

The final step is to shut down the windows VM, then reboot into the native windows partition to make sure it still works.  I did receive a few blue-screens before logging in at the beginning, but they appeared random and haven’t happened since.

And that’s all there is to it- simple, eh? Your windows partition should now run in native mode and vm mode.

Useful Utility: less

2

Less is more.

That’s the common joke about less- It provides the same functionality as the older utility, more; but oh, how much more than more!

Less allows you to easily scan backwards as well as forwards- something more is not too good at (though it is possible). Less also allows you to navigate with arrow keys, page up and page down, home and end.

Less provides a quick way to view files as well- Many editors (like vim) need to read an entire file first, and often create a temporary copy (for editing) of the file. This isn’t a problem until you try to browse a 56 gig log file of a rabid JBoss instance- if your root directory isn’t large enough, chaos ensues. Less circumvents this by only loading a page at a time. Yes- searches do take longer, but it beats crashing a system.

Useful Commands:

  • R: Repaints the screen, rereading the file from the disk. useful if the file is constantly changing (like a logfile)
  • / and ?: Just like in vim, used for searching forwards and backwards
  • g and G: Jumps to the top or bottom of the file, just like vim
  • :n and :p: Jump to the next/previous file (if you pass less more than one file)
  • q: quits. slightly important
  • ! [cmd]: runs a given command outside of less- useful if you can’t remember the output of another command and need a quick reminder (ifconfig, tail, route, ls, etc)

Useful Flags:

  • -N: Shows line numbers
  • -s: squeeze adjacent blank lines into one
  • -R: shows raw control characters, a.k.a. “turns color on!”

As usual, there are dozens of more options, flags, variables and behavior- you’d be surprised what less can do for you.

Free Jabber / XMPP clients for a Blackberry?

14

anyone know of any good jabber clients for the blackberry? I’ve tried a couple with little luck, and most of them cost more than I can afford for this test. Features required

  • Must run on BlackBerry 8703e v4.1.0x
  • Connection server can be configured differently than jid address (i.e. you@morgajel.net for jid, jabber.morgajel.net for connection server.) This rules out Mobber as far as I can tell
  • Requires SSL/TLS
  • Non-strict cert checking

Let me know if you have any suggestions.

Intro to Vim Tip #6 (Multiple viewports)

1

One feature of vim I don’t use enough is the ability to split the screen and view multiple files at once. I use this feature all the time when I use vimdiff, but not really any other time. I thought I’d take a moment to lay out some uses of it (thank Linux.com for the reference):

From Command Mode:

  • :sp splits the screen horizontally
  • :vsp splits the screen vertically
  • Ctrl-w Ctrl-w moves between viewports
  • Ctrl-w [right arrow] moves active viewport 1 to the right
  • Ctrl-w [left arrow] moves active viewport 1 to the left
  • Ctrl-w 3[left arrow] moves active viewport 3 to the left
  • Ctrl-w q will close the active window.

and remember that you can open a file with 😮 filename in the newly created viewport

Shutup Shutup Shutup!

0

die you wretched pc speaker beep that is so loud when I use the find bar in firefox or tab complete in the cli and nothing is found!

  rmmod pcspkr
  echo blacklist pcspkr >> /etc/modprobe.d/blacklist

aaah, glorious silence.

Request Tracker 3.6.5 broken after updating Cent OS

0

Can’t locate object method “seek” via package “File::Temp” at /usr/lib/perl5/site_perl/5.8.8/MIME/Parser.pm line 816.

The underlying problem is perl was updated and overwrote the “correct” version of File::Temp that you probably installed when setting up RT and forgot about. To fix this issue


cpan install File::Temp
/etc/init.d/httpd restart

MAKE SURE TO RESTART APACHE! I didn’t, and it cost me probably 2 hours of screwing around with it.

I’m posting this because
http://www.nabble.com/RT-3.6.5-and-Sendmail-error-and-looks-like-perl-error-td15989015.html
Didn’t really mention what the final working solution was.

28

2

Whew, it’s been a busy year. Back in 2005 I wrote a list of things I’d like to do eventually that I’d be able to do if I had the time and resources that winning the lotto would provide. I’ve made a positive step towards realizing a couple of those.

Family

The big change this year was the addition of Ian. We didn’t get off too well in the beginning, but we’re doing pretty good now. He’s just now to the point where he’s taking his first steps. He’s a smart kid, very inquisitive, but stubborn. Within a few years he’ll be learning how to read and write- I’m guessing it won’t be long until I’m teaching him how to program. He’s got an eye for any type of electronics, but goes nutty for my blackberry or laptop. Yeah, he’s a geek in training.

Jackie’s been doing fairly well, all things considered. She’s been staying home with Ian rather than going back to work, and it’s driving her a little stir crazy. To help ease the cabin fever, she got a laptop for christmas- Ian wasn’t letting her stay in the office, so now she has a way to keep in contact with people from the living room.

Weddings

This was the year of the wedding… Brad and Erin, Jordan and Beth, Matt and Carrie, William and Charleen, Jackie’s friend Joslyn, Jackie’s sister Lori, and Paul and Kristen. I only made it to 4 of the weddings, but I was standing up in two of them. The ones we went to were all in Grand Rapids, so we had the joy of driving back and forth 155 miles each way, with the added bonus of dropping Ian off somewhere along the way

Work

Work started off pretty rough. I have a habit of reflecting the attitudes of those around me, and my supervisor at the beginning of the year was pretty negative. That coupled with Ian’s birth and all the associated expenses turned me into a pretty miserable person. Fortunately the supervisor left and was replaced with a cautious optimist. Things got better- so much so that I just passed the 1 year mark at my current place and still find it interesting and entertaining.

Technologies

I’ve played with many new technologies this year- Jboss, Netscaler and CentOS being the three foremost. I’ve dug back into ruby with a couple of new projects, as well as LDAP and a plethora of new utilities. I even picked up a bit of python. This trend doesn’t look like it’s gonna let up, so the job should be exciting and interesting for some time to come.

Projects

This year saw me move away from music and go back towards software (although I have been playing harmonica in the car at stoplights on the way to work). I joined the Luma team as head cheerleader and started the QT4 branch. After becoming frustrated with the python, qt3->qt4 transition and the codebase in general, I started an unofficial sister project, Ruma. I still sit in the Luma channel and help when I can, but I’m gonna sit back and wait until we’re ready for QT4- hopefully we’ll scrap the entire codebase and start fresh.

Right now I have two other developers “working” for me on Ruma, Lars and Hiro. They’ve put a lot of effort into bringing this bad boy to life, and I’m thankful I’ve had their help. For those of you not aware, Luma and Ruma are LDAP administration tools. As a System Administrator, I use LDAP a lot, so having specialized tools can be helpful.

Another project I started this year was competing in National Novel Writing Month. I finished the rough draft for my first book, Sinblade, a week early. It’s only 150 pages or so, but not a bad start all things considered. Jackie’s (sorta) working on revising it, and once she’s done I’ll open it up for others to start giving me feedback. I’m excited and nervous about it. If it takes off and people like it, I have 6 or so more books that I’m interested in writing.

The money situation is still pretty tight, but it’s getting better. Hopefully next year will be as much of an improvement over this year as this was over last year.

Introduction to Subversion

0

I was planning on simply republishing my previous svn article, but realized that it sucked compared to what I know now.

Prerequisites

I’ll presume you have the following things.
– a Linux machine
– subversion already installed

Terminology to Know

There are a few terms that get mangled if you’re coming from other types of source control. This is just to clear things up.
Repository: the central storage place on the subversion server where your data is kept.
Checked-out copy: Unlike VSS, saying something is checked out does not imply that the file is locked. Also referred to as a local copy; but bear in mind that it doesn’t contain *all* of the data of the actual Repository.
commit: save the changes you made locally to the repository.

Mental Hurdles

All of the files stored in a subversion repository are stored in a meta-filesystem. Much like an ISO image sitting on your desktop is not simply a folder full of files, a subversion repository is not directly accessible when you open it. Instead, you’ll see the guts of the repository- DB files, hooks, locks, etc. Don’t go digging through there to manually change your files- it’ll break things.

Another important one is the meta-filesystem. The “inside” of your repository is just a big filesystem. Much like /bin and /home exist on a linux machine by convention, there are certain base-level directories you should create for convention’s sake. The first thing you should do with a new repository is create three new base level directories: /tags, /trunk and /branches. Your main development will take place in /trunk. Don’t worry about the other two at the moment.

When I refer to the root of the repository, I’ll often refer to it as / or root. This *IS NOT* your server’s root directory or the physical location of the repository- it’s the part of the meta-filesystem where /trunk, /tags and /branches reside.

Step 1: Creating the Repository

Creating a repository is fairly simple. Anyone can create a repository where ever they have write access. All they must do is run

$ svnadmin create ~/project1/

This should create an empty repository. This will demonstrate what I’m talking about when I say that your repository is a meta-filesystem:

morgajel@unicron ~ $ svn ls file:////home/morgajel/project1
morgajel@unicron ~ $ ls /home/morgajel/project1
conf dav db format hooks locks README.txt
morgajel@unicron ~ $ svn mkdir file:////home/morgajel/project1/trunk -m 'creating trunk'

Committed revision 1.
morgajel@unicron ~ $ svn ls file:////home/morgajel/project1
trunk/
morgajel@unicron ~ $ ls /home/morgajel/project1
conf dav db format hooks locks README.txt

Here you can see the repository was empty, then we created a directory called trunk (using a commit message to describe the change we made), then showing that the directory was in fact created. Do the same thing for /tags and /branches.

We now have a working repository!

Checking out the Repository

Creating a repository is fine, but using it would be much more… useful. Next you should check out a copy of your project. Under normal conditions you’ll only be checking out the /trunk, but you mileage may vary in different situations. Since this is on our local machine, we can use the file:// protocol. Other protocols exist, like http:// (webdav), svn:// (svnserve), and svn+ssh:// (svn over ssh), but you don’t have to worry about them right now.


morgajel@unicron ~ $ svn co file:////home/morgajel/project1/trunk my_project1
Checked out revision 3.

This should check out the empty /trunk directory to a local folder called my_project1. The only thing in this directory is a hidden .svn directory which holds the guts of your local copy repository info. It’s similar in function to the CVS directory in CVS. Unfortunately a nearly-empty directory isn’t much use, so let’s add some content.

Adding Content

So let’s add some content.

morgajel@unicron ~ $ cd my_project1/
morgajel@unicron ~/my_project1 $ mkdir -p lib bin share/docs
morgajel@unicron ~/my_project1 $ touch configure Makefile share/docs/README lib/foo.pm bin/widget.pl
morgajel@unicron ~/my_project1 $ svn status
? configure
? share
? lib
? bin
? Makefile

Here I created a bunch of directories and created some empty files. When I ran svn status, svn told me that there were 5 things it wasn’t versioning. Let’s add them.

morgajel@unicron ~/my_project1 $ svn add configure share lib bin Makefile
A configure
A share
A share/docs
A share/docs/README
A lib
A lib/foo.pm
A bin
A bin/widget.pl
A Makefile
morgajel@unicron ~/my_project1 $ svn status
A configure
A share
A share/docs
A share/docs/README
A lib
A lib/foo.pm
A bin
A bin/widget.pl
A Makefile

As you can see, it recursed down into share, bin and lib and added all the goodies inside of each directory. You can also see svn status shows these as well. Keep in mind they’re just slated to be added to the repository- they’re not added yet. Let’s go ahead and commit them.


morgajel@unicron ~/my_project1 $ svn commit -m "a bunch of empty files and directories"
Adding Makefile
Adding bin
Adding bin/widget.pl
Adding configure
Adding lib
Adding lib/foo.pm
Adding share
Adding share/docs
Adding share/docs/README
Transmitting file data .....
Committed revision 4.

Modifying Data

So suppose you’d like to modify these files, you you decide to move the README to the root of your local copy (~/my_project1/):


morgajel@unicron ~/my_project1 $ svn mv share/docs/README README
A README
D share/docs/README
morgajel@unicron ~/my_project1 $ svn stat
D share/docs/README
M bin/widget.pl
A + README

Notice that I used svn mv to move files rather than regular old mv- That’s to make sure svn is aware of the move and keeps the file history associated with the new file. You can also see bin/widget.pl now include some new info as well, and displays an M[odified] next to it. The + next to README shows that it copied the history over from it’s previous position. So what happens if we move a file without svn mv?

morgajel@unicron ~/my_project1 $ mv configure config
morgajel@unicron ~/my_project1 $ svn status
? config
! configure
D share/docs/README
M bin/widget.pl
A + README
morgajel@unicron ~/my_project1 $ mv config configure

You can see that svn panics(!) that configure has gone missing, and sees this new file called config that it’s currently not revisioning. It doesn’t know that they’re the same file.

Commit Messages

You’ve seen me use the -m flag a couple of times now- I’m using it to keep things flowing. If you don’t use it, you’re prompted in your favorite $EDITOR to create a commit statement, which includes the list of modified files. Using the -m flag is useful if you’re scripting commits (I use this when dumping and committing a nightly config file from our load-balancer).

Most of the time however, you’ll use your Editor. Make sure to keep your commit messages sweet and to the point- other’s will see them.


morgajel@unicron ~/my_project1 $ svn commit
[vim shows up, I enter the following text]
Small changes to demonstrate movements
- moved the README
- added shebang to widget.pl
[save and exit vim]
"svn-commit.tmp" 8L, 190C written
Adding README
Sending bin/widget.pl
Deleting share/docs/README
Transmitting file data .
Committed revision 5.
morgajel@unicron ~/my_project1 $ svn update
At revision 5.
morgajel@unicron ~/my_project1 $ svn log
------------------------------------------------------------------------
r5 | morgajel | 2007-11-20 15:55:21 -0500 (Tue, 20 Nov 2007) | 4 lines

Small changes to demonstrate movements
- moved the README
- added shebang to widget.pl

------------------------------------------------------------------------
r4 | morgajel | 2007-11-20 14:17:04 -0500 (Tue, 20 Nov 2007) | 1 line

a bunch of empty files and directories
------------------------------------------------------------------------
r1 | morgajel | 2007-11-20 13:35:28 -0500 (Tue, 20 Nov 2007) | 1 line

creating trunk
------------------------------------------------------------------------

You’ll notice that revisions 2 and 3 aren’t listed- if you’ll remember correctly, they were used to commit the /tags and /branches directories. svn log only reports changes that affect the current target (in this case, ~/my_project1 which is a local copy of /trunk).

There’s a couple more tips and tricks I could go on about- if there’s any interest in this post maybe I’ll write some more about more advanced topics.

Go to Top