Archive for the howto Category

MiniHOWTO: Save and recover full list of installed packages with dpkg

Posted in GNU/Linux, Ubuntu, howto with tags , , on April 22, 2008 by Pete Daniels

Oh, the things you catch flying by on the mailing lists! This tip comes from Ulrich Grün:

To make installation of your favoured packages more easy, you could save your list of installed packages from your old system, and then use this list for your new one:

dpkg –get-selections > list-of-installed-packages

dpkg –set-selections < list-of-installed-packages

then with aptitude with option ‘g’ or with synaptic or other packaging programme: installation of this list of packages. Maybe, an apt-get upgrade will do this as well (not tested)

One very important thing to note, as another poster in that thread brought up, is to always check the list and make sure you know what you’re doing before you use it as basis for an upgrade, especially if the list is from a different version (Gutsy to Hardy, for instance), or you could really hose yourself. But god damn, I can’t count how often I’ve looked for something like this! Thanks, Ulrich!

Gimp MiniHOWTO: Make a black border around a selection

Posted in howto with tags , on April 12, 2008 by Pete Daniels

Okay, this was hard as hell for me to figure out, but once I did, it was appallingly easy, so I want to put this out there in case anyone else stumbles over it in the future. See the logo at the top of my page with the fist and the monitor? The original image of the monitor is a black image that I found in the “openclipart” package (which is chock full of fun stuff, btw, sudo aptitude install openclipart). Yesterday I was fucking with my business card layout, and I wanted to turn that monitor into a white image with a black outline so I can superimpose my text on it. Here’s how to do it.

Using the color select tool, I select the monitor. Ctrl-C Ctrl-V to make a copy of it as another layer. Flood fill that layer with white, then scale it down by a few pixels. Viola, a white monitor with a black outline!

It’s one of those things that if you’re not savvy, it takes you an hour to wrap your head around but once you do, you’re like, “Oh shit I’m an idiot!” So maybe this post can save someone else the embarrassment :)

-pd-

HOWTO: Compiling 101

Posted in GNU/Linux, howto with tags , , on April 3, 2008 by Pete Daniels

Quite often, on scanning some of the more n00b-oriented forums (fora?), I will come across the perennial “I have to actually compile something?! WTFOMFG! Linux is sooo not ready for the desktop! How the hell am I supposed to perform such brain surgery?” posts. Not that I’m picking on anyone. In fact, for the bash virgins, compiling source can oft be a source of fear and frustration, and I think one of the unintended side-effects of n00b-ready distros like Ubuntu and PCLinuxOS is that the “you should never have to compile anything” mentality, while good by itself (I use aptitude for installation of new software whenever possible), ultimately is a disservice to first-time users, because a month or five down the trail they’re going to run into something that’s not in the repositories that they want, and because no one’s ever explained to them what the compiling process is and how it works, they’re going to go apeshit like the (completely fabricated) fictional n00b poster above. The following is a ten-step recipe for compling code, and found on the Kubuntu mailing list, originally posted by Luís Silva, and reprinted here with his gracious permission. May it find the eyes that need to see it most.

A tar.gz is a set of files that was first archived with tar and then
compressed with gzip. You will also often find tar.bz2. The difference being
the compression utility used, in this case bzip2. tar itself can handle them
both.

Here is how it goes:
1- Create a folder named BUILD in your /home/YourUserName (This is just to
keep your home tidy!)
2- move/copy the tar.gz into this folder
3- I suppose you have already used the command line before. If you did the
above in the command line just cd to the BUILD folder. If not, open a
terminal, type “cd” (without the “) (this is to make sure you are in your
home folder), type “cd BUILD”.
4- Now you are in the BUILD folder, you are going to unzip and untar the file:
tar vxzf yourfile.tar.gz
The “v” is for verbose, the “x” is for extract, “z” is because you have a
gziped file (you should use “j” instead if you had a tar.bz2), and the “f” is
to say that the next word is going to be your file name.
5- now you should have a new folder there. Check it with “ls -hl”
6- “cd” to the new folder.
7- Each program in source code comes with one or several scripts that perform
the actual compilation and installation for you. Typically you have
a “configure” script there. Again, check it with “ls -hl”. Run it
with “./configure”
8- If you get any errors just post them here so we can help you going through
them. If don’t just type “make”. This should compile your program.
9- If everything went as expected, and you want to install the program in your
system type “sudo make install” and enter your password when asked for it.
10- That’s it. There are surely a lot of things I omitted. If you want to know
more about each command you used (and you should be learning about these)
type ‘man command’ on the command line (replacing command by what you want to
know about.

A nice thing about kde (I assume you are using kde) is that you have man, info
and help available in konqueror. So typing man:command, info:command or
help:command in the location bar gives you help on the desired command. For a
newbie I would recommend its EXTENSIVE use.

Ok! Have fun and keep trying. Don’t stop just because something didn’t work
the first time.

That’s great advice at the end. Don’t quit on it just because you can’t figure it out right away. Maybe you’re missing a library somewhere, or the configure script is looking for something that you do have, but in an unexpected place. Keep poking, put up forum posts, trawl IRC channels. Email the author if you have to. Everything worth doing is hard and scary the first time. There’s a whole big raft of people waiting to help you. Good luck!

-pd-

Spotlight Application: HOWTO rock better, faster, harder with cmus (Part 1 of ?)

Posted in GNU/Linux, howto with tags , , on March 17, 2008 by Pete Daniels

I promised some more serious in-depth reporting now that my life has calmed down a little bit, so here we go with a walkthrough for a wonderful and underappreciated application, cmus. This post started as just a brief introduction, but as I dug into it, I realized this sucker was gonna get long. Also, although the documentation for cmus is really good, there’s a total lack of howtos for this application on the interwebs, and as Greg will tell you, we here at Guerrilla Tech are committed to caulking all the holes! (There’s a good story that goes along with that, but you know, never mind.)

So I’ve been idly looking at text-based audio players for a while, but yesterday I was sitting here playing Civ 4 on my Windows partition (I have a dual boot machine, Kubuntu/Civ 4) and was suddenly and irresistibly seized with the need to listen to some Nightwatchman right now. So I fired up the laptop and looked at some of my notes from last time I had this thought, and did a little google fishing for a non-graphical music manager. My criteria:

  1. Not a player, a manager. I’m demanding when it comes to my music management software. I run Amarok on my Kubuntu desktop and gmusicbrowser on my Gnome laptop. After experimenting with just about every free software music management/jukebox application that I could find in the repositories at least once, I am convinced that these two are absolutely the best of their breed (yes, that was two plugs for the price of one, slick, eh?). Music is a large part of what I do with my computer every day, I need a program that can keep up with my listening.
  2. Something with a relatively easy initial learning curve, and solid documentation. I don’t expect to master the program in half an hour (in fact, if I can master it in half an hour, it’s probably not what I’m looking for), but I should at least be playing music within half an hour.
  3. .mp3, .ogg, and .flac support.
  4. It must exist in the Ubuntu repositories.

Enter cmus, the c* music player. Install with sudo aptitude install cmus, fire it up with cmus, and we’re on our way. Let’s do a walkthrough, huh? (Remember, kids, for best results with any howto, always follow along in The Fabulous Manual! It’s quite comprehensive, and much of the material here was been lifted verbatim. I hope no one minds.) Read more »

HOWTO: Install _only_ KDE4 on Ubuntu 7.10

Posted in GNU/Linux, KDE 4, Ubuntu, howto with tags , , , on February 16, 2008 by Pete Daniels

UPDATE: Please stop using this howto, it is obsolete and only being kept up for archiving purposes. The Kubuntu-KDE4 8.10 beta is out! Use it instead!

Yes, I know I can install KDE4 on top of KDE3.5 in Kubuntu. I know that the final release of 8.04 will have separate install discs for KDE3.5 and KDE4. But I want what I want and I want it right fuckin’ now. Here’s how I did it.

  1. Install the server edition of Ubuntu 7.10. I will not detail this process here; if you don’t already know how to work with the debian-installer, don’t take it personally, but this howto is probably a little beyond you. Go forth, read the fabled manual, and come back when you’ve built your first lightsaber, young Jedi. Don’t worry, I’m not going anywhere.
  2. Reboot, log in. Install the generic kernel. This step is not strictly necessary, but the generic kernel is optimized for low latency desktop use. What this means to you, Joe User, is that applications can pre-empt the kernel, resulting in slightly lower overall processing power, but increased desktop responsiveness. Oh, the things you learn hanging out here!-> sudo aptitude install linux-generic. _Reboot_ into the generic kernel (you’ll have to select it from the GRUB menu just this once) before moving on to step 3.
  3. Remove the server kernel. -> sudo aptitude remove linux-image-2.6.22-14-generic linux-ubuntu-modules-2.6.22-14-generic linux-server linux-image-server. GRUB will update itself. (Note: By the time you read this, the kernel version may have changed, in which case you’ll have to change the version number above. You can find out what kernel you’re running with -> uname -r.
  4. sudo nano /etc/apt/sources.list and add the line “deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu gutsy main universe multiverse restricted” (no quotes)
  5. sudo aptitude
  6. In aptitude, press “u” to update the package list. Press “/” to bring up a search bar, and search for kde4-core. Press “+” to install. This should automatically install the x server with it, but check to make sure by searching for xserver-xorg and making sure there’s an “i” next to it. Also search for and mark kdm for installation.
  7. MUY IMPORTANTE! Search for kdm-kde4 and press “-” to cancel the installation. I have a showstopper bug with kdm-kde4, wherein when kdm starts, it kills all my other ttys*, which I cannot live without. I have seen no known fix for this, and I haven’t even seen anyone else with the problem, so your mileage may vary, but you’ve been warned. After all this is said and done, press “g” to install. It’ll pull down about five million package, so if you need to go to the corner store for a pack of smokes, now’s a good time. EDIT: Okay,my ttys vanished again.kdm-kde4 is not installed, it happened after an update to xserver-xorg-video-intel. I think it may be related to this bug, but I’m not sure. I have a seperate bug report filed here. EDIT TO THE EDIT: This seems to be fixed in Feisty.
  8. Reboot into KDE4! Right now, only the base KDE4 desktop is installed, but wait there’s more! First, install Adept (there isn’t a KDE4 version yet) with -> sudo aptitude install adept. Then check out extragear-plasma, kdepim-kde4, koffice-kde4, kde4-amusements, kdeadmin-kde4, kdeartwork-kde4, kdeaccessibility-kde4, kdeedu-kde4, kdegames-kde4, kdemultimedia-kde4, kdenetwork-kde4, kdegraphicskde4, and kdeutils-kde4. Etc, etc. You may just want to search for KDE4 in Adept and go down the list.
  9. Enjoy!

-pd-

HOWTO: Use cron to schedule tasks

Posted in GNU/Linux, howto with tags , , on January 25, 2008 by Pete Daniels

This will be the first in an intermittent series of howtos, ranging in difficulty from “beginner” to “high-intermediate.” They will mostly focus on, predictably, things I myself have had trouble with in the past; hopefully some other green n00b will find this and have an easier time of it than I did. Of course, if you’d like to request a howto, drop it in the comments (this also lets me know that I’m not just talking to myself), I’ll do the best I can.

Okay, mark this one as “beginner.” Today we’re going to learn about task scheduling on GNU/Linux systems. Let’s say that you want to open Kontact to the calendar at 7:00 every morning, so it’s open when you sit down with your coffee. We already know that the terminal command to open kontact to the calendar is kontact –module korganizer. (I found that by typing kontact –help) So far so good, how do we get it to run at a scheduled time?

Here’s where it starts to get all elegant and Unix-y. (Yes, I know there are graphical frontends to do this stuff on Gnome and KDE, but frankly, I found them to be much more of a pain in the ass than doing it the “hard” way, so I’m gonna teach you right.) Read more »