Ubuntu's useful apt-get hints

Ubuntu 7.04, or Feisty Fawn as it’s known to it’s friends, has added a neat upgrade to the apt-get tool. For those who don’t know, apt-get is the tool Ubuntu uses to install and remove software. A small problem in the past has been trying to figure out what the name of the package required was.

In Feisty Fawn, if you try to run a command that isn’t installed a small message will be displayed telling you how to install it! The software has to be in your repository, so typing notepad and expecting it to tell you to apt-get install windows isn’t going to happen!

This morning I needed to update my local WPMU work area so …

$ svn update
The program 'svn' is currently not installed. You can install it by typing:
sudo apt-get install subversion

apt-get moo still works too! 🙂

Filter spam through Postfix and Spamassassin

It has been a long time since I used and configured Sendmail, and I don’t miss it one bit now that Postfix is on the scene, but the amount of spam I receive does bother me. My Junk folder had reached 160MB, mostly due to some idiots sending huge spam attachments, but also because spam still works and a majority of the email circulating is spam and not legitimate.

Spamassassin is how we fight back. Unfortunately it needs a reasonably powerful server, gobs of memory and CPU when there’s a lot of incoming email and time to configure. Using spamd/spamc makes things easier on your server but it’s still a hefty price to pay for being spam free.

Here are a few pages I found useful this morning when getting things up and running on my Ubuntu server:

I also recommend running Postgrey to stop some junk mail before it gets into your system at all.

Now, if only there was a Spamassassin for the junk mail and clothes collection leaflets we get to the front door. How’s about a Defense Tower that would fire pellets when it noticed someone with leaflets calling to the door?

Edit: Justin talks about one of Spamassassin’s honeypot traps and about goings on at Blacklist.ie

Shutdown Ubuntu with ctrl-alt-delete

Power cuts are becoming a way of life for many people and here in Blarney we get our fair share of them unfortunately. The second in as many weeks happened this morning and before I could rig up a network cable between my laptop and desktop the UPS powered down and my big noisy desktop died with it. Thankfully without filesystem corruption.

Normally when you press the magic combo of ctrl-alt-delete the machine reboots but in this case it would be much better if the machine did a shutdown. In previous versions of Linux I had to edit /etc/inittab to get the desired effect but that file doesn’t exist in Ubuntu Edgy. Instead you must look at /etc/event.d/control-alt-delete. That file is fairly self explanatory which is all well and good because there’s very little information if you don’t know what to look for.

According to a post here, “Ubuntu replaced init with upstart event daemon”. It’s simple to change it to shutodown. Replace “-r” with “-h” in the following line:
exec /sbin/shutdown/ -r now "Control-Alt-Delete pressed"
No need to run inittab, just hit the magic combo to halt the computer!

PS. thanks so much for all the comments yesterday and the day before. I was bowled over by the response to both posts, especially the Daffodil Day one which struck a chord with many people

I made my Macbook cry

If Macs are so perfect why do they keep crashing and dying and need to be rebooted seeminly after every update? I’m just back from another reboot when Flock brought the system down. Yes, yes, must switch to another browser but after Mark’s ranting about the slowness and general bloatedness of OS X Firefox I’m wondering what I’ll use.

For all the fans of Microsoft Windows out there, here’s a sort of BSOD from the Mac. This happened at the last BarCamp in Waterford. I have witnesses!

2007-01-20__mg_8276.jpg

In the interests of fairness, I should also say that Linux died horribly on me when Firefox, Flock, GIMP and Bibblepro were all loaded and swap went haywire. It was quicker to put it out of it’s misery and reboot than wait for the kernel to kill one of the above apps. But why spoil a good anti-Mac rant by injecting some perspective?

Hi! I'm Linux!

imlinux.jpg

Apple advertisments become cliches within a short space of time which is a testament to how good they are, or perhaps how often the fanboys go on about them in online forums…

Unfortunately Linux is still regarded as being a geeky system only and spoofs of the current Apple advert feature a guy dressed in a Tron costume look ridiculous and certainly won’t help. This advert from Novell may help change that. If it doesn’t, well it might pique the interest of some guys who will try Linux and like it. Even though the advert is sponsored by Novell, I recommend you try Ubuntu Linux. You can download and try it without installing and it’s super easy to use!

Read all about it on Reverend Ted’s site and download the first advert.

All in all, it’s a balance that we hope to have struck right: representing Linux as sexy and confident, while avoiding sexual cliches that are degrading to women. While there may be some flaws in our execution (particularly how the third video throws out the people as computers metaphor altogether), overall I really hope that we managed to create a playful spoof that effectively subverts the “Mac vs Windows” framework that Apple has established with the “Get a Mac” campaign.

Ted updated his post with the second and third videos. I’ve included them here for your blogging pleasure.
Continue reading “Hi! I'm Linux!”

That mouse presses all the right buttons

Having just installed Ubuntu Edgy on a squeaky clean partition I’m still migrating some of my settings and programmes from my last Ubuntu install. Why did I reinstall when an upgrade from Dapper already went well? Unfortunately in the course of configuring my Wacom graphics tablet I broke my sound and for the life of me I could not remember how to fix it. That and I was running out of space and there was a nice 28GB NTFS partition doing nothing but taking up space..

Your mouse is probably luckier than some but if some of the buttons on it don’t work then look for the following line in /etc/X11/xorg.conf:
Option "Protocol" "ExplorerPS/2"
and change it to this:
Option "Protocol" "ImPS/2"

I hate middle mouse button clicking on a scroll wheel and this Microsoft mouse is worse than others. The side button works much better for me! Finally, I can press the right button again! 🙂

Oh and good luck if you have a widescreen monitor. My Dell 2405 LCD barfed every time I tried the graphical install. I had to look for the “alternate” cd and do a text install, and then install the proprietary Nvidia drivers and add a suitable modeline to /etc/X11/xorg.conf. I haven’t done that since I don’t know how long ago. Definitely in the last century.

Death and Divorce Unix style

When you break up with your significant other you go through the motions of living your life, but in a daze. At some stage you need to let go and move on, no matter how hard it is. (from xkcd)

userdel

PS. Congrats Elly on the move to WordPress! A pity this cartoon wasn’t published before your talk at BarCamp!

PPS. But seriously, a friend just broke up with his girlfriend of over 4 years. She was cheating on him, I hope he listens to how to dump a cheating girlfriend!

Cannot load mysql extension. Please check your PHP configuration.

A friend recently had a problem configuring a new server. He installed PHP, Apache, MySQL and phpMyAdmin but when he launched it he got the following error:

phpMyAdmin – Error
Cannot load mysql extension. Please check your PHP configuration.

If you’ve installed all of the above more than once you’ll know what is more than likely wrong. The MySQL PHP module isn’t loaded. First of all, you must find your php.ini. It could be anywhere but if you create a small php file with the phpinfo(); command it will tell you where it is. Common places include /etc/apache/, /etc/php4/apache2/php.ini, /etc/php5/apache2/php.ini or even /usr/local/lib/php.ini

Edit your server’s php.ini and look for the following line. Remove the ‘;’ from the start of the line and restart Apache. Things should work fine now!

;extension=mysql.so

should become

extension=mysql.so

Linux Ubuntu Dapper to Edgy – no problem

I upgraded my Ubuntu 6.06 install to the new Edgy soon after it’s release using the simple command gksu "update-manager -c". Several hours later, and after clicking on a few dialog boxes to update files in /etc/, I’m not running Ubuntu Edgy on my desktop box.

Initially I wondered where Firefox 2.0 was hiding, but on my upgraded system it’s /usb/bin/firefox.ubuntu so it’ll live alongside version 1.5. I also noticed that when saving files in the GIMP the filename would disappear when I clicked on a new folder in the “bookmark” folder of the Gnome file dialog. Once I noticed, ctrl-c to record the filename and ctrl-v to paste it in again worked fine. I rename my files when saving so it’s not much of a hardship.

My machine seems slightly faster but I haven’t delved too deeply into what has been upgraded but Firefox, xchat, terminal, GIMP and Gthumb all work fine! Did your upgrade go as well?

GNUCash 2.0 on Ubuntu Dapper

It’s that time of the month again when I have to do a VAT return, so my attention is drawn towards accounting software for Linux. Having just got the latest and greatest version of GNUCash installed on Ubuntu I’d like to share how I did it:

  1. Open http://www.yourfilelink.com/get.php?fid=151771 and http://www.yourfilelink.com/get.php?fid=151772 and download gnucash-common_2.0.1-1_all.deb and gnucash_2.0.1-1_i386.deb from there. (via)
  2. Install the .deb files using the following command: sudo dpkg -i gnucash-common_2.0.1-1_all.deb gnucash_2.0.1-1_i386.deb
  3. You may get an error like this:

    dpkg: dependency problems prevent configuration of gnucash:
    gnucash depends on g-wrap; however:
    Package g-wrap is not installed.
    dpkg: error processing gnucash (–install):
    dependency problems – leaving unconfigured
    Errors were encountered while processing:
    gnucash

    If you do, run the command sudo apt-get -f install which will download g-wrap guile-1.6-dev guile-library libffi4-dev libgwrap-runtime0-dev libncurses5-dev libreadline5-dev and any other dependencies.

  4. Finally, you’ll be greeted with the following message:

    Setting up libgwrap-runtime0-dev (1.9.6-3) …
    Setting up g-wrap (1.9.6-3) …
    Setting up gnucash (2.0.1-1) …

Happy budgeting and accounting!

While on the subject of VAT, since Google is a US company, Europeans don’t have to pay VAT on our Adsense earnings, yet. This article by Jennifer Slegg suggests that some EU countries may decide to charge VAT on online earnings. That’s a little crazy because Google doesn’t add VAT to the invoices of European publishers. If something like that happened in Ireland I’d be out of pocket by an extra 21% plus the normal 42% tax I pay on earnings at the top level. Ouch. (via)