DriveBy Seminar - Linux

Getting Started

How do you get started with Linux? One of the best things about Linux is that there's almost something for everyone, but this leads to the porblem of trying to find it. Some of you might be interested in putting together an embedded device, others might want to run their own servers, a few of you want to hack it up and maybe one of you will want to try out Linux on a more regular basis. The great thing is that Linux can do all that for you, but we'll have to learn you up a bit.

What's Different?

Let's get started. So what's so different about Linux? There's a few important philosophies that make up the foundation of Linux. One concept was borrowed from Unix; Everything is a file. This applies to regular files, directories and even devices. This abstraction allows you to "write" to your printer as if it was a text file. Another concept, one you're likely to be familar with, Open Source envelopes the ideas of open standards, community contribution and the ability to try it again your way. Finally, the concept we're most likely to play with building our projects is Small Pieces, Loosely Joined. Many programs and services are built to be linked together in ways that the author may not have originally intended. This concept is pushed along with the help of open standards (so everyone can play and easily switch out things) and the first concept that everything is a file (passing data back and forth can be as easy as reading and writing files).

With this in mind, note the following:


Devices are files, and can be found under /dev.

With the latest versions of Linux (2.6.x), udev is (becoming) the default. udev is responsible for populating /dev with your devices, including in some cases nicer names like /dev/printer instead of /dev/lp0.

The files you find in /dev are special. Some of them are character devices (printers) and take one char at a time. Others are block devices (hard drives) which are usually fed in chunks. This stuff is handled by the device drivers you have builtin or modules that are loaded when needed.

Speaking of device drivers, there's a lot of devices out there and more and more drivers are being made and added everyday. So, some of your devices may work right away, and others you may have to fight to get working. Things are getting better and on the upside, there's no need for a huge kitchen sink approach like you get with other operating systems.

/dev/cdrom in most cases act as a "proxy" for your cdrom drive. Other programs read from /dev/cdrom in a way similar to reading from "readme.txt". But that's not the whole story.

User Interface

While it is a matter of personal taste what UI you decide on, the hear of any *nix system is the commandline

For most everyday things, many people prefer a window-based GUI. The big two are KDE and Gnome. There's not really a wrong choice there, but KDE seems friendlier to new folks.

For automated tasks, system administration and remote work the commandline is a life-saver. It's easy to learn how to string commands together and get things done quickly.


Linux is a multi-user operating system in the truest sense. Unlike mainstream operating systems, which cater towards single-user uses, Linux has multiple users, services, etc. in mind.

Files have permissions. You may be familiar with -rwxr-x-rx (or 755). The idea behind this is that every file or directory can have separate permissions (or allowable actions) for the user (the one who owns the file), a group (a group the owner belongs to) and others (everyone and anyone else).

Permissions let you grant and revoke read, write and execute privileges on the file level and view/list, write and visit (meaning you can use files inside even if you can't list them) on the directory level.

Every user has a /home.

There is a superuser. Use of the superuser should be restricted. Do your thing as a regular user and if you need something later, then call on the superuser root.

Distribution Quiz

What flavor to try? If you really want to get your feet wet and dive right into it you can try out a LiveCD running many different flavors of Linux. This way you can test the water and not leave a puddle on your old OS if you decide it's not for you. We'll hand out a few during the session. But here's what I recommend.


My Gentoo, how I love thee. My distribution of choice, emphasis on choice. Gentoo is source based and built around the Portage package management system. Portage handles little metadata files called ebuilds, which are like little recipes for compiling the software you want. One of the greatest features is the USE variable that allows you to specify preferences like USE="mysql php ssl" that tell portage to add those options if they're available. Unlike many binary based systems, you're not likely to encounter dependency hell. Your options are compiled in, off to the side, and when it's done it merges it in and swaps it with your old version if you have one (in some cases while it's still running).

Gentoo is a great way to reach Linux Zen, as you will have to work really closely with your system. The installation process, and your resulting mistakes, may teach you more about Linux than I ever could. Once you have a Gentoo system up and running, you can enjoy other things like a beautiful init system and system optimizations (which may give you a slight edge especially on an embedded project). But in some ways, Gentoo is not for the faint of heart. You may want to buck up a bit before approaching it.


Ubuntu is based around Debian and has an excellent and friendly community (which is why I recommend it over vanilla Debian). Ubuntu uses the apt packaging system. You can use it to build stuff from deb packages that come in binary and source forms. I feel this is much friendlier than rpm based systems, which I won't recommend (flame me if you like). It's really easy to get a system up and running fairly quickly.


I wish I had more to say here. Hmm. I like apt. Oh, I said that. You can use it in OSX, by the way, with Homebrew. Debian and OpenBSD are known for being stable and secure. There that's it...move along these aren't the...nevermind.

Commandline 101

Shells. This is where you're likely to spend a lot of time. Or not if you get good at scripting. Anything that you type in can be scripted. So, don't repeat yourself. Find or write out scripts for things you do a lot. It's also important to learn how to tie programs together.

Basic Resources

Questions are inevitable with Linux and welcome in many places. If you've given a once over of the documentation, then gather up the error messages and a detailed explanation of the problem (including context, and important bits about your setup) and ask for help. If you have a question, then it's likely someone else has already asked it. Good places to look include the project's website (mailing list archives, forums, wikis, bugs), Superuser and Stack Overflow, the Gentoo forum, Ubuntu forum and Q&A, the Linux Questions community, and IRC channels.


What do you develop? I've been working on some of the following and I feel like they are worth mentioning in this context.

Dynamic Languages
Python. It made our thesis for us almost. Don't tell anyone.
Ruby. It's like code poetry. Also check out why's poignant guide while you're at it.
Web Applications & Services
Ruby on Rails. Drink the Kool-Aid, it's tasty. Really, it's dead easy to build prototypes very, very quickly. It has the potential to decimate (or liberate) Dynamic Web Development
PICs and other Microcontrollers
Talking Serially. This is prolly the easiest way to go with your project. It allows you to write code in a higher-level language if you'd like and communicate with your PIC circuit serially. This also applies when thinking in terms of communicating via the network (including Bluetooth).
PIC Programming. It can be done, but I wouldn't call it plug and play.
Screen-Based Art & Electronic Music
Processing, but you know this.
Pd, free software not unlike Max/MSP.