linux

You are currently browsing articles tagged linux.

Some Debian developer will probably see this and yell at me for doing something very evil, but I find this trick quite useful and thought I’d share it with the world. You might notice I also made use of it in my Debian Java mini-howto.

The Debian “alternatives” system is basically a set of utilities designed for manipulating what is no more than a complex collection of symlinks. However, the flexibility it affords users is wonderful. It allows the administrator to set up intelligent “default versions” for system utilities such as editors, pagers, and terminals.

And it also, if you abuse it slightly, gives you an easy way to manage applications installed into /opt.

Debian, as you might know, isn’t that great at always packaging applications that don’t agree with its “social contract”. So you’ll usually find yourself jumping through hoops to get anything that involves Java installed. I install apps like Eclipse, Azureus, and VMWare into directories in /opt (/opt/eclipse, /opt/azureus, etc). And then I use update-alternatives to add intelligent symlinks back into the main system:

update-alternatives --verbose --install [desired symlink] [name] [executable location in /opt/whatever] 500

For a specific example: update-alternatives --verbose --install /usr/bin/vmware vmware /opt/vmware/bin/vmware 500

If you also want to install a link for the manpage, you can also do that:

update-alternatives --verbose --install /usr/bin/vmware vmware /opt/vmware/bin/vmware 500 --slave /usr/share/man/man1/vmware.1 vmware.1 /opt/vmware/man/man1/vmware.1

(I know that actually points to the manpage of the vmware XF86 driver, but you get the idea…)

And since all the links are tracked by update-alternatives, I can easily remove them when I uninstall the application: update-alternatives --remove-all vmware

Tags: , ,

Every time I set up a new system I have to figure out how to do this again, so I decided to post instructions for my benefit and for the benefit of those who might also be having problems with this.

Debian’s “Social Contract” forbids it from distributing “non-free” code as official packages. Thus, Sun’s version of Java is not in any of the official mirrors. You can sometimes find third-party packages from Blackdown and other groups, but they are often out of date and annoying. I prefer to get my Java directly from Sun.

I install my JDKs into /opt and use “dummy packages” to let Debian know that I really do have Java installed. That way I can install Debian packages requiring Java to be installed and everything will go smoothly.

This mini-HowTo assumes that you’re running Debian Unstable (Sid), but it should also work if you’re using Testing or even Ubuntu. It also assumes you’re doing all these steps as root.

Read the rest of this entry »

Tags: , , ,

Fundable.org

fundable

I thought I’d take a minute to plug my friend’s new startup, a project that I think has a lot of potential and that could be very cool if it takes off.

Fundable.org. Its a very neat idea. Say, for instance, that you’ve got a project you’d like to undertake which requires buy-in from a large number of individuals. Something like having a web designer create a good looking webpage for an open-source project or bringing a decent band to a musical vacuum like Pittsburgh.

Fundable allows you to create a “group action” that people can contribute money towards. Say it’ll take $1000 to get The Long Winters to make a stop in Pittsburgh during their next tour:

  1. Create a group action with a goal of getting them to play here in Pittsburgh.
  2. Allow the advance purchase of 100 tickets to the show for $10 apiece.
  3. If the group action gets 100 people to contribute, the $1000 is “turned on” and the group leader can then withdraw the money and set up the show.
  4. If the action doesn’t get enough contributors, everybody’s money gets refunded.

Its a neat concept and I think it could be great for setting up “bounties” for open-source projects or for starting advertising campaigns for non-profit groups.

So go check them out and let me know what you think.

Tags: , , , , , ,

I’ve been bad. Until recently I haven’t been backing up my MySQL database. Bad things could have happened.

Today I finally hacked up a simple script to run from cron that will automatically dump, zip, and mail backups of my MySQL tables to an email address I specify. I set up a Gmail account to send the dumps to because they’re about 8 meg each. The dumps are also encrypted using my PGP 1024-bit public key to give me a bit of security.

Since I didn’t manage to find anything similar in my Googling, I decided to post it.

#!/bin/sh # Performs a backup of MySQL, encrypts it using PGP, and mails it to a particular user # The user to mail the backup to. Should have a public key in the above user's keyring... MAIL_TO="your-backup-account@gmail.com" MAIL_TO_KEY="Your PGP key ID" # Subject of the mail. A date stamp will be appended to it MAIL_SUBJECT="[mysqldump] MySQL Backup for " ###################################### DATESTAMP=`date %Y-%m-%d` FILENAME="/tmp/mysqldump-$DATESTAMP.gz" # Generate the dump mysqldump --all-databases | gzip > "$FILENAME" # Encrypt it gpg --encrypt --recipient "$MAIL_TO_KEY" "$FILENAME" # Mail it! mpack -s "$MAIL_SUBJECT $DATESTAMP" -c application/octet-stream $FILENAME.gpg" "$MAIL_TO" # Remove the backups rm -f $FILENAME $FILENAME.gpg

Tags: , , , , , ,

Leap of faith

Well, after spending a little time learning about it, last night I made the jump from Debian Sid (“unstable”) to Ubuntu Linux. Ubuntu is a Debian-based distribution that promises to focus more on desktop users by providing earlier releases of Gnome and other desktop applications.

Ubuntu Linux

Overall, the switch went fairly smoothly. I chose Ubuntu “Hoary Hedgehog” (its development branch), which is based on Debian “Unstable.” I switched my apt-get sources over to the Hoary repository, launched “apt-get update && apt-get dist-upgrade” and crashed on the couch to watch a movie. An hour or two later (after fixing one minor upgrade snag), it was done. With the exception of a few core packages left over from Debian and probably wayyyyyy too many config files, my laptop is an Ubuntu machine now.

Ubuntu is pretty nice. It feels a bit more “polished” than Debian, and now I’ve got Gnome 2.10, which is kind of snazzy. But there’s something I miss about Debian. Its kind of like when I traded in my old Jeep for a brand new 4Runner. Its slick and smooth and has lots of gadgets, but there’s something about the sharp edges on that old reliable you miss. Its like my laptop has lost that rock-solid Debian feel that made me feel like I could slam my machine repeatedly against the desk without doing damage. Time will tell how I finally feel about Ubuntu.

Update: I’m also very concerned with the overabundance of the color brown throughout all of their default themes. Muddy, ugly, painful to look at brown.

Update: There seems to be a fair amount of interest in how my experiment turned out. Well… it turned out badly. I wasn’t very happy with Ubuntu and I ended up reinstalling Debian. True, Ubuntu has newer versions of many packages than Debian has, but without that level of quality and reliability that Debian packages usually have. My machine lost that robust quality that Debian brought.

Tags: ,

« Older entries § Newer entries »