<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7430472870795422881</id><updated>2011-11-26T09:08:32.812-06:00</updated><category term='Wireless'/><category term='flash'/><category term='keyboard shortcuts'/><category term='sudoers file'/><category term='Regular Expressions'/><category term='rm'/><category term='network manager'/><category term='mv'/><category term='Skinny Elephant'/><category term='info'/><category term='Bootable Flash Drive'/><category term='RAM'/><category term='Raising Skinny Elephants'/><category term='Songbird'/><category term='Bash Tutorial'/><category term='Picasa'/><category term='audio'/><category term='locate'/><category term='scheduling commands'/><category term='cp'/><category term='first post'/><category term='wpa_supplicant'/><category term='laptop display'/><category term='grep'/><category term='Dell'/><category term='alsa'/><category term='Inkscape'/><category term='.png'/><category term='Inspiron Mini'/><category term='crontab'/><category term='gconf-editor'/><category term='man'/><category term='java'/><category term='Favorite applications'/><category term='Debian'/><category term='Personal Post'/><category term='snd-hda-intel'/><category term='cd'/><category term='find files'/><category term='Broadcom wl driver'/><category term='.svg'/><category term='USB drive'/><category term='first'/><category term='Moving Windows'/><category term='Raster'/><category term='mkdir'/><category term='pwd'/><category term='fork bomb'/><category term='Vim'/><category term='updatedb'/><category term='rmdir'/><category term='Photo album'/><category term='sudo'/><category term='redirection'/><category term='ImageMagick'/><category term='Upgrade'/><category term='USB Installation'/><category term='command operators'/><category term='Install'/><category term='gconf'/><category term='SSD'/><category term='Mini 9'/><category term='Mini PCIe'/><category term='Command Line Tricks'/><category term='Bash'/><category term='Image Editing'/><category term='wicd'/><category term='cat'/><category term='Vector'/><category term='less'/><category term='ls'/><category term='Installation'/><title type='text'>grabag-linux</title><subtitle type='html'>rm -rf /   # Why does my computer break after I run this?</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-2922902374226903893</id><published>2009-08-12T23:29:00.000-05:00</published><updated>2009-08-12T23:29:10.118-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal Post'/><title type='text'>A Personal Post</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;As you probably noticed, I took a bit of a break from posting.  I figure coming off that break is as good a time as any to take some time to say a few things unrelated to the typical postings on here...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I've been pretty busy lately, but who hasn't?  The thing is that I'm probably only going to be getting busier coming up.  The reason for this is that in addition to working a full time job, I'm going to be going back to school part time.  The plan is to take some computer science courses to be able to get into a graduate program.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;So, what does this mean for grabag-linux?  Hopefully it means a new source of ideas for posts, but it will also mean less time in which to write posts.  I don't plan on quitting grabag-linux, but I don't think I will be able to keep up with the two posts per week pace that I've been keeping so far.  Moving forward I'm going to cut back to one post a week; I figure Sunday night is a good time for that.  Depending on how things go, I may have to fudge a day or two here or there, but I'll do my best to keep up with weekly postings.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;So, what have I got planned coming up here?  Well, I have plans for something big on Conky, some ideas for some smaller posts, and there are always lots of cool things to do with ImageMagick.  But, if you have ideas for something you'd like to see me post on, feel free to shoot me an email or post a comment with your ideas.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time, back with more focus on Linux in the post.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-2922902374226903893?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/2922902374226903893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/08/personal-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2922902374226903893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2922902374226903893'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/08/personal-post.html' title='A Personal Post'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-4018852615954598039</id><published>2009-07-29T23:55:00.000-05:00</published><updated>2009-07-29T23:55:00.465-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fork bomb'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Bash'/><title type='text'>Bash Fork Bomb</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;Maybe you've heard of the bash fork bomb, maybe you haven't.  You may have even seen the command that launches the fork bomb but don't know what it means or just haven't taken the time to think it through.  Whatever the case, the bash fork bomb is something that is pretty interesting.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The short explanation of what the fork bomb does is that it recursively and exponentially spawns processes until your system crashes.  So, what does this fork bomb look like?  Here it is:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ :(){ :|:&amp;amp; };:&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;So, that's great, but what exactly does it do?  Well, let's break it down to explain what it is&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;:(){ :|:&amp;amp; }&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This defines a function &lt;strong&gt;:&lt;/strong&gt; that does not accept any arguments, thats the &lt;strong&gt;()&lt;/strong&gt; part.  So, what does the function do?  That's the part inside the curly braces.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;{ :|:&amp;amp; }&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This is the meat of the function, what gets run when you actually call &lt;strong&gt;:&lt;/strong&gt;.  When you call the function &lt;strong&gt;:&lt;/strong&gt;, the first thing it does is to call itself and it pipes the output into another call of itself.  So, short story here is that &lt;strong&gt;:&lt;/strong&gt; calls itself twice; hence the exponential growth of processes spawned.  The thing is that each time &lt;strong&gt;:&lt;/strong&gt; gets called, that's another process running on the system.  And, here's the kicker, the second time &lt;strong&gt;:&lt;/strong&gt; is called, it is sent to run in the background with the &lt;strong&gt;&amp;amp;&lt;/strong&gt;, so killing the parent process won't kill it.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;;:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This is where we actually call &lt;strong&gt;:&lt;/strong&gt; for the first time.  The &lt;strong&gt;;&lt;/strong&gt; operator says to run the following command immediately after the previous one has finished.  So, what does it do?  Immediately after defining the &lt;strong&gt;:&lt;/strong&gt; function this calls it, and then you play the waiting game until your system crashes.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You should probably not run this command on your system.  If you're curious, fire up a virtual machine inside virtual box and give it a go there.  Maybe I'll do that and post a video.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;So, what good is this fork bomb?  Well, this is something that sys admins use as a way to test limits on user processes.  Once you launch this fork bomb, the only way to end it may be to reboot your system.  The reason is that you have to destroy all instances of it to resume normal function.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-4018852615954598039?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/4018852615954598039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/bash-fork-bomb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4018852615954598039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4018852615954598039'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/bash-fork-bomb.html' title='Bash Fork Bomb'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-5860687280572961548</id><published>2009-07-27T21:55:00.002-05:00</published><updated>2009-07-27T21:56:58.412-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><category scheme='http://www.blogger.com/atom/ns#' term='Regular Expressions'/><title type='text'>Regular Expressions in Vim</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;Regular expressions are a fantastic thing to keep in your arsenal.  To get a rough idea of what regular expressions are for, check out this xkcd comic on &lt;a href="http://xkcd.com/208/"&gt;regular expressions&lt;/a&gt; if you haven't already seen it.  Basically, regular expressions allow you to find and act on patterns in a file or group of files.  I'm going to be looking at this from how you can use regular expressions with &lt;a href=""&gt;Vim&lt;/a&gt;, but regular expressions are certainly available in a much larger capacity throughout linux.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;When learning a new programming language or programming concept, I find it useful to be able to see examples of code that other people have written.  Unfortunately, this attack is probably not quite as helpful for regular expressions.  Reading regular expressions can be quite tricky and may require a fair amount of time and energy to decipher a regular expression if you don't have any notes handy to explain them.  Just a hint from my personal experience, you should probably leave a comments in any program or script you write to explain any regular expressions contained within.  If you don't leave comments, you may find yourself looking back at the regular expressions in your code and feeling like you're reading &lt;a href="http://en.wikipedia.org/wiki/Brainfuck"&gt;brainfuck&lt;/a&gt;.  The best way to learn regular expressions, in my experience, is to dive right in and start writing them yourself.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That all said, let's get started here with where the bulk of the work is done with regular expressions: metacharacters.  Metacharacters, or escaped characters, are special characters that represent something else in a regular expression.  That maybe doesn't make a whole lot of sense as you read it, but, hopefully, it will be clearer with the following list of metacharacters:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;.&lt;/strong&gt; - Represents any character except the "new line" character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\n&lt;/strong&gt; - Represents the "new line" character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\s&lt;/strong&gt; - Represents any whitespace character (e.g. space, tab, etc.)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\S&lt;/strong&gt; - Represents any non-whitespace character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\d&lt;/strong&gt; - Represents any numerical digit (0-9)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\D&lt;/strong&gt; - Represents any non-numerical character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\x&lt;/strong&gt; - Represents any hex digit (0-f), case insensitive&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\X&lt;/strong&gt; - Represents any non-hex digit&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\o&lt;/strong&gt; - Represents any octal digit (0-7)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\O&lt;/strong&gt; - Represents any non-octal digit&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\h&lt;/strong&gt; - Represents any head of word character (a-z,A-Z,_)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\H&lt;/strong&gt; - Represents any non-head of word character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\p&lt;/strong&gt; - Represents any printable character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\P&lt;/strong&gt; - Represents any non-digit printable character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\w&lt;/strong&gt; - Represents any word character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\W&lt;/strong&gt; - Represents any non-word character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\a&lt;/strong&gt; - Represents any alphabetic character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\A&lt;/strong&gt; - Represents any non-alphabetic character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\l&lt;/strong&gt; - Represents any lowercase character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\L&lt;/strong&gt; - Represents any non-lowercase character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\u&lt;/strong&gt; - Represents any uppercase character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\U&lt;/strong&gt; - Represents any non-uppercase character&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I know, that's quite a list, but once you start writing some regular expressions, it's not too bad to refer to a list and before you know it, you'll find you won't even have to reference any list.  Now that we've covered the metacharacters, the next place we want to look is how to denote the number of times something is to be repeated.  The answer is with another class of escaped characters, called quantifiers.  Quantifiers can be either greedy or non-greedy.  Greedy quantifiers try to match as many times as possible.  Non-greedy quantifiers try to match as few times as possible.  This should be clear once I run down the list of quantifiers and use them in a couple examples:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;*&lt;/strong&gt; - Matches 0 or more of the preceding characters, as many as possible (greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{-}&lt;/strong&gt; - Matches 0 or more of the preceding characters, as few as possible (non-greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\+&lt;/strong&gt; - Matches 1 or more of the preceding characters, as many as possible (greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\=&lt;/strong&gt; - Matches 0 or 1 of the preceding characters&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{n}&lt;/strong&gt; - Matches the preceding characters exactly n times&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{n,m}&lt;/strong&gt; - Matches the preceding characters at least n times and at most m times, as many as possible (greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{-n,m}&lt;/strong&gt; - Matches the preceding characters at least n times and at most m times, as few as possible (non-greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{n,}&lt;/strong&gt; - Matches the preceding characters at least n times, as many as possible (greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{-n,}&lt;/strong&gt; - Matches the preceding characters at least n times, as few as possible (non-greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{,m}&lt;/strong&gt; - Matches the preceding characters at most m times, as many as possible (greedy)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\{-,m}&lt;/strong&gt; - Matches the preceding characters as most m times, as few as possible (non-greedy)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We have enough to go through some common examples.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Find dates in YYYY-MM-DD format (two equivalent expressions):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;/\d\d\d\d-\d\d-\d\d&lt;br /&gt;\d\{4}-\d\{2}-\d\{2}&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;There is another point that I should make, the &lt;strong&gt;/&lt;/strong&gt; character is a special character in Vim, so it has to be escaped.  For example, if you want to find dates in mm/dd/yyyy format:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;/\d\{1,2}\/\d\{1,2}\/\d\{4}&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Before we can do much with finding and repacing text within Vim, there is one more thing we should go over.  A lot of times when finding and replacing text, we will want to keep part of the patern that we find and have it in a different (or even keep it in the same) place.  This will probably be easier if I just do this with an example.  The following will convert all dates from MM/DD/YYYY format to YYYY-MM-DD format:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;:%s/\(\d\{2}\)\/\(\d\{2}\)\/\(\d\{4}\)/\3-\1-\2/g&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;There are a couple things to explain in the above example.  The &lt;strong&gt;\(&lt;/strong&gt; and &lt;strong&gt;\)&lt;/strong&gt; characters are not actually searched for, but are used to delimit the paterns that you want to keep for the text to replace with.  The &lt;strong&gt;\n&lt;/strong&gt; characters are mapped to the paterns that are surrounded by &lt;strong&gt;\(&lt;/strong&gt; and &lt;strong&gt;\)&lt;/strong&gt; characters in order.  In other words, the first thing in the "find" portion of the command surrounded by &lt;strong&gt;\(&lt;/strong&gt; and &lt;strong&gt;\)&lt;/strong&gt; characters maps to &lt;strong&gt;\1&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;What if you want to turn a list with each value on separate lines into a comma separated list?  Here's how:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;:%s/\n/,/&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;What about that problem from the xkcd comic linked above?  To find text formatted as an address I will assume the following about the address:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The address is of the form that you would use to mail a letter in the United States&lt;/span&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The name is two words (i.e. first and last name only)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The house number is no more than 4 digits&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The street name ends with a common ending: st., ave., blvd., etc. and none longer than four characters.&lt;/span&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The zip code is in extended form: #####-####&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Before the example, I should explain that since the &lt;strong&gt;.&lt;/strong&gt; character is a metacharacter, if you want to search for a period character specifically, we need to escape it like this: &lt;strong&gt;\.&lt;/strong&gt;.  Also, the &lt;strong&gt;^&lt;/strong&gt; character is used by Vim to denote the beginning of a line and the &lt;strong&gt;$&lt;/strong&gt; character is used to denote the end of a line.  Here's my example of a search command to find text formatted like an address:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;/^\w*\s\w*\n\d\{,4}\P*\w\{2,4}\.\n\P*,\s\u\{2}\s\d\{5\}-\d\{4}$&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I know that's kind of long, but let me break this example down one part at a time:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;^&lt;/strong&gt; - Makes sure that it starts finding the address at the beginning of a line&lt;/span&gt;&lt;/li&gt;&lt;br/&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\w*&lt;/strong&gt; - This is to find the first name&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\s&lt;/strong&gt; - This is to find the space between the first and last name&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\w*&lt;/strong&gt; - This is to find the last name&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\n&lt;/strong&gt; - This is to make sure that there is nothing else on this line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\d\{,4}&lt;/strong&gt; - This looks for a house number of at most 4 digits&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\P*&lt;/strong&gt; - This looks for the text of the street name, and takes into account street names with hyphens or multiple words&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\w\{2,4}\.&lt;/strong&gt; - This looks for the street ending (e.g. st. or blvd) ending with a period character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\n&lt;/strong&gt; - This makes sure that there is nothing else on this line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\P*,&lt;/strong&gt; - This looks for the city name ending with a comma character, and takes into account cities with hyphens or multiple words&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\s&lt;/strong&gt; - Makes sure there is a space between the city and state abbreviation&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\u\{2}&lt;/strong&gt; - This looks for the two digit state abbreviation&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\s&lt;/strong&gt; - This makes sure there is a space between the state abbreviation and the zip code&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\d\{5}&lt;/strong&gt; - This looks for the first five digits of the extended zip code&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;-&lt;/strong&gt; - This makes sure there is a hyphen separating the two sections of the zip code&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;\d\{4}&lt;/strong&gt; - This looks for the last four digits of the extended zip code&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;$&lt;/strong&gt; - This makes sure that there is nothing else on this line&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I know that this may all seem rather daunting, especially if you've never really worked with regular expressions, but the best advice I can give is what I said before: start trying to write your own regular expressions.  Sure, you'll make mistakes at first; heck, I still make mistakes when I write regular expressions.  But, at least you can learn from your mistakes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Well, that pretty much does it for tonight's post.  Have fun writing regular expressions.  See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-5860687280572961548?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/5860687280572961548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/regular-expressions-in-vim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/5860687280572961548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/5860687280572961548'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/regular-expressions-in-vim.html' title='Regular Expressions in Vim'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-2457743605827800595</id><published>2009-07-23T21:55:00.000-05:00</published><updated>2009-07-23T21:55:00.331-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Vim: Visual Modes</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;I realized that in my last post, I mentioned the Visual and Visual Line modes in Vim without actually mentioning what you would use these for.  The visual modes are used for selecting text and doing things like cutting and copying text, or in vim-speak deleting and yanking text, and for running commands on the selected text.  Once you change to visual mode, moving the cursor around will automatically select text.  Visual line mode works much like visual mode, only you can only select entire lines.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Cutting and copying in visual modes:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;y&lt;/strong&gt; -  yanks (copies) the selected text&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;d&lt;/strong&gt; - deletes (cuts) the selected text&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Cutting, copying, and pasting in normal mode&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;:y&lt;/strong&gt; or &lt;strong&gt;yy&lt;/strong&gt; or &lt;strong&gt;Y&lt;/strong&gt; - yanks the current line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;:ny&lt;/strong&gt; - yanks line number n&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;:n,my&lt;/strong&gt; - yanks line numbers n through m, inclusive&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;:d&lt;/strong&gt; or &lt;strong&gt;dd&lt;/strong&gt; - deletes the current line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;D&lt;/strong&gt; - deletes from the current cursor position to the end of the line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;:nd&lt;/strong&gt; - deletes line number n&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;:n,md&lt;/strong&gt; - deletes from line number n through m, inclusive&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;p&lt;/strong&gt; - puts (pastes) text from the clip board starting to the right of the cursor, or below the cursor if putting entire lines of text&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;P&lt;/strong&gt; - puts text from the clip board starting to the left of the cursor, or above the cursor if putting entire lines of text&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Another important thing when you are editing anything is to know how to undo and redo changes made.  This is really easy to do in Vim:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;u&lt;/strong&gt; - undo the most recent change&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;U&lt;/strong&gt; - undo all of the most recent changes to the current line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;r&lt;/strong&gt; - redo the last undone change&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That pretty much does it for this post.  See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-2457743605827800595?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/2457743605827800595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/vim-visual-modes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2457743605827800595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2457743605827800595'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/vim-visual-modes.html' title='Vim: Visual Modes'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-8276881464035436745</id><published>2009-07-19T23:55:00.003-05:00</published><updated>2009-07-23T21:24:14.385-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Vim: an Introduction</title><content type='html'>&lt;span style="font-face: georgia, sans-serif;"&gt;If you saw my &lt;a href="http://grabag-linux.blogspot.com/2009/07/favorite-linux-applications.html"&gt;favorite linux applications&lt;/a&gt; post, then you'll know that Vim is my text editor of choice.  Vim is a very powerful text editor, but it does come with a bit of a learning curve.  I figured I would present an introduction into Vim that should help in getting to the point where using Vim is not a challenge.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;I suppose the first thing that we should do is cover how to open a file in Vim:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ vim filename&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;This will open the file &lt;strong&gt;filename&lt;/strong&gt;, and if the file does not exist, Vim will create the file once you save.  Probably the first thing everyone notices when they first open up Vim is that they cannot immediately enter text into the file.  The reason for this is that Vim is a modal editor with the following modes: Insert, Replace, Visual, Visual Line, and Normal modes.  Vim opens up by default in Normal mode which is where you can issue commands to the Program.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Another common problem that people face when they are first learning to use Vim is that they have a hard time keeping track of which mode they are in.  The first thing I will point out is that at the bottom of the Vim window, it does tell you what mode you're in; it will display the following:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;-- INSERT --&lt;/strong&gt;: When in Insert Mode&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;-- REPLACE --&lt;/strong&gt;: When in Replace Mode&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;-- VISUAL --&lt;/strong&gt;: When in Visual Mode&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;-- VISUAL LINE --&lt;/strong&gt;: when in Visual Line Mode&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Or it will be blank when in Normal Mode&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Part of the reason that people have a hard time keeping track of what mode they are in is that once the open up Vim, they set it to Insert Mode and leave it there.  If you only set Vim to Insert mode when you are actually inserting text into the file and leave it in Normal mode otherwise, this will cut down on the confusion and encourage you to learn Vim commands, rather than just using Vim like Notepad.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;OK, enough for my introductional rant, let's get down to the business at hand and start talking about how to use Vim:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;Changing Modes&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Before we start discussing the commands and how to use the various modes, it may be a good idea to know how to change between them so that you don't get yourself stuck somewhere in unfamiliar territory.  The first thing I will point out is that from Normal mode, you can get to any of the other modes, but from any other mode, you have to return to Normal mode before you can change to a different mode.  Here is a list of hot-keys that you can use to change modes:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;i&lt;/strong&gt; - Puts you into Insert Mode where the cursor currently sits&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;I&lt;/strong&gt; - Puts you into Insert Mode at the beginning of the current line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;a&lt;/strong&gt; - Puts you into Insert Mode one character after where the cursor currently sits&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;A&lt;/strong&gt; - Puts you into Insert Mode at the end of the current line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;s&lt;/strong&gt; - Puts you into Insert Mode and deletes the character immediately under the cursor&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;S&lt;/strong&gt; - Puts you into Insert Mode and deletes the current line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;r&lt;/strong&gt; - Puts you into Replace Mode for only one character where the cursor currently sits&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;R&lt;/strong&gt; - Puts you into Replace Mode and keeps you there where the cursor currently sits&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;v&lt;/strong&gt; - Puts you into Visual Mode where the cursor currently sits&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;V&lt;/strong&gt; - Puts you into Visual Line mode on the current line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;Esc&lt;/strong&gt; - Returns you back to Normal Mode&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;Moving around in Normal Mode&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;The first thing I will say about Normal Mode is that there are, what I call, hot-keys and commands.  Hot-keys are keys that when pressed do something immediately.  Commands start with either the &lt;strong&gt;:&lt;/strong&gt; character for normal commands or the &lt;strong&gt;/&lt;/strong&gt; character for search commands.  Now I will run down a list of hot-keys and commands for moving around in Normal Mode in Vim&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;h&lt;/strong&gt; - Moves the cursor to the left one character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;j&lt;/strong&gt; - Moves the cursor down one line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;k&lt;/strong&gt; - Moves the cursor up one line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;l&lt;/strong&gt; - Moves the cursor to the right one character&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;w&lt;/strong&gt; - Moves the cursor to the right one word&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;b&lt;/strong&gt; - Moves the cursor to the left one word&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;$&lt;/strong&gt; - Moves the cursor to the end of the line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;^&lt;/strong&gt; - Moves the cursor to the beginning of the line&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;gg&lt;/strong&gt; - Moves the cursor to the first line of the file&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;G&lt;/strong&gt; - Moves the cursor to the last line of the file&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:n&lt;/strong&gt; - Moves the cursor to line number n&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;Searching for and Replacing Text&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;I shouldn't even have to explain how important it is to be able to do find and replace commands inside a text editor.  I use them all the time and they make things go a whole lot faster.  Searching for text in Vim is very easy:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;/text&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Typing the above while in Command Mode will move the cursor to the next appearance of &lt;strong&gt;text&lt;/strong&gt; after the cursor's current position.  To move to the next appearance, simply type &lt;strong&gt;n&lt;/strong&gt;; to move to the previous appearance, type &lt;strong&gt;N&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Replacing text is a little bit more complicated, but here is the basic syntax:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;:[region]s/[text to find]/[text to replace with]/[options]&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;This may look a little daunting, but let's just break it down one piece at a time:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;[region]&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;The region tells the command what section of the file to do the find and replace on.  You can use a number to do the replace only on one line, you can use two numbers separated by a comma to replace between two lines inclusive, or you can use the &lt;strong&gt;%&lt;/strong&gt; character to replace throughout the entire document.  Here are three examples:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;:5s/find/replace/&lt;br /&gt;:5,10s/find/replace/&lt;br /&gt;:%s/find/replace/&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;The first example with substitute the first instance of &lt;strong&gt;find&lt;/strong&gt; with &lt;strong&gt;replace&lt;/strong&gt; on line number 5.  The second example will substitute the first instance of &lt;strong&gt;find&lt;/strong&gt; with &lt;strong&gt;replace&lt;/strong&gt; on each line between line numbers 5 and 10, inclusive.  The third example will substitute the first instance of &lt;strong&gt;find&lt;/strong&gt; with &lt;strong&gt;replace&lt;/strong&gt; on each line in the entire file.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;[text to find]&lt;/strong&gt; and &lt;strong&gt;[text to replace with]&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;These two sections are where the bulk of the work for the substitute command is done.  This is where you identify the text that you want to replace and what you want it to be replaced with.  The real power of these areas comes when you start using regular expressions, which I will cover in a future post.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;[options]&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;The options are where you tell the substitute command how to behave.  If you do not specify any options, then it only performs the substitution on the first match on each line in the specified region.  Here is a list of the options available:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;g&lt;/strong&gt; - This option will perform the substitution on all matches in the specified region&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;c&lt;/strong&gt; - This option will prompt you for confirmation before making substitutions&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;i&lt;/strong&gt; - This option will ignore case when looking for matches&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;The above options can be combined.  For example if you wanted to find do a substitue on al matches ignoring case, you could do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;%s/find/replace/gi&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;Working with files&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;To really be able to use Vim effectively, you're going to have to know how to open and save files as well as exit the program when you are done.  Here is a list of commands for handling these actions:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:e [filename]&lt;/strong&gt; - This will open the file [filename] in Vim&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:w&lt;/strong&gt; - This will save the open file&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:sav [filename]&lt;/strong&gt;  - This will save the open file as [filename]&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:q&lt;/strong&gt; - This will exit Vim&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:q!&lt;/strong&gt; - This will exit Vim, discarding any changes since the last save&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:wq&lt;/strong&gt; - This will save the open file and exit Vim&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;&lt;strong&gt;:x&lt;/strong&gt; - This behaves much like &lt;strong&gt;:wq&lt;/strong&gt;, it will save the open file and exit Vim, but will not save if no changes have been made&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Well, that does it for a pretty basic introduction into Vim.  See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-8276881464035436745?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/8276881464035436745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/vim-introduction.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8276881464035436745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8276881464035436745'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/vim-introduction.html' title='Vim: an Introduction'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-4381194968399825706</id><published>2009-07-15T23:55:00.002-05:00</published><updated>2009-07-16T00:01:37.436-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grep'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><title type='text'>Searching files with grep</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;It is pretty common that you might want to search for text within a file or directory.  The best way to do that is with &lt;strong&gt;grep&lt;/strong&gt;.  The basic way to use &lt;strong&gt;grep&lt;/strong&gt; is:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep [PATTERN] [FILE]&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Searching a single file&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;A simple example would be if you wanted to see all the different Linux kernels that show up in your &lt;strong&gt;/boot/grub/menu.lst&lt;/strong&gt; file, you could:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep kernel /boot/grub/menu.lst&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Searching for multiple strings&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;What if you want to search for multiple strings in one file?  Say, you want to see all the section headings, identifiers, and drivers in your &lt;strong&gt;/etc/X11/xorg.conf&lt;/strong&gt; file.  You could do this by using the &lt;strong&gt;-e&lt;/strong&gt; option, and I'll also use the &lt;strong&gt;-i&lt;/strong&gt; option to ignore case when searching:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -i -e section -e identifier -e driver /etc/X11/xorg.conf&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Searching multiple files&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;It is also possible to use grep on all the files in a directory or just on a couple files that you want using either the &lt;strong&gt;*&lt;/strong&gt; wildcard or by identifying files with the &lt;strong&gt;-f&lt;/strong&gt; option.  For example, let's say I wanted to search all my blog posts saved on my computer for ones that mention ImageMagick:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -i imagemagick ~/blog/*&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Displaying lines before and/or after match&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Sometimes you want to see the context in which the matched text appears.  To do this we can use the following options: &lt;strong&gt;-A&lt;/strong&gt;, for lines after the match; &lt;strong&gt;-B&lt;/strong&gt;, for lines before the match; or &lt;strong&gt;-C&lt;/strong&gt;, for lines on both sides of match.  So, repeating the previous ImageMagick search to display 5 lines of text after the match, 5 lines before the match, or 5 lines on both sides of the match, we could use the following, respectively:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -iA 5 imagemagick ~/blog/*&lt;br /&gt;$ grep -iB 5 imagemagick ~/blog/*&lt;br /&gt;$ grep -iC 5 imagemagick ~/blog/*&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Displaying lines that do &lt;em&gt;not&lt;/em&gt; match&lt;/strong&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You might want to find lines that are not commented out in your &lt;strong&gt;/etc/apt/sources.list&lt;/strong&gt; file.  To do so, we can use the &lt;strong&gt;-v&lt;/strong&gt; option, and we want to find lines that do not contain the &lt;strong&gt;#&lt;/strong&gt; character.  Since the &lt;strong&gt;#&lt;/strong&gt; character is used to comment out lines in Bash, we have to search for this in a way that won't comment out the rest of the command (hint: regular expressions...I plan on doing a post dedicated specifically to the topic of regular expressions in the future), so we can search for this in either of the following two ways:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -v "#" /etc/apt/sources.list&lt;br /&gt;$ grep -v \# /etc/apt/sources.list&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Displaying only file names that contain matches&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;It may be the case that you are really only concerned with the names of the files that contain your search string.  To do this, we can use the &lt;strong&gt;-l&lt;/strong&gt; (lower case L) option.  I'll return to the ImageMagick example above here:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -il imagemagick ~/blog/*&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Displaying the number of matches per file&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To go one step further from the previous example, you can use the &lt;strong&gt;-c&lt;/strong&gt; option to show you the number of matches you have in each file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -ic imagemagick ~/blog/*&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you test out the above example, you'll find that it returns all the files that have no matches as well.  If you only want to show the number of matches on files that actually have matches, we can use a little bit of redirection to pipe the output of one grep command into the input of another grep command (and a little help with regular expressions):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -ic imagemagick ~/blog* | grep -v ":0$"&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Displaying the line numbers for the matches&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Sometimes it is important to know where in a file the matches are, to help find this, we can use the &lt;strong&gt;-n&lt;/strong&gt; option:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ grep -in imagemagick ~/blog/*&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Well, that does is for a pretty basic introduction into &lt;strong&gt;grep&lt;/strong&gt;.  As usual, there are still some other things that you can do with &lt;strong&gt;grep&lt;/strong&gt;.  The biggest thing that you can use with &lt;strong&gt;grep&lt;/strong&gt; that I have not really covered is the use of regular expressions, but that is a topic deserving of its own post.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-4381194968399825706?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/4381194968399825706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/searching-files-with-grep.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4381194968399825706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4381194968399825706'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/searching-files-with-grep.html' title='Searching files with grep'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-7765072569338631936</id><published>2009-07-12T23:55:00.001-05:00</published><updated>2009-07-12T23:55:00.923-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sudo'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><title type='text'>Re-issue Previous Command as Root</title><content type='html'>&lt;span style="font-face: georgia, sans-serif;"&gt;Here's a quick Bash tip.  Don't you just hate it when you key in a command at the terminal and press enter only to realize that you didn't preface the command with &lt;strong&gt;sudo&lt;/strong&gt;?  Well, have no fear, because the command &lt;strong&gt;!!&lt;/strong&gt; will re-issue the previous command.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Now, I know you're probably thinking, "what good does that do me?  I can just press the up arrow and then hit enter to run the last command."  And you'd be right; however, what if you wanted to re-issue the previous command, but you wanted to put &lt;strong&gt;sudo&lt;/strong&gt;at the beginning of it?  Well, you could simply press the up arrow and then move the cursor to the beginning of the prompt and then key in &lt;strong&gt;sudo&lt;/strong&gt; and press the enter key, or you could just do this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ sudo !!&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;The time that this happens to me most frequently is when I want to edit a file, for example, if I wanted to add a new repository to my &lt;strong&gt;/etc/apt/sources.list&lt;/strong&gt; file, and run the following by mistake:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ vim /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;This will open up the &lt;strong&gt;sources.list&lt;/strong&gt; file as read only, a fact which becomes perfectly clear once you change to insert mode in vim, with a &lt;strong&gt;Warning: changing a readonly file&lt;/strong&gt; warning across the bottom of the window.  At this point, it's easy to close the file, and re-open it as root with:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ sudo !!&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Well, that pretty much does it for tonight.  See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-7765072569338631936?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/7765072569338631936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/re-issue-previous-command-as-root.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/7765072569338631936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/7765072569338631936'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/re-issue-previous-command-as-root.html' title='Re-issue Previous Command as Root'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-129638192031262424</id><published>2009-07-09T23:55:00.002-05:00</published><updated>2009-07-09T23:55:00.199-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ImageMagick'/><category scheme='http://www.blogger.com/atom/ns#' term='Image Editing'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><title type='text'>More on ImageMagick</title><content type='html'>&lt;span style="font-face: georgia, sans-serif;"&gt;I've talked about ImageMagick &lt;a href="http://grabag-linux.blogspot.com/2009/05/batch-image-editing-with-imagemagick.html"&gt;before&lt;/a&gt;, and I figured it would be fun to cover some more features available with it.  The reason I like ImageMagick is that it is really convenient for when you want to do the same thing to a large group of pictures.  You may find yourself with some digital pictures that you want to make look more artsy by changing them to black and white or maybe to a sepia tone.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;The first thing I always do before using ImageMagick is to make backup copies of all my pictures I'm going to be editing.  Once you're ready to get started, converting pictures to black and white is really easy:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mogrify -monochrome input.jpg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;It really is that simple.  The above will only convert the image named &lt;strong&gt;input.jpg&lt;/strong&gt;.  If you wanted to do the same thing to all &lt;strong&gt;.jpg&lt;/strong&gt; images in a directory, you could do this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mogrify -monochrome *.jpg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Sepia tone allows for a little more tweaking, because it allows you to input a threshold as a percent of the intensity, ranging from 0 - 99.9%.  This is something that you would want to play with to get the desired result, but from my experience 80% is usually a good starting point.  We could convert an image to sepia tone like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mogrify -sepia-tone 80% input.jpg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;Again, you could use the same command on all &lt;strong&gt;.jgp&lt;/strong&gt; images in a directory:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mogrify -sepia-tone 80% *.jpg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;This still only scratches the surface of what you can do with ImageMagick.  I'll be covering more of the features in future posts.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-face: georgia, sans-serif;"&gt;See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-129638192031262424?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/129638192031262424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/more-on-imagemagick.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/129638192031262424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/129638192031262424'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/more-on-imagemagick.html' title='More on ImageMagick'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-4554870159618248241</id><published>2009-07-05T23:55:00.002-05:00</published><updated>2009-07-05T23:59:34.031-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Favorite applications'/><title type='text'>Favorite Linux Applications</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;I thought I would change things up a little bit this time and talk about some of my favorite Linux applications.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Terminal Emulator&lt;/strong&gt; - Terminator&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you do very much from the terminal, you'll surely find scenarios where you would like to have multiple terminal windows or tabs open at once.  Tabs are great, but if you want to be able to see the contents of multiple terminal windows as once, they don't help.  If you keep opening up new windows, it can become a chore to resize and manage all the windows so that you can see all of what you want.  &lt;strong&gt;Terminator&lt;/strong&gt; takes care of that by allowing you to split your terminal window and drag the split to resize your frames however you want.  The split windows in &lt;strong&gt;Terminator&lt;/strong&gt; allow for more efficient use of screen real estate as you don't have so much space taken up by window borders and decorations.  To install &lt;strong&gt;Terminator&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get install terminator&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Text Editor&lt;/strong&gt; - Vim&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I feel that everyone should know how to use at least one real text editor, and &lt;strong&gt;Vim&lt;/strong&gt; is a great choice because it can run on almost any platform.  &lt;strong&gt;Vim&lt;/strong&gt;, or at least Vi, is installed by default on all Linux systems, so, if you know &lt;strong&gt;Vim&lt;/strong&gt;, you'll always be able to use a text editor on any Linux machine.  Aside from being easily available, &lt;strong&gt;Vim&lt;/strong&gt; is a very powerful and extensible text editor.  &lt;strong&gt;Vim&lt;/strong&gt; can do syntax highlighting and spell checking as well as allowing you to write macros and use regular expressions.  In fact, I use &lt;strong&gt;Vim&lt;/strong&gt; to write all of my posts on here.  To make sure you've the latest version of &lt;strong&gt;Vim&lt;/strong&gt; installed from your repositories:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get install vim&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Web Browser&lt;/strong&gt; - It's a two way tie:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Firefox/Iceweasel - I like &lt;strong&gt;Firefox&lt;/strong&gt; for the great set of add ons available for using it.  Also, it is very easy to get &lt;a href="http://grabag-linux.blogspot.com/2009/05/installing-flash-and-java-in-debian.html"&gt;Java and Flash installed&lt;/a&gt; for &lt;strong&gt;Firefox&lt;/strong&gt; in Debian.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Links2 - I like using &lt;strong&gt;Links2&lt;/strong&gt; for when I'm reading a lot of text in a blog or when I'm reading web comics.  &lt;strong&gt;Links2&lt;/strong&gt; is a great lightweight web browser and has a graphical mode.  To install &lt;strong&gt;Links2&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get install links2&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To launch &lt;strong&gt;Links2&lt;/strong&gt; in graphical mode:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ links2 -g&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Chat Client&lt;/strong&gt; - Naim&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I know that Pidgin is pretty much the standard favorite chat client, but I like the simplicity and the keyboard commands/shortcuts in &lt;strong&gt;Naim&lt;/strong&gt;.  I will admit that &lt;strong&gt;Naim&lt;/strong&gt; does have a bit of a learning curve, as with most console apps, but once you get past that, I find &lt;strong&gt;Naim&lt;/strong&gt; to be a great chat client.  To install &lt;strong&gt;Naim&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get install naim&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Video Player&lt;/strong&gt; - VLC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;From my experience, &lt;strong&gt;VLC&lt;/strong&gt; can play just about anything you throw at it.  It is by far the easiest video player I've used to play DVDs with menus, and the interface is very simple.  To install &lt;strong&gt;VLC&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get install vlc&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Audio Player&lt;/strong&gt; - Songbird&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I like the clean interface and the ability to install add ons to &lt;strong&gt;Songbird&lt;/strong&gt;.  Check out my earlier post on &lt;a href="http://grabag-linux.blogspot.com/2009/05/installing-songbird.html"&gt;installing &lt;strong&gt;Songbird&lt;/strong&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Well, that's a good start for my favorite Linux applications.  What are your favorites?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-4554870159618248241?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/4554870159618248241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/favorite-linux-applications.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4554870159618248241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4554870159618248241'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/favorite-linux-applications.html' title='Favorite Linux Applications'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-834456085325352280</id><published>2009-07-01T23:55:00.000-05:00</published><updated>2009-07-01T23:55:01.314-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install'/><category scheme='http://www.blogger.com/atom/ns#' term='Picasa'/><category scheme='http://www.blogger.com/atom/ns#' term='Photo album'/><title type='text'>Installing Picasa in Debian</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;Everyone needs a good photo album program.  My favorite is Google's &lt;a href="http://picasa.google.com/"&gt;Picasa&lt;/a&gt;: it does a great job at organizing your pictures and even has some good tools for touching up your photos.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We're going to go ahead and set up the Google repositories in Debian so that our package manager will handle upgrades as they become available.  To do this, we will need to add the following to our &lt;strong&gt;/etc/apt/sources.list&lt;/strong&gt; file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# Google repository&lt;br /&gt;deb http://dl.google.com/linux/deb/ stable non-free main&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;As always, you can use your favorite text editor to add this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or, you can use &lt;strong&gt;echo&lt;/strong&gt; and output redirection:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# echo "# Google repository" &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;# echo "deb http://dl.google.com/linux/deb/ stable non-free main" &amp;gt;&amp;gt; /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now that we've got the repository added, we need to add the apt-key so that we can use it without error:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# wget -q -O – https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We are ready to update our packages list:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get update&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now that everything is up to date, we can install Picasa with the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get install picasa&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This should put Picasa on your menu, and you're ready to start using Picasa.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-834456085325352280?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/834456085325352280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/installing-picasa-in-debian.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/834456085325352280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/834456085325352280'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/07/installing-picasa-in-debian.html' title='Installing Picasa in Debian'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-3374844092388623626</id><published>2009-06-28T23:55:00.001-05:00</published><updated>2009-06-28T23:55:02.516-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='keyboard shortcuts'/><category scheme='http://www.blogger.com/atom/ns#' term='Moving Windows'/><title type='text'>Moving Windows with the Title Bar Off Screen</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;In pretty much any operating system, if you want to move a window, you can click and drag the title bar of the window to move it.  This shouldn't come as a surprise; in fact, you should probably be questioning why I'm even mentioning it.  Well, what happens if you have a window open up and the title bar is off screen?  If you use computers long enough, I promise, you will run into this scenario.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You are more likely to run into this situation if you are using a netbook with the standard resolution of 1024x600.  I wouldn't call this a common event with my Mini 9, but I'll be honest, it's happened a few times.  So, what can we do when we find ourselves in this situation?  Well, it turns out that there are a couple of things that we can do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Keyboard only method&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Your Linux distro should have a keyboard shortcut for moving windows.  In Debian, the default is &lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;F7&lt;/strong&gt;.  To find out what the keyboard shortcut for moving windows is on your installation, open up a window (pretty much anything will do..nautilus, firefox, etc.).  Then open the Window Menu for the window you just opened (keyboard shortcut here is &lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;Spacebar&lt;/strong&gt;), and you should see this on the list.  Now to move a window, you simply need to press the keyboard shortcut you found and then you can move the active window with the arrow keys.  You can also simply move the mouse after pressing the keyboard shortcut, and when you click the mouse, the window will stay where you put it.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Keyboard and Mouse combination method&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;There is another default shortcut for moving windows, and I find this one easier to remember.  We simply need to hold the &lt;strong&gt;Alt&lt;/strong&gt; key and click and drag anywhere on the window we wish to move to reposition it.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now you should never have to worry about windows being positioned such that you cannot click and drag the title bar.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-3374844092388623626?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/3374844092388623626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/moving-windows-with-title-bar-off.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3374844092388623626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3374844092388623626'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/moving-windows-with-title-bar-off.html' title='Moving Windows with the Title Bar Off Screen'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-8053860305810978513</id><published>2009-06-24T23:55:00.004-05:00</published><updated>2009-06-25T00:01:10.896-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='redirection'/><category scheme='http://www.blogger.com/atom/ns#' term='command operators'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Bash Tutorial'/><title type='text'>Bash Tutorial: Part 3</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;We're back at it with more about using Bash.  This time, rather than focus on new commands, we'll look at command operators and redirection.  Command operators allow you to run multiple Bash commands in one statement.  Redirection is not just a useful tool when performing magic, it's also a great way to change where the input and/or output of a command come from and/or go.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Command Operators&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To execute multiple commands one after another, we use the &lt;strong&gt;;&lt;/strong&gt; operator.  In other words, the first command specified will run until completion before the second command starts.  For example, if you want to update your index for the &lt;strong&gt;locate&lt;/strong&gt; command and then search for the &lt;strong&gt;xorg.conf&lt;/strong&gt;, we would do the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# updatedb ; locate xorg.conf&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The above is essentially the same as running this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# updatedb&lt;br /&gt;# locate xorg.conf&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Executing commands in rapid succession all on one line is cool, but it can be more useful to run multiple commands all at the same time.  For example, if you wanted to write a Bash script to launch firefox, pidgin, and songbird all at once, the important piece would be the following command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ firefox &amp;amp; pidgin &amp;amp; songbird&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Another use for the &lt;strong&gt;&amp;amp;&lt;/strong&gt; operator is if you want to run a command in the background.  In other words, if you would like to run a command, but instead of waiting for the command to finish to regain control of the terminal, the control will immediately be returned and your computer will continue executing the command in the background.  To do this, you simply end your command with &lt;strong&gt;&amp;amp;&lt;/strong&gt;.  If you wanted to update your index for the &lt;strong&gt;locate&lt;/strong&gt; command, but don't want to wait for this to finish, you could do the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# updatedb &amp;amp;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Redirection&lt;/strong&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Sometimes, the output of a command isn't immediately important, but you would like to save a record of it for later.  To do that, we can use the &lt;strong&gt;&amp;gt;&lt;/strong&gt; operator to create a new file, or overwrite an existing file, with the output of a command.  For example, if you're trying to troubleshoot a networking problem, you might want someone to look at the output of the &lt;strong&gt;ifconfig&lt;/strong&gt; command on your system.  To save this output, you can do the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# ifconfig &amp;gt; output.txt&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Sometimes you want the output of a command to write to a file, but you don't want to lose the existing contents of that file.  In this case, we can use the &lt;strong&gt;&amp;gt;&amp;gt;&lt;/strong&gt; operator to append the output to the end of the specified file.  For example, if you want to add the output of the &lt;strong&gt;lsmod&lt;/strong&gt; command to the output file we just created, we could do the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# lsmod &amp;gt;&amp;gt; output.txt&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you have read some of my other posts, you have seen me use the two above redirection operators in conjunction with the &lt;strong&gt;echo&lt;/strong&gt; command to create or add to files that control the behavior of some parts of the computer.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&amp;lt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;There are also cases where you might want to specify the input of a command or program from a file.  One example I can think of is if you have a text file that you would like to sort, you could use this as the input for the &lt;strong&gt;sort&lt;/strong&gt; command like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ sort &amp;lt; unsorted.txt&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Of course, the above will simply output the text from &lt;strong&gt;unsorted.txt&lt;/strong&gt; to the screen in sorted order.  If we wanted to save the sorted version of the text file, we could combine input and output redirection to accomplish this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ sort &amp;lt; unsorted.txt &amp;gt; sorted.txt&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The &lt;strong&gt;&amp;lt;&amp;lt;&lt;/strong&gt; operator acts basically as a simple line based text editor.  If you remember, we used it in the &lt;a href="http://grabag-linux.blogspot.com/2009/05/installing-songbird.html"&gt;Installing Songbird&lt;/a&gt; post as an option for creating the Bash script to launch Songbird.  Here's an example of the &lt;strong&gt;&amp;lt;&amp;lt;&lt;/strong&gt; operator with the &lt;strong&gt;sort&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ sort &amp;lt;&amp;lt; EOF&lt;br /&gt;&amp;gt; 3&lt;br /&gt;&amp;gt; 1&lt;br /&gt;&amp;gt; 2&lt;br /&gt;&amp;gt; EOF&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;For another example, I've included the section where we used this in the Songbird post.  In this example we use both input and output redirection to create a Bash script without dealing with a real text editor:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# cat &amp;gt; /usr/share/Songbird/launcher.sh &amp;lt;&amp;lt; EOF&lt;br /&gt;&amp;gt; #!/bin/sh&lt;br /&gt;&amp;gt; cd /usr/share/Songbird&lt;br /&gt;&amp;gt; ./songbird&lt;br /&gt;&amp;gt; EOF&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;|&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Pipes.  Saving the best for last here, pipes allow you to redirect the standard output of one command to the standard input of another command.  That may sound a little confusing as you read it, but let me give an example, that may clear things up:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ls -al | less&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Using what we have learned about Bash command operators, the above command is basically the same thing as:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ls -al &amp;gt; temp.txt ; less temp.txt ; rm temp.txt&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;As you can see, piping commands is powerful and can save a bit of typing.  My favorite use of pipes is with the &lt;strong&gt;grep&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ps -ef | grep firefox&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt; I'll cover both the &lt;strong&gt;ps&lt;/strong&gt; and &lt;strong&gt;grep&lt;/strong&gt; commands in future posts, but the above will give you information about any processes running on your system that have firefox as part of the process name.  The above would be the same as the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ps -ef &amp;gt; temp.txt ; grep firefox temp.txt ; rm temp.txt&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That does it for Part 3 of the introduction to Bash.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-8053860305810978513?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/8053860305810978513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/bash-tutorial-part-3.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8053860305810978513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8053860305810978513'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/bash-tutorial-part-3.html' title='Bash Tutorial: Part 3'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-3538068607506199056</id><published>2009-06-21T23:55:00.002-05:00</published><updated>2009-06-24T17:49:05.439-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cat'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Bash Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='less'/><title type='text'>Bash Tutorial: Part 2</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;For part 2 of my Bash tutorial, I didn't have the time to make it as big as I had wanted, so it's a little shorter.  Let's get started.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Displaying file contents&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;cat&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Concatenate files.  The &lt;strong&gt;cat&lt;/strong&gt; command can be used to type out the contents of a file or of multiple files.  To type out the contets of your &lt;strong&gt;/etc/apt/sources.list&lt;/strong&gt; file, just do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cat /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to type out the contents of multiple files right after each other, just do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cat file1 file2 file3&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;less&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;less&lt;/strong&gt; is similar to &lt;strong&gt;cat&lt;/strong&gt; for displaying the contents of a single file.  However, &lt;strong&gt;less&lt;/strong&gt; is much better than &lt;strong&gt;cat&lt;/strong&gt; for large files.  If you use &lt;strong&gt;cat&lt;/strong&gt; on a large file, you will only be able to see the end of the file because the contents would have scrolled out of view and even beyond the scroll buffer.  &lt;strong&gt;less&lt;/strong&gt; allows you to scroll through the entire contents of the file with the up and down arrows as well as the page up and page down keys.  To use &lt;strong&gt;less&lt;/strong&gt; to display the contents of your &lt;strong&gt;/etc/apt/sources.list&lt;/strong&gt; file, just do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ less /etc/apt/sources.list&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That's all for now.  Next time we'll be back with part3.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-3538068607506199056?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/3538068607506199056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/bash-tutorial-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3538068607506199056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3538068607506199056'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/bash-tutorial-part-2.html' title='Bash Tutorial: Part 2'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-6348722420670892834</id><published>2009-06-17T23:55:00.003-05:00</published><updated>2009-06-24T17:50:35.185-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rm'/><category scheme='http://www.blogger.com/atom/ns#' term='pwd'/><category scheme='http://www.blogger.com/atom/ns#' term='man'/><category scheme='http://www.blogger.com/atom/ns#' term='mv'/><category scheme='http://www.blogger.com/atom/ns#' term='info'/><category scheme='http://www.blogger.com/atom/ns#' term='rmdir'/><category scheme='http://www.blogger.com/atom/ns#' term='cd'/><category scheme='http://www.blogger.com/atom/ns#' term='mkdir'/><category scheme='http://www.blogger.com/atom/ns#' term='cp'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Bash Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='ls'/><title type='text'>Bash Tutorial: Part 1</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;I know a lot of people get scared any time the command line comes up when using a computer.  Really, the command line shouldn't be scary, and learning how to use the command line in any operating system will only make you better at using your computer.  As such, I figured I would do a couple posts as an introduction into the Linux shell I use most: the Bourne-again shell (Bash).  Let's get started.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Moving around the shell&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;pwd&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Print working directory.  When you first open a shell, it starts you in your home directory, usually &lt;strong&gt;/home/[username]&lt;/strong&gt;, also abbreviated &lt;strong&gt;~&lt;/strong&gt;.  If you're ever not sure what directory you're currently working in, the pwd command will tell you:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ pwd&lt;br /&gt;/home/[username]&lt;br /&gt;$&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;ls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;List files.  If you want to see what files and folders are in a directory, ls is the command to do it.  If you just want to see the contents of the current directory, just use:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ls&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;In Linux, files whose name begin with &lt;strong&gt;.&lt;/strong&gt; are hidden.  To list the contents of the current directory and show hidden files, use:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ls -a&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to see more information about the files, such as who has permissions to read, run, and execute files; the owning user and group; the file size; and the last date modified, just use:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ls -l&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The &lt;strong&gt;ls&lt;/strong&gt; command does not simply restrict you to looking at files in your current working directory; you can look inside any directory you want.  To see the long listing of all files in the &lt;strong&gt;/usr/bin&lt;/strong&gt; directory, just use:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ls -al /usr/bin&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;cd&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Change directories.  Now that we've covered how to see your current working directory and listing files within directories, the next place to go is to change directories.  In order to change directories to &lt;strong&gt;/etc/X11&lt;/strong&gt;, just do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cd /etc/X11&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We can also use &lt;strong&gt;..&lt;/strong&gt; to move up a level:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ pwd&lt;br /&gt;/lib/modules/2.6.26-2-686/kernel/net/ipv6&lt;br /&gt;$ cd ..&lt;br /&gt;$ pwd&lt;br /&gt;/lib/modules/2.6.26-2-686/kernel/net&lt;br /&gt;$ cd ../..&lt;br /&gt;$ pwd&lt;br /&gt;/lib/modules/2.6.26-2-686&lt;br /&gt;$ cd ../2.6.26-1-686&lt;br /&gt;$ pwd&lt;br /&gt;/lib/modules/2.6.26-1-686&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Working with files&lt;/strong&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;cp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Copy.  The basic syntax for the &lt;strong&gt;cp&lt;/strong&gt; command is:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cp [source file] [destination file]&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;For example, if you wanted to make a backup copy of your &lt;strong&gt;.bashrc&lt;/strong&gt; file before making changes:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cp .bashrc .bashrc-backup&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This is a good for copying single files, but if you want to make a copy of an entire directory, we can use the &lt;strong&gt;-r&lt;/strong&gt; option to do a recursive copy:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cp -r Documents Documents-backup&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;mv&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Move.  The &lt;strong&gt;mv&lt;/strong&gt; command works similar to &lt;strong&gt;cp&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mv [source file] [destination file or directory]&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to simply rename your &lt;strong&gt;.bashrc-backup&lt;/strong&gt; file to fix edits made to your &lt;strong&gt;.bashrc&lt;/strong&gt; file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mv .bashrc-backup .bashrc&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to move a file into a different directory:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mv .bahsrc-backup Backup/&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you need to move or rename a directory, it works exactly the same with the mv command as moving files.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;mkdir&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Make directory.  If you want to create a new directory for all your digital pictures, just do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mkdir Pictures&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You can also create a any missing parent directories with the &lt;strong&gt;-p&lt;/strong&gt; option:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mkdir -p Pictures/Vacation/2009&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;rm&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Remove.  If you want to delete the &lt;strong&gt;.bashrc-backup&lt;/strong&gt; file, just do:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ rm .bashrc-backup&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to delete a directory and all the files and subdirectories within it, you can use the &lt;strong&gt;-r&lt;/strong&gt; recursive option:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ rm -r /Pictures/Vacation/2009&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;rmdir&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Remove directory.  If you want to delete a directory, you can use the &lt;strong&gt;rmdir&lt;/strong&gt; command.  The &lt;strong&gt;rmdir&lt;/strong&gt; command requires that the directory that you're trying to delete is empty:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ rmdir Pictures/Vacation/2009&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Similar to the recursive option that we've seen with other commands, we have the &lt;strong&gt;-p&lt;/strong&gt; parents option to use with &lt;strong&gt;rmdir&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ rmdir -p Pictures/Vacation/2009&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The above behaves the same as the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ rmdir Pictures/Vacation/2009&lt;br /&gt;$ rmdir Pictures/Vacation&lt;br /&gt;$ rmdir Pictures&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Learning more&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We've covered a lot in this post, but there is still more that can be done with the above commands.  Here are some resources that are available to learn more of the options available.&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;man&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Manual.  The &lt;strong&gt;man&lt;/strong&gt; command will bring up what is called the "man pages" for other commands.  The man pages describe the syntax and available options for bash commands and programs.  The syntax for &lt;strong&gt;man&lt;/strong&gt; is as follows:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ man [command]&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;So, if you wanted to see more information about the &lt;strong&gt;cp&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ man cp&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;info&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Information.  The &lt;strong&gt;info&lt;/strong&gt; command is similar to the &lt;strong&gt;man&lt;/strong&gt; command, but the info pages can be a little easier to learn from if you're not used to reading man pages.  If you want to see the info page for the &lt;strong&gt;cp&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ info cp&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That does it for Part 1 of the introduction to Bash.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-6348722420670892834?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/6348722420670892834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/bash-tutorial-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/6348722420670892834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/6348722420670892834'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/bash-tutorial-part-1.html' title='Bash Tutorial: Part 1'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-8568257563328594147</id><published>2009-06-14T23:55:00.003-05:00</published><updated>2009-06-14T23:57:35.220-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='scheduling commands'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='crontab'/><title type='text'>Scheduling Commands with Crontab</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;A common thing to want to do is to schedule a command to run at a specific time.  We can do with with &lt;strong&gt;cron&lt;/strong&gt; using the &lt;strong&gt;crontab&lt;/strong&gt; command.  By default, all users have permissions to use &lt;strong&gt;crontab&lt;/strong&gt;; however, this can be changed by the existence of one of two files:&lt;/sytle&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;/etc/cron.allow&lt;/strong&gt; - Only users listed in this file can use &lt;strong&gt;crontab&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;/etc/cron.deny&lt;/strong&gt; - Users listed in this file cannot user &lt;strong&gt;crontab&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To see what you have scheduled via &lt;strong&gt;crontab&lt;/strong&gt;, you can run the following command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ crontab -l&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to see what is scheduled to be run as a different user, you can use the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# crontab -u [username] -l&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Where you would replace &lt;strong&gt;[username]&lt;/strong&gt; with the appropriate username.  Entries in the crontab file have the following syntax:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;[m] [h] [dom] [mon] [dow] [command]&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now, I'll explain the above:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;[m]&lt;/strong&gt; - Minute to run; represented as a number: 0-59&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;[h]&lt;/strong&gt; - Hour to run; represented as a number in: 0-23&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;[dom]&lt;/strong&gt; - Day of Month to run; represented as a number: 1-31&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;[mon]&lt;/strong&gt; - Month to run; represented as a number: 1-12&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;[dow]&lt;/strong&gt; - Day of Week to run; represented as a number: 0-6 (Sunday is 0)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;[command]&lt;/strong&gt; - Command to run&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;All of the timing options above can be replaced by an &lt;strong&gt;*&lt;/strong&gt; where necessary to have your command run for all possibilities of that option.  For example, in my post on &lt;a href="http://grabag-linux.blogspot.com/2009/06/finding-files-on-your-computer.html"&gt;locating files&lt;/a&gt; I mentioned scheduling the &lt;strong&gt;updatedb&lt;/strong&gt; command.  Let's say we want to schedule this command to run every morning at 6:30 am, then we would put the following into the root user's crontab file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;30 6 * * * updatedb&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You can also use a comma separated list for the timing options to have a command run at multiple timings.  For example, I have the bad habit of staying on my computer too late at night when I should be going to bed.  To try to correct this, in the past, I have scheduled my computer to shutdown at 11:00 pm on Sunday through Thursday nights:&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;55 22 * * 0,1,2,3,4 shutdown -h +5&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now that we see the necessary syntax for entries in the crontab file, how do we use the &lt;strong&gt;crontab&lt;/strong&gt; command to edit the file to schedule our commands?  We can use the following to create or edit a user's crontab file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ crontab -e&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The above will open your current user's crontab file in the current user's default text editor.  Once here, you simply need to put in the entries you would like using the above syntax to schedule them.  There are some other options that you can use with the &lt;strong&gt;crontab&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;-l [username]&lt;/strong&gt; - Displays &lt;strong&gt;[username]&lt;/strong&gt;'s crontab file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;-r [username]&lt;/strong&gt; - Removes &lt;strong&gt;[username]&lt;/strong&gt;'s crontab file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;-u [username]&lt;/strong&gt; - Runs the specified contab command on &lt;strong&gt;[username]&lt;/strong&gt;'s crontab file&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That pretty much does it for a basic introduction to scheduling commands with &lt;strong&gt;crontab&lt;/strong&gt;.&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-8568257563328594147?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/8568257563328594147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/scheduling-commands-with-crontab.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8568257563328594147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8568257563328594147'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/scheduling-commands-with-crontab.html' title='Scheduling Commands with Crontab'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-6924325123066448149</id><published>2009-06-10T23:55:00.001-05:00</published><updated>2009-06-10T23:55:01.054-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='updatedb'/><category scheme='http://www.blogger.com/atom/ns#' term='locate'/><category scheme='http://www.blogger.com/atom/ns#' term='find files'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><title type='text'>Finding Files on Your Computer</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;It happens to all of us, we forget where files are saved.  The good news is that with the &lt;strong&gt;locate&lt;/strong&gt; command is a great way to find files on your computer.  Before we can use the locate command, we've got to build an index of the files on our computer, which is easy enough: we just need to use the &lt;strong&gt;updatedb&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# updatedb&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;It is a good idea to periodically run the &lt;strong&gt;updatebd&lt;/strong&gt; command to keep your index current when you go to search for files.  All you need to know to search for files is to know all or part of the file name.  For example, if you couldn't remember where the &lt;strong&gt;xorg.conf&lt;/strong&gt; file is saved, you can search for it like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ locate xorg.conf&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Here is an example output of the above command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ locate xorg.conf&lt;br /&gt;/etc/X11/xorg.conf&lt;br /&gt;/usr/share/man/man5/xorg.conf.5.gz&lt;br /&gt;/var/lib/x11/xorg.conf.md5sum&lt;br /&gt;/var/lib/x11/xorg.conf.roster&lt;br /&gt;$&lt;/div&gt;&lt;br /&gt; &lt;span style="font-family: georgia, sans-serif;"&gt;Alternatively, if you were looking for the &lt;strong&gt;xorg.conf&lt;/strong&gt; file, but could only remember that the filename started with &lt;strong&gt;xorg.&lt;/strong&gt;, you could search for it like the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ locate /xorg.&lt;br /&gt;/etc/X11/xorg.conf&lt;br /&gt;/usr/share/X11/xkb/rules/xorg.lst&lt;br /&gt;/usr/share/X11/xkb/rules/xorg.xml&lt;br /&gt;/usr/share/man/man5/xorg.conf.5.gz&lt;br /&gt;/var/lib/dpkg/info/xorg.list&lt;br /&gt;/var/lib/dpkg/info/xorg.md5sums&lt;br /&gt;/var/lib/x11/xorg.conf.md5sum&lt;br /&gt;/var/lib/x11/xorg.conf.roster&lt;br /&gt;$&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;There is more that can be done with the &lt;strong&gt;locate&lt;/strong&gt; command, but this has covered about 98% of the times I've used it.  I'll probably cover some more of these features in a later post.  Another thing that is useful is to schedule the &lt;strong&gt;updatedb&lt;/strong&gt; command via &lt;strong&gt;cron&lt;/strong&gt;, which we'll be discussing next time.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-6924325123066448149?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/6924325123066448149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/finding-files-on-your-computer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/6924325123066448149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/6924325123066448149'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/finding-files-on-your-computer.html' title='Finding Files on Your Computer'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-4074782001034250602</id><published>2009-06-07T23:55:00.000-05:00</published><updated>2009-06-07T23:55:00.406-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gconf-editor'/><category scheme='http://www.blogger.com/atom/ns#' term='gconf'/><category scheme='http://www.blogger.com/atom/ns#' term='laptop display'/><title type='text'>Turn Off Your Laptop Display</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;One thing I find inconvenient about laptops is that they typically do not have a power button for the display the way standard monitors do for desktop computers.  It turns out that if you have ACPI enabled in your kernel, there's an easy way to create a keyboard shortcut to turn off your laptop display.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;First thing, we can test to make sure this will work by running the following command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ xset dpms force off&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That should turn off your laptop monitor until you move the mouse or type on the keyboard.  Now to assign the keyboard shortcut, we need to open the configuration editor with the following command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ gconf-editor&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You'll want to navigate the tree view on the left to the following path: &lt;strong&gt;/apps/metacity/keybinding_commnads&lt;/strong&gt;.  In the right panel you'll see that it lets you assign 12 commands (numbered 1 through 12).  Just pick an empty one and assign it the following value:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;xset dpms force off&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Next you will want to find the following path on the tree view on the left: &lt;strong&gt;/apps/metacity/global_keybindings&lt;/strong&gt;.  Here you will see entries named &lt;strong&gt;run_command_x&lt;/strong&gt; for &lt;strong&gt;x&lt;/strong&gt; between 1 and 12.  You will want to find the command that you edited earlier and in the &lt;strong&gt;Value&lt;/strong&gt; space, type in the shortcut you want to run this with.  For example, on the Mini 9, since Sleep is mapped to &lt;strong&gt;Fn&lt;/strong&gt;+&lt;strong&gt;1&lt;/strong&gt;, I decided to map this to &lt;strong&gt;Alt&lt;/strong&gt;+&lt;strong&gt;1&lt;/strong&gt;.  To do this, I used the following value:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;&amp;lt;Alt&amp;gt;1&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Once you do that, you can test your keyboard shortcut and then close out of the configuration editor.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-4074782001034250602?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/4074782001034250602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/turn-off-your-laptop-display.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4074782001034250602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4074782001034250602'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/turn-off-your-laptop-display.html' title='Turn Off Your Laptop Display'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-1801574674036798267</id><published>2009-06-03T23:55:00.001-05:00</published><updated>2009-06-03T23:55:00.947-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Raster'/><category scheme='http://www.blogger.com/atom/ns#' term='ImageMagick'/><category scheme='http://www.blogger.com/atom/ns#' term='Inkscape'/><category scheme='http://www.blogger.com/atom/ns#' term='Image Editing'/><category scheme='http://www.blogger.com/atom/ns#' term='.svg'/><category scheme='http://www.blogger.com/atom/ns#' term='Vector'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='.png'/><title type='text'>Convert Raster Graphics to Vector Graphics</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;Have you ever wanted to convert a raster image (.jpg, .png, etc.) to a vector image (.svg)?  Maybe not yet, but in my post on &lt;a href="http://grabag-linux.blogspot.com/2009/05/installing-songbird.html"&gt;Installing Songbird&lt;/a&gt;, when we added Songbird to the menu, we did not have an icon to set for the menu item.  It turns out that this is because we need a &lt;strong&gt;.svg&lt;/strong&gt; image and the Songbird tarball only came with a &lt;strong&gt;.png&lt;/strong&gt; image.  No worries, though, we'll go through converting raster to vector and, specifically, how to convert the &lt;strong&gt;songbird.png&lt;/strong&gt; image to a vector image for use on our menu.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;In order to do this, we're going to make use of two programs: &lt;strong&gt;ImageMagick&lt;/strong&gt; and &lt;strong&gt;Inkscape&lt;/strong&gt;.  ImageMagick is a powerful command line utility for all kinds of graphics manipulations.  Inkscape is more widely known as an open source GUI vector graphics editor; however, it also comes with its own set of command line tools.  Let's make sure we have these two programs installed:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get update&lt;br /&gt;# apt-get install imagemagick inkscape&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;While it is possible to do this though the Inkscape GUI, I find the whole process easier and faster right from the command line.  We will use ImageMagick to resize images, if necessary (refer to my first &lt;a href="http://grabag-linux.blogspot.com/2009/05/batch-image-editing-with-imagemagick.html"&gt;ImageMagick post&lt;/a&gt; if you have questions about resizing images with ImageMagick), and we will use Inkscape to do the actual conversion.  The command to do the actual conversion is actually very simple:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ inkscape InputImage.png --export-plain-svg=OutputImage.svg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;When you run this command, expect to see a message similar to the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;(inkscape:30498): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion `quark &amp;gt; 0' failed&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This is OK, your image still got converted.  Now, let's use this to get the &lt;strong&gt;songbird.png&lt;/strong&gt; image in place for use on our menu.  Let's start by copying the &lt;strong&gt;songbird.png&lt;/strong&gt; image into out home directory to make things easier:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cp /usr/share/Songbird/songbird.png ~/&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now we can use the &lt;strong&gt;mogrify&lt;/strong&gt; command to resize this to a 48x48 pixel image and then use the &lt;strong&gt;inkscape&lt;/strong&gt; command to convert this to &lt;strong&gt;songbird.svg&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mogrify -resize 48x48 songbird.png&lt;br /&gt;$ inkscape songbird.png --export-plain-svg=songbird.svg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now, we'll just copy our new &lt;strong&gt;songbird.svg&lt;/strong&gt; image into the same directory as all the other menu icons:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# cp songbird.svg /usr/share/icons/hicolor/scalable/apps/&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If we set up Songbird in your menu the way &lt;a href="http://grabag-linux.blogspot.com/2009/05/installing-songbird.html"&gt;I described before&lt;/a&gt;, then all we will need to do is to restart X (&lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;Backspace&lt;/strong&gt;) and our new &lt;strong&gt;songbird.svg&lt;/strong&gt; image should should show up in our menu.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-1801574674036798267?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/1801574674036798267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/convert-raster-graphics-to-vector.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/1801574674036798267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/1801574674036798267'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/06/convert-raster-graphics-to-vector.html' title='Convert Raster Graphics to Vector Graphics'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-5576164761985964632</id><published>2009-05-31T23:55:00.002-05:00</published><updated>2009-05-31T23:55:00.341-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ImageMagick'/><category scheme='http://www.blogger.com/atom/ns#' term='Image Editing'/><category scheme='http://www.blogger.com/atom/ns#' term='Command Line Tricks'/><title type='text'>Batch Image Editing with ImageMagick</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;If you take a lot of digital pictures, you may find that there are times when you want to do the same thing to a group of images.  You could use the GIMP to edit all of your pictures one at a time, but that is a time-consuming process, especially if you just want to make thumbnails of your vacation pictures.  The good thing is that there is a simple, yet powerful, command line utility that you can use to edit photos en masse: ImageMagick.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Let's start by making sure that we have ImageMagick installed:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get update&lt;br /&gt;# apt-get install imagemagick&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I'm going to start by going over two of the features of ImageMagick that I use the most frequently: resizing and cropping images.  There are a lot more features available in ImageMagick, and I will probably cover more of them future posts.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Batch Resizing Images&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Digital SLR cameras are great for taking high quality pictures, the problem is that they typically take very large pictures that are too large for a lot of uses, such as posting on a blog or using in a presentation.  Generally, the first thing I will do is open one of my pictures in the gthumb or some other image viewer that allows me to zoom in and out to find the percentage I want to shrink the images to.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The next thing I do is I will make copies of all my images that I am going to edit so that I can retain the originals; I do this in a separate directory to minimize my own confusion:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cd /[path-to-images]/&lt;br /&gt;$ mkdir thumb&lt;br /&gt;$ cp *.jpg thumb/&lt;br /&gt;$ cd thumb&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now, we just use the &lt;strong&gt;mogrify&lt;/strong&gt; command with the &lt;strong&gt;-resize&lt;/strong&gt; option to resize our images.  Let's say we want to resize them all to 20% of their original size:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mogrify -resize 20% *.jpg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Depending on the number of images you are resizing, this command may take a little bit to run, but it is a lot faster than editing each image by hand.  If you wanted to resize your images to a specific size, say to create background images for your Mini 9, we would specify 1024x600 pixels rather than a percent:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mogrify -resize 1024x600 *.jpg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That pretty much does it for resizing pictures with ImageMagick.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Batch Cropping Images&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;For my post on &lt;a href=""&gt;Installing Debian&lt;/a&gt;, I ran the installation in VirtualBox and took screen shots of the VirtualBox window to get the images I posted.  The problem with this was, there was some of the window showing in the screen shots that I did not want to include in my post as you can see below:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iPZ-XYa4r7U/SiNDIUIGydI/AAAAAAAAADE/AvByz2ZICv0/s1600-h/WithBorder.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 273px;" src="http://1.bp.blogspot.com/_iPZ-XYa4r7U/SiNDIUIGydI/AAAAAAAAADE/AvByz2ZICv0/s320/WithBorder.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5342187393112263122" title="Original screen shot with VirtualBox border" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The good news is that this window border was identical on all of my screen shots, so I just had to figure out what I needed to crop on one image, and I could use that information in ImageMagick to crop all of the screen shots that I took.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;In order to figure out what I needed to crop, I opened one of the images in the GIMP.  Using either the rectangle selection or the crop tool, I selected the region that I wanted to crop out of the image.  Then looking on the tool window, I was able to see the position of the top-left corner of the selection as well as the dimensions of the selection:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_iPZ-XYa4r7U/SiNDIkgjDuI/AAAAAAAAADM/CQ7ST8TRPJY/s1600-h/Offsets.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 258px;" src="http://3.bp.blogspot.com/_iPZ-XYa4r7U/SiNDIkgjDuI/AAAAAAAAADM/CQ7ST8TRPJY/s320/Offsets.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5342187397509746402" title="Size and Offsets gathered via GIMP" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The &lt;strong&gt;Position&lt;/strong&gt; section, indicated above in red, is what we will use for our offset with &lt;strong&gt;mogrify&lt;/strong&gt;, and the &lt;strong&gt;Size&lt;/strong&gt; section, indicated above in blue, is what we will use to define the size of the area we want to crop.  We just need to use the information above with the &lt;strong&gt;mogrify&lt;/strong&gt; command with the &lt;strong&gt;-crop&lt;/strong&gt; option.  But first, we'll copy the images to keep a record of the originals:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cd /[path-to-images]/&lt;br /&gt;$ mkdir cropped-images&lt;br /&gt;$ cp *.png cropped-images/&lt;br /&gt;$ cd cropped-images&lt;br /&gt;$ mogrify -crop 639x480+1+44! *.png&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The exclamation point in the above command is there to make ImageMagick move the viewport for the image to the same as the crop offset.  That may sound a little confusing, so I've included a screen shot of what a picture looks like in the GIMP if you don't use the exclamation point in the above command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SiNDI-djZxI/AAAAAAAAADU/WbT7dUZnZuU/s1600-h/GIMP-Unmoved.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 314px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SiNDI-djZxI/AAAAAAAAADU/WbT7dUZnZuU/s320/GIMP-Unmoved.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5342187404476507922" title="Cropped Image in GIMP without moving the viewport" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;So, you are best to use the exclamation point in the command, and when you use it, you're picture will look like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SiNDJJOybQI/AAAAAAAAADc/axnMvdp71V0/s1600-h/GIMP-Moved.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 284px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SiNDJJOybQI/AAAAAAAAADc/axnMvdp71V0/s320/GIMP-Moved.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5342187407367367938" title="Cropped Image in GIMP with moving the viewport" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That's about all there is for batch cropping images with ImageMagick&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-5576164761985964632?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/5576164761985964632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/batch-image-editing-with-imagemagick.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/5576164761985964632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/5576164761985964632'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/batch-image-editing-with-imagemagick.html' title='Batch Image Editing with ImageMagick'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iPZ-XYa4r7U/SiNDIUIGydI/AAAAAAAAADE/AvByz2ZICv0/s72-c/WithBorder.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-2968061200502624026</id><published>2009-05-27T23:55:00.004-05:00</published><updated>2009-05-27T23:57:50.817-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><category scheme='http://www.blogger.com/atom/ns#' term='Songbird'/><title type='text'>Installing Songbird</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to use Songbird as a media player in Debian, you may run into some problems since there isn't a Songbird .deb installation file compatible with Debian.  You're in luck, though, because it's not too difficult to install from the tarball available from the &lt;a href="http://getsongbird.com/"&gt;Songbird website&lt;/a&gt;.  We'll start in the logical place by downloading the tarball &lt;a href"http://download.songbirdnest.com/installer/linux/i686/Songbird_1.1.2-1042_linux-i686.tar.gz"&gt;here&lt;/a&gt;, or you can use &lt;strong&gt;wget&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ wget http://download.songbirdnest.com/installer/linux/i686/Songbird_1.1.2-1042_linux-i686.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now we want to untar the installation file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# tar -xvf Songbird_1.1.2-1042_linux-i686.tar.gz -C /usr/share/&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The above will create a directory &lt;strong&gt;Songbird&lt;/strong&gt; inside &lt;strong&gt;/usr/share/&lt;/strong&gt;.  This way we can keep things clear in your home directory.  In theory, we could actually run Songbird right now; however, we can do a few easy things to make it much easier to use Songbird.  First thing, we're going to create a shell script, &lt;strong&gt;/usr/share/Songbird/launcher.sh&lt;/strong&gt;, containing the following text:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;#!/bin/sh&lt;br /&gt;cd /usr/share/Songbird&lt;br /&gt;./songbird&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We can create this file with our favourite text editor or straight from the command line with &lt;strong&gt;cat&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim /usr/share/Songbird/launcher.sh&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit /usr/share/Songbird/launcher.sh&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# cat &amp;gt; /usr/share/Songbird/launcher.sh &amp;lt;&amp;lt; EOF&lt;br /&gt;#!/bin/sh&lt;br /&gt;cd /usr/share/Songbird&lt;br /&gt;./songbird&lt;br /&gt;EOF&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The next thing we need to do is to change the permissions on the &lt;strong&gt;/usr/share/Songbird&lt;/strong&gt; directory and all child objects so that users other than root can run Songbird:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# chmod 755 -R /usr/share/Songbird&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now the next thing we want is to be able to launch Songbird simply by typing &lt;strong&gt;songbird&lt;/strong&gt; into the terminal, the run prompt, or deskbar.  We can do that simply by creating a symbolic link to the shell script we just created:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# ln -s /usr/share/Songbird/launcher.sh /usr/bin/songbird&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now you can go ahead and test this out simply by typing &lt;strong&gt;songbird&lt;/strong&gt; into the terminal, run prompt, or deskbar.  The next thing that many people will probably ask for is to add Songbird to their menu.  We just need to run &lt;strong&gt;alacarte&lt;/strong&gt; to do this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ alacarte&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Alacarte should also be accessible from the System menu (&lt;strong&gt;System&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Preferences&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Main Menu&lt;/strong&gt;).  You'll want to select the menu item you would like Songbird to appear under in the &lt;strong&gt;Menus&lt;/strong&gt; panel to the left, and then click the &lt;strong&gt;New Item&lt;/strong&gt; button on the right.  In the &lt;strong&gt;Create Launcher&lt;/strong&gt; window, you'll want to use the following settings:&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Type&lt;/strong&gt; - Application&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Name&lt;/strong&gt; - Songbird&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Command&lt;/strong&gt; - songbird&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Comment&lt;/strong&gt; - &lt;em&gt;Whatever description you would like, or leave it blank&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Click &lt;strong&gt;OK&lt;/strong&gt; to create the launcher and then make sure the &lt;strong&gt;Show&lt;/strong&gt; checkbox is checked for Songbird in the &lt;strong&gt;Items&lt;/strong&gt; panel in the middle.  Then click close and you will now be able to launch Songbird from your menu.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Enjoy listening to your music in Songbird.  See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-2968061200502624026?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/2968061200502624026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-songbird.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2968061200502624026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2968061200502624026'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-songbird.html' title='Installing Songbird'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-6226598982661511907</id><published>2009-05-24T23:55:00.004-05:00</published><updated>2009-05-25T10:44:47.742-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Raising Skinny Elephants'/><category scheme='http://www.blogger.com/atom/ns#' term='Skinny Elephant'/><title type='text'>Raising Skinny Elephants</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;Even with as stable as Linux is, at some point, you will probably run into a situation where your system becomes unresponsive.  Most of the time, restarting X by pressing &lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;Backspace&lt;/strong&gt; will take care of the problem.  However, if you are unfortunate enough to find yourself in a situation where your machine will not respond to this, there is still something you may be able to do: Raise the Skinny Elephant.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I know this sounds pretty silly, but it is just a mnemonic device to help you remember what to do.  Before I explain that, let's check to make sure your system has the &lt;strong&gt;sysrq&lt;/strong&gt; key enabled:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ ls /proc/sys/kernel/sysrq&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If your system finds this, then it is enabled.  On most keyboards, the &lt;strong&gt;sysrq&lt;/strong&gt; key is the same as the &lt;strong&gt;Print Screen&lt;/strong&gt; key.  The exception here is on some laptop keyboards, &lt;strong&gt;Print Screen&lt;/strong&gt; and &lt;strong&gt;sysrq&lt;/strong&gt; are mapped to different function keys.  This is not the case on the Dell Mini 9, both &lt;strong&gt;Print Screen&lt;/strong&gt; and &lt;strong&gt;sysrq&lt;/strong&gt; keys are mapped to &lt;strong&gt;fn&lt;/strong&gt; + &lt;strong&gt;7&lt;/strong&gt;.  Now onto the mnemonic device:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;R&lt;/strong&gt;aising &lt;strong&gt;S&lt;/strong&gt;kinny &lt;strong&gt;E&lt;/strong&gt;lephants &lt;strong&gt;I&lt;/strong&gt;s &lt;strong&gt;U&lt;/strong&gt;tterly &lt;strong&gt;B&lt;/strong&gt;oring&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;So, now that we know the mnemonic, what do we do with it?  We can type the following key strokes to reboot an unresponsive system:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;sysrq&lt;/strong&gt; + &lt;strong&gt;r&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;sysrq&lt;/strong&gt; + &lt;strong&gt;s&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;sysrq&lt;/strong&gt; + &lt;strong&gt;e&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;sysrq&lt;/strong&gt; + &lt;strong&gt;i&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;sysrq&lt;/strong&gt; + &lt;strong&gt;u&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;sysrq&lt;/strong&gt; + &lt;strong&gt;b&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Between each line, we should wait a couple seconds to let the system finish what we're telling it to do.  Speaking of, just what are we telling the system to do?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;r&lt;/strong&gt; - Puts the keyboard in raw mode&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;s&lt;/strong&gt; - Syncs the disk&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;e&lt;/strong&gt; - Terminates all processes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;i&lt;/strong&gt; - Kills all processes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;u&lt;/strong&gt; - Remounts all filesystems in read only&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;b&lt;/strong&gt; - Reboots the system&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;When your system reboots, fsck will run to check your disk, just let it run.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I just want to restate that this is not something you should do normally, it is there as a failsafe for when everything else fails: when &lt;strong&gt;Ctrl&lt;/strong&gt; + &lt;strong&gt;Alt&lt;/strong&gt; + &lt;strong&gt;Backspace&lt;/strong&gt; or rebooting from the command line do not work.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Edit: Thanks to Scowdich for pointing this out:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Typing &lt;strong&gt;Alt&lt;/strong&gt;+&lt;strong&gt;SysReq&lt;/strong&gt;+&lt;strong&gt;r&lt;/strong&gt;,&lt;strong&gt;e&lt;/strong&gt;,&lt;strong&gt;i&lt;/strong&gt;,&lt;strong&gt;s&lt;/strong&gt;,&lt;strong&gt;u&lt;/strong&gt;,&lt;strong&gt;b&lt;/strong&gt; will do the same thing, but will skip the unnecessary fsck on reboot.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-6226598982661511907?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/6226598982661511907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/raising-skinny-elephants.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/6226598982661511907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/6226598982661511907'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/raising-skinny-elephants.html' title='Raising Skinny Elephants'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-8551078181653703986</id><published>2009-05-20T23:55:00.003-05:00</published><updated>2009-05-20T23:55:00.622-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wicd'/><category scheme='http://www.blogger.com/atom/ns#' term='network manager'/><category scheme='http://www.blogger.com/atom/ns#' term='wpa_supplicant'/><title type='text'>Installing wicd</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;If you find that you don't like the default network manager in Debian, you may want to check out some of your other options for managing your network connections.  I have found that I like to use &lt;strong&gt;wicd&lt;/strong&gt;: it seems to do a better job at handling wireless network connections than the default network manager.  Before we can do the installation, we'll want to add the following to your &lt;strong&gt;/etc/apt/sources.list&lt;/strong&gt; file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;deb http://apt.wicd.net lenny extras&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To do this, you'll want to either open the file in your favourite text editor or use the &lt;strong&gt;echo&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# echo "deb http://apt.wicd.net lenny extras" &amp;gt;&amp;gt; /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Next, we want to add the key for the wicd repositories:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# wget -q http://apt.wicd.net/wicd.gpg -O- | apt-key add -&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now we are ready to install wicd from our newly added repository:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get update&lt;br /&gt;# apt-get install wicd&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That's really all there is to installing wicd.  During the installation, it will actually remove the default network manager and will set wicd to start up on boot up.  See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-8551078181653703986?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/8551078181653703986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-wicd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8551078181653703986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8551078181653703986'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-wicd.html' title='Installing wicd'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-8548483278034510822</id><published>2009-05-17T23:55:00.000-05:00</published><updated>2009-05-17T23:55:00.065-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='Install'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Installing Flash and Java in Debian</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;By default in Debian, the Iceweasel web browser does not have very good flash support and does not contain any support for java.  These are not difficult to install, so let's get started.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Flash installation&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We'll need to download the flash installation from Adobe.  You can get the installation &lt;a href="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz"&gt;here&lt;/a&gt;, or you can download it with &lt;strong&gt;wget&lt;/strong&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Once you've got the file, we'll need to untar it to get to the actual contents:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ tar -xvf install_flash_player_10_linux.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now you need to change to the directory that was created from the above tar command and we can go ahead and run the installation:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ cd install_flash_player_10_linux&lt;br /&gt;$ ./flashplayer-installer&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The above command should recognize the directory for the default location of Debian's installation of Iceweasel.  The installation will prompt you to close your web browser.  You should now be able to go surfing the internet and play the flash games and flash videos that you want to.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;strong&gt;Java installation&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Installing Java is a bit easier, as the required packages are in the Debian repositories.  To install Java applet support in Iceweasel, we just need to run the following commands:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get update&lt;br /&gt;# apt-get install sun-java6-plugin&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That's really all there is to installing Java support.  You should now be able to run Java applets in Iceweasel.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;See you next time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-8548483278034510822?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/8548483278034510822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-flash-and-java-in-debian.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8548483278034510822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/8548483278034510822'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-flash-and-java-in-debian.html' title='Installing Flash and Java in Debian'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-3174462136294801942</id><published>2009-05-13T23:55:00.003-05:00</published><updated>2009-05-14T16:45:47.809-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='alsa'/><category scheme='http://www.blogger.com/atom/ns#' term='audio'/><category scheme='http://www.blogger.com/atom/ns#' term='snd-hda-intel'/><title type='text'>Enabling Audio in Debian on the Mini 9</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;Something you'll probably notice if you're running Debian, and possibly the full version of Ubuntu, on your Mini 9 is that, out of the box, audio will not play out of the speakers.  This is not a very difficult problem to solve, but does require creating a config file to tell the system how to load the sound module.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;We will want to create a file with the following lines:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;alias snd-card-0 snd-hda-intel&lt;br /&gt;options snd-hda-intel index=0 model=dell&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The file we want to create is &lt;strong&gt;/etc/modprobe.d/sound&lt;/strong&gt;.  In order to create this file, you'll want to open this file in your favourite text editor, or use the echo command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim /etc/modprobe.d/sound&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit /etc/modprobe.d/sound&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# echo "alias snd-card-0 snd-hda-intel" &amp;gt; /etc/modprobe.d/sound&lt;br /&gt;# echo "options snd-hda-intel index=0 model=dell" &amp;gt;&amp;gt; /etc/modprobe.d/sound&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now that we've created this file, we need to reload the &lt;b&gt;snd_hda_intel&lt;/b&gt; module:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# rmmod snd_hda_intel&lt;br /&gt;# modprobe snd_hda_intel&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The first command above may return a message saying that the &lt;b&gt;snd_hda_intel module is in use&lt;/b&gt;.  If you get this message, you can either reboot or force the system to unload the module with the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# rmmod -f snd_hda_intel&lt;br /&gt;# modprobe snd_hda_intel&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now that we've got the module loaded correctly, we need to turn up the volume on the Mini 9 speakers.  If you haven't removed the volume control applet from your panel, you can just double click on that to bring up the volume control window.  Alternatively, you can run the following command to bring up the terminal volume control application:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ alsamixer&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;GUI Interface:&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_iPZ-XYa4r7U/Sgt0svrLHiI/AAAAAAAAAC8/n0rOZMCWDNQ/s1600-h/gnome-volume-control.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 193px;" src="http://3.bp.blogspot.com/_iPZ-XYa4r7U/Sgt0svrLHiI/AAAAAAAAAC8/n0rOZMCWDNQ/s320/gnome-volume-control.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5335486495611100706" title="Gnome Volume Control" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Terminal Interface:&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sgt0sboBylI/AAAAAAAAAC0/JMlsKi9q_5I/s1600-h/alsamixer.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 196px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sgt0sboBylI/AAAAAAAAAC0/JMlsKi9q_5I/s320/alsamixer.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5335486490229197394" title="AlsaMixer terminal app" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You'll want to adjust the volume on the "Speaker" control indicated in the screen shots above.  After doing that, your audio should be working correctly on your Mini 9&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Next time we'll install flash and java support in the Mozilla/Firefox/Iceweasel web browser&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-3174462136294801942?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/3174462136294801942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/enabling-audio-in-debian-on-mini-9.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3174462136294801942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3174462136294801942'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/enabling-audio-in-debian-on-mini-9.html' title='Enabling Audio in Debian on the Mini 9'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iPZ-XYa4r7U/Sgt0svrLHiI/AAAAAAAAAC8/n0rOZMCWDNQ/s72-c/gnome-volume-control.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-76722692159538714</id><published>2009-05-10T23:55:00.014-05:00</published><updated>2009-05-21T16:45:46.048-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Broadcom wl driver'/><category scheme='http://www.blogger.com/atom/ns#' term='Wireless'/><title type='text'>Wireless networking on the Dell Mini 9 - Broadcom wl driver</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;One of the first things you might notice when you boot into Debian with the Mini 9 is that the wireless card does not work out of the box.  The reason for this is that the wireless card in the Mini 9 is not compatible with the b43 driver with which you may be familiar.  Broadcom has released a driver specifically for the wireless card in the Mini 9.  To confirm that you need the wl driver from Broadcom, open a terminal session and run the following command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ lspci -nn | grep 14e4&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This should return something that looks like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;03:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g [14e4:4315] (rev 01)&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The important things above are the &lt;strong&gt;BCM4312&lt;/strong&gt; and the &lt;strong&gt;[14e4:4315]&lt;/strong&gt;.  If you see these things, then you know that you'll need to download the wl driver &lt;a href="http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5_10_91_9.tar.gz"&gt;here&lt;/a&gt;.  Or you can use &lt;strong&gt;wget&lt;/strong&gt; from the terminal:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ mkdir broadcom_wl &amp;amp;&amp;amp; cd broadcom_wl&lt;br /&gt;$ wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5_10_91_9.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Before we can compile and install the driver, we're going to have to make sure we have a couple packages installed on our system:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get update&lt;br /&gt;# apt-get install build-essential linux-headers-`uname -r`&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now we want to untar the file so we can get to installing it&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ tar -xvf hybrid-postsrc-x86_32-v5_10_91_9.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You should notice two directories: &lt;strong&gt;lib&lt;/strong&gt; and &lt;strong&gt;src&lt;/strong&gt; as well as one file: &lt;strong&gt;Makefile&lt;/strong&gt; in the directory where you untarred the download.  Now we're going to do some cleanup and then compile the driver:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ sudo make -C /lib/modules/`uname -r`/build M=`pwd` clean&lt;br /&gt;$ sudo make -C /lib/modules/`uname -r`/build M=`pwd`&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now you should see a file &lt;strong&gt;wl.ko&lt;/strong&gt; in the directory.  Now we want to see if there are any of the following moudles loaded on your system: b43, b43legacy, or bcm43xx.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ lsmod | grep 43&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Make a note of which of the above mentioned modules you found with the above command.  You'll want to unload the corresponding module with the appropriate command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# rmmod b43&lt;br /&gt;# rmmod b43legacy&lt;br /&gt;# rmmod bcm43xx&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You will want to double check that the module(s) got unloaded correctly with the &lt;strong&gt;lsmod&lt;/strong&gt; command above.  After confirming that these modules have been unloaded, we will want to copy the &lt;strong&gt;wl.ko&lt;/strong&gt; file into the appropriate directory for the system to find it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless/wl.ko&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now we should be able to load the wl driver, and if you need to use wpa_supplicant, we'll load the ieee80211_crypt_tkip module as well:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# depmod&lt;br /&gt;# modprobe ieee80211_crypt_tkip&lt;br /&gt;# modprobe wl&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now your wireless adapter should be working properly.  You should confirm that the system sees the adapter now:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ /sbin/ifconfig&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You should see at least three adapters displayed:&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;eth0 - This is your ethernet adapter&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;lo - This is your loopback adapter&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;eth1 or wlan0 - This is your wireless adapter, mine shows up as eth1&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now you should be able to connect to your wireless network through network-manager, wicd, or whatever program you use to manage your network connections.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The next important step is that we want to make sure that our new wireless driver starts up on system start up.  This means we get to roll up our sleeves and edit some system files.  First we'll start by blacklisting the drivers that we had to unload before.  You'll want to add the appropriate lines from the following into your &lt;strong&gt;/etc/modprobe.d/blacklist&lt;/strong&gt; file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;blacklist b43&lt;br /&gt;blacklist b43legacy&lt;br /&gt;blacklist bcm43xx&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You can add these lines by opening the file with your favorite text editor:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim /etc/modprobe.d/blacklist&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit /etc/modprobe.d/blacklist&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you want to be a little quicker about it, you can use the &lt;strong&gt;echo&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# echo "blacklist b43" &amp;gt;&amp;gt; /etc/modprobe.d/blacklist&lt;br /&gt;# echo "blacklist b43legacy" &amp;gt;&amp;gt; /etc/modprobe.d/blacklist&lt;br /&gt;# echo "blacklist bcm43xx" &amp;gt;&amp;gt; /etc/modprobe.d/blacklist&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This will prevent the above modules from being loaded in the future.  Now we want to make sure the &lt;strong&gt;ieee80211_crypt_tkip&lt;/strong&gt; and &lt;strong&gt;wl&lt;/strong&gt; modules are loaded by default.  We'll have to edit the &lt;strong&gt;/etc/modules&lt;/strong&gt; file to add the following lines to it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;ieee80211_crypt_tkip&lt;br /&gt;wl&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Again, you can edit this file in your favorite text editor or with the &lt;strong&gt;echo&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim /etc/modules&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit /etc/modules&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# echo "ieee80211_crypt_tkip" &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;# echo "wl" &amp;gt;&amp;gt; /etc/modules&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now that we've got the wireless adapter working and loading on system start up, the next thing you may notice is that the wireless adapter does not work after resuming from suspend.  There is a pretty easy fix for this.  We are going to create a file that will tell the system how to deal with the wireless adapter on suspend.  It doesn't really matter what you name this file, as long as it is located in &lt;strong&gt;/etc/pm/config.d/&lt;/strong&gt; you're ok.  I followed a convention that you may notice in other Linux system folders and named my file &lt;strong&gt;01-modules&lt;/strong&gt;.  The file needs to contain the following text:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;SUSPEND_MODULES="wl"&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You can create this file with your favorite text editor or with the &lt;strong&gt;echo&lt;/strong&gt; command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim /etc/pm/config.d/01-modules&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit /etc/pm/config.d/01-modules&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Or:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# echo "SUSPEND_MODULES=\"wl\"" &amp;gt; /etc/pm/config.d/01-modules&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now that you've got that file created, your wireless adapter should be working whenever you boot up your Mini 9 and when you resume from standby.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Next time we'll get the audio working on the Mini 9&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-76722692159538714?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/76722692159538714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/wireless-networking-on-dell-mini-9.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/76722692159538714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/76722692159538714'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/wireless-networking-on-dell-mini-9.html' title='Wireless networking on the Dell Mini 9 - Broadcom wl driver'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-5730624893975184029</id><published>2009-05-09T17:44:00.001-05:00</published><updated>2009-05-09T17:51:17.533-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sudo'/><category scheme='http://www.blogger.com/atom/ns#' term='sudoers file'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><title type='text'>Bonus Post: Using sudo in Debian</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;If you're familiar with Ubuntu or other Linux distros, you may be familiar with the &lt;b&gt;sudo&lt;/b&gt; command.  If you're not familiar with &lt;b&gt;sudo&lt;/b&gt;, this is a command that lets you run a command as another user.  Typically, on home computers, this is used to allow you to run commands as the root user, rather than having to log in as the root user.  You may notice that, by default, your user is not in the sudoers file.  Personally, I like sudo, so I'm going to add my user to the sudoers file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;In order to edit the sudoers file, we have to be logged in as root.  Let's pull up a terminal session and run the following command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;$ su&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This will prompt you for the root password and then you should notice you're at a &lt;b&gt;#&lt;/b&gt; prompt rather than a &lt;b&gt;$&lt;/b&gt; prompt.  If you try to edit the &lt;b&gt;/etc/sudoers&lt;/b&gt; file right now, you'll notice that it does not allow any user write access.  This is to prevent user error when editing this file by formatting things incorrectly or something.  The way you &lt;i&gt;should&lt;/i&gt; edit this file is with the &lt;b&gt;visudo&lt;/b&gt; command.  It is possible to edit this with some other commands, but it is not recommended.  To open up the file for editing, we should run the following command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# visudo&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You should see a line in the file that looks like:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;root ALL=(ALL) ALL&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To get the same behaviour you may be used to seeing in Ubuntu or other Linux distros, you'll just want to add a line almost identical to the above line, only substituting your user name for "root":&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;grabag-linux ALL=(ALL) ALL&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To save the changes, hit Ctrl + x, this will prompt you with a question asking to save the changes.  Answer "y" to save the changes, and this will prompt you for the location of the file to save.  By default, it should populate the file name &lt;b&gt;/etc/sudoers.tmp&lt;/b&gt;, just delete the &lt;b&gt;.tmp&lt;/b&gt; off the end of the file name to save it to the correct location.  This will prompt you saying that the file already exists and asks if you want to overwrite the file; answer "y" to save and quit visudo.  Now you can exit your root session and test out your new sudo authority:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# exit&lt;br /&gt;$ sudo apt-get update&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;That does it for this bonus post.  I'll be back tomorrow with the regularly scheduled post on configuring the wireless adapter on the Mini 9.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-5730624893975184029?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/5730624893975184029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/bonus-post-using-sudo-in-debian.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/5730624893975184029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/5730624893975184029'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/bonus-post-using-sudo-in-debian.html' title='Bonus Post: Using sudo in Debian'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-4392617530454308741</id><published>2009-05-06T23:55:00.009-05:00</published><updated>2009-05-07T00:20:52.173-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Installing Debian Linux</title><content type='html'>&lt;span style="font-family: georgia, sans-serif;"&gt;If you've been keeping score at home, you should know that we're now ready to install Debian on the Mini 9.  Before you install Linux on a computer, you'll need to make sure your BIOS is set to allow you to boot from your installation media.  I'll be installing from the bootable flash drive  I made in an &lt;a href="http://grabag-linux.blogspot.com/2009/04/debian-installation-from-usb-flash.html"&gt;earlier post&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;In order to get into the BIOS on a mini 9, you need to reboot and press "2" to get in there.  You'll need to enable boot from "USB Storage" and set this to boot with higher priority than the internal Hard Drive.  If you're following this to install Debian on a different computer with a cd installation, the process should be similar, and you just want to make the CD-ROM drive boot with the highest priority.  Be sure to save your changes when you exit the BIOS conifiguration.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now we're ready to do the installation.  You'll want to put the installation flash drive in a free USB port or the installation CD in your CD-ROM drive and reboot your computer.  The system should boot up into the installation.  If you're installing from a USB flash drive using the method I described before, it should boot automatically into the text based installation.  If you're installing from the CD, it should give you an option for a text based or graphical installation; the biggest difference is the graphical installation lets you use the mouse and looks a little nicer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Before we get started talking about the actual installation, I have a few things to mention:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I highly recommend having a wired internet connection during the installation for two reasons:&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;This will automatically configure networking on your computer&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You will be able to download package updates from a mirror during the installation&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Don't worry about making mistakes during the installation:&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You will (or at least should) learn from them&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You can always re-install over a bad install&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The Debian installation is not too complicated, so I will skip over the stuff that is easy and go into more detail in the areas where there are real decisions to be made and/or I have reasons for wanting to do things in a particular way.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Choose Language&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Not a whole lot to explain here, you should know what language you want.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Select Keyboard Layout&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Again, not too deep here, should closely match your language.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Configure the network&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Hostname: give your computer a name&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Domain name: if you don't know what you put here, you can probably leave it blank&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Configure the Clock&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;You should know your time zone.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Partition Disks&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Partitioning your hard drive is probably the place where people get the most scared or are the most unsure.  I suppose I'll start with a quick explanation of what a partition is.  An analogy for thinking about a hard disk with partitions would be to think about a field with a fence dividing it into different parts.  Stuff that is in one area is cut off from another area by the fence, and if you wanted to make one area bigger, you'd have to move the fence.  For more on partitions, check out this &lt;a href="http://en.wikipedia.org/wiki/Disk_partitioning"&gt;wikipedia entry&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SgIwKe2wJUI/AAAAAAAAAB0/xJW2sSDkck8/s1600-h/07-Partition-Method.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SgIwKe2wJUI/AAAAAAAAAB0/xJW2sSDkck8/s320/07-Partition-Method.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332877865399625026" title="Choose the method for partitioning the hard disk" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Partitioning your hard drive is really not that scary.  When you get to place on partitioning your hard drive, I highly recommend manually partitioning your hard drive.  Doing so will give you more knowledge of your system and will be better for preserving your data should something go wrong.  Speaking of preserving data, I make all my partitions primary partitions, as opposed to logical partitions.  It has been my experience that if you need to boot into a livecd environment to recover data, this is much easier if you're not using logical volumes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;All Linux really needs to operate is a root partition (mount point: / ).  Some will say that Linux also needs a swap partition, but if you've got enough RAM this is not necessary, and many people suggest not putting a swap partition on an SSD.  Speaking of SSDs, people recommend using the ext2 file system to prevent extra write cycles from the journaling features with the ext3 file system.  Also, you should set up your partitions on an SSD with the mount option "noatime."  This mount option means that the system will not update the last access time for a file; in short, this means fewer write cycles.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SgIwKrZ56JI/AAAAAAAAAB8/MauJ-pyG1FI/s1600-h/08i-Partition-Boot.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SgIwKrZ56JI/AAAAAAAAAB8/MauJ-pyG1FI/s320/08i-Partition-Boot.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332877868768290962" title="/boot partition setup" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;They say the partition containing the /boot directory should be located as close to the front of the drive as possible.  I take this a step further by creating a partition specifically for /boot.  I set this partition up to be 100 MB with an ext2 file system.  Not surprisingly, this partition needs to have the "boot flag" turned on.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;The next partition I create is the root partition, and I probably make it bigger than it actually needs to be at 10 GB, but I figure that way I won't run out of space for installing programs.  Since this is on an SSD, I set it up as ext2 with the "noatime" mount option.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If I were going to create a swap partition, I would do it next.  If you're going to create a swap partition, it doesn't make sense to make your swap partition smaller than the amount of RAM you have on your system.  Unless, of course, you don't plan on using the hibernate function (i.e. suspend to disk); in which case you can make your swap partition whatever size you wish.  I am not making a swap partition here because this is on an SSD.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Now I make my final partition: /home.  I make this partition take up any remaining space on the drive.  Putting /home in its own partition is good for cases where you need to re-install your system, but don't want to lose your personal data.  If you mess up your system beyond repair or choose to upgrade by doing a fresh installation, it is possible to leave your /home partition intact.  Like my / partition, I'm keeping this one ext2 and using the "noatime" mount option because it is on an SSD.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SgIwKrfpV3I/AAAAAAAAACE/694Ffy94nis/s1600-h/08l-Partition-End.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SgIwKrfpV3I/AAAAAAAAACE/694Ffy94nis/s320/08l-Partition-End.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332877868792371058" title="Reviewing Partitions before writing change to disk" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Note, the available disk space above does not match what I have said that I used above and the USB flash drive does not show as an available disk.  This is because I took the screen shots while running the installation in VirtualBox on another computer.  The numbers I mention above do match what is currently setup on my Dell Mini 9.&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SgIwK3ho_pI/AAAAAAAAACM/tIxxGI3WtUA/s1600-h/08m-Partition-SwapWarning.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SgIwK3ho_pI/AAAAAAAAACM/tIxxGI3WtUA/s320/08m-Partition-SwapWarning.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332877872021962386" title="No swap partition warning" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If you don't create a swap partition, the installer will give you a warning, you can simply select "No" to move on past this.&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iPZ-XYa4r7U/SgIwLAFcHxI/AAAAAAAAACU/avmeONSUNSk/s1600-h/08n-Partition-WriteChanges.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_iPZ-XYa4r7U/SgIwLAFcHxI/AAAAAAAAACU/avmeONSUNSk/s320/08n-Partition-WriteChanges.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332877874319597330" title="Confirm writing changes to the partition table and format hard drive" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Selecting "Yes" on the above screen will write your changes to the partition table and format the hard disk.  Once you do this, you'll find it's not quite as exciting as you had hoped.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Installing the Base System&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Absolutely no user intervention in this step&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Set up Users and Passwords&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Root Password: If you're familiar with Ubuntu, this will be a new step.  Ubuntu tries to hide the root user from you, in what is, I suspect, a measure to make it slightly more difficult to damage your system.  Note: Just because you &lt;i&gt;can&lt;/i&gt; log in as the root does &lt;i&gt;not&lt;/i&gt; mean you should.  In fact, I recommend logging in as root only when necessary&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;New User setup: Here you can set up the user that you will be primarily logging in as.  Just enter your name, pick a user name, and password.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Configure the Package Manager&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;I would recommend using a network mirror.  This will automatically download package updates during the installation.  This will take longer than not doing so, but you'll have up to date software packages when the installation is finished.  Just pick your country and then select a mirror.  When it asks about an HTTP proxy, chances are you can leave this blank if you don't know what you need to do here.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Software Selection&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SgIwZOph1VI/AAAAAAAAACc/2FdStSBWYIU/s1600-h/21-SoftwareSelection.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SgIwZOph1VI/AAAAAAAAACc/2FdStSBWYIU/s320/21-SoftwareSelection.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332878118747231570" title="Software Selection" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;For the Mini9, you pretty much only want the Desktop Environment, Laptop, and Standard System features.  If you're installing on some other machine, you probably have an idea what you want to use it for, and chances are if you don't know what something is on the list, you don't need it.  Plus, you can always install this stuff later anyway if you find you need/want something here and you didn't mark it for installation.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Installing Software&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;To steal a mantra from &lt;a href="http://en.wikipedia.org/wiki/Charlie_Papazian"&gt;Charlie Papazian&lt;/a&gt;: Relax, Don't Worry, Have a Homebrew.  (Or a commercial brew is fine)&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Install GRUB Boot Loader on a Hard Disk&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_iPZ-XYa4r7U/SgIwZUWxhrI/AAAAAAAAACk/pu8mX9_91J8/s1600-h/22-GRUB-Install.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_iPZ-XYa4r7U/SgIwZUWxhrI/AAAAAAAAACk/pu8mX9_91J8/s320/22-GRUB-Install.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332878120279180978" title="Install GRUB to the MBR" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;If this installation of Linux is going to be the only operating system on your machine, there's no reason that I can think of not to install GRUB to your master boot record&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;&lt;b&gt;Finish the Installation&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SgIwZUT0psI/AAAAAAAAACs/Qx5zyRnBO7Y/s1600-h/23-Finished.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SgIwZUT0psI/AAAAAAAAACs/Qx5zyRnBO7Y/s320/23-Finished.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5332878120266802882" title="Installation is complete!" /&gt;&lt;/a&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Congratulations, you've finished the installation of Debian Linux.  Simply select continue, and be sure to remove your installation media before rebooting your computer to enjoy your new Linux installation&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: georgia, sans-serif;"&gt;Well, that does it for this post.  Next time, we'll start configuring Debian to work correctly on the Dell Mini 9.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-4392617530454308741?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/4392617530454308741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-debian-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4392617530454308741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4392617530454308741'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/installing-debian-linux.html' title='Installing Debian Linux'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iPZ-XYa4r7U/SgIwKe2wJUI/AAAAAAAAAB0/xJW2sSDkck8/s72-c/07-Partition-Method.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-3019403226561536797</id><published>2009-05-03T23:55:00.016-05:00</published><updated>2009-05-04T00:06:56.968-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inspiron Mini'/><category scheme='http://www.blogger.com/atom/ns#' term='Dell'/><category scheme='http://www.blogger.com/atom/ns#' term='SSD'/><category scheme='http://www.blogger.com/atom/ns#' term='Mini 9'/><category scheme='http://www.blogger.com/atom/ns#' term='Mini PCIe'/><category scheme='http://www.blogger.com/atom/ns#' term='Upgrade'/><title type='text'>Dell Inspiron Mini SSD Upgrade</title><content type='html'>&lt;span style="font-family: georgia;"&gt;Before I bought the Mini 9, I tried to find out as much information as I could about the SSD that came with it.  Most of the blogs I found said that the default SSD that Dell puts in these things is not very fast.  When I called Dell to ask about the speed of the SSD, the guy I talked with told me the SSDs were, and I'm not making this up, "5400 RPM."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;That pretty much settled it for me, I went with the minimum 8 GB SSD from Dell and started looking to buy an SSD online for the Mini 9.  The Mini 9's use mini PCIe with a PATA interface for their SSDs, which means not that many companies make them.  Most of the SSDs I found had 40/15 MB/s read/write speeds, but I found from &lt;/span&gt;&lt;a style="font-family: georgia;" href="http://www.mydigitaldiscount.com/"&gt;mydigitaldiscount.com&lt;/a&gt;&lt;span style="font-family: georgia;"&gt; that RunCore makes &lt;/span&gt;&lt;a style="font-family: georgia;" href="http://www.mydigitaldiscount.com/ProductDetail.jsp?LISTID=800008DE-1224564428"&gt;SSDs for the Mini 9&lt;/a&gt;&lt;span style="font-family: georgia;"&gt; that have 78/44 MB/s read/write speeds.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;The RunCore drives are a little more expensive, but, in my opinion, worth it for the speed.  Few people realize how much of a bottleneck your hard drive can be for tasks like launching programs or booting up.  Also, it appears that mydigitaldiscount.com has trouble meeting demand with these RunCore SSDs, so be prepared to wait a bit for what I think is the best SSD on the market for the Mini 9.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;Be careful when shopping for SSDs for a Mini 9.  Don't get one that says it's designed for an ASUS netbook, I've read that these are too large to fit inside the Mini 9.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;Things you'll need to upgrade your SSD in your Mini 9:&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Mini 9&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Mini PCIe SSD with PATA interface&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Phillips head screw driver&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;External CD/DVD drive with an installation disc for your favourite operating system or an operating system installation loaded onto a &lt;a href="http://grabag-linux.blogspot.com/2009/04/debian-installation-from-usb-flash.html"&gt;bootable flash drive&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: georgia;"&gt;Before you get started, like before, you'll want to ground yourself so you don't ruin anything with a static discharge.&lt;/span&gt;&lt;span style="font-family: georgia;"&gt;Let's get started.&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Remove the back plate on your Mini 9.  Refer to my &lt;a href="http://grabag-linux.blogspot.com/2009/04/dell-inspiron-mini-9-ram-upgrade.html"&gt;Dell Inspiron Mini 9 RAM Upgrade&lt;/a&gt; post for instructions on removing the back plate.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Remove the screws holding the SSD into place, it should spring up and sit at an angle.&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rySViV0I/AAAAAAAAABs/gvZam3VBrI4/s1600-h/SSD-Screws.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://3.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rySViV0I/AAAAAAAAABs/gvZam3VBrI4/s320/SSD-Screws.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5331676783024691010" title="Mini 9 SSD - Remove indicated screws" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Carefully remove the SSD and set aside.&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rZWIPRdI/AAAAAAAAABM/peP2PbVH4ig/s1600-h/EmpytSSDSlot.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rZWIPRdI/AAAAAAAAABM/peP2PbVH4ig/s320/EmpytSSDSlot.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5331676354545927634" title="Mini 9 - Empty SSD slot" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rmVwTkwI/AAAAAAAAABc/IVU_EVnxzts/s1600-h/SSD-Compare.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 231px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rmVwTkwI/AAAAAAAAABc/IVU_EVnxzts/s320/SSD-Compare.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5331676577783845634" title="SSDs - New (left), Old (right)" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;Notice on the RunCore SSD (on the left) the silver connector at the top, just right of center.  That is a USB port; the RunCore drives can also be hooked up to a computer via USB.  If only the drive Dell shipped with the Mini 9 had this feature.&lt;/span&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Insert your new SSD in place of the old one.  Carefully, but firmly, push the drive into place.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;The drive will, again, sit at an angle.  Replace the screws to hold the drive down&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rgrTWK0I/AAAAAAAAABU/fGyCipG395Q/s1600-h/NewSSD.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rgrTWK0I/AAAAAAAAABU/fGyCipG395Q/s320/NewSSD.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5331676480488745794" title="Mini 9 - New SSD in place" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rrub0-QI/AAAAAAAAABk/c9swYUWhbuE/s1600-h/SSD-Finished.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://2.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rrub0-QI/AAAAAAAAABk/c9swYUWhbuE/s320/SSD-Finished.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5331676670308186370" title="Mini 9 - SSD upgrade completed" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: georgia;"&gt;Replace the back plate on your Mini 9.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family: georgia;"&gt;Congratulations, you've successfully replaced your SSD on your mini 9!  As far as doing something with your old SSD, I haven't come up with a use yet.  Apparently, there is a &lt;a href="http://buffalo.jp/products/catalog/storage/shd-es9m-uc/"&gt;Japanese company&lt;/a&gt; that makes external enclosures to turn these mini PCIe SSDs into external USB drives.  My Japanese isn't the best, but I think they are kind of expensive.  If anyone finds an affordable way to turn my spare SSD into an external hard drive, please let me know!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;Next time, we'll tackle the operating system installation using a bootable flash drive.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-3019403226561536797?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/3019403226561536797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/dell-inspiron-mini-ssd-upgrade.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3019403226561536797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3019403226561536797'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/05/dell-inspiron-mini-ssd-upgrade.html' title='Dell Inspiron Mini SSD Upgrade'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iPZ-XYa4r7U/Sf3rySViV0I/AAAAAAAAABs/gvZam3VBrI4/s72-c/SSD-Screws.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-4430716046359149906</id><published>2009-04-29T23:55:00.032-05:00</published><updated>2009-05-01T21:58:12.849-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='USB Installation'/><category scheme='http://www.blogger.com/atom/ns#' term='USB drive'/><category scheme='http://www.blogger.com/atom/ns#' term='Bootable Flash Drive'/><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Debian Installation from a USB Flash Drive</title><content type='html'>&lt;span style="font-family:georgia;"&gt;Before we can move on to upgrading the SSD on the Mini 9, I figured we should perpare our installation media.  Since the Mini 9 does not have a CD/DVD drive on it, and I don't have an external CD/DVD drive laying around, I decided that I would install Debian onto the Mini 9 via a USB flash drive.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Things you will need:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;A computer running Linux (a Mini 9 with Ubuntu Remix on it should do fine)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;A USB flash drive:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;At least 64 MB for the business card .iso&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;At least 256 MB for the network install .iso&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;At least 1GB for the standard CD .iso&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;A Debian installation .iso (you only need one of the following):&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;&lt;a href="http://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-501-i386-businesscard.iso"&gt;Current business card .iso&lt;/a&gt;* ~ 40 MB&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;&lt;a href="http://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-501-i386-netinst.iso"&gt;Current network install .iso&lt;/a&gt;* ~ 154 MB&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;&lt;a href="http://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-501-i386-CD-1.iso"&gt;Current standard CD .iso&lt;/a&gt; ~ 647 MB&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:georgia;"&gt;*Using either of these, you will need a wired internet connection during the installation process to download packages.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;The following addional files:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;&lt;a href="http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/cdrom/initrd.gz"&gt;initrd.gz&lt;/a&gt; ~ 4 MB&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;&lt;a href="http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/cdrom/vmlinuz"&gt;vmlinuz&lt;/a&gt; ~ 1 MB&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;I did this using the standard CD .iso because I already had it downloaded, but either of the other two should work just fine.  Just a heads up for when you actually install with this, I recommend a wired internet connection during the installation as this will autmatically configure networking during the installation process and it will download any package updates when installing.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;I think we're ready to get started.&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Let's start by making sure we have all everything we need installed on our computers.  We will need the dosfstools package if our flash drive is not a single FAT16 partition, the syslinux and mtools packages to install the syslinux boot loader on the flash drive, and the mbr package in case we need to fix a corrupted MBR on the flash drive:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# apt-get update&lt;br /&gt;# apt-get install dosfstools syslinux mtools mbr&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Check the file system on your flash drive and get the device name for the flash drive (if you're working on a Mini 9, this is probably /dev/sda).  For the purposes of this guide, I will use /dev/sdX for the device name of the flash drive, be sure to replace the "X" with the appropriate letter.  You will want to make sure you have the correct drive name for you flash drive; you don't want to accidentally format your hard drive because you used the wrong drive name.  Most flash drives come with a single FAT16 partition, which is what we want since we will be using syslinux as the boot loader which uses a FAT16 partition.  We can use fdisk to check the partitions on the flash drive and to get the device name:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# fdisk -l&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Skip this step if your flash drive is already a single FAT16 partition.  If your flash drive is not a single FAT16 partition, we will make changes to the partition table with fdisk and format the filesystem with mkdosfs.  First we want to make sure none of the partitions on the drive are mounted:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# umount /dev/sdX1&lt;br /&gt;# umount /dev/sdX2&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Repeat the above for each partion number shown when you listed your partitions with fdisk before.  Now that the drive is not mounted, we can write a new partition table with fdisk:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# fdisk /dev/sdX&lt;br /&gt;Command (m for help):&lt;/div&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Typing "m" will give you a list of commands&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;If you need to see a list of partitions again (this will help make sure you're messing with the right drive), type "p"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Type "d" and then a partition number to delete a partion&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Repeat above step until typing "p" returns no partions&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Create a new partition with "n"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Type "p" to make it a primary partiton, and then "1" to make it the first partiton&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Hit the 'Enter' key twice to make this partition take up the whole drive&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;You should now be back at the 'Command (m for help):' prompt, type "a" and then "1" to set the boot flag on the first partition&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Type "t" then "1" and then "6" to set the file system on the partion to FAT16&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Type "w" to write the partition table, and then you should be back at the standard bash prompt&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Now we want to format the file system with mkdosfs:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# mkdosfs /dev/sdX1&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;At this point, the flash drive is probably mounted on your system (even if you just formatted it), so we need to unmount it before we can install syslinux on it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# umount /dev/sdX1&lt;br /&gt;# syslinux /dev/sdX1&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Now we need to mount the flash drive; the easiest way to do that is to unplug it and plug it back in.  By default, my flash drive was mounted to /media/disk.  If you have already downloaded the vmlinuz and initrd.gz files, copy them onto the flash drive now.  Alternatively, we can download them directly to the flash drive:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# cd /media/disk&lt;br /&gt;/media/disk # wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/cdrom/initrd.gz&lt;br /&gt;/media/disk # wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-i386/current/images/cdrom/vmlinuz&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Now we need to create a file called 'syslinux.cfg'.  This is a configuration file for syslinux that tells it what to do.  The file needs to contain the following information two lines:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;default vmlinuz&lt;br /&gt;append initrd=initrd.gz ramdisk_size=12000 root=/dev/ram rw&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Depending on the image you are booting with this, you may need to increase the &lt;b&gt;ramdisk_size&lt;/b&gt; parameter.  I used the above settings with the standard CD iso image and did not have any problems.  Also, if you run into issues with booting from the flash drive, it may help to add &lt;b&gt;devfs=mount,dall&lt;/b&gt; to the second line.  You can create this file with your favourite text editor:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# vim syslinux.cfg&lt;/div&gt;&lt;br /&gt;&lt;div id="code"&gt;# gedit syslinux.cfg&lt;/div&gt;&lt;br /&gt;&lt;div id="code"&gt;# nano syslinux.cfg&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Or you can create the file directly from the command line with the 'echo' command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# echo "default vmlinuz" &amp;gt; syslinux.cfg&lt;br /&gt;# echo "append initrd=initrd.gz ramdisk_size=12000 root=/dev/ram rw" &amp;gt;&amp;gt; syslinux.cfg&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Now you can copy your iso to the flash drive:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# cp /`path to iso`/`iso file name`.iso /media/disk/&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Or you can drag and drop the file in nautilus or whatever your file manager of choice is.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;At this stage you &lt;i&gt;should&lt;/i&gt; be done, but I always have to do an extra step.  For some reason, during the above processes, I always corrupt the MBR on the flash drive.  Not to worry, though, because it is easy to repair.  First we need to unmount the flash drive again and then we can use install-mbr:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;# umount /dev/sdX1&lt;br /&gt;# install-mbr /dev/sdX&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Well, there you have it!  You should now have a flash drive that you can boot up into the debian installation with.  You should be able to boot up into the installation on any computer that will allow you to boot from USB (you may need to turn this on in the BIOS).  We are all ready to swap out the SSD in the Mini 9 with a bigger and faster one in my next post.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-4430716046359149906?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/4430716046359149906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/04/debian-installation-from-usb-flash.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4430716046359149906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/4430716046359149906'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/04/debian-installation-from-usb-flash.html' title='Debian Installation from a USB Flash Drive'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-2504087246702182802</id><published>2009-04-26T23:55:00.005-05:00</published><updated>2009-04-26T23:55:00.793-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inspiron Mini'/><category scheme='http://www.blogger.com/atom/ns#' term='Dell'/><category scheme='http://www.blogger.com/atom/ns#' term='Mini 9'/><category scheme='http://www.blogger.com/atom/ns#' term='RAM'/><category scheme='http://www.blogger.com/atom/ns#' term='Upgrade'/><title type='text'>Dell Inspiron Mini 9 RAM Upgrade</title><content type='html'>&lt;span style="font-family:georgia;"&gt;When I bought my Mini 9, Dell wanted $75 to upgrade the RAM from 512 MB to 2GB.  Dell also only puts in 533 MHz RAM when you order the Mini 9, but they sell replacement &lt;a href="http://accessories.us.dell.com/sna/productdetail.aspx?c=us&amp;amp;l=en&amp;amp;sku=A2412386"&gt;RAM at 800 MHz&lt;/a&gt;.  I found on &lt;a href="http://www.newegg.com"&gt;Newegg.com&lt;/a&gt; that I could get a &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820208407&amp;amp;Tpk=20-208-407"&gt;2 GB stick of RAM at 800 MHz&lt;/a&gt; for about $17 that would work in the Mini 9.  Seemed like a no-brainer to me.  NOTE: it appears the price has gone up for this particular stick of RAM.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;In order to upgrade the RAM on your Mini 9, you will need:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;span style="font-family:georgia;"&gt;&lt;li&gt;Dell Mini 9&lt;/li&gt;&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;RAM - 200 pin DDR2 at 800HMz (533 MHz or 667 MHz will also work)&lt;/li&gt;&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Small phillips head screw driver&lt;/li&gt;&lt;/span&gt; &lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Before you get started, remember to ground yourself (that's no TV, no phone, and no internet...) so that you don't ruin your electronics with a static discharge.  That means it's probably not a good idea to put on and take off your new sweater a bunch of times really fast or scuff around the carpet in your wool socks.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Let's get started.&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;span style="font-family:georgia;"&gt;&lt;li&gt;Make sure your Mini 9 is turned off and you have disconnected the power cable and removed the battery.&lt;/li&gt;&lt;/span&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_iPZ-XYa4r7U/SfOLF3IaeYI/AAAAAAAAAAc/9D6pbNG1O5Y/s1600-h/Mini9-BackPlate.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 311px;" src="http://3.bp.blogspot.com/_iPZ-XYa4r7U/SfOLF3IaeYI/AAAAAAAAAAc/9D6pbNG1O5Y/s320/Mini9-BackPlate.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5328755716924275074" title="Mini 9 Back Plate" /&gt;&lt;/a&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Remove the two screws indicated above and gently pry the back plate off with the screw driver.&lt;/li&gt;&lt;/span&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iPZ-XYa4r7U/SfOLy8EwTjI/AAAAAAAAAAk/OjJ1i89k0jM/s1600-h/Mini9-Inside.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://1.bp.blogspot.com/_iPZ-XYa4r7U/SfOLy8EwTjI/AAAAAAAAAAk/OjJ1i89k0jM/s320/Mini9-Inside.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5328756491345219122" title="Mini 9 Insides" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SfOMEXyNdYI/AAAAAAAAAAs/PDkOhaLkOx0/s1600-h/Mini9-RAMBrackets.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://4.bp.blogspot.com/_iPZ-XYa4r7U/SfOMEXyNdYI/AAAAAAAAAAs/PDkOhaLkOx0/s320/Mini9-RAMBrackets.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5328756790841406850" title="RAM Brackets" /&gt;&lt;/a&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Carefully use your fingers to pull the metal brackets on the sides of the RAM to the sides, the RAM should pop up at an angle.&lt;/li&gt;&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Pull the stick of RAM out and set aside for later.&lt;/li&gt;&lt;/span&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SfOM3_nNBvI/AAAAAAAAAA0/rHfqyY4GHYY/s1600-h/RAM.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 318px;" src="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SfOM3_nNBvI/AAAAAAAAAA0/rHfqyY4GHYY/s320/RAM.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5328757677705987826" title="RAM - Old (top) and New (bottom)" /&gt;&lt;/a&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Put the new RAM in place.  Carefully, but firmly, push it into the connector, it should remain up at an angle like the old RAM just before you removed it.&lt;/li&gt;&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Carefully, but firmly, press the RAM down until the side brackets click into place and the RAM stays securly down and parallel to the board.&lt;/li&gt;&lt;/span&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SfONOfKHGLI/AAAAAAAAAA8/YoZsaVknEF0/s1600-h/Mini9-NewRAM.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://2.bp.blogspot.com/_iPZ-XYa4r7U/SfONOfKHGLI/AAAAAAAAAA8/YoZsaVknEF0/s320/Mini9-NewRAM.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5328758064131020978" title="Mini 9 Inside with new RAM" /&gt;&lt;/a&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Replace the back place, pressing down so that it clicks into place and replace the screws.&lt;/li&gt;&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Replace the battery and/or plug in the power cable and boot up your Mini 9 and enjoy your new RAM.&lt;/li&gt;&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;&lt;li&gt;Get crafty with the RAM you removed from your Mini 9.  Make some nice jewelry out of it, maybe a neclace or some earrings, use your imagination!&lt;/li&gt;&lt;/span&gt; &lt;/ol&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Well, we did it, and it wasn't that hard.   Next time we'll prep for upgrading the SSD by making a bootable Debian installation flash drive.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-2504087246702182802?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/2504087246702182802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/04/dell-inspiron-mini-9-ram-upgrade.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2504087246702182802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/2504087246702182802'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/04/dell-inspiron-mini-9-ram-upgrade.html' title='Dell Inspiron Mini 9 RAM Upgrade'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iPZ-XYa4r7U/SfOLF3IaeYI/AAAAAAAAAAc/9D6pbNG1O5Y/s72-c/Mini9-BackPlate.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7430472870795422881.post-3980377037249104820</id><published>2009-04-22T22:02:00.002-05:00</published><updated>2009-04-24T00:51:15.713-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='first post'/><category scheme='http://www.blogger.com/atom/ns#' term='first'/><title type='text'>Token First Post</title><content type='html'>&lt;span style="font-family: georgia;" &gt;Welcome to my blog, grabag-linux.  As you may have guessed from the name, this is going to be a relatively linux-centric blog.  I got the idea after I got a new netbook (a Dell Inspiron Mini 9) and a friend suggested I document all the stuff I've been doing to it as a reference for anyone else who needs it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;" &gt;I realized he was on to something, but figured there is only so much I can write about linux specific to my netbook.  So, much of the content will be general linux stuff with some posts specific to the Mini 9.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;" &gt;I got the Mini 9 to be a fun toy and for portability.  I bought it with the cheapest options across the board with the intentions of upgrading the RAM and SSD myself.  In my next post, I'll take a screw driver to the back of the Mini 9.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7430472870795422881-3980377037249104820?l=grabag-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grabag-linux.blogspot.com/feeds/3980377037249104820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://grabag-linux.blogspot.com/2009/04/token-first-post.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3980377037249104820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7430472870795422881/posts/default/3980377037249104820'/><link rel='alternate' type='text/html' href='http://grabag-linux.blogspot.com/2009/04/token-first-post.html' title='Token First Post'/><author><name>grabag-linux</name><uri>http://www.blogger.com/profile/10244015143396539811</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
