How I Learned Linux

[Update: A bunch of you are here because Eric S. Raymond is awesome and nice. Thanks, ESR!]

And, by extension, how you can.

I’ll start this off with a disclaimer. I am not a Linux expert by any means–in fact, I’m not even fluent, and don’t use it as my main operating system. However, if I sit down in front of a Linux computer to do some work, I’m perfectly comfortable with using it. I can use the command line comfortably, I know what repositories are for and not to download just whatever interesting-looking tarball off the Internet (unless I’m doing so to tinker with it), I can do a tiny bit of shell scripting, and I can even compile or interpret my own programs (written in less annoying languages) via the command line.

Most people are not there. It took me a long time to get there; I remember being interested in Linux long before I figured out even how to learn how to use it.

The boost that let me get into the Linux world was discovering virtual machines, which are great for letting you play with different distros, screw things up, delete everything if you want/need to, start over–all sort of nonsense. It’s worth noting that Linux systems won’t be as reliable on a VM because of funky stuff with virtual hardware and guest additions and that kind of thing. The tutorial I wrote earlier can help with that. (If you’re used to Windows, you won’t notice anything strange about their reliability.)

You don’t need to take a formal class on Linux. In fact, if you really want to learn Linux, taking a class will feel painfully slow for you and will probably try to teach you silly stuff like how to get X Windows [*] to run on a network, which will be boring and frustrating. You can learn much of what you would in a Linux class by tinkering–although, if you’re focused on computer networking rather than programming, you might like taking a class.

On whether it’s right to write intro posts like this

Hackerdom seems to contain a large contingent which considers that anyone who can’t find the information in the rest of this post for themselves isn’t worth helping, because they won’t have the right spirit or work ethic. I disagree. It’s entirely possible to not even know what to type into Google in order to start solving your problem, and this doesn’t necessarily imply anything about the person who is confused. Whether they’ll admit it or not, many hackers will have been similarly helped by being around other hackers who at least know what program their juniors are looking for but don’t know exists. This is what Linux User Groups are for–but, again, most people don’t know those exist, either.

I can understand not wanting to spoon-feed people all the way, and someone with the true hacker spirit wouldn’t want to be spoon-fed anyway because it’s too much fun to do your own research, since you run into lots of other interesting knowledge along the way. But I don’t consider it a detriment to the Linux world to give people a boost in, so here we go: how to get comfortable with Linux.

No, I’m not going to describe what everything does. This post would become ridiculously long and that IS something you can Google for yourself. I will, however, provide you with good links and descriptions where they’re necessary. 

1. Set up your first virtual machine (VM).

i. Download VirtualBox (opens in new tab)

ii. Download a torrent client–a reader suggested deluge or transmission; I haven’t used them myself. I use uTorrent, but as I don’t know much about P2P systems, I pretty much picked the first one I found. As our commenter pointed out, uTorrent has certain questionable downsides. Perhaps when I have time, I’ll do some research about the different torrent clients and do a post about it.

Also, learn how to set it up. If stuff downloads, but only uploads at a painful snail’s pace, you probably have it set up wrong (although you might just have a less popular distro).

iii. Torrent at least one Linux .iso file. If given the option, choose 32-bit.

Distros (distributions) you might want to play with include Xubuntu (which is pretty easy to use and has a decent interface), Debian with GNOME (which is my favorite), Fedora (which is a little different! but maybe you’ll like it), and Mint (which, depending on which one you get, may be based off of either Ubuntu or Debian–it’s kind of a nice middle ground between them and very popular). I suggest making VMs of any distro you’re interested in, and playing with them, rather than relying on other people’s opinions about which you should use. Those posts can be fun to read, but not very helpful in the long run.

Distros you should save for a point when you know what you’re doing better and want to explore other things Linux can do include, but are not limited to, Puppy Linux and Kali Linux. Puppy is meant for running on tiny systems and can be run on computers which don’t even have a hard drive (it can run on just RAM), and Kali is meant for digital security testing. Please don’t do anything stupid with Kali.

iv. Set up your VM.

There are a lot of how-tos on this subject, including my own, which I just updated; I really suggest that you get into the habit now of checking more than one to see how they’re different and how one might be better than the other. My own included a few weird voodoo/cargo-cult programming things that were in there because they’d made something work for arcane reasons when really it was something else that was wrong–which is why it just got updated, and why you should always look at more than one tutorial. Keep the links of good tutorials; you’ll meet other newbies who need them.

2. Learn the command line.

There are numerous excellent tutorials on this. I don’t need or want to rewrite them, but I will link to them.

Zed A. Shaw’s tutorial at the end of Learn Python the Hard Way. Start with this one. Keep the link; you can learn Python at that web site, the tutorials are really good. Don’t be dissuaded by the name, it’s easier than learning from the dispassionate bureaucrats writing Microsoft programming manuals any day.

How-To Geek (Will teach you how to install things, very important–although if you’re using Fedora or a derivative, you can’t use apt-get. Just replace “apt-get” with “yum” in any of the commands mentioned and you should be fine.)

If you’re still confused about apt-get, look here for Ubuntu’s how-to.

LinuxCommand.org — I don’t remember reading this all the way through, but I had it bookmarked, so probably it answered some question or other. Come back to it if you have questions.

3. Don’t break your system (unintentionally).

Sometimes you intentionally pound on stuff to see what breaks it. However, if something breaks and you have no idea what you did, that’s a glaring neon sign that you haven’t learned enough. It helps to know what kind of stuff will break your system and why before you get to that point, though.

Here’s a link I found with good advice. It says Debian, but the points it makes are not Debian-specific.

Don’t Break Debian

4. Know where to go for help.

Your first resource when you don’t know how something works should be this really helpful command that you NEED to know. It’s called “man”. No, there isn’t a “woman” command. “man” is short for “manual.”

Typing “man ls” into the Terminal will show you everything you could ever want to know about the ls command, including different formatting options like -a and -l. The utility of those flags may not seem like much, until you write a shell script that needs to use ls and have the output in a reliable format, so man pages can be your best friend.

Man pages can also be found on the Internet.

Google is your other best friend. Learn how to use it, please; it’ll save everyone’s time, including yours, in the long run.

However, if you’ve spent more than 30 minutes to an hour (depending on the complexity/obscurity of your problem) trying to find answers, it’s probably time to go to a human. Preferably, one who can program.

Your distro will have its own forum. If you’re trying out different distros, make sure you go to the right forum for the distro that has the problem, even if the bug isn’t distro-specific.

There are also more general Linux forums, like this one which even has a newbie section.

5. Learn the secret handshake.

I was going to make a joke about this to finish off the article. Then I realized there actually is kind of a secret handshake, if you want to be a hacker and not just become competent with Linux. Consider this optional but fun; it may help you stick with Linux instead of giving up, so visit these links if you get bored.

The Jargon File

How to Become a Hacker

How to Learn Hacking

This collection of links should set you in good stead to becoming competent with Linux. If, given this boost, you can’t get any further or find anything interesting to do with what you’ve learned… well, that’s the point where we’d be spoon-feeding you. But I think it’d be hard to get through all this without sort of learning the attitude and skills you’d need to keep going, if you wanted. If you weren’t cut out for this sort of hobby, you probably wouldn’t have had the persistence or interest to make it through–you would have given up halfway through this post.

Good luck, and happy hacking!

*X Windows is an older remote access program, and a window system. It used to be a reasonably good program, I’ve heard, but it’s not a good option now. It would allow you to virtualize one computer’s GUI on another computer. But there are inherent security risks in programs that transfer GUIs over a network–at least, so far. If there were a startup that wanted to improve that, I bet there’s a huge market for a secure remote access system.

Our teacher didn’t like it–she’s a firm believer in using SSH and the command line for this sort of thing, and I agree until someone comes up with a better solution–and I don’t think the textbook writer liked it either because he put it at the very end of the chapter, after all the other options.

 

SSH is faster anyway.

Advertisements

This is an intro post

I’m Rebekah. I’m a 17-year-old programming nerd; I’m about halfway through my AAS in Programming, after which I’ll switch to a 4-year college. I want to have a job in the CS or IT field… I’m not sure I particularly care what it is, as long as it’s interesting. I’d awfully like to make money off of writing and fixing Linux programs for a Linux-based company, or maybe I can find a job as an IT consultant. That’d be cool. I also aspire to work on open-source software, although what I’ve seen around looks far too complicated for my current skill level.

The reason I made this blog is that the Microsoft Overlords have sunk their claws in awfully deep here. So far, I’ve taken:

-two classes in VB (yuck)

-a terrible intro-level web design class that quite frankly I could have taught better since I’d already read the Head First book on it (it got me free college credits though)

-a Java class (which was pretty cool, but not very in-depth), and

-a handful of dorky intro-level classes. For example, Intro to Programming Logic, which is basically superfluous if you already kinda know another programming language. Personally, I think it’s superfluous anyway; why teach pseudocode when you can teach Python? Python’s so high-level that it’s almost pseudocode-like in its syntax, and you can actually run it and make sure it works. /rant

Right now I’m taking C#, which I like well enough, and I’ve got a Linux course later this semester that I’m feeling good about, because I started flicking through the textbook preemptively and it actually cites the Jargon File and distinguishes between “hacker” and “cracker” in the first chapter. Eeeee!

I’ve tinkered a bit with tutorials on Ruby and Python, and I own a hard copy of the lovely Python book produced by Zed A. Shaw; if you’re looking for a Python book to learn from, the Internet version can be accessed via this elegant and finely-crafted link, and the hard copy version is $30 from the aforementioned web site (it’s $5 cheaper on Amazon if you’re really pressed for cash, but if not, I recommend buying from Mr. Shaw directly, both to support him and because I believe you do get some extras for buying straight off his site).

My biggest problem-solving technological accomplishment to date is a digital signage solution proposed to the college. It’s just a system of monitors hooked up in different places around the school, and there’s some kind of mystical back-end hardware that was being leased to the school and their support could go “poof” any day. Nobody’s really been maintaining the system. It’s just kind of been collecting dust. The higher-ups in the IT department just kinda tossed the problem to the students, and I came up with the favorite solution. Which hasn’t been implemented yet, because the current signage program hasn’t gone poof yet and the administrators are more skilled procrastinators than the students.

My solution was just to hook a Raspberry Pi up to each of the monitors (cheap, and small enough to hide in the acoustic ceiling tile or strap on the back of the monitors), hook it up to the school’s wireless, and stick a simple little hack into Raspbian in order to make it boot on a schedule and straight into Chrome in Presentation Mode. The web page it would boot to would be a school-maintained site which simply displayed a slideshow of whatever signs the school wanted to put up. Particularly, I was going to alter WordPress and make a theme to do that so the college folks could use WordPress’s nice, friendly interface–but it turned out someone had already done that, so I didn’t have to. I came up with the concept and my older brother did a lot of the legwork; figured out what needed to be changed, figured out how to change it. Got around resolution problems and hooking up to wireless networks automatically, stuff like that.

I offered to personally code the RPis to the school’s monitors. If they procrastinate so long that I’m out of school by the time they finally implement the solutions, they’re gonna be -1 solution that’s a third as expensive as the only other proposal (it’s only like ~$50/monitor with network cards and cables accounted for).

I’m pretty proud of that. But I want to get to the point where I don’t need my brother’s help to do stuff like that, and I want to get to the point where I can tell other people about the solution and offer up a code snippet that will auto-detect their monitor’s resolution and set it up for them, so people who aren’t terribly tech-savvy can still figure it out. Moreover, so that other geeks who’ve been presented with this solution by their equivalent higher-ups don’t have to reinvent the wheel, OR try to parse my or someone else’s garbled instructions on how to do it. If they need to do something different with the resolution, the code that automatically sets the thing up would probably explain things better than I could (at least if it’s sufficiently commented).

Hmm, maybe that can be my first project. I’ve been looking for something to tinker and learn with, so maybe this’ll be it. This blog sure was a good idea! Talking to myself always seems to generate new ideas.

Oh, speaking of reinventing the wheel. I almost forgot to mention the other main goal of this blog! It’s so that other programming nerds who want in on the magical world of Computers That Do What You Tell Them To don’t have to fish around on the Internet just to figure out how to set up a VM that runs Lubuntu or whatever. That’ll probably be my next post.

I should go eat, and work on C# assignments. Laters.