Archive for the ‘Articles’ Category

Handling “Package file is invalid” problems on CyanogenMod 7

Update: The latest update for CyanogenMod for Milestone – version 7.1.0.3 solves this problem as well.

Lately I’ve been having problems updating software on my Motorola Milestone (1, as in A853) running CyanogenMod 7.1 (thanks to Nadalbak who maintains an unofficial and unsupported port of CyanogenMod for this old device). When I start the Android Market and do an update of an existing application, I get the error “Package file is invalid” for any application. Sometimes removing an application and reinstalling it will work, but often not.

There could be several problems that cause this, apparently a problem with the file permissions on the file systems is common, and if this is your problem then it can be fixed by opening the terminal emulator, executing “su” to gain super-user permissions and then running “fix_permissions” (it will take a while to complete).

If this doesn’t solve the problem for you, then likely the problem is that you ran out of space on your “data” partition or “cache” partition. This is very common if you have a large “apps partition” on your SD card and you are in the habit of installing tons of applications – I know I am 🙂 .

(more…)

Mounting SMB shares using URL under GNOME and KDE

As most Linux users are aware, you can access network shares with your file browser of choice (Dolphin, Nautilus and probably others) by writing URLs into the file browser’s “location bar”1.

If you ever had to work with MS-Windows file server, you should know that you can also access SMB file shares using URLs – with the schema “smb”, like this: smb://file-server/share-name.

(more…)

  1. and this works just as well with the desktop’s “run dialog” – try holding ALT-F2 and typing something like ftp://ftp.mirrorservice.org/ and up comes your file browser showing the FTP site’s directories. This won’t work for GNOME 3, at least at this time. []

Installing Consolas TrueType Font for Linux

This is a short “how to” article on how to get and install the new Microsoft Consolas Monotype font – this is a very nice programmer font and as described in Dan Benjamin’s “Top 10 Programming Fonts” it is highly recommended for use in your programmer’s editor or IDE (As a side note, his top selection, Inconsolata is also very nice and I highly recommend it if you don’t feel like using Microsoft created software and/or aren’t interested in performing the steps below which may or may not be legally problematic).

The main problem with using Consolas on your Linux workstation, is that this font is provided by Microsoft, and while if you are running MS-Windows (or even Mac OS-X) it may already be installed – as it is bundled with many Microsoft products, us in the Linux world have no easy (and legal) way to get to use Consolas in our code editing. Unlike Microsoft Core Fonts for the Web Consolas is not available for download – probably for the same reason the core fonts packages were pulled. But as Consolas is bundled with many Microsoft products, some are available for free download for anyone, we can use that to get us some nifty Consolas prettiness in our day to day Linux computing.

(more…)

Script Day: automatically locate the next valid transaction in MySQL binlog

Sometimes the MySQL replication breaks due to some corruption in the binary log files1. When your binary log files are corrupted, the only option (other then trying to rebuild a database of hundreds of gigabytes) is to try to skip over the corrupted region and get the slave to pick up from where the transactions are valid.

Locating the correct position in the binary log from which the server can carry on is difficult but can be made easier by the mysqlbinlog utility that can scan the binary log files and show you which position is valid using the --start-position to try random positions in the binary log file and see which position will let you read from the file2.

(more…)

  1. I have yet to find a good explanation to why it happens and how to prevent that []
  2. because in the binary log transactions can have any size, so they can end and start at any point []

Mandatory Access Control And Malware

After listening to the virtus/malware discussion on LUG Radio’s new (but apparently one-off) show (check it out at lugradio.org, these guys are hilarious), got me thinking about how much Linux users are exposed to malware.

Lets forget, for the sake of the discussion, the technical attacks1 as these are relatively easy to handle and Linux operating systems are already pretty well protected against such. The main vector of attack for malware these days is Social Engineering anyway – this is how Mac OS-X users get attacked by malware: you browse a web site, and an image that looks like a a blinking dialog box notifies you that your computer has been infected by a virus and prompts you to download this “fix”.

Most of us, technically inclined users, sneer at this type of “threat”, but most people aren’t technically inclined and there are enough people out there that will be fooled by this practice time and time again. Click the image and a binary gets downloaded to your computer and if it is in the correct format it will get executed.

(more…)

  1. Such as buffer overflows and such []

MySQL 5.5 on Ubuntu 10.10

As we all know, MySQL 5.5 is the best thing since sliced bread (or, not exactly, but that’s what everyone will have you think), but unfortunately Ubuntu‘s latest and greatest server operating system – Ubuntu 10.10 Server comes with MySQL 5.1.

Even the next version of Ubuntu – 11.04 Natty Narwhal – doesn’t seem to deliver MySQL 5.5, so upgrading is not really an option as of yet. There is a bug report to deliver MySQL 5.5 for Natty, which is even marked as “in progress” but there’s no guarantee that it will happen.

So how to go about (ab)using the latest software from Oracle? One way is to build it yourself on your server, or convert the Oracle provided RPM packages using the alien tool – but its not really Ubuntu native and a mess (in both cases). Here is another approach:

(more…)

How to set up a Warcraft 2 LAN party

Another article in the “I need to write this for myself and what better place then on my blog” series:

If you are familiar with the old (but great) Warcraft 2 game, then you know its a great multiplayer game but unfortunately you need a “Battle.net server” to play and even if the Blizzard servers were up (and for this old game, they’re not though there are a few 3rd party free servers) – you probably don’t want to have all the party goers connect up to an external server.

So how to run a Warcraft 2 LAN party?

(more…)

Running VirtualBox on Ubuntu 11.04 Natty alpha

I’m using the current Ubuntu alpha – 11.04 as my desktop OS on my laptop, and on the same laptop I sometimes need to run VirtualBox to access an MS-Windows environment.

In the current Natty alpha this doesn’t work well. I have VirtualBox 4.0 installed from Oracle’s repository, but it doesn’t manage to compile the kernel module it needs – probably because of the “RC” nature of the current Natty’s kernel (2.6.38-rc4) as of this writing.

I’ve seen many posts on the internet about running Ubuntu 11.04 as a guest in VirtualBox, but couldn’t find anyone talking about my problem, which is the opposite – running VirtualBox on Ubuntu 11.04. So here’s how to get this thing working:

  1. Install VirtualBox 4.0 (from Oracle’s repository)
  2. Install the kernel headers package for Ubuntu: sudo apt-get install linux-headers
  3. Edit the headers’ Makefile to declare the same version as the uname command: run uname -r and note the suffix after the version number, for example mine says “2.6.38-3-generic“, so I am interested in “-3-generic“. Edit the Makefile using sudo gedit /usr/src/linux-headers-<version>-3-generic/Makefile , and the fourth line should say something like “EXTRAVERSION = -rc4“. Change the value (in this case “-rc4“) to what you found out from uname.
  4. add autoconf.h to the linux include directory, because it is missing for some reason:
    cd /usr/src/linux-headers-<version>-3-generic/include/linux
    sudo ln -s ../generated/autoconf.h

Now you can run sudo /etc/init.d/vboxdrv setup and it should complete successfuly and allow you to start VirtualBox.

Enhanced by Zemanta

I Hate Pod Catchers

[Updated: 29/7/2011]

One of the reasons to get a new mobile internet device, is to get a better pod catcher to use in order to feed my podcast listening habit :-). Its not that Escarpod for Symbian was bad – it was a very good application and any new podcatcher I’ll get will be measured against it – but my P1i was kind of dying and regardless all new development in Escarpod was happening in the S60 version and not for UIQ that the P1i was running.

Once I had an android device, the next order of business was to find the best podcatcher (for me). I’ve downloaded and tried all the podcatchers I could get my hand on, so here’s the summary of my trials and tribulations. If I missed any podcatcher that you know of (and want me to compare against those listed below), then drop me a note about it.

(more…)

Script day: output the tail of a log based on time

As system administrators we often want to list the last few lines from a log file in order to track problems and see system reports. The UNIX command tail is very useful for that purpose and lets you display an arbitrary number of lines from the bottom of any file.

But often this is not really what you want – an administrator might want to see what happens in the last X minutes and the common practice to do this is to run tail with a guessed number of lines, see if you get what you want and if its not enough increase the number and try again.

Here’s another approach that works well if the log file you want to trace has time stamps for its lines (more…)