You're at Mabishu, a website about discovering quality on code, searching emerging technologies, and leading a simpler, more mindful coder life. This site was established in 2005 by Fran Diéguez, a blogger, software developer, and open source geek. Subscribe to the RSS feed for updates.

Automatic upgrades on Ubuntu with apt and cron

Written on January 22nd, 2010
.

If you want to get automatic upgrades of your personal repositories I haven’t find a way to get managed with unattended-upgrades so I have done the next wordarround.

This way is to use apt-get and crontab together, so open your crontab editor:

sudo crontab -e

And type the next line to execute our upgrade every night at 1AM:

0 1 * * * (/usr/bin/aptitude -y update && /usr/bin/aptitude -y safe-upgrade) 2>&1 >> /var/log/auto_update.log

Save and exit your editor, and you are all set! You could check the logfile: /var/log/auto_update.log every once in a while to see if everything is still running smoothly.

Note: If you have a solution to get to work unattended-upgrades package with custom repositories please fill a comment below.

Block Grub2 entries with user/pass auth

Written on January 20th, 2010
.

As I wrote on tittle since grub’s 2529 svn revision we can use “Basic authentication” on entries. One of the huge regression bugs that grub2 introduces since is replacing grub on main distribution, like Ubuntu. This bug impedes me to implement on the hostile environments where I have deployed GNU/Linux boxes (university community).

This solution is still on initial development but after probe it I have to say that works perfectly for me. Here I’ll explain how to activate authentication support on grub2 and with this avoid that unprivileged users change grub entries or boot from memory sticks or similar.

Just edit file /boot/grub/grub.cfg and prepend the next text:

set superusers="user1"
password user1 password1
password user2 password2

menuentry "GNU/Linux" {
        set root=(hd0,1)
        linux /vmlinuz
}

menuentry "Windows" --users user2 {
        set root=(hd0,2)
        chainloader +1
}

as you can see this syntax is very simple and self-explainable. Take a lot at second menu entry, with that only user2 can boot on “Windows”  and only user1 and user2 can edit grub entries..

By other side, this introduces a huge security bug ’cause password is written on plain text. At this moment password command only has  support for pain passwords so if we want encrypted passwords we have to create a config file at /etc/grub.d/ and using

grub-mkpasswd-pbkdf2

we can generate a block with user and pass like the next one (trimmed ’cause brakes the layout page):

password_pbkdf2 user3 grub.pbkdf2.sha512.10000.9290F727ED06C....38BA45

For more, and possibly more actualized, information go to http://grub.enbug.org/Authentication

Install Ubuntu Karmic Koala on a MacBook

Written on December 27th, 2009
.

After 4 months trying to fix my laptop finally with success, yesterday I installed Ubuntu 9.10 (Karmic Koala) on my MacBook (2,1).  Actually, rather than write a “OMG it’s so great!”-post, I turned it out a howto fix some issues of Ubuntu 9.10 (Karmic Koala) on a MacBook 2,1.

First Impressions

First of all, kernel devs has been hardly working on the Intel 945GM video driver, lame wonders like the civilizations or something, I’m talking OMFGWTF!?!11-sized wonders!

Using wildly unreliable readings from glxgears:

– 8.10 (Intrepid Ibex): ~1100 fps
– 9.04 (Jaunty Jackalope): ~900 fps (and I’m being generous here)
– 9.10 (Karmic Koala): ~3200 fps!

I’ve got 3x more frames per second than I did in 8.10. Now graphics feel smoother and I think I could almost run a 3D accelerated game on it. Read the rest of this entry »

Optimizing MySQL databases

Written on December 9th, 2009
.

A huge used database reverberate on a more fragmented database even if you delete any large data. The data base admin should optimize and take care of this especially if dealing with a lot of varying characters (VARCHAR).

At this article I will explain how to opmimize MySQL databases with tools that mysql provides. I will separate on two cases:

  • Optimizing just one table
  • Optimizing all the tables on a database

The main disvantage is that you can only optimize MyISAM, InnoDB, and ARCHIVE tables.

Read the rest of this entry »