2009.09.03

Rules for How to Write Cross Platform Code

After reading this interesting blog about creating petabyte size storage servers I found this entry about rules to follow when writing cross platform code by Brian Wilson to be a good read for anyone doing cross platform coding in C/C++ (or any language for that matter).

The author works for Back Blaze which seems like a nice inexpensive backup service. I will probably subscribe to their services once they have a Linux client. It is a little hard to ignore the irony of the cross platform article when the Linux client is still missing, however, anyone that has worked for a software corporation knows there are often many other non-technical reasons for their product release decisions.

There are 10 types of people in the world: those who understand trinary, those that don't, and those that confuse it with binary.


2009.08.21

Apache 2 Web Server Configuration

I finally got my site backup up and working on a new server. A very quiet Dell Studio Slim 540s, running Ubuntu 8.10 and apache 2. I had been running apache (1) on an old hand built Celeron 500MHz server that made a lot of noise and had some hard drives dying. It was long over due for an upgrade.

Installing Ubuntu 8.10 was easy enough as was moving subversion over (it was the first thing I did). All I needed to do for subversion was to rsync the directory over along with all of the other files I was copying, and start the service. Once I had my ssh keys setup, subversion worked just like it did on the old server.

Getting apache to work correctly, however, was not nearly as easy. The server itself worked fine out of the box, but I have a lot of domain names that I proxy with apache and it took me a while to figure out how to set those up correctly. After looking at far too many examples online I finally got it working. The following are the steps I took, and hopefully this will save someone else the time it took me to figure it out. Note that all of these commands need to be run as root or via sudo.

First I added some needed modules:

a2enmod proxy proxy_connect proxy_http proxy_ftp userdir

Then setup the proxy configuration by editing /etc/apache2/mods-available/proxy.conf:

<IfModule mod_proxy.c>
        ProxyRequests Off

        <Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Deny from all
                Allow from all
        </Proxy>

        ProxyVia On
</IfModule>

I did not need to make any changes to the default userdir.conf.

Now create a site file for every site you run. Here is mine for nulldot as an example:

Edit /etc/apache2/sites-enabled/nulldot:

<VirtualHost *:80>
    ServerName nulldot.org
    ServerAlias nulldot.org *.nulldot.org

    ProxyPass / http://localhost/~kyle/blog/
    ProxyPassReverse / http://localhost/~kyle/blog/
</VirtualHost>

Obviously, replace nulldot.org with your domain name and point the ProxyPass and ProxyPassReverse lines to your target directory.

Then enable the site with:

a2ensite nulldot

Now restart apache2 and hopefully everything works:

/etc/init.d/apache2 restart

Getting information off the Internet is like taking a drink from a fire hydrant.

— Mitchell Kapor


2008.01.29

How to Get Started Learning Emacs

I do realize that I'm probably quite biased on the topic of editors, but be that as it may, Emacs is simply the best editor, IDE, environment, platform, lifestyle, etc. there is. And it's high time you learned how to use it.

First a quick aside... I used vi and vim for 10 years or so before I finally decided to bite the bullet and take the time to learn Emacs. It probably took me 6 months of playing with Emacs to really get comfortable with it. Hopefully these suggestions will help lessen that amount of time for others.

I'm assuming that you can figure out how to find and install Emacs for your system. You may read how to obtain Emacs from the GNU Emacs site.

...

Here are some good sites for more information about Emacs:

The problem with the GNU coding standards is they ASSUME that everyone in the world uses emacs. If that were the case, free software would die because we would all have wrist problems like RMS by now and no longer be able to code.

- Knghtbrd


2007.12.11

Android Software Development Kit

Google along with The Open Handset Alliance has released their very cool software stack for mobile phones. There is a lot of hype behind this project and a lot of people think it will be the next big thing for mobile phones. Personally, I'm very excited for the future of mobile phones as they go away from being a closed and tightly controlled environment to an open one.

Here are a few videos introducing Android:

If you are interested in programming for the Android platform it is very easy to get started. Download the SDK and follow the instructions. I recommend using Eclipse with the Android Plug-in. It comes with some example applications that are interesting to look at.

Here are some videos that give a technical overview and a programming example:

I've mentioned the OpenMoko and Qtopia Greenphone projects before, which have similar goals, but lack the backing and hype that Android has.

I worry about my child and the Internet all the time, even though she's too young to have logged on yet. Here's what I worry about. I worry that 10 or 15 years from now, she will come to me and say "Daddy, where were you when they took freedom of the press away from the Internet?"

- Mike Godwin, Electronic Frontier Foundation


2007.10.21

Rockbox Open Source Jukebox Firmware

After hearing me complain about Apple's move to deliberately block non approved software from interfacing with their iPods, a friend/coworker of mine recommended I try running Rockbox on my iPod Photo. So about a week ago I installed it and gave it a try.

It was easy enough to install, although I couldn't get the RockboxUtilityQt installer to work. I followed the directions on installing manually from Linux, copied the files to my iPod's root directory, ran the ipodpatcher program to install the new boot loader, then rebooted my iPod.

I found Rockbox intuitive to use, and so far everything just works as I would expect. It has different font themes including one that looks like the original iPod font. It plays music very well, has play lists, and a bunch of fun games. It supports over 15 codecs, including MP3, Ogg, AAC, WMA, Real Audio, etc. Also, it coexists with the normal iPod firmware, so you can switch back at boot time if you like.

I haven't played around with the play lists yet so I don't know how they compare with Apple's Smart Play Lists that I've become addicted to. One nice feature is that you can create play lists and name them on the iPod itself.

There are many features that improve upon the regular iPod firmware. For example, the volume has more range and goes a lot louder. The buttons have more functionality — combinations as well as long presses do different things.

I have noticed one thing that might be a show-stopper for me... battery life is awful when running Rockbox. However, this is a known issue and a fix is in the works.

CNET has a nice write-up of Rockbox.

Don't be trapped by dogma — which is living with the results of other people's thinking.

- Steve Jobs


2007.08.14

Photosynth Multidimensional Picture Spaces

Even though I think all of the Microsoft Operating Systems suck eggs, many of Microsoft's other products are impressive. First there was Office, then Visual Studio, and now something really cool... Photosynth.

Have a look at this presentation of it by Blaise Aguera y Arcas at a TED conference.

The only down side is that it only runs on Windows XP or Windows Vista. Hopefully it will be ported to other Operating Systems.

Phase One: Collect underpants.
Phase Two: ?
Phase Three: Profit.

— South Park Gnomes


2007.07.23

Flash for 64-bit Firefox in Ubuntu

I use 64-bit Ubuntu on my workstation at work. It needs to be 64-bit because I use 64-bit images of Red Hat for development and testing. Most software that I need works well with the exception of flash in Firefox.

I never really cared too much about this at work before since I usually don't visit a lot of flash based sites. Although it did kind of suck not being able to play the cool YouTube video all of my coworkers were watching.

Well, after my last blog entry caused my work browser to crash I decided to do something about it. I found some great directions in the Ubuntu Forums that cover many options. The one that worked for me was the Nspluginwrapper script (towards the end).

Until Adobe gets of their butt and makes a 64-bit version of their latest flash, this is a good alternative.

You can't drink all day if you don't start in the morning.


2007.07.19

Miro Internet TV and Video Player

The other day, while try to figure out how to make an RSS feed in Muse I found this page from a google search. At first I glanced over it, but upon a quick re-read I noticed the link to an interesting application called Democracy Player which upon clicking re-directed me to Miro. Miro bills itself as a free open source internet TV and video player.

Miro sounded pretty cool and they had instructions on how to install it on Ubuntu (not to mention Mac OS X, Windows, Fedora, Debian, and Gentoo as well). So I added their repository to my sources list, updated, and installed Miro. I couldn't find an application icon to launch it, so I just ran it from the command line. After a few quick questions it was up and running.

Wow is this thing cool and intuitive. As I clicked away, I very quickly had videos being downloaded in the background. Diggnation, Ask A Ninja, X-Play, Google Tech Talks, etc. Then I tried a custom search against YouTube and Google Video for Compiz and Berly. After showing me a list of videos for each it allowed me to create a feed from my queries that I could then subscribe to — very cool.

As I write this it is busy downloading some 100+ files I've already selected. Six are waiting for me to watch them now. Clicking on the Miro Guide presents me with some featured video feeds and the currently most popular. This is very similar to how iTunes works as well. Did I mention it was intuitive?

I could go into all of the cool things this application can do, but you really need to just install it yourself and start playing with it. I haven't been this excited about an application in a while. I might have to call this one a "killer app".

Does the name Pavlov ring a bell?


2007.06.30

Ignore Whitespace with Subversion Diff

My team at work uses Subversion (SVN) for our version control system. I like Subversion a lot and would recommend it over Concurrent Versions System (CVS) or Source Safe.

I've noticed one annoyance with Subversion when using the svn diff command. By default it does not ignore whitespace changes nor is there an option for this. My group uses different editors with different settings and the whitespace in our source code seems to change with every update. Some of us use tabs, some use spaces (like me) and it seems like everyone has a different indexing scheme. This means that using Subverion's diff command shows most of the code has having been changed witch makes it all but useless. The solution was found with an easy google search which lead me to this site that had a solution.

Basically instead of using svn diff you use:

svn diff --diff-cmd diff -x -uw FILE

To have this work with Emacs' psvn Subversion interface add the following to your Emacs config:

(require 'psvn)
(setq svn-status-default-diff-arguments '("--diff-cmd" "diff" "-x" "-wbBu"))

Happy version control!

OS X. Because it was easier to make Unix user friendly than to fix windows.


2007.06.04

First Post

Well every blog has to have one. This is just a marker for when I finally added blogging to my site.

My name is Kyle Sherman and this is my technically inclined blog that will primarily focus on computer science topics along with other things I care about.

I'm using Muse in Emacs to write and publish this entire site. I will be blogging about the specifics of how I do this and my setup in the future.

For some general information about this site and my contact information see my about page.

Cheers!

— Kyle Sherman

Linux is as much about being Communist, as is the phrase, "of the people, by the people, and for the people".