Archive

Archive for the ‘Personal Projects’ Category

Using the Dvorak layout in FreeBSD

March 14th, 2010 Chris No comments

Those of us that type a lot will eventually begin to feel the effects of such an activity manifest as some sort of pain, most likely carpal tunnel syndrome. As somebody who has touch typed for the better part of 15 years, I definitely feel the effects every now and then. Several years ago I heard of an alternate keyboard layout called “Dvorak” that allegedly helped reduce the stress on your hands, but could potentially give you a free speed boost. I won’t go into the nitty-gritty details, but encourage you to take a look at the Wikipedia article.

There are two ways to use the Dvorak layout: in the console and in Xorg. They’re both quite easy to switch to as well.

To switch over your console, you can either run the sysinstall program as root or just manually specify the keymap using kbdcontrol -l “us.dvorak”. Using sysinstall ensures that the Dvorak layout is retained after a reboot, whereas the kbdcontrol command does not. Switching back is as simple as using kbdcontrol -l “us” and removing the entry from rc.conf if you used sysinstall.

For Xorg users, simply open a terminal and run the following to toggle back and forth:

setxkbmap dvorak

setxkbmap us

If you are using a desktop environment such as Gnome or KDE, you should be able to change the layout using the appropriate control panel.

I hope to work my way up to my QWERTY speed fairly quickly and be proficient in both layouts, but I’ll certainly need to practice. For the record, this post took about 40 minutes to compose with my layout switched to Dvorak…

Fun with numbers…

February 11th, 2010 Chris No comments

So I’m neck deep in my GRE studies. I’ve already gone through two GRE books and an ebook. I’m close to finishing my third book (this test is NOT easy). I’m learning some interesting properties of numbers such as the following:

Integers:

  • Integers are whole numbers (whether positive or negative)
  • Fractions are not integers
  • Zero is an integer!
  • Positive integers get larger as they move farther from zero
  • Negative integers get smaller as they move farther from zero

Consecutive numbers:

  • Listed in order of increasing value without any numbers missing between them
  • Fractions and decimals cannot be consecutive numbers; only integers can!
  • You can even have consecutive even integers: 2, 4, 6, 8…

Properties of Zero:

  • 0 is even
  • 0 plus any other number is equal to that number
  • 0 multiplied by any other number is equal to 0.

Positives and Negatives:

  • pos x pos = pos
  • neg x neg = pos (“two wrongs make a right” is my memorization tool)
  • pos x neg = neg

Even or odd?

  • Any number that can be cleanly divided by 2 is even (i.e. no remainder)
  • Any number that cannot be cleanly divided by 2 is odd (i.e. has a remainder)
  • Zero is even
  • Fractions are neither even nor odd
  • Any integer is even if its units digit is even, and odd if its units digit is odd
  • Multiplying and adding odd and even integers
  • even x even = even
  • odd x odd = odd
  • even x odd = even
  • even + even = even
  • odd + odd = even
  • even + odd = odd

Absolute Value:

  • Absolute value is how far away a number is from zero
  • Absolute value is always a positive integer whether or not the number in question is positive or not

Prime Numbers:

  • A number is prime when it is only divisible by itself and the number 1
  • Here’s all the prime numbers less than 30: 2,3,5,7,11,13,17,19,23,29
  • Zero is not a prime number
  • 1 is not a prime number
  • 2 is the only even prime number
  • Prime numbers are always positive integers. There’s no such thing as a negative prime number

Rules of Divisibility:

  • An integer is divisible by 2 if its units digit is divisible by 2. For example, 598,447,896 is divisible by 2 because the units digit (6) is divisible by 2.
  • An integer is divisible by 3 if the sum of its digits is divisible by 3. For example, 2,145 is divisible by 3 because (2+1+4+5 = 12) is divisible by 3.
  • An integer is divisible by 4 if its last 2 digits form a number that’s divisible by 4. For example, 712 is divisible by 4 because 12 is divisible by 4.
  • An integer is divisible by 5 if its units digit is either 0 or 5
  • An integer is divisible by 6 if it’s divisible by both 2 and 3
  • An integer is divisible by 9 if the sum of its digits is divisible by 9
  • An integer is divisible by 10 if its units digit is 0

Remainders:

  • When one integer cannot be divided evenly by another, the remainder is what is left over after the division
  • When one integer divides evenly by another the remainder is zero (no remainder)

Factors:

  • A number is a factor of another number if the second number can be divided by the first with no remainder
  • Factors of 12: 1,2,3,4,6,12
  • Best to write factors in pairs to make sure you get them all:
  • 1 and 12
  • 2 and 6
  • 3 and 4

Multiples:

  • A multiple of a number is that number multiplied by an integer
  • Multiples of 10: -20 (10 x -2), -10 (10 x -1), 10 (10 x 1), 20 (10 x 2), etc…

There’s obviously far more to the GRE than these simple concepts but some are quite handy and will make short work of doing calculations for the GRE. Yea, you can’t use a calculator at all. Fire up those neurons!

Passed the MPLS exam!

September 25th, 2009 Chris No comments

Finishing out my Cisco studies (for now), I’ve finally passed the Cisco MPLS (642-611) exam. I have to say, this exam is probably the hardest Cisco exam I’ve taken to date. It even made the QOS exam seem easy. As usual, the easiest way to pass is to know the topics cold. In addition to the test topics, here’s what I recommend knowing:

  • MPLS Fundamentals
  • Intricacies of MPLS VPNs
  • Differences between different types of Internet access
  • Configuration of all MPLS topics

By fundamentals, I don’t mean just knowing that LDP runs on TCP port 646. You’ll want to know the nitty gritty details about cell mode and frame mode differences, exactly how labels work, and how labels are distributed throughout the network, among other things.

MPLS VPNs are pretty complicated topic, with such topics as VPN label stacks, route targets, and address families. Knowing those topics, as well as knowing redistribution and how the various routing protocols are configured will help you get past the finish line.

For some reason, Cisco documentation on MPLS Internet access is a bit sparse. I can’t really recommend anything other than picking up a good book on MPLS. Ignore the recommended Cisco Press books; they’re horribly out of date and are priced like they just came out. I recommend both the MPLS Fundamentals book and the MPLS Configuration on Cisco IOS books.

Lastly, you need to know the configuration topics like the back of your hand. To learn them, you’ll either want access to a rack of routers (and ATM switches if you’re lucky) or you can use something like GNS3 and dynamips. This is where the MPLS Configuration book really shines. Aside from teaching you all the basic topics, it also shows you how to configure all the advanced stuff. When you can configure advanced MPLS VPNs such as central service MPLS VPNs without referring to any material, you’re probably good to go. Don’t forget about managed MPLS VPN services like ODAP and NAT.

Overall, the test isn’t impossible but it’s no walk in the park. With plenty of book study and hands on time on some routers, test day should turn out successfully.

Categories: Cisco, Networking, Personal Projects Tags:

Hello Gentoo!

August 2nd, 2009 Chris No comments

I have to admit, I’m a bit of a glutten for punishment. For some reason, I actually enjoy the challenge of lesser-known distributions. While I’ve been taking a good hard look at FreeBSD and how it might meet my needs, it is still lacking several key applications I rely on: VirtualBox (yes, it’s in ports, but have you actually gotten it to work? I haven’t) and the  Adobe Flash player (tried gnash, didn’t work. Adobe won’t cough up an amd64 FreeBSD player). Granted, these are minor hiccups but other things are also keeping me from using FreeBSD on my main desktop.

To that end, I’ve been happily using Debian Lenny. It’s nice because it generally works on anything you throw at it and the apt utility can’t be beat for software management. Apt can also be a royal pain in the ass. I tried for hours to get it to play nicely and install mplayer with the codecs I wanted but there seemed to be a “stuck” package on my system that wouldn’t upgrade. My other annoyance with apt is that applications aren’t always updated as fast as they should be. The main one that comes to mind is Pidgin, the IM client that connects to all the different messenging networks. Again, I wrestled with apt for weeks, trying to get the latest greatest version of Pidgin without having to move over to Sid. I even tried using the backports repository. Still no dice.

That’s when I started thinking about FreeBSD again. I’ve been using it successfully on a new laptop I’ve got (article on that to follow at some point) but there my requirements are much less. So then I thought about Gentoo. Gentoo has all the Linux goodness and a system called portage that isn’t unlike the FreeBSD ports tree. In fact, portage was inspired by FreeBSD’s ports system! So I set out to install Gentoo on my main desktop box.

I’ve got fairly vanilla hardware so I was sure that it was all supported. (specs: Intel Core2 Quad Q6600, 6 GB PC-8500 RAM, 2x 1 TB hard drives (one for backup), EVGA Geforce 9500 GT, Intel Pro/1000 NIC, Gigabyte EP45-3DSL motherboard, Logitech USB mouse and keyboard) I was happy to see that I was right. I simply burned a CD of the weekly minimal installer CD and booted up. Gentoo is interesting because unlike most other distributions of Linux, you aren’t confronted with a happy graphical installer. Nope, you get dropped to a root prompt and have to go from there. Fortunately, the documentation is impeccable and very easy to follow. To take full advantage of my hardware, I followed the AMD64 guide, located here. I was lazy when I installed and opted to use Gentoo’s “genkernel” package to build my kernel for me. I may trim down my kernel at a later point and remove all the junk that’s not needed. After about 45 minutes, I had a bare system up and running.

The fun part is deciding where to take it from there. Since I’m using this machine as a desktop box, I installed Xorg and my current favorite window manager, XFCE. Like FreeBSD, Gentoo compiles all software from source code so you can really take advantage of your hardware. Unlike FreeBSD, however, Gentoo’s portage system is a lot easier to use. Instead of drilling down the ports tree to find what you want, then issuing a “make install clean”, you simply use the ‘emerge’ utility. This is as simple as “emerge –search <someapp>” to search for something and then “emerge <someapp>” to install it. emerge is definitely more powerful than that (I’m using it to update my entire system as I’m writing) so it’s well worth either looking at the man page or the online documentation.

I did run into a few kinks along the way. After having a base system installed along with XFCE, I wanted sound so I can listen to some tunes while working. Since genkernel pretty much gives you a kitchen sink kernel, ALSA support was already in the kernel (which by the way, is how it’s supposed to be moving forward I’m told). The only thing I had to do was to emerge the alsa-utils port so I’d get the mixer app and startup scripts. Documentation for that is located here.

The other kink I ran into was the need to dual boot that other OS. Yes, I still play the occasional game here and there but by and large, my days are spent in Linux doing stuff. The grub section under the installation guide is helpful, but not in a case where you’ve got Windows installed on a different drive. The problem is that Windows wants to be on the first drive and can’t fathom why you’d want to boot into any other OS. To remedy this, I added the following information to my grub.conf file:

title Windows XP
        rootnoverify (hd2,0)
        map (hd0) (hd2)
        map (hd2) (hd0)
        chainloader +1

In my case, my Windows drive is the third physical hard disk installed (the first being the Linux installation and the second being the backup drive). Remember,  in Grub-land, hard disks start at zero. Since Windows doesn’t like not being the first drive, you have to trick its boot loader into thinking it is. This is where the map commands shown above come in handy. The last line just tells grub to seek 1 sector from the start of the partition (usually the boot sector).

So far I’m really impressed with Gentoo. I no longer have to worry about conflicts (emerge takes care of it for you) or outdated packages (emerge builds the latest/greatest depending on your system profile). My system is clean, has only what I actually use, and I have a far more thorough understanding of what’s going on. What’s not to like??

Categories: Linux, Personal Projects, Software Tags:

A few updates…

May 25th, 2009 Chris No comments

No, I didn’t fall off a cliff. Been busy with lots of stuff:

  • Passed the CCDP ARCH test and became a CCDP on April 25th!
  • Lots of house remodeling projects
  • Working on my final Cisco test (for now : ), the MPLS exam
  • Various other sundries

On the FreeBSD front, I found an old 250GB SATA drive and installed it in my current rig as the only drive (just to be sure I don’t screw something up). Not surprisingly, rebuilding the kernel and world with the latest 7.2 Release is quite snappy as compared to the Thinkpad T40. I was pleased that the Nvidia driver in ports worked without a hitch though it has no 3D acceleration whatsoever. For that you need Nouveau. I went my usual install route: install the minimal FreeBSD distribution, build world and build kernel, build Xorg from ports (including mouse, keyboard, Nvidia driver, and vesa driver for backup) with HAL support, build some sort of window manager (Fluxbox is my current favorite), install a shell (I’m torn between bash and zsh), and install Firefox 3. The entire process took about an hour and a half.

All of my hardware either worked out of the box or worked after a few tweaks but I used the i386 version of FreeBSD, not the AMD64 version. Before I built HAL, I had to use a PS/2 keyboard in order to actually install. Either I missed something or USB hotplug support isn’t there out of the box and needs to be added to rc.conf. I was pleasantly surprised to see that my Blackberry was recognized when I plugged it in. It didn’t automount or anything but it was neat to see it get recognized. I’ve yet to get it to work, but there is a ports version of barry available. Barry is a little rough around the edges but I was able to back up my Blackberry Curve 8320 to my Linux box with it.

It seems like FreeBSD is maturing and quite rapidly. Now that VirtualBox is coming for FreeBSD, the only barrier left is either getting a native 64-bit Flash plugin/player or for Gnash to mature rapidly. I tried Gnash on i386 FreeBSD and it works, but only part of the time.

I still watch with a bit of wonder and amazement at the effort that goes into an Open Source operating system and applications. That the developers can get their projects working with little or no support from hardware vendors is nothing short of amazing.

FreeBSD 7 on a Thinkpad T40 update

April 18th, 2009 Chris 1 comment

Not too long ago I wrote a how-to article on how to get FreeBSD 7.0 working on my IBM Thinkpad T40. Among other things, I omitted a section on getting proper video drivers working. The graphics chip is an ATI RV250 (Mobility 9000). This means the driver you should use is the ‘radeon’ driver. Use ‘pciconf -lv |grep ATI‘ to see which chip you’ve got. After toiling a bit with it, I figured out how to get the Open Source ATI drivers working.

Because I want to generally keep my systems pretty current, I recently installed FreeBSD 7.1 on my T40. It’s important to know that the FreeBSD project generally breaks up development into three separate releases, namely CURRENT, STABLE, and RELEASE, in order of most bleeding edge to most stable. After building Xorg 1.6.0, I tried to start an X session just to see if I would get the ugly TWM desktop. To my surprise I got just a black screen but that was it. Even more surprising was that the usual “three finger salute” (ctrl + alt + backspace) didn’t kill my X session. I then hit ‘alt + F2′ to log into another vty and manually kill off X. Here’s where the fun began. It killed more than X; it locked my entire machine up. I continued futzing with my xorg.conf, kernel modules, and locking my system up for a good hour. I then threw in the towel and wound up asking a friend who’s a FreeBSD developer WTF was going on. I learned a few interesting facts:

  • The DRM code in 7.1 was more than 2 years old
  • It is not necessary to manually load or pre-load any kernel modules for video
  • X.org should work well with ATI graphics cards (but the amd64 release may not work) since the ATI driver model has had substantial structural changes to it.

On the first point, there’s two ways around the old code: Either download/burn/install the FreeBSD 7.2 release candidate or rebuild world. Since I’m a glutton for punishment, I decided to rebuild world. It’s not actually that hard, just time consuming. Use the ‘csup’ utility to grab the entire CVS source tree from your nearest csup server and follow the directions listed here to rebuild your system using the RELENG_7 tree.

The second point is easy enough. There’s no need to add anything to your /boot/loader.conf file in order to get X working. X.org will load any necessary kernel modules when you type ‘startx‘. As an interesting aside, I actually locked my system up when attempting the unload the radeon.ko kernel module when I had learned that preloading isn’t necessary. Doh!

Once you’ve rebuilt your system and are running 7.2-STABLE, it probably wouldn’t be a bad idea to rebuild your installed ports. This isn’t necessary per se since X.org should work without even building a config file, but it is a good step, just to make sure everything is up to date. I use the portupgrade utility located in /usr/ports/ports-mgmt/ with the following: portupgrade -aRr. That should upgrade all outdated ports recursively as well as recursively rebuilding dependencies.

I’ll expand on the last point a bit. ATI has been much more generous with contributing documentation to the Open Source community than Nvidia. In fact, Nvidia hasn’t contributed anything other than a proprietary driver for Linux and FreeBSD, though there’s a project called Nouveau which aims to build an Open Source Nvidia driver. Because of this, FreeBSD has an Open Source ATI driver (/usr/ports/x11-drivers/xf86-video-radeonhd and usr/ports/x11-drivers/xf86-video-ati) and using the old proprietary fglrx driver is no longer necessary. There’s one hiccup to this though. The driver has to be re-worked every time a new ATI chip comes out. To solve this, ATI is moving towards the same unified driver model Nvidia has used for years and taking it a step further. They now have an Open Source BIOS abstraction layer called ATOMBios. The idea is to make it easier to more rapidly deploy drivers for new graphics cards. Read all about that in this article. Bravo ATI!

By the time you finish reading this, your ports should be up to date and you should be able to use hardware accelerated ATI drivers on your Thinkpad. I’m running XFCE4 on my Thinkpad and it’s causing me to reevaluate the old “FreeBSD vs. Linux” question. Maybe I’ll spend a little more time working on the other parts that I overlooked in my article.

Enjoy!

Getting FreeBSD 7.0 running on an IBM Thinkpad T40

November 12th, 2008 Chris 2 comments

I’ve been experimenting with various operating systems on my Thinkpad and have been trying to get a Unix-like system on there. I’ve played with Ubuntu but the battery life is abysmal. I can get around 3 hours with Windows XP installed and barely half that with Ubuntu 8.10 installed.

Just for grins, I decided to see how difficult it would be to get FreeBSD 7.0 working on this machine. After I was done, I decided I’d share the knowledge:

Here’s how I did it

Passed the QOS test!

October 12th, 2008 Chris No comments

Finally, after 6 long months of studying for this thing! It was tough and I thought that I had bombed it halfway through. I’ll keep it short: know all the objectives and you’ll pass.

Next up is the CCDP ARCH exam. I’ve passed the CCNP routing and switching exams which are prerequisites for the CCDP so I figured why not just take one more exam and add another certification to my belt? After that’s done I’ll take the MPLS exam and have the CCIP certification. I think I’ll take a break after that…

Moved to new hardware

July 18th, 2008 Chris 2 comments

So over the past few days, I’ve moved my websites to new hardware. I got a used Sun Enterprise 420r and decided it was time. Pretty nice box: 4 UltraSPARC II processors at 450Mhz each, 1 Gig of RAM, and 72 GB of drive space. Of course it’s running my favorite server operating system – FreeBSD. I considered and even tried to install Solaris 10 but it was being a PITA so I threw my hands up and just downloaded the FreeBSD ISO instead. In the process, I’ve learned how to move a site and minimize the impact of doing so (not that I have a heavily trafficed site anyways). For the curious, my old hardware was a PIII 800 with 512 MB RAM and 160 GB of drive space. If the day ever comes that I need more space I can always pop in another drive. I don’t see that happening soon though.

Passed the Cisco BGP test!

April 12th, 2008 Chris 1 comment

Okay, so I’m two weeks late on posting this but it’s still exciting! I’m actively working towards the CCIP so I wanted to take this test before June so I can stick to my “study and pass a test within a reasonable timeframe” schedule. It’s pretty difficult and I actually failed it on the first try (with a 750 out of a 755 passing score. Argh!). This time around I passed with a more respectable 912.

Without divulging too much, you should definitely know all of the testing objectives cold. They can be found here. Pay particular attention to the differences between IBGP and EBGP and all of the features each offers. I used the “Internet Routing Architectures” book by Sam Halabi and it was excellent. Even if you’re not taking the BGP test, it would be a good idea to have that book on hand as a reference. Read it twice and the test should be a piece of cake.

-->