Posts Tagged gentoo

iPhone Happiness

Well. I purchased an iPhone Thursday. Friday was NOT a productive day. In fact, neither was today. It’s a great little tool and it’s very handy.

One of the first things I noticed was that my voicemail messages (which get emailed to me from my VoIP provider) were NOT able to be played on the iPhone. Basically, they support WAV files but they must be in a specific format.

Solution? Well, I immediately thought that I could set up a spare email account on one of my domains and use procmail to run a conversion on the audio on my Linux box (and forward the results to my regular email account). I did a search and was pleasantly surprised to see that it had already been done (in exactly this way). However, after trying to get it working on mine I realized that it was a little messy since I was using virtual mappings (in order to store all email domains/users/aliases in a Postgresql database). Hmmm… So, I played around with maildrop (with which I was previously not at all familiar with). After much, much tweaking of permissions on folders (maildrop requires some odd and sometimes nearly conflicting permissions for things to work) I was able to get it to work as expected. I shamelessly stole the script that had already been created, emerged sox and some other utilities to support the conversion and fixed some bugs that I found along the way in my mail config (finally cleared out 250+ emails that had been queued up forever).

After all that, I still have a slight issue. A WAV file goes from being 60K to being 500K when I convert it to the “acceptable” format. Oh well. AT & T’s EDGE network isn’t the fastest for downloading 500K but I guess it’s a lot better than nothing. It sure is nice to be able to get both your Cell voicemails and your home voicemails all on the same device. The iPhone is the first (so far as I know) cell phone to offer “visual voicemail” where voicemail is essentially downloaded rather then being available over one of those irritating “press 7 to delete your message”-type interfaces.

Phew… fun stuff. I’ve decided that since I spent the time playing with maildrop I might add some fun things (like system automation via email). There are definitely a few maintenance tasks that might be nice to automated via email. At work I have a proxy and email (at least from my work email account) is one of the few things that I’m allowed to use. I guess in theory I could run a really slow, email-based terminal session (email “ls -al” and after about 30 seconds get the results emailed back). That would be kind of cool. And a terrible security hole. 🙂

Sorry I’ve been slow on updating. I need to get back into the habit. Hope all my faithful reader(s) are well!

, , , , , , , , ,


VPS Hosting

So I had been looking for a new VPS host… I’ve used GoDaddy for a while and although it was decent a few years ago because of it’s pointy-clicky Plesk interface, I’ve since found that it’s easier to maintain it myself at the command line. I’m still running Fedora Core 2 and in order to upgrade, it’s really painful. Back in the day, there were packages that I could install but now my only real option is to upgrade the OS entirely (which involves backing up, wiping, and restoring). Seems easier to move to a Gentoo-based VPS, save a few shekels, and get better performance. I also previously only used my server for hosting simple LAMP web sites. I’d like to move towards not only Apache/MySQL/PHP but also Ruby on Rails, Subversion, Trac, and other things.

So, my two main options were VPSLink in Seattle, WA and Slicehost in St. Louis, MO. These were chosen somewhat arbitrarily based off of reviews (mostly “personal” type reviews from blogs).

I purchased a 1GB RAM VPS for a month from VPSLink and a 3 month 512MB RAM VPS from SliceHost. Prices for equivalent products are very close but SliceHost does require a minimum of 3 months.

First off, I noticed that my ping time is obviously pretty good to the Seattle based VPSLink. I get 30-40ms response. I get 50-60ms response from SliceHost. Now, I remote into a server in the D.C. area and try again. Now I get a response time of 90-100ms for VPSLink and 30-40ms for SliceHost. This seems to make sense since SliceHost is more centrally located. Since my website traffic is fairly evenly spread across the U.S. (only rarely overseas) this seems to be a plus for SliceHost.

I like the SliceHost management interface. It’s a “developer” type interface that’s very simple but very fast and gives me a lot of flexibility. I don’t like the VPSLink interface. It’s annoying and (as I just noticed tonight — doesn’t always seem to be exactly running). Most of the features are similar but I do feel like I can really control things better with SliceHost. For starters, the VPSLink is dog-slow compared to SliceHost and also has separate sections for billing, support, management, etc. It’s a pain to deal with. SliceHost is essentially one page with tabs. And it has more features like the rescue mode (mentioned below).

Well, the VPS with VPSLink is FAST. I do an emerge –sync && emerge world and I get the entire Gentoo installation updated quickly. However, now things seem a little odd and it seems like something’s caused a memory leak. Rather than chase it down, I do a reboot instead. Whoops — mistake. Gentoo (configured in a Xen environment) has a known bug which causes some problems. A trivial fix but I need to boot with a Live CD or something similar. And my server is in a data center in Seattle somewhere. Hmmm… I contact tech support — do they offer a Live CD equivalent boot? They do not. SliceHost does. This is a big deal overall. Especially with Gentoo, I have a bad habit of goofing something up and breaking my boot process. Since I’ve always dealt with locally stored boxes, it’s just a minor annoyance to have to connect a monitor and keyboard to the system and resolve the issue. However, the only fix VPSLink offers is “rebuild the box”. So if I break the boot process, I lose ALL data on the box. Ouch.

So, after one month of using SliceHost and not really being excited about rebuilding my VPSLink box AGAIN, I’ve canceled VPSLink and have begun to migrate all websites from my old Fedora Core 2 server to the new SliceHost Gentoo. It seems stable, fast, and reliable and if I do make a mess of things I’m confident I can get it back up and running without too much pain.

Over the last week I’ve spent FAR too much time trying to resolve little things like successfully getting non-Roman characters into the MySQL database (it’s odd the way the Gentoo MySQL USE flags work), getting Apache updated and still having PHP work, resolving a mess of library dependencies (I got to use revdep-rebuild — yay!) and also playing with Jails and getting an SSH account setup that chroot’s it to it’s web page root. All fun stuff but time consuming. I love Gentoo though — it’s not always the cleanest but it seems like you’re never “stuck”. Or at least that’s been my experience.

, , ,

1 Comment

Funny things in Gentoo

In Gentoo, “emerge” is the package manager (the tool used to install new applications and software on the system). You can type “emerge mozilla-firefox” to install the most recent Firefox release or “emerge ruby” to install the Ruby programming language.

Here’s a slightly unexpected result…Diane will like this… 🙂

Emerge Moo

Okay, so it doesn’t do anything, but it’s kind of funny.




Well in my drug-induced down time I’ve been fiddling with my Gentoo server some more… I added Wake-on-Lan support to the kernel so that I can power the system up from upstairs or across the country. It’s nice because I don’t tend to leave it on all the time and even when I’m home, it’s a pain to hit the power button since I keep the system squirreled away in a cabinet.

In addition however, I also added OpenVPN support to the server. I punched a hole in the firewall and set up Ethernet bridging in order to give me full access to the entire network when I’m away from home. It works amazingly well. It wasn’t quick to set up but it was kind of fun. Basically you create an Ethernet bridge between a “real” network adapter and the virtual OpenVPN adapter and assign that bridge the IP address of the old “real” network adapter. I like.

, , , ,


More Bash Scripts

I need to copy all of my FLAC files out of my directory tree but preserve the folder structure that they were in… Here’s my script.

Unfortunately, it’s not a “perfect” solution as there are issues when handling special characters in files (especially newline characters). However, since my file really just have spaces in them, that’s all this was designed to beat.

SOURCEDIR="/var/mirror/Data/Audio/My CD Archive"
mkdir "$TARGETDIR"
find "$SOURCEDIR" -type d | while read DIR; do
  if [[ "$DIR" != "$SOURCEDIR" ]]; then
    SHORTDIR=`echo $DIR | sed 's/.*///g'`
    echo "Now in $DIR"
    find "$DIR" -name "*.flac" | while read FILE; do
      SHORTFILE=`echo $FILE | sed 's/.*///g'`
      echo "Now moving $SHORTFILE"
    echo "--------------------"
    sleep 1

, , ,

1 Comment


So… Back on march 30th I posted an entry on my storage solution. I had built a computer and had added a basic RAID configuration to it:

I finally got my RAID solution in place. I went cheap and got two 500GB hard drives ($145 each) and a HighPoint RocketRAID 1740 RAID 0/1/5 4 channel SATA 3.0 GBps card ($110).

So… With this configuration I get 500GB of storage (430GB or so after formatting). This was great for a while. However, recently I realized I needed more. All of my personal “stuff” that’s somewhat irreplaceable doesn’t take up much room. Add my ripped CDs in and you get about 100GB. I have another 25-50GB of random things (disk images for linux installs, video rips (which I haven’t in the past kept for very long so I was okay with not backing them up)). So I wasn’t exactly out of room but I was using a fair bit. However, I also wanted to snag a relation’s (who will remain unnamed) music collection. It’s 499GB. That’s 272 days worth of music if played continuously. We follow a strict rule to ensure compliance with copyright law: we don’t tell anyone.


Anyway — I needed more storage so I picked up some hard drives from Fry’s online (why is their online store called “Outpost”? It makes no sense). They were cheap! $89 per 500GB drive. They came with free shipping and I shipped them to Virginia when I was there on travel to save on state sales tax. When I got back, I copied my existing data to a 500GB external drive, added the new drives, prayed a quick prayer that my system wouldn’t overheat and started it up. I reconfigured the RAID array from a 2 x 500GB RAID 1 array to a 4 X 500GB RAID 5 array. This gives me 1.5TB (1.4 TB or so formatted). It’s nice. I’ve loaded everything on there and since I have so much extra breathing room I’ve immediately started piling on stuff that I previously had kept on local hard drives. Here’s my usage currently:


It’s nice to have some room…

, , ,