Wednesday, January 27, 2010

I guess some time in the last few months, I updated udev on my Gentoo Xen Guest. Normally, this wouldn’t be a problem and it wasn’t since I didn’t need to reboot the system until yesterday. It wouldn’t come back up automatically, so I consoled the domain with xm, and saw this:

* Mounting proc at /proc ... [ ok ]
* Mounting sysfs at /sys ... [ ok ]
* Your kernel is too old to work with this version of udev.
* Current udev only supports Linux kernel 2.6.25 and newer.
* Could not create /dev/pts!
* Checking root filesystem ...Failed to open the device '/dev/hda2': No such file or directory
* Filesystem couldn't be fixed :(
[ !! ]
Give root password for maintenance
(or type Control-D to continue):

Of course I didn’t read the obvious error at first, and started messing around with other things before finally realizing the kernel the Xen domain is booting from is still at version 2.6.18. I had two options:
1) upgrade the domu kernel from xen-sources (>2.6.18-r12 still being masked on this system) and copy it to the xen host for the vm to boot from.
2) downgrade udev and pretend it never happened.

I chose #2, mainly because it’d take less time and work.
In short, here’s what I did:Note: This is all from root on the Xen Dom0, not the guest machine.. since it wouldn’t boot yet.

Tuesday, December 1, 2009

Thesh17’s been running on a linode VPS for a month or so now. It works great until it gets railed, and apache dies. Then a few hours later I notice the site’s down and login to restart it. Originally I wrote a shell script that would just check if httpd was running. If it wasn’t, it’d start it. It’d also check the output of ‘free -m’ and if memory usage(not counting buffers) was greater than 90%, restart apache.

You’d think that’d be good, right? Wrong. I don’t know why, but occasionally things would get confused. It’d see httpd running, but it wasn’t serving any pages on port 80. service httpd status would show it was stopped, but the script didn’t check http connectivity or the actual pid file. I honestly didn’t troubleshoot this much, and just manually killed the processes/restarted httpd.

I decided to search for some scripts similar to mine(and better), but instead ended up landing on a utility called Monit. It’s basically a service monitor you can run(locally or remotely) and depending on different conditions, it will restart the service and make sure it’s running. This can be as simple as the pid in the pid file not existing, or more complex like the process has been using 90% of the cpu for the last 30 minutes.

As an example, here’s what my apache monit config looks like right now:

I’m going to give Monit a try for a few weeks and see how it works out. I’ve been using nagios lately as well, but it seems kind of cumbersome to me and mainly one used for monitoring/reporting. Monit will actually restart a service if it detects a problem which *usually* is a good thing.

Linux is sleeker and faster than windows while much more personal than Mac (also its fucking free). However,it (even ubuntu) is a tough install (for a normal layman), but keep your chin above your tits because it will pay off in time.

Also if you don’t read Cracked, you should. Posibly one of the best blogs (internet magizine?) out there for people with a fetish with dick jokes and general bestiality.

posted by Kanchi_r0b0t at
11:30 pm

Comments Off on Linux spelled out for your window/mac people. (cracked.com)

Sunday, November 1, 2009

I always forget little things like this. Today I changed the dyndns hostname I’ve been using on a server, and needed to update my Apache vhost .conf file to reflect the new domain. There’s only about 10-15 virtual hosts in this file, but I still didn’t want to manually edit it. I’m lazy.

vim 90_bac.supercoolname.tld.conf

Once you’re in vim, it’s super-easy to do a find and replace. This is the command I ran:

%s/bac.supercoolname.tld/bac.evenbettername.tld/g

%s tells vim to search through the entire file.

/g tells vim to replace every instance of bac.supercoolname.tld with bac.evenbettername.tld

There’s a ton of other useful stuff you can do with regular expressions, but this is something I forget a lot when I don’t use it frequently.

Configure the Source

Compiling the Source

Letting make run it’s course is the most time consuming part of the process, so if you have something else to do while it’s compiling. Go do it.

cd mythtv make -j2 cd ../mythplugins
make -j2

Installation

Simply run checkinstall and answer a few questions

cd ~/src/mythtv; sudo checkinstall

When it promts you, simply enter Mythtv or whatever you want for the description. The package name should automatically be mythtv. By using checkinstall we are still using Ubuntu/debian’s package system to install Mythtv and everything will be a lot easier to uninstall or upgrade in the future.IMPORTANT: Change the version field to something like 20071226 (todays date) so that we don’t get an error building the package.(see screenshot below)

cd ~/src/mythtv; sudo checkinstall
cd ~/src/mythplugins; sudo checkinstall
cd ~/src/mythplugins; sudo checkinstall
Only this time when you run checkinstall; increment the Release field. So if it’s 1 now, change it to 2. dpkg will upgrade it to this new package.

Conclusion / Possible Problems

If you already know how to configure and setup mythtv, you should be good to go on your own now (with the latest bleeding-edge features.)

Stay tuned for Part II in the series, but until then if you encounter any problems following this how-to guide; Please post a comment or send me an email with the issue you’re having. We’ll get it resolved!

Saturday, December 1, 2007

Preface

This guide is written for Ubuntu or any debian-based distro of Linux; Mainly because I’m lazy and decided to use apt-get.
I’m also not going to explain newsgroups or .nzb files in general right now. I might write a follow-up for that later. I do however recommend the use of Giganews.

One: I get a small discount if you use my referral to sign up.

Two: It’s only $20 for the first month with unlimited download, 20 connections, and SSL.

Three: It’s the best usenet provider I’ve found so far and is able to max out my connection. Way faster than BitTorrent.

Update: Astraweb is offering a special. $11/mo for the life of your account. I’ve been using them for several months with no complaints. If you’re looking for the best deal, you may want to try Astraweb.

What is HellaNZB?

hellanzb is a Python application designed for *nix environments that retrieves nzb files and fully processes them. The goal being to make getting files from Usenet (e.g.: Giganews Newsgroups) as hands-free as possible. Once fully installed, all thats required is moving an nzb file to the queue directory. The rest; fetching, par-checking, un-raring, etc. is taken care of by hellanzb.

Make sure you configure the server information in the .conf file. It’s pretty self explanatory and gives examples.

If you’re planning to use SSL; make sure you enable the SSL option and change the port from 119 to 443.

Set the PREFIX dir to something like /home/username/ or /mnt/storage/hellanzb/

That’s it. You can download a .nzb file and put it in PREFIX_DIR/nzb/daemon.queue/ and if hellanzb is running, it will automatically start processing the .nzb file and then download its contents. Start hellanzb like this:hellanzb.py

Once it finishes downloading a file. It’ll check to make sure it’s all there and repair it using PAR if it needs to, then unrar it and copy the extracted content to PREFIX_DIR/usenet. It’ll also delete the .rar and .par files once it’s done with them.

Make Hellanzb startup on boot as an init script

I found this init.d script on the ubuntu forums that basically starts hellanzb in a screen session at boot.