Tuesday, June 29, 2010

OSX with PC Hardware

What do you do when a Macintosh motherboard ceases to function, you don't have a warranty, and you do not have money for a Macintosh motherboard? Well, you use a PC motherboard. WHAT?! WAIT!? HUH!?

It really isn't that difficult. The ASUS P5KPL-CM has a great track record, as do many of the Intel Desktop boards. Main things to keep in mind are that Intel processors (Core Duo, Core 2, and i5/i7) are easier to work with than AMD, and Nvidia graphics are easier to work with than ATI. Also, Leopard has more support for various hardware than does Snow Leopard. So how is it done (new install recommended)?

Well, first you will want to cruise on over to Kexts.com and search for kernel extensions (drivers) that will support your hardware. You need to be very, very specific. Download those, and put them somewhere that will be accessible. The next thing you need to do is download Empire EFI, and again you need to be specific to your CPU. You burn Empire EFI to a CDR, and leave it in the tray. Reboot. You will come to a boot screen, and at that point you swap the disc for your OSX installation disc (best to use the retail copy that sells for $30.00 US). Hit f5, and once you see your disc on the boot selection, go ahead and hit enter. You will launch into the installer. If something goes wrong, you can try again. This time press tab once you have highlighted the install disc. For boot options use "-x -v" and note what the boot hangs on. A quick google of the errors will usually yield some information on how to solve the error. A classic one is "still waiting for root device". In your BIOS you need to see if you can switch your HDD mode to AHCI, and you need to make sure that the filesystem on your HDD is one that is supported by OSX. Usually, this means it would need to be either HFS(+), FAT, or NTFS. Some of the Linux disc formats make the installer freak out.

After you've completed the installation, swap out the OSX install disc for the Empire EFI disc. Boot with selecting your HDD. You will come to a desktop that probably looks pretty bad (low resolution), and you most likely won't have a lot of device support. First, double click the Empire EFI disc icon, and find your way to the myHack installer. This is the easiest way to make your system bootable. During that install process be sure to look out for the "customize" button and see if any of your hardware is mentioned.

After this is taken care of get Kext Helper, and install the kexts you downloaded earlier.

Quite a few people seem to have problems with graphics. First thing, do not install the voodoo graphics enabler for SL until you've done a software update to 10.6.4. Intel HD graphics chipsets are often supported after upgrading to 10.6.4 as well. If you have mouse lag, this is usually solvable by installing the AppleUserUpstream disabler. The frame buffer disabler is also convenient if you have the PC version of an Apple card.

Audio is sometimes problematic. Often, the voodoohda kext will work. When it doesn't options are slim. You can find kexts for most common audio chipsets, but when you can't it's time to buy an external audio card that supports OSX. For wireless cards, most broadcom chipsets can be made to work, but otherwise I recommend an external adapter there as well. Hawking makes some excellent ones.

If nothing you try works, I highly recommend looking into some of the OSX86 distributions that litter torrent sites. iPC and iDeneb are both very common, have a ton of kexts, and can be used on Intel or AMD. The only thing I advise here is using Leopard not Snow Leopard. I would also recommend that you have a legal copy of OSX of the same version. The Apple EULA openly states that OSX is to be used on Apple Branded Hardware only.

Tuesday, June 15, 2010

Market Share

I consistently find myself looking up statistics for OS market share around this time every year. Every year numbers change. Every website reports different numbers from the last, and the only thing that one can assuredly deduce is that it is impossible to accurately gauge how many systems are running a specific OS. With that said, market share does matter.

For software engineers, time is very limited. It takes much of one's limited resources to make quality software, and it takes quite a bit of time. This means that choosing target platforms is very important if you plan on being successful with a certain product. It would be folly to write server software for a system that will not succeed in the server market. Likewise, it would be folly to write entertainment software for a system that will never succeed in the entertainment world. Strangely, Linux is only a large force in mainframes and super computers. There Linux is not only a contender, but is instead the only contender. In the server realm, we can reliably say the until rather recently Linux and BSD were the strongest. Microsoft has caught up quickly and can now claim roughly 40% as can Linux, and everyone else makes up the remaining 20%.

What's interesting is the hold that Microsoft has on the desktop market. According to the w3counter: OSX is 7.83%, Linux is 2.78%, iPhone, WAP, and Android together make up about 1%, and everything else is Windows. What's funny is that Apple is now the 7th largest computer manufacturer in the world. They're also the only one to have beaten the industry average in growth for Q1 of 2010. What does this mean?

This means that there is still a chance for the rest of us. Apple has proven that Microsoft's empire is not invulnerable. If people can recognize the differences between Mac and PC, they can recognize the difference among Linux, Mac, and PC. With that said, I think that people are also learning the reality. Windows just sucks. I am not saying this from a fanboy stand point. I dislike Macintosh too. I don't even really care for Linux. I simply think that Linux and OSX are better products than Windows (security, stability, ease of use, performance, scalability, total cost of ownership). The key to this is simply Total Cost of Ownership.

With a Windows system, people will suffer from many different things. First, the cost of upgrades: software (Windows and applications for Windows will need to be purchased), labor for IT personnel, and hardware upgrades/replacements. Second, the cost of maintaining Windows machines: anti-malware/security software (usually annually recurring costs), IT personnel to monitor system health, compatibility management with Windows update, and security staff that are well aware of social engineering attacks.

With Macintosh, you have a higher initial equipment investment, but afterwards you need only worry about social engineering attacks (usually, this is unauthorized physical access to a certain machine). Upgrade costs are minimal (around 30USD for each OS upgrade), and backwards compatibility among OSX versions is fairly acceptable.

With Linux systems, you set it and forget it. The hardware cost isn't high. The only cost here is protection from social engineering attacks (like Macintosh, these are usually unauthorized physical access to a given machine). So far, all three are susceptible to tampering when in person. You simply need a liveCD/USB, and/or a laptop, a screwdriver, and an ATA-USB bridge... and all the data can be yours if you are so inclined. This will never change, but what is changing is important. Linux, OSX, BSD, and Solaris are all far more secure than is Windows. This is not due to obscurity. Linux is hardly obscure. It competes with Microsoft in the most valuable market, servers. Do I want one credit card number, or one million credit card numbers. I will go with the million. Windows suffers because it's an easy target. The differences are largely architectural. OSX, BSD, and Solaris share this architecture and enjoy its benefits.

So where does market share difference leave us? The same place we started, except we can look forward to a better future. The trend lines show Unix-like systems winning the OS wars. Microsoft is still the giant, but Linux and OSX are gaining.

Monday, June 7, 2010

A Good Old Dog

The Mutt MUA started in 1995 when Michael Elkins wrote the first version. It's powerful, light-weight, made for CLI, and tends to suck less than do other email clients. It's my MUA of choice, and if you've never used it (or haven't in a while), you may want to give it a try. For the purposes of this little tutorial, I am going to assume that you use Gmail (who doesn't these days?). Another thing, Mutt has many more configuration options than those I will present here, I encourage you to look through the reference and explore more.

Most distributions have pre-compiled Mutt binaries available. It's part of the default Slackware installation, and as such I didn't need to grab it. If you use Ubuntu/Debian you can simply "$sudo apt-get install mutt postfix" and a few seconds later you are ready to go. In openSUSE, you should be able to find it with zypper, and for everyone else out there you can get packages or source at the mutt.org downloads page.

Mutt is an MUA (mail user agent), and not really an E-Mail client in the sense to which you are most likely accustomed. Unlike Pine (which comes with Pico built into it) and unlike any graphical E-Mail client, Mutt cannot handle much on its own. This results in the usage of other applications to create messages, and in many cases to view attachments. It also means that the sending/receiving of mail is usually done through outside applications. If you use IMAP (Gmail can use IMAP) and SMTP (again, Gmail can use SMTP) you are ready to rock without sendmail/getmail.

Setting Up Your Account
Fist, let's create our ~/.muttrc file. In your favorite VTE type "nano ~/.muttrc" and we will begin.

set copy=yes
set smtp_url="smtp://janedoe@smtp.gmail.com:587/"
set smtp_pass="password"
set from="janedoe@gmail.com"
set realname="Jane Doe"

For security reasons, you may elect to not enter your password here. The .muttrc file is plain text, and it would be fairly easy for someone to steal your password. If you do not enter it here, you will be prompted for it at every start of Mutt.

set imap_user="janedoe@gmail.com"
set imap_pass="password"
set folder="imaps://imap.gmail.com:993"
set spoolfile="imaps://imap.gmail.com/INBOX"
set record="imaps://imap.gmail.com/Sent"
set postponed="imaps://imap.gmail.com/Drafts"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set mbox_type=Maildir
set folder=~/Mail

set timeout=10
set mail_check=10
set sort=threads
set sort_aux=reverse-date-received
set move=no
set mark_old=no

set editor=nano #you can use any editor you choose
set markers=no
set signature=~/.sig #you can specify a signature but it's optional
set include=yes
set forward_format="Fwd: %s"

set mailcap_path=~/.mailcap
auto_view text/html

The mailcap file is important for viewing images and pdfs and other things. We can set it up now, and if you would like to look further into mailcap settings Gary Johnson has a good explanation at his mutt page.

text/html; echo && /usr/bin/w3m -dump %s; nametemplate=%s.html; copiousoutput
application/pdf; /usr/bin/evince %s
image/jpg; /usr/bin/display %s
image/gif; /usr/bin/display %s
image/jpeg; /usr/bin/display %s
image/png; /usr/bin/display %s

And there you are! You are all set up to use Mutt for your emailing. Using mutt, mcabber, lynx/links, and cmus you can pretty much kiss your mouse good bye. In GNOME, I maximize those four (one per desktop) and ctl+alt+(right arrow/left arrow) can take me across the four applications. Typically, I use DWM though. Hope you found it fun, hope you found it useful.

With the way this is set up, an MTA is not needed. Mutt automatically can do IMAP and SMTP now.

Friday, June 4, 2010


It's rather strange, this thing called Linux. We hear of Linux powered devices proliferating the market while the users are completely unaware of what they are using. What a success. An operating system that is so simple people simply are unaware of what they are using. It's an overwhelming success story. Phones, tablets, eReaders, netbooks, DVRs, and so on are everywhere, and Linux powers many of them. On the desktop, things are a little different. Most people use Windows, and fewer but many use Macintosh, and then are those lunatic Linux people. I often wonder why Linux hasn't taken off and I personally believe that much of it is due to a lack of marketing. So, what is this post about? Distributions.

Recently, I tried Ubuntu 10.04 and I was impressed. It was very responsive, very pretty, and still had the flexibility I crave. A few simple aptgetinstalls and I had all of my development tools. A few more and I was looking at dwm with all of my beloved programs like vi, cmus, mutt, and lynx. It was an enjoyable experience. Then I noticed that when left unattended for a bit the system locked up. Oh no. Rather than fiddle with it and see what was wrong, I downloaded openSUSE.

It was very responsive, very pretty, and still had the flexibility I crave. A few simple zypperinstalls and I had all of my development tools. A few more and I was looking at dwm with all of my beloved programs. It was an enjoyable experience. Upon noting that similarity (minus the locking up), I decided to see if this similarity would continue. I installed Fedora. Same thing. I installed Debian, Mandriva, Sabayon, MEPIS, Pardus, and GoboLinux and all of the experiences were rather similar. Why do we do this? Why do we make our systems so similar? Then it clicked.

In earlier days, creating a Linux desktop distribution was rather challenging. None of them worked all too well, and none of them gained a lot of notoriety (outside of Slackware and Debian). For many of the leaders of the pack listed above they all approached that same problem, and while things are different under the surface, the end result is the same. MEPIS, Sabayon, Pardus, and GoboLinux are all newcomers. GoboLinux has other reasons for existence, but it falls into the same category. Why would they create systems similar to those already out there? Simple. They know of no other niche, but would still like their slice of the pie.

The majority of early distributions had a niche to fill. Slackware was for BSD/UNIX people, Debian was for the open source fanatics, Knoppix was for the mobile, Tinfoil Hat was for the paranoid, Red Hat for servers and enterprise environments, Mandrake for Desktops, and BuildRoot/OpenWRT for embedded systems. Where are we now? Those same distributions can fill those same roles, and for the most part all of the others are... well... superfluous. Untangle can serve as a router, and there is a little competition there. Yet, most of the 400+ systems out there are just like every other.