Mac GNU/Linux install, i3-wm setup & usage, homebrew, iTerm 2, & other thoughts.

Hello everyone!

So, the semester has had a fair amount of time pass and I decided to finally get a post in about a good amount of things I’ve experienced so far in the class and what not. Alright, so let’s get this started:

Installing GNU/Linux on it’s own partition along side Mac OS X Mountain Lion 10.8.2. Goodness, all I have to say about this is that it was pretty terrible getting things worked out. All the blame is able to be aimed at the almost infinite amount of incorrect and outdated “documentation” there is in a google search. The first time, after a couple tries and trying to tweak various things to get the Linux boot to work or trying blah blah blah to make blah work, I had to ultimately completely restore my Mac from a Time Capsule backup. I upgraded the harddrive in my computer so it was basically going to have to restore around 400GB of stuff back from this time capsule back up so that took about 24 hours. Ha, good start right? This was after screwing around with this first set up terribleness for about 4 hours. This first round of terribleness was caused by something I totally knew about already but had forgotten about at the time making it much more terrible haha. And this was the fact that there is a “security” feature for Mac’s that doesn’t let you boot anything or install anything from bootable devices or CDs if they are connected via a USB port. Just use the CD drive you say? Well, I took out my CD drive to have another HDD installed. So, how did I get GNU/Linux installed? Yeah, you got it. I had to take out the extra HDD, put back in the CD drive, install it to the partition on my original HDD, take the CD drive back out, put back in the extra HDD, and then use my computer like normal. What a mess! But that isn’t the half of it! The first time I did this, I messed up the install. Basically, I think it came down to either you cannot have a /sda/boot partition because the installer will try and write the MBR there AND/OR you CANNOT let the GNU/Linux install write the MBR to Mac’s boot record whatever because it’s a different type of boot record that is called EFI so it will mess things up AND/OR you have to, for sure, write that GNU/Linux MBR to the ROOT ( / ) directory or your life will end instantly AND/OR the ROOT ( / ) has to be the first after all your Mac (and bootcamp Windows install if you were triple booting) so it can see that boot record you installed to that ROOT partition and load up GRUB (or LILO or whatever you decided to use) and load up your GNU/Linux install. Gee, that all seems really simple, doesn’t it? Yeah, not at all. I eventually got it all installed after at least 3 days total of screwing around. Brutally… fun…?

So, wow, that was great! I then had it going in class with mostly everything I needed installed and wanted to switch from the windows manager that came with my install and use i3 (which if you don’t know what i3 is, it’s the windows manager that Darren uses on his GNU/Linux install on his Mac so take a look at that in class). i3 is pretty much the definition of useful and productive. Pretty much very little to no mouse usage, relatively simple hot keys, window management made easy, great stuff. Well, after I first got it installed, I had no idea how to open a terminal window haha. The mouse does nothing on the desktop and there are no menus or anything available (which is fine because that’s the point) but I could not figure it out after 5 minutes so I eventually ended up having to google it from my iPhone haha. OKAY! Got it! mod-return. Mod is whatever key you decided to set it at when you first start and configure i3. Usually, it’s the windows / command key or the alt key. Those are the two most popular. I continue to play around with this and do the first homework assignment on this install. Only a few things that aren’t configured that I need like how to make the laptop go to sleep when I shut the lid, some things about the scroll pad that do some behavior that is goofy like scrolling really fast, things like that. But overall, I got it going nicely. It is still a little annoying having to reboot to do linux homework or what not.

This is where homebrew comes in. On the Mac side, there are a few popular community supported equivalents of yum, apt-get, emerge, etc aka package managers. There is Mac Ports but I’ve used that before and it’s the definition of pain. The more logical, popular, and less painful one is homebrew. Homebrew is awesome. Just like “apt-get install blah” you can do “brew install blah” and it will more than likely have a Mac ported version of the things we have in Unix class. And this allows me to do a few things I couldn’t on my other partition, namely listen to music (I could have configured a music player on my other install but iTunes has everything already together since I’ve been on my Mac side longer), not have to reboot, learn to navigate my computer with the terminal instead of the Finder, etc. So, I eventually got everything set up here all easy (an hour tops I think) and got connected to the IRC server with mosh / ssh and tmux with a little help from Darren after class and bam, I’m pretty much golden!

Darren suggested I check out iTerm 2 which is a better Terminal emulator than the Mac terminal because it adds some slick features. So I did. He wasn’t kidding. iTerm 2 is awesome. I love it. Better hot keys, better usage, plays better with weechat and IRC, just better. So now I leave iTerm 2 full screened and try and basically play in that window more than I do in my other desktop windows essentially making the iTerm 2 terminal my home stomping group over using my mouse to click around. I can’t live in there forever, of course. I have to write blog posts, check scholar, Skype, iTunes, etc, but that’s much less Finder usage which means I’m more efficient. Finder usage is equivalent to slow.

I was going to have another section on “other thoughts” but I think I’ve written more than enough and tortured anyone actually reading this long enough! I will say this though: bash programming is rough. Until next time everyone, stay awesome.

-Mattie (pengii23)
Currently listening to: “Gravel (Original Mix)” by Feed Me

What a great class, amirite!?

Ok, so some of you may not agree (yet) but if you know what’s good for you, you will soon enough! There is nothing better than Unix class, and honest to goodness, there has not been a better version of this class than the one we are currently receiving! I’ve taken this class years ago and dropped it due to too many credits and needing to relieve some stress. So what, you say? A legitimate response. Well, had I been in your position and learning all of which we have already learning as a sophomore or hell, anyone younger than my age and class, I would’ve been much better off in almost all my classes in the future. I can say that for a fact. I love this class right now. I know a lot of what we are learning, but that makes me excited for you all! I love seeing that the things I learned all during my co-op experiences are being taught in classes! I love that so much because you all will be able to take more advantage of your co-op and internship experiences and not learn things like git or GNU/Linux generics, but rather, learn all the specialties the company has to over you. I cannot wait to see what you all do in the future. But hey, I will also be the guy keeping you on your toes because I still know some things you don’t. If you want to know more, you now know where to find me.

Well. until next time everyone, stay awesome.

Mattie, out.

Current Tune (Song by Artist): “Wait (The Killabits Remix)” by Adventure Club && Father Said (ft. Skrillex)” by 12th Planet
Current Preferred Language: Python
Current Fun: Making some fun tunes with Ableton Suite 8 :D and blogging with

The File System

This week, we learned a little more about the UNIX file system. The file system is similar to that of any other major operating system. There are some exceptions however. For instance, instead of having multiple drives (ie. C:\, D:\), everything is located under the root directory (/) as seen below. All other devices (disk drive, etc.) are located under /dev.

Unix File System

One very important command to keep in mind is chmod or change mode. This command allows you to change the permissions of files and directories. I decided to do a little more exploring of the command. While searching, I came across a list of common chmod combinations (below) here.



chmod 400 file To protect a file against accidental overwriting.
chmod 500 directory To protect yourself from accidentally removing, renaming or moving files from this directory.
chmod 600 file A private file only changeable by the user who entered this command.
chmod 644 file A publicly readable file that can only be changed by the issuing user.
chmod 660 file Users belonging to your group can change this files, others don’t have any access to it at all.
chmod 700 file Protects a file against any access from other users, while the issuing user still has full access.
chmod 755 directory For files that should be readable and executable by others, but only changeable by the issuing user.
chmod 775 file Standard file sharing mode for a group.
chmod 777 file Everybody can do everything to this file.
chmod +x file Enables only the file execution.

Basic Shell Commands and Python Exercises

Basic Shell Commands

This week in ECE 2524, we took a look at some of the basic shell commands listed below.

alias diff man rmdir unalias
cat echo mkdir script whereis
cd exit more source which
cp hostname mv ssh whoami
chmod less pwd tar ps
date ls rm touch grep
find head tail ln wc

The exercise was pretty straight forward. As a small group, we divided the commands for each person to research. For each of our commands, we had to find the usage of the command, common flags and options, and some examples. In my opinion, the exercise would have been more helpful if after we discussed our commands, we had an exercise where we would have to use some or most of the commands. However, overall the exercise was a good learning exercise.


Python Exercises

We have been following along with an online book, Learn Python the Hard Way, that will teach us how to program in python. I have made it through exercise 9, and so far it has been very helpful. I have quite a bit of experience in various other languages, and this book helps me see the connection Python has with them. I look forward to going through the rest of the book.

Hello world!

Welcome to Blogs@VT Sites. This is your first post.

Well, there you have it everyone! This is my first post. Currently going to be up pretty late getting things set up and what not, not just for this class but others. Should be a busy but interesting and exciting semester. Music, learning, and coding all are fun and fun is how I will survive the semester and ultimately graduate in May; no ifs, ands, buts, maybes, or anything of the sorts because another semester is just not happening!

Currently, thinking back to having taken ECE3574 before having taken this class, I do feel that 3574 would have been easier had I taken this class first. Seeing that we will be learning things like make and building code in the Unix environment, knowing such a thing before having taken ECE3574 would have saved me a fair amount of confusion; yes, now that I know about these things from real world work experiences I had after ECE3574, such a thing seems rather simple and silly to be confused about but that goes for everything once you have a strong grasp of it. However, having something as basic as that be a point of confusion when deadlines were (and still are for many of my classes) tight and concepts are new, it really was an unnecessary and sometimes harmful roadblock to hit. Of course, since I am going to be graduating in May, I obviously managed to survive the class, but I think this class is certainly something that should be taken before ECE3574 if at the least at the same time because when I took the class, it was assumed one knew how to do something like ‘make’, build, and compile programs in the *nix environment. All in all, trying to master the stuff we are learning in our classes is hard enough as it is when we are on the same level as all our peers. Adding an extra roadblock, especially one that could have been, in a sense, avoided is something that should be avoided as much as possible for the sake of one’s grade, but more importantly, one’s sanity. :)

And to go off on just one more tangent before getting to some other class work, I had just recently moved most, if not all, my music collection off my computer’s hard drive during break to free up space. I have no idea how I manage to get so much music, videos, TV shows, apps, etc. on my computer, but I do so anyways, after doing that, that goal was accomplished and it came just in time because now I will be able to partition the hard drive to install some form of GNU/Linux on my MacBook Pro which I have not decided upon just yet. I’ve had Virtual Machines of Linux before for various reasons (VirtualBox, Parallels, VMWare Fusion), but I’ve found that it just doesn’t feel quite “real” enough for me to try and use it a bit more than my Mac OS. Granted, I have a lot of nice things I need on my Mac OS but if I want to try and use GNU/Linux more singularly as opposed to being able to just switch back an forth and lose the experience of using just GNU/Linux, then partitioning is the way to go for me which is why I am really glad things are working out the way they are right now. VMs may work just fine for other people to get the singular GNU/Linux experience, and it’s not like using the VMs wasn’t a great solution for me in the past, but this time, I’m trying to really commit to using just GNU/Linux to get stronger with it.

Well. until next time everyone, stay awesome.

Mattie, out.

Current Tune (Song by Artist): “The Worst of Them” by Issues
Current Preferred Language: C
Current Fun: Drinking ALL THE COFFEES with my Keurig! :D