Ubuntu and DVDs: Still pathetic in 2010

2010-01-15 11:05:27 PST

Tags: , ,

I'm a little blown away that Ubuntu 9.10 still has no DVD support and can't even install it. Pretty amazing 0_o.

Ah well, after seconds of googling I found a slightly popup laden answer:
http://shibuvarkala.blogspot.com/2009/10/how-to-make-ubnutu-910-karmic-koala.html

Not bad. a) install Mediabuntu repos, b) install DVD support.

Still, it's 2010 and Ubuntu has no support for DVDs. In any way. Lame.

Shoes 2 packaged for Ubuntu: My first package

2009-08-20 10:36:01 PST

Tags: , ,

So you may have noticed a few days ago a link to an article on teaching to program in a newish language called Shoes. Its a cute language on top of Ruby for whipping up fun cute little GUI apps, event oriented and good for introductions to programming. So I wanted to play with it but Ubuntu and Debian ship the old version 1 and version 2 has been out since December 2008. So I checked Ubuntu's bugzilla and sure enough, there was a bug from April asking for a version bump with no response. So I figured it might be time to step up to the plate. So I brought up the Ubuntu Packaging Guide and gave it a read. Turns out Shoes wasn't trivial to package but with the old version 1 Deb package as a starting point I was able to get version 2 packaged! It's now sitting in Ubuntu's bugzilla at https://bugs.launchpad.net/ubuntu/+source/shoes/+bug/359031 and if you just want the Shoes 2 i386 deb, its at http://launchpadlibrarian.net/30491206/shoes_0.r1134-1_i386.deb. So yeah, check it out, give it a whirl, have fun.

As a side note, I've found Ubuntu's bugzilla to be sporadically responsive which sucks a bit, but does encourage one to step up some... But looking at Debian, where this package actually originated from is even worse. They have no web interface for entering bugs, they only accept them via email or a command line tool. It does seems like a epic usability fail. So here's hoping that now that Shoes 2 has been packaged as a .deb we'll see it in Ubuntu sooner rather than later. Maybe I should just make a new bug for it?

(I hate to say it, but I still have found the Gentoo bugzilla to be blazingly responsive and have fond memories of it. I wish other communities could learn from it, what ever it is they are doing right.)

Backup around firewalls with ssh and rsync to encrypted destinations

2009-08-14 12:09:08 PST

Tags: , , , ,

I decided I really needed to work on a server backup system, so here are my notes on the system I have now.

First things first, the files I want to backup are owned by all different users, so the only user who can run the backup process is root. Therefore I can't just run rsync from my local machine and grab the files from the server, the backup process has to be run on the server and backup to the backup machine. Now in my case this was a bit of a trick because the backup machine was behind a firewall, so the server had no direct line of communication to it. So I wrote a script to turn on a reverse ssh port forward.

recv-serv-backup.sh

 
#!/bin/sh
 
ssh -R 8000:127.0.0.1:22 -N user@kvasir.mindstab.net
 

When run on the backup machine behind a firewall, it connects to the server (kvasir) and listens on port 8000. When ssh on kvasir connects to port 8000 it redirects that traffic to local port 22, the ssh port of the backup machine. This is how the firewall is gotten around. Reverse port mapping is a cool trick to master.

Next as root on kvasir I generated a public ssh key and put it on the backup machine so root could automatically log on repeatedly to the back up machine (think lots of rsync calls) once the key was loaded once. Then I hooked up the key to keychain. That is all better outlined at:
Gentoo Linux Documentation: OpenSSH key management, Part 1 and
Gentoo Linux Documentation: OpenSSH key management, Part 2.

The all I needed to do was poke the rsync syntax to use the nonstandard ssh port for backup. The best method I found was

rsync -e "ssh -p 8000" -av

rsync for those of you who don't know is a great little backup tools. It's like a smart (in that it only copies files that have been modified since the last backup) network aware (since it can use ssh) copy tool. Simple but really useful.

So with that I wrote a backup script on the server

server-backup.sh

 
#!/bin/sh
 
backup () {
        echo "$1..."
        DST=`echo "$1" | awk '{split($0,a,"/");  result = "/"; for (i=2 ; i < length(a)  ; i++)   result = result "/" a[i];  print result;  };'`
        rsync -e "ssh -p 8000" -acv $1 dan@127.0.0.1:~/kvasir$DST ;
 
}
 
backup "/svn"
backup "/git"
...
 

There is one caveat, rsync won't create subdirectories on the other side specified in the path so you need to create the basic directory structure.

 rsync -e "ssh -p 8000" -av /git user@127.0.0.1:~/kvasir/git

is fine because it will create /git just fine, but

 rsync -e "ssh -p 8000" -av /home/user user@127.0.0.1:~/kvasir/home/user

will fail if ~/kvasir/home doesn't exist. So you'll need to create the basic directory structure or enhance the backup function to strip out extra directories in the target path.

Finally, I didn't want anyone and everyone to potentially be able to gain access to private data on the backup machine, so the target directory needed to be encrypted. There are a lot of options, but I opted for the easy encFS route and just installed "cryptkeeper" and had it setup the directory.

Now all I have to do is mount the encrypted backup directory, run the script to turn on the reverse ssh tunnel, and run the backup script, and I have an encrypted backup solution for my server that gets around firewalls.

Not bad.

References

    Is Gentoo dying or just becoming old?

    2009-02-25 12:58:21 PST

    Tags: , , ,

    So I haven't really touched my Gentoo desktop in over a year since I bought my new laptop, it's biggest use now is that it's plugged into my 5.1 speakers so I run MPD on it and remote control it for music use. However, I just got a gorgeous new 22" LCD screen for it so I plan on using more now, at least for movie viewing. So I decided it was really time to upgrade the software on it, so I did an emerge --sync, changed to the newest 2008.0 profile and started looking at what shiney new software I'd get.

    Well, Gnome 2.24 is still unstable. A bit disappointing, but there was a gentoo wiki page detailing all the packages I needed to put in /etc/portage/packages.keyword to get Gnome 2.24. So then I was looking at Xorg. xorg-server 1.3 is still the only stable release under Gentoo. It's like 2 years old now! Really? That is the best Gentoo can do? So then I started looking at other stuff. GCC 4.1 is still the latest stable release (4.3.* has been out for a year and 4.1's latest release is 2 years old). At which point I realized that if I wanted a current modern Linux system I either would HAVE to run a unstable Gentoo system, or change distros.

    Looking at the fact that if I wanted to stay with Gentoo, I'd have a day or two of compiling a head of me, and then who knows what integration head aches as programs and config files change just to get a vaguely working vanilla Gnome system on an "unstable" Gentoo system, I balked. It just didn't seem worth it. Also, Gentoo is a system that really depends on the compiler, so having the only stable compiler be a two year old version really surprised me and kind of was the nail in the coffin.

    So I'm downloading Ubuntu 8.10 and I'll have it installed probably before even 'emerge --system' would be done. And it will be modern, and cutting edge, and all the desktop software will work and be integrated together in all the ways that Gentoo never really does with out lots of extra work.

    And so I'm forced to ask: is Gentoo dying? It used to be easy to at least have a cutting edge system with Gentoo. That was one of it's big appeals, that software hit portage before anywhere else. But now, lots of "new" stuff is off in an overlay, and stable in the main portage tree is shockingly (at least to me) old and conservative. It seems way to much hassle to get a cutting edge desktop out of Gentoo now, especially with Ubuntu doing a decent job of it so trivially.

    I still have Gentoo on my server, but again, I just had to install a new overlay, just to get the "new" Ruby 1.9 line which has been out for a year, and everyone, even Debian stable is carrying (do you know how weird that is to me?). And what is the point of having a "stable" if it's so old as to be half unusable and older than even Debian stable? This is not the Gentoo I remember, and I'm even a little surprised with how easy I decided to abandon it on my desktop, but when it came down to it, it really didn't offer me much of a compelling or even difficult choice. :(

    Ruby 1.9 and mysql-ruby on Gentoo

    2009-02-17 23:36:59 PST

    Tags: , , , ,

    So I like Ruby the language but my two biggest problems are 1) it's slow, and 2) since it's a less popular language, it has less bindings.

    Anyways, this came to head today. Problem 1 is pretty much solved with Ruby 1.9, which is now not slow, so yeah! However, not all the not large collection of bindings ruby has have been ported to 1.9, and if they have they haven't necessarily made it into package managers yet.

    So far I'm writing off Ubuntu for the moment (it's ruby and ruby-mysql are out of date), maybe 9.10 will have the latest packages, or maybe I'll get back to it and compile them all :(, but it's not too important since the project I'm working on will run on my Gentoo server anyway so that's where it's most important to get everything working. So!

    To get Ruby 1.9.1 on Gentoo, you need to use the Ruby Overlay, so install layman, and make sure your copy of subversion is compiled with either webdav_neon or webdav_serf so that it can get subversion repositories over http. Then install the ruby overlay

    #layman -a ruby
    

    From there you need to unmask dev-lang/ruby in /etc/portage/package.unmask and then you can install it. It will also install the eselect module for configuring ruby 1.8 and ruby 1.9 on your system. Once it's installed, select Ruby 1.9

    # eselect ruby --list
    Available Ruby profiles:
      [1]   ruby18 *
      [2]   ruby19 (with Rubygems)
    # eselect ruby --set 2
    Successfully switched to profile:
      ruby19
    

    Yeah! However I needed mysql support under ruby, which comes from the mysql-ruby package (when online, this is not to be confused with the ruby-mysql package, from the same website, but different and not what you want :/ ).

    Sadly, the portage version of mysql-ruby is an old 2.7.something and the overlay version is 2.8, but the only thing that works with ruby 1.9 is 2.8.1. So we need to set that up. Make a copy of the ebuild and edit it in the overlay

    # cd /usr/portage/local/layman/ruby/dev-ruby/mysql-ruby
    # cp mysql-ruby-2.8.ebuild mysql-ruby-2.8.1.ebuild 
    
    // Edit the new ebuild in your preferred editor and comment out
    // line 28 that looks like
    //  epatch "${FILESDIR}/${P}-test.patch"
    // we don't need the patch anymore
    
    # ebuild mysql-ruby-2.8.1.ebuild digest
    

    And now you have an ebuild for the latest version of mysql-ruby which works with ruby 1.9 so go ahead and install it. Hopefully shortly the ebuild will make the overlay. It's all just a matter of time really. This is just a transition period hack.

    Disappointed in the extream

    2008-11-26 17:48:49 PST

    Tags: , ,

    I am shocked and annoyed and disappointed with Ubuntu right now. Upgrade my parent's box to Intrepid and some how the new grub menu.lst told grub to find the kernel on the wrong harddrive and passed the wrong partition to the kernel for hte root filesystem, and it dropped the windows boot option. The computer went from dual boot to 100% unbootable with a standard Intrepid upgrade. I am so disappointed. If it had been my parents doing this they would have essentially bricked their computer. What the hell.

    Of course I just pulled out a Gentoo livecd (those things are eternally useful) and went in and fixed the menu.lst file. It's a good thing I made a copy of the old menu.lst so I could get the proper partition's UUID. I mean seriously. What the hell. Get your act together. This upgrade was a clusterfuck.

    How can I tell my parents to use a system that might accidentally brick the whole computer (their other OS too).

    Firefox and the new Hotmail

    2008-11-07 20:42:42 PST

    Tags: , , ,

    I don't know who to be annoyed at actually. Microsoft just upgrade their hotmail interface, and hotmail is about the last MS product I use (that and the MSN server though I obviously don't use their client). Anyways, suddenly hotmail wasn't working for me which was a rather large pain. I searched around and found the solution.

    In Firefox, goto "about:config" and put a filter of "vendor" in and hit enter. Change general.useragent.vendor from "Ubuntu" to "Firefox".

    Then it works fine. It's annoying MS is still doing such browser specific tweeking and it breaks on something so small, but then again, it does seem that they at least support vanilla Firefox. I don't know how important the vendor string is but if it's breaking compatibility maybe Canoncial should leave it alone?

    Work around I probably shouldn’t need

    2008-06-24 00:39:16 PST

    Tags: ,

    I had to install amsn just so could video chat with a friend on MSN. Really? On the plus side, at least I could do it :)

    Also, figured out how to use skype on Ubuntu. Skype really want /dev/dsp. And Ubuntu now uses pulseaudio. So basically if you've done anything with sound, Skype won't be able to get the sound. Which sucks. However, pulse audio ships with this handy utility 'pasuspender' which temporarily suspends pulse audio and it's lock on /dev/dsp. So to actually use skype

    pasuspender skype
    

    And skype can then seize and monopolize the sound card. So you can use it, but no other sound till you shut Skype down. So it's 2008 and we still can't share the sound card :/.

    Turning your laptop into a wired to wireless router for your wirelessly challenged friends

    2008-05-25 12:23:29 PST

    Tags: , , ,

    Say you're at a party and the only internet is a wireless router and for whatever reason, no one can plug into it. Wireless internet only. You with your fancy laptop are sitting pretty and this is just fine. They your friend shows up lugging his clunky old desktop that only has an ethernet port for internet connectivity. Is he out of luck? Turns out not, because you an come to the rescue!

    It's really easy, especially with Ubuntu.

    To start with, you need to be a router, so you need firewall software that can do NAT (network address translation). This is part kernel side (NAT and iptables options enabled and modules loaded) and part user space side, in the form of the program 'iptables', so make sure it is installed, which it is by default on Ubuntu (I think).

    Now all you really need to do is add two routing rules, one says anything coming on the ethernet port should go through the NAT procedure, which basically means it's IP headers are tweaked to make it look like they originated from your computer and then you send them along to the internet. The second rule helps facilitate this (I'm a little less sure what it does, but it's needed).

    In this case we are assuming the interface eth0 is the wired network and eth1 is the wireless. Change as required.

    iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
    iptables --append FORWARD --in-interface eth0 -j ACCEPT
    

    Next you just need to tell the kernel port forwarding should be turned on, and you can do this through the wonderful /proc filesystem.

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

    Now you're pretty much ready to go. Connect to the wireless, presumably though NetworkManager or your wireless toll of choice. Then enable the wired network manually.

    ifconfig eth0 up 192.168.1.1
    

    This turns on eth0 with a local network address of 192.168.1.1. Now plug your friend's computer into the ehternet port with a crossover ethernet cable or into a hub and then the hub into you with regular ethernet cable and have them manually pick an address on 192.168.1.* (or whatever local network you chose, it doesn't matter) and set you (192.168.1.1) as the gateway router.

    If this is a little much for them or they are running an OS that makes this non trivial, than its really another easy step for you to set up a DHCP server and do all the configuration for them :).

    So install dhcpd, on Ubuntu it's 'dhcp3-server', on Gentoo I think it's just 'dhcpd'.

    Now we have to configure it. We have to tell it the gateway router, which is us (192.168.1.1), the nameservers (the servers in /etc/resolv.conf) and the pool of IPs to use and what interface/network to listen on.

    Open the config file, on Ubuntu '/etc/dhcp3dhcpd.conf'.

    The relevant parts are as follows

    ...
    # servers in /etc/resolv.conf
    option domain-name-servers 192.168.0.1;
    
    ...
    
    # the local network you created
    subnet 192.168.1.0 netmask 255.255.255.0 {
            #IPs free to assign
            range 192.168.1.100 192.168.1.200;
            #your computer, the router
            option routers 192.168.1.1;
    }
    

    And that's it. (Re)Start the server

    /etc/init.d/dhcp3-server restart
    

    And you are now serving all the information your friend's computer will need to automatically connect properly.

    They should now be online once they restart their internet connection.

    One annoying thing about Ubuntu vs Gentoo is that on Ubuntu, the init system is a bit more kludgy and old fashioned. Any server software installed is automatically configured to start at boot time, forever, which in this case isn't what you want. You only want the dhcpd server to run very rarely, at parties, the rest of the time it's a waste. So we need to turn it's auto starting off. Apparently the /ubuntu init system barely supports this, we have to force it.

    update-rc.d -f dhcp3-server remove
    

    Now just turn it on when you need with its init.d file.

    Adventures with Ubuntu and XP and the family computer

    2008-05-17 12:54:46 PST

    Tags: , , , ,

    So my folks Windows XP box started having difficulty booting. Most of the time it would go to boot and suddenly you'd be back at the BIOS, then the "Windows didn't shutdown properly last time" menu and then once you selected "boot normally" the cycle would begin again. Usually eventually you'd get lucky and Windows would boot (but sometimes they gave up first). Not good. This started a while ago and seemed to get worse (I think, I never use the box so I don't know). Anyways, eventually they figured (hoped actually because otherwise it was hardware failure) that their XP install was corrupted and asked me to reinstall Windows for them.

    They gave me the CD that came with the box and I loaded it up and first things first, no harddrive detected. Yep, that's right, no harddrive. To be fair, XP is old, it's from 2001, and pretty much all computers come with SATA harddrives now, which didn't even exist in 2001, so it's not entirely fair to expect XP to support them. This is one of the downsides of only doing releases every 6 years. Being not terribly invested in this "install XP" project I tossed my hands up and said it's a no go and offered Linux as an alternative. My Dad was definitely interested in Linux but wasn't sure it would be all there for his business software, so I said, "no fear, let's just do a trial run, and if it doesn't work, no worries, you can, you know, always buy Vista". The thought of having to spend money to make a computer that did work, work again, for no good reason vs. the low commitment of a trail run sold him on the project.

    So I burned a copy of Hardy Heron, the newest Version of Ubuntu, released just last month. It loaded up and recognized all the hardware and installed, no trouble. I'm old fashioned so I opted for a separate root and home partition, but other than that, a vanilla install. Then we booted up and everything just worked out of the box. Even the printer. So I loaded all their data on from one of my boxs from whence it had been backuped to and let them at it (after a few tweaks, like my mom's desktop).

    fuzzybear

    The results?

    Mom loved it. For her, it turns out the killer feature was desktop icon stretching. She really liked the larger icons. And of course, no difficulty using it for her normal uses which are nearly entirely Internet look ups. The other big hit was Eye of Gnome, the photo viewer. Last year we had about 1600 of my mom's parents family slides turned into digital photos (at no small cost) and the stock Gnome photo viewer is perfect and intuitive enough for her to use and enjoy (the newly added left right buttons to scroll a directory are crucial here, so good work guys).

    My moved out sister dropped by and gave it a try, and she too was sold. For her, the large stock puzzle/games selection was the seller. It worked just fine for her net usage, but the large selection of games got her attention and kept it just on introduction for over half an hour and she only explored a few of the games in that time. She'll be back. She also was amused by compiz eye candy.

    As for my Dad? Sadly neither of his business apps worked under Wine. Maximizer 8 failed to install (a little sad since it's reasonably popular and not so new) and D--------, which is from what I can gather an in house piece of software from his company, also failed to install. A few tales from his trials installing it under Windows were horrific thought, like for the first time install you are required to turn off the firewall. 0_o In house software can be scary and shoddy stuff.

    So Linux failed to satisfy everyone of my family's needs, so back to Windows. I was disappointed but resigned. And then came mom to the rescue. She chimed in she didn't want to go back. She liked her new Ubuntu desktop! So that was all I needed to float the idea of dual-boot. And thankfully we had two partitions already. Dad was sold too. He does want to learn more about Linux and so looked forward to the opportunity, but also needs his business software.

    So I popped in a Gentoo LiveCD, because there really is no better system recovery and maintenance CD than a Gentoo LiveCD. I copied the Ubuntu root over to the second partition, moved /home and edited fstab and grub/menu.lst and reinstalled grub (from within the Ubuntu chroot because the one thing that particular LiveCD was 'missing' was Grub) and then changed the partition type of the first partition from Linux to NTFS and volia, we were ready to go.

    Then back to Ubuntu because the Gnome Device Manager is actually full of awesome and gave me all the hardware information I needed so that I could get the appropriate drivers for Windows (remember when it was the reverse and it was crucial to go into Windows System Manager to get all the hardware info so Linux could install?). Then off to the net to find the Sata drivers, and then I tossed those onto a floppy disk and tried the XP install again. Sure enough, after loading the drivers from the disk, XP install found the harddrive and was happy enough to install onto the partition I had marked for it.

    Then it booted into Windows XP SP1 glory. Which was surprisingly not glorious because it had no drivers so we had a 640x480 low colour screen with no sound. And no programs. Dad and I spent the rest of that day and the next few after that running Windows Update and downloading and installing drivers and programs manually from the net. The Windows Update website actually pretty much continually stalled out and failed when it came time to get service pack 2 which was disconcerting but by then the update manager had been installed and it was able to get and install SP2 for us. Shortly after which my dad horrifyingly noticed the Windows booting bug was back! We were horrified. All this work and no fix? Was it hardware failure? But Ubuntu was still booting fine. So we kept at it and apparently now with SP3 installed it's gone back to booting normally.

    So yes, that means Microsoft in one of their post SP2 updates introduced some bug that rendered our computer nearly unbootable, which drove us to Linux which was brain dead easy to install. And then when we discovered Linux didn't quite fulfill all our needs, they made the migration back to XP as painful and full of near hopeless despair as possible.

    So thank you Microsoft for driving my family to try Linux because they've found they like it, and thank you after that for highlighting exactly why we don't want to be hooked on Windows. It's been educational for my family, and now ever computer in my house has Linux installed on it and my family is interested in learning about it! And I owe it all to Microsoft.

    (It should be pointed out that my dad's work still has a ban on IE7 and Vista because it doesn't work with their software yet which is a mark against both Microsoft and Vista, and my dad's company's computer department because, lets face it, it is the future and it has been out for over a year. But this did mean Vista really wasn't a viable option on the fact that it would have cost us more money and it wouldn't have accomplished the one goal we needed it for, which was running my dad's business software. XP was our only option.)

    Valid XHTML 1.0!
    Valid CSS!
    Mindstab.net is proudly powered by WordPress
    Entries (RSS) and Comments (RSS).
    11 queries. 0.479 seconds.