ubuntu

Burning CDs/DVDs/Blu-Ray in Debian/Ubuntu

For long time I've been wondering why I can't seem to burn DVDs or Blu-Rays properly using k3b in Linux (or any other graphical burning software for that matter). The problem is cdrkit (a fork of the original cdrtools).

You can get the latest version of cdrtools, which actually supports burning to Blu-Ray and also should create DVDs properly, by installing cdrecord from this PPA. You might as well also install mkisofs from there too.

Prior to finding this PPA, I had compiled cdrtools from source, which is pretty easy. That also involved installing smake, also from the cdrtools author.

Linux Mint Debian Edition: One word: FAST

I'm just trying out Linux Mint Debian Edition and the best part about it is how fast it is. The desktop is super responsive, almost feels like a new fresh Windows machine in that respect. User switching is also super fast and works perfectly, something that Ubuntu had never quite mastered. Most importantly, however, is the fact that it is not using Canonical's Unity, but instead it is still using Gnome 2.

It's been a long time since I have used an almost-pure Debian distribution but it feels good to be back. My Linux evolution went something like this: Redhat->Corel (debian)->Mandrake->Debian->Gentoo->Ubuntu->???. I will definitely move to something Debian-based or possible Gentoo. I may keep the LMDE on my laptop and put back Gentoo on my desktop. Unity is just plain awful and should never have seen the light of day. Ubuntu was great when it first started and it was basically a Debian derivative that just worked. Nowadays Ubuntu is a different beast. It's slow, awkward, cumbersome, bloated, and I can't stand the fact that they are forcing Unity down people's throats. I'm positive that Unity will be a failure in the end.

init.d Script for Trac on Ubuntu Linux

I modified an nginx init.d script and created an init.d script for trac.d. I run tracd and then forward traffic from trac.davidgrant.ca to trac's port (using nginx) rather than using cgi or fast-cgi. Please let me know if you have any problems with this scripts and I will fix it.

#! /bin/sh
### BEGIN INIT INFO
# Provides:          tracd
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the tracd web server
# Description:       starts tracd using start-stop-daemon
### END INIT INFO
 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/tracd
NAME=tracd
DESC=tracd
#DAEMON_OPTS="-s -r -d -p 8080 --basic-auth=*,/etc/tracd/tracusers,trac /trac"
DAEMON_OPTS="-s -d -p 8000 /home/david/trac --pidfile /var/run/$NAME.pid"
 
test -x $DAEMON || exit 0
 
# Include tracd defaults if available
if [ -f /etc/default/tracd ] ; then
        . /etc/default/tracd
fi
 
set -e
 
case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
                --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --pidfile \
                /var/run/$NAME.pid
        sleep 1
        start-stop-daemon --start --quiet --pidfile \
                /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac
 
exit 0

After you create the script at /etc/init.d/tracd, don't forget to do the following:

sudo chmod +x /etc/init.d/tracd
sudo /usr/sbin/update-rc.d -f tracd defaults

to make the script executable and to make it run on startup.

Tags:

Make Shared Folders Work in TinyXP as a Guest in VirtualBox

I gave TinyXP Rev 09 a try recently as a guest in VirtualBox. (I do have a legal license for Windows XP, so while that definitely doesn't make downloading TinyXP legal, I feel that morally speaking it's ok).

I wasn't able to browse for shared folders at \\vboxsvr as I expected. It is, however, possible to map these folders to drives using the "net use" command:

net use z: \\vboxsvr\david

That worked perfectly. Have fun!

Sorry Kubuntu, I've Switched to Ubuntu

I've used Kubuntu for a long time. In fact I had never used plain Ubuntu except for once a long time ago on an old laptop but then I promptly removed it because it caused the laptop to overheat badly (it was painful on the thighs) and so I went Gentoo, my bread-and-butter distribution. I never liked Gnome for some reason. I never had good experiences with Gnome in Debian or Gentoo. KDE always seemed to work a lot better out of the box. It might be because KDE is an all-in-one solution whereas Gnome is a bit more modular and made up of metacity, gnome-panel, nautilus and a bunch of applets. I remember trying out Gnome in gentoo and metacity wouldn't start, or it would crash spontaneously. Not Gnome's fault, but it's a problem that just would never have happened in KDE.

Ubuntu has fixed all that by focusing on Gnome and ignoring all other desktop systems and window managers and making it work great out-of-the-box. Gnome is nothing like I remember it being. Kubuntu allowed me to continue using KDE, which I was used to but unfortunately I think Kubuntu has fallen behind Ubuntu. The biggest factor here is probably Ubuntu's far larger user base. More users reporting bugs and more developers eating their own dogfood. 90% of all Ubuntu tips & tricks and how-tos on the web are for Ubuntu, not Kubuntu. A few things turned me off Kubuntu in the last while:

  • Totally broken X config in KDE Control Center (mangles xorg.conf file badly, had to use nvidia-config or "dpkg-reconfigure xorg-server".
  • Documentation on the web is almost always Ubuntu-specific and relied on going to menu items that just aren't present in Kubuntu (at least not out of the box).
  • Not easy to set up Compiz on Kubuntu Gutsy (at least if you upgrade from Edgy). It's easy to set up in Ubuntu Gutsy or Hardy.
  • Bad experience with KDE 4. I tried it a few times after it was released and it felt like a piece of alpha software. Was hoping for a better experience but it was buggy and I don't think Kubuntu has the resources behind it to perfect it like Ubuntu does with Gnome.
  • Auto-mounting had been good in Kubuntu but once in a while I have problems (not able to unmount, devices spontaneously unmounting themselves, etc.... I have never had a problem in Ubuntu so far and I enjoy the fact that I don't get that annoying pop-up after I plug something in in Kubuntu or Windows.

Dual Boot Ubuntu and Vista on Dell Inspiron 1720

I just got a new Dell Inspiron 1720. A little background information on why we got this laptop... Previously we had one Desktop computer and a MythTV server/frontend and a TV in a separate room. The TV was a huge CRT TV, but not only that, the TV and couch took up en entire room. We recently got a 24" LCD for the desktop computer and decided that we could use that as our "TV" and computer and get rid of the TV room and use it for something else. We then found ourselves in the situation where one of us wants to watch TV and the other wants to use the computer so we definitely needed another computer. A laptop was the best idea as it allow us to use it as a MythTV frontend and watch TV from bed or any other place in the house. So in summary, we replaced a TV room, massive CRT TV and couch with a 17" widescreen laptop.

Unfortunately, the Dell Inspiron 1720 only comes with Vista. I thought about installing XP, but then I read about how I would have to get SATA drivers and slip stream them into the Windows XP CD and that Dell didn't have XP sound drivers for the 1720. In other words installing XP would be a huge PITA. Since I don't plan on using Windows that much anyways, I figure I can live with Vista. I will tweak it a bit anyways to get rid of its annoyances and I can live with the slightly worse gaming performance (which should improve over the next few years anyways, I suspect).

Here are all the steps I took to get Linux and Vista working on my Dell 1720.

Prepare for Linux:

  • Tell BIOS to boot from CD. Reconfigure BIOS to try booting from CD first so I don't have to remember to hit F12 while booting.
  • Reinstall Vista without Dell crap. I popped the Vista CD in the drive and booted to the CD. I deleted all 4 existing partitions (recovery partition, EISA partition, Windows Vista C: partition, and Dell media direct partition). I don't need the media direct and EISA junk. I then had to add the SATA driver from the Drivers and Utilities CD or else the installation would hang later on. I created one 120 GB partition for Vista.
  • Install Vista drivers. With the freshly installed Vista, all the drivers will be missing, most notably, the NVIDIA video drivers. I downloaded these from the Dell website along with a bunch of other drivers (sound driver required for microphone to work).
  • I downloaded Ubuntu 64-bit Live CD and burned it on another computer.

Installing Ubuntu: After selecting the first boot option from the Live CD it started to boot, but then the screen went completely blank (not just black but completely-turned-off-black. It turns out this is because the splash screen fails. X never did load. I pressed CTRL-ALT-F1 and then pressed Enter and the login prompt appeared (you may just see "running local boot scripts", until you press Enter. This is because the boot sequence steps run in parallel and the login prompt already started above). I then typed "startx" and X/Gnome loaded (I can't remember if it worked right away...I may have fiddled with the "Driver" setting in the "Device" section, by setting it to "nv"). I then installed Ubuntu and told the installer to automatically partition and use up all the remaining free space on the drive. When it came time to reboot, the screen went dead again on shut down and although I waited a long time, the computer never restarted and I had to power it down manually, then power up.

Fixing the "dead screen" on boot up and shutdown/reboot: Open up /boot/grub/menu.lst and remove all occurrences of the word "splash" and "quiet". Getting rid of the splash screen makes bootup a bit more interactive (rather than seeing a blank screen), but more importantly it allows the it to shut down properly.

Wireless/wi-fi: When ordering the laptop from Dell's website I chose the "Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)" which I had heard had better Linux support (without using ndiswrapper), but wireless still did not work out-of-the-box. I changed two things at once, so I am not sure which made it work. The first thing I did was update all packages and brought in upgrades from gutsy-updates and gutsy-proposed repositories (of course you need to plug into a wired network to do that)). I installed and upgraded all linux-restricted-modules* packages. The second thing I did was to copy and paste my WEP key, rather than typing it out by end. Now wireless works great. The Network Manager applet is so easy to use.

Wireless Update: wireless seems to lock up after a while and a process called "ipw3945" uses 100% cpu. Using the laptop as a MythTV frontend requires a stable network connection so the fact that the wireless doesn't work sucks. I've tried using the MythTv Player in Vista and it does the job but it just doesn't compare to MythTV's own frontend. I have heard that the ipw3945 module that comes with Gutsy is basically deprecated and has been replaced with the iwlwifi module from Intel. The easiest way to get it is to use kernel 2.6.24 which comes from with the next release of Ubuntu, Hardy Heron (currently in Beta, to be released in a few weeks).

Sound: Sound didn't work out-of-the-box. I installed the "linux-backports-modules-generic" package from gutsy-backports and now it works. Since Ubuntu's volume control and the button on the laptop case both control the Master volume, I used "alsamixer" to increase the PCM volume to max.

Video: My screen was stuck in 800x600 mode. Running sudo dpkg-reconfigure -phigh xserver-xorg created an xorg.conf file that gave me maximum 1920x1200 resolution. The nvidia driver doesn't work though, it complains that my GeForce 8600M GT is not supported. After updated some kernel packages in previous steps, now when I enable the nvidia driver in the "Restricted Drivers Manager" it works.

DVD: I followed these instructions for DVD playback in Ubuntu.

Hardware Sensors: I ran sensors-detect and no hardware sensors were detected.

That's about it! I'll update this page with any other tips or tricks as I find them.

HP Officejet 5610 Works Great in Linux

I just bought an HP Officejet 5610 4-in-1 for home because we had a need for a copier and a fax machine. A scanner is something I also occasionally wish I had. So this thing does it all, and the best part is that it all works flawlessly in Linux, which is the reason I bought it (see "HP all-in-one device works great with Linux"). In fact, installing it was probably easier than it would have been in Windows for the following reasons:

  • No need to insert a CD
  • No need to reboot
  • No need to finick with Windows and the way it handles USB devices. (If you've ever accidentally plugged a device into the USB port before installing the drivers and had it not work in the end then you know what I mean).
  • No navigating through any install wizards

Photocopying and faxing (from the tray) worked right away without even plugging it into the computer.

Printing worked almost instantly (turns out that hpijs and hplip were already installed on my Ubuntu Feisty box, but I needed to install hpijs-ppds to get the HPLIP ppds) after adding the printer using KDE's printer management interface (I used to use the cups web interface but the KDE one is a bit easier to use nowadays). I haven't tried printing photos yet but there is a photo-quality option in the printer settings called "600 dpi, Photo, Full Bleed, Black + Color Cartr., Photo". I'm sure it works fine, just as it did for my old HP 710C and 920C.

I wasn't sure how to setup a fax queue in CUPS. It turns out the best way to do this (and to install a printer driver) is to just run "hp-setup". This installed a printer and a fax queue. So I just deleted the redundant printer that I had created in the paragraph above. The "hp-setup" wizard was maybe even a bit easier than the KDE Cups one. Now I have a fax and a printer in cups. I haven't tried faxing yet but printing to the fax queue works and I can see the faxes when I run "hp-sendfax" so it probably works.

Scanning was a breeze. No driver installation required, all I had to do was run kooka or xsane (better) and the scanner is detected automatically. xsane is really powerful and can do some automatic contrast and brightness adjustments as well as provide full manual control.

I would recommend this printer to anyone! I also use a Samsung ML-1740 laser printer by the way, and it is great and works well in Linux too. I have refilled the cartridge about 4 times now with cheap toner and the same cartridge works great. I was also able to get a backup refurbished cartridge for cheap.

Tags:

Setting Up postfix to send outgoing mail on ubuntu

I don't know why but this is one of those things that I find extremely annoying to set up. Mainly because it often requires installing a full-blown MTA to do a much simpler job than it was designed to do. Unfortunately, ssmtp and exim, the only simpler ones, often suck (especially ssmtp, which even the maintainer gave up on). What follows is how I got postfix working on my Ubuntu Feisty machine (should work on more recent version of Ubuntu as well):

sudo apt-get install postfix
sudo dpkg-reconfigure postfix

Here are the options to answer in order:

"satellite" (when given the list of configuration styles)
<your normal user> (where to forward root's mail to)
<your host name>
<your ISP's smtp server>
accept default (when asked what other domains to accept mail from)
No (default is no synchronous updates on mail queue)
127.0.0.0/8 (accept default unless you know what you are doing)
0 (mailbox limit)
+ (default)
all (default)

Reload or restart postfix, then do some testing:

sudo apt-get install mailx
echo test |mail -s "test mail sent to external" <a href="mailto:me@gmail.com">me@gmail.com</a>
echo test |mail -s "test mail sent to normal user" <normal user name>
echo test |mail -s "test mail sent to root" root

You should get an email to your external address. And if you run

mail

you should see 2 emails there for you, one that was sent to root (but was directed to you, see /etc/aliases for why) and the other that was sent to you.

To have those mails sent to an external address instead (like your me@gmail.com address) do the following:

echo me@gmail.com > ~/.forward

Update (2007-07-19): When I changed ISPs, my new ISP did not like my From: address being david@centurion (I just named it after the case model). So I had to do the following. Add this to /etc/postfix/main.cf:

smtp_generic_maps = hash:/etc/postfix/generic

Add this to /etc/postfix/generic:

@centurion      <a href="mailto:david@telus.net">david@telus.net</a>

I just made up an email address there to make it happy.
Don't forget to run sudo postmap /etc/postfix/generic

Why Gentoo is Still Better than Ubuntu

So I am on a Kubuntu edgy laptop at work and I am trying to get WPA wireless networking working before the upcoming demo that we are putting on. Since I have no idea what kind of networking is set up at both demo locations I am making sure all options work. WPA is the last one to take care of.

I finally found a front-end for wpa_supplicant that actually works. It's called kwlan and it is currently at version 0.5.8. Ubuntu edgy only has version 0.4.7. I really want 0.5.8 because 0.4.7 has some glaring bugs. Feisty actually has 0.5.8. There is no way I am upgrading this entire box to feisty. Because of ubuntu's binary nature, in order to get kwlan-0.5.8 installed I might actually have to bump a lot of packages to feisty just to get it working. Even if I just want kwlan-0.5.8, how to I get it? I'll have to add some sources to /etc/apt/sources.list and possibly jump through a few more hoops to be able to install one package from feisty without apt-get upgrade wanting to upgrade everything to feisty. If kwlan-0.5.8 wasn't available in feisty, my only option would be to make my own deb package. Good luck with that (I maintained a debian package once, called camserv a long time go. Way harder than ebuilds.)

In gentoo it is as simple as coping the ebuild to my /usr/local/portage folder, renaming it to kwlan-0.5.8.ebuild, creating the digest and then emerging the 0.5.8 version. Assuming the upstream developer did not make massive changes to the build process, simply renaming the ebuild name from kwlan-0.4.7.ebuild to kwlan-0.5.8.ebuild should work. Like a lot of things, it's a hell of a lot easier in Gentoo.

Sure that's just one reason why Gentoo is better than Ubuntu. There are many others. Just look at Ubuntu Guide. A whole friggin' guide to install a lot of things that can be easily installed in Gentoo (mplayer, acrobat, java, flash, etc...). Not to mention that eix rocks compared to anything apt has, and paludis is awesome. Every time I think Ubuntu is better than gentoo, I end up taking that back soon after.

Subscribe to RSS - ubuntu