<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

    <title>HPLogsdon</title>
    <link href="https://blog.hplogsdon.com/atom.xml" rel="self"/>
    <link href="https://blog.hplogsdon.com/"/>
    <updated>2024-12-18T18:34:40+00:00</updated>
    <id>https://blog.hplogsdon.com/</id>
    <author>
        <name>Howard Logsdon</name>
    </author>
    <entry>
        <title>Cross Compiling a Linux Kernel from scratch</title>
        <link href="https://blog.hplogsdon.com/cross-compiling-a-linux-kernel-from-scratch/"/>
        <updated>2013-03-17T18:22:17+00:00</updated>
        <id>https://blog.hplogsdon.com/cross-compiling-a-linux-kernel-from-scratch/</id>
        <content type="html">&lt;p&gt;Just a quick note so I don’t have to look this up all the time.&lt;/p&gt;

&lt;p&gt;From a vanilla Debian base box (the NetInstall, or similar), we’ll need the basic &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;build-essential&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;make&lt;/code&gt; packages. apt-get install them. We’ll also need &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git&lt;/code&gt;, which is less likely to be installed be default.&lt;/p&gt;

&lt;p&gt;The first order of business is figuring out what hardware you’ll be targetting. This is ARM, i386, x86_64/amd64, etc. Shouldn’t be too difficult to determine.&lt;/p&gt;

&lt;p&gt;The second order of business is obtaining the kernel. If you’re cross-compiling, then you’re more likely to be wanting a fork of the kernel from somewhere. Right this minute, I’m looking at compiling a new Kernel with some specific options for a Raspberry Pi. They’re got their &lt;a href=&quot;https://github.com/raspberrypi/linux/&quot;&gt;own repo&lt;/a&gt; for now. Someday down the line, it might end up being merged back into Mainline Linux, which would be at &lt;a href=&quot;https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/&quot;&gt;kernel.org&lt;/a&gt; (download/git links at the bottom of the page).&lt;/p&gt;

&lt;p&gt;So either checkout/branch to the version you want, or download and untar it to your home directory. It’s generally not recommended to be running as root for any compilation action, including any sudo actions, so there’s no reason in needs to be in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/src&lt;/code&gt;. If you recompiling your kernel for the machine you’re running on that’s a different story.&lt;/p&gt;

&lt;p&gt;Set an environmental variable to the base location, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export KERNEL_SRC=&quot;$HOME/src/linux&quot;&lt;/code&gt;, and cd into it: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd $KERNEL_SRC&lt;/code&gt;.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Installing Raspbian on a RaspberryPi Through a Serial Console</title>
        <link href="https://blog.hplogsdon.com/installing-raspbian-on-a-raspberrypi-through-a-serial-console/"/>
        <updated>2013-03-10T19:51:06+00:00</updated>
        <id>https://blog.hplogsdon.com/installing-raspbian-on-a-raspberrypi-through-a-serial-console/</id>
        <content type="html">&lt;p&gt;First some backstory, because I feel like writing a fucking post to make up for the past year I haven’t:&lt;/p&gt;

&lt;p&gt;I picked up a &lt;a href=&quot;http://www.raspberrypi.org/&quot;&gt;Raspberry Pi&lt;/a&gt; some months back without much of a need for it. Most of my electronics stuff is bought without a use, so I guess it’s no surprise I jumped on the bandwagon. I ended up ordering what is called the ModelB, which is the earlier model with 256MB of ram. To be honest, I didn’t really even know what the hell the board did, I just heard other tech junkies babble on about how it was going to revolutionize home computing (hint: it didn’t and won’t). Since it’s a full computer, not just a microcontroller like an &lt;a href=&quot;http://arduino.cc&quot;&gt;Arduino&lt;/a&gt; makes it a relatively poor tinkering device compared to booting up a vanilla Debian, Ubuntu or ArchLinux VM. But, none of that really makes the device useless. I just haven’t found it’s use yet, thought I’m still fucking around with it.&lt;/p&gt;

&lt;p&gt;Days after I put in my order, an article came to my attention where a FreeBSD hacker successfully booted into multi-user on the device. This is particularly interesting to me, as someone who prefers the BSD over GNU, and so the first couple weeks I had the device I had followed his instructions multiple times, installing FreeBSD onto the SD card and booting up, and then PXE booting from another box, and just doing some weird network booting I never really have had the opportunity to mess around with before. But, there are only so many FreeBSD installations you can do on a new computer before you actually want to start playing with the hardware and turning the computer into something that computes things. Unfortunately at the time, all communication was restricted to the UART serial console. This really put a kink in doing anything more than a little C or Python hacking. Within a couple weeks the Pi was collecting a bit of dust, quite literally, so I threw it in a bag and tossed it in with the seldom used Arduinos.&lt;/p&gt;

&lt;p&gt;Cut to this weekend, where I have spent the past few months at a new job as a Ruby developer full time, instead of just when I had the chance to do Ruby and where I’m required to know enough sysopts to keep my designated projects up and running on Debian servers. I’ve always like Debian the most of all the Linuxes, anyways, but now I get to do it consistently. An article from &lt;a href=&quot;http://arstechnica.com/information-technology/2013/03/how-two-volunteers-built-the-raspberry-pis-operating-system/&quot;&gt;ArsTechnica&lt;/a&gt; came across the stream this week about the two guys that bootstrapped the &lt;a href=&quot;http://www.raspbian.org/&quot;&gt;Raspbian&lt;/a&gt; project, which brings Debian to the armv6 platform (armv6 is kinda the bastard child of the ARMs, not a lot of support since there aren’t many enterprisey uses for it. armv7 is more popular). It’s an interesting read, and it manged to re-spike my interest in the device. My first issue when reading the article though is the lack of WiFi, and the fact that it’s kind of a fragile little snowflake. So, I hopped on Amazon to pick up a Linux compatible USB mini-wifi adapter based on the RTL8188CUS RealTek chipset and then over to &lt;a href=&quot;http://adafruit.com/&quot;&gt;Adafruit&lt;/a&gt; and picked up a &lt;a href=&quot;http://adafruit.com/products/859&quot;&gt;case&lt;/a&gt;, and after realizing the case would prevent serial communication by blocking access to the GPIO pins, picked up a kind of breakout board dubbed the &lt;a href=&quot;http://adafruit.com/products/914&quot;&gt;Raspberry PI Cobbler&lt;/a&gt;. Because the internet is amazing, I was able to receive these items within days of ordering. I’m still amazed at how far the internet has come since the days it took tens of minutes to load a single JPEG.&lt;/p&gt;

&lt;p&gt;But, to the point of the fucking story, I now had a case, a way to tie into the GPIO pins, and the ability to not have it wired into my router. The last step is to just install Raspbian, right? If it was only so fucking easy. Even though I’m using a Debian based OS instead of FreeBSD, I still don’t care much for a graphical display. But, I also wanted a minimal installation, something that all the dozens of images floating around the internet seem to not get (Apache, X11 and LXDE &lt;em&gt;DOES NOT A FUCKING MINIMAL IMAGE MAKE!!!&lt;/em&gt;). This leaves me with the &lt;a href=&quot;http://www.raspbian.org/RaspbianInstaller&quot;&gt;Raspbian Installer&lt;/a&gt;, which is essentially a Debian NetInstall built around Raspbian. Perfect, just a barebones installation as soon as it finishes running. I copied the installation files to a clean SD card, threw the RPi into the enclosure, plugged it into my TV, which is the only device I own with HDMI input, plugged in my trusty Aluminum Apple keyboard and sat down for a quick install. Except, the damn thing doesn’t seem to want to respond to my fucking keyboard. A quick overview of what the fuck I’m doing reveals that my keyboard is actually an un-powered USB hub that happens to have a bunch of buttons on it. The RPi isn’t powerful enough to run it. Great. Luckily I have a powered hub I can use to send enough power to the keyboard, but it’s tightly coupled to my desktop setup, so after grudgingly pulling that off I try again and receive the same damned result. I’ve tried all sorts of combinations but was never able to actually get the keyboard to respond. Fuck fuck fuck.&lt;/p&gt;

&lt;p&gt;Well, the next step is what? Try for a serial installation? This is where things get grey. There isn’t a lot of documentation around the internals of Raspbian, and almost every fucking Google search on “installing raspbian” results in some shitshow about DDing some goddamned image onto an SD card and patting yourself on the back with the “Hacker” merit badge. I’m glad there are a lot of *nix newbies getting into this, but it gets aggrivating trying to find information about cool shit to do with the RPi when every blog post is “10 ways to hack your PI”, and it’s just 10 different &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-get install&lt;/code&gt; commands. Give me 10 ways people have made cool things with this fucker, not 10 ways people have used a cheap ass computer to watch porn on a TV or saved money on not buying a TimeCapsule.&lt;/p&gt;

&lt;p&gt;So, I started poking around with the installer. In the rpi_installer-08-19-12.zip archive there are some unsurprising files, like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kernel.img&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;start.elf&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;loader.bin&lt;/code&gt;, typical linux boot shit (sans vzimage and initrd). But, nothing too revealing except for the textfile &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cmdline.txt&lt;/code&gt;. In here we have a long ass line of arguments to what I am assuming is the bootloader (which I’m unsure as to what that is exactly, if it’s completely custom from &lt;a href=&quot;https://github.com/raspberrypi&quot;&gt;here&lt;/a&gt;, or if it’s something like &lt;a href=&quot;http://www.denx.de/wiki/U-Boot/&quot;&gt;uBoot&lt;/a&gt;, nether of which I have any experience with). Three of these are dealing with tty settings:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nv&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ttyAMA0,115200 &lt;span class=&quot;nv&quot;&gt;kgdboc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ttyAMA0,115200 &lt;span class=&quot;nv&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;tty1&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The first is obviously the standard console, and the second appears to be the kernel debugger (gdb) output console. The third appears to just be a repeat of the first, but it’s configured to talk to tty1, which in the default case ends up enabling the installer to output to the HDMI port. You’ll see that it’s a different format as well, since it’s a different kind of tty. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ttyAM*&lt;/code&gt; devices on the Raspberry Pi are hardware ttys, where as the ttyN (where N is a digit) are software. This makes the initial configuration changes easy, just change &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tty1&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ttyAMA0,115200&lt;/code&gt;, and magically, we can boot the RPi’s installer all the way to the ncurses screen while viewing the output on the serial console.&lt;/p&gt;

&lt;p&gt;But, and this is the reason I’m writing this up, things don’t work right just yet. We need to be able to connect to the serial line, and send keyboard commands as well. I’ve normally just been using GNU screen to connect through my FTDI cable and in this instance it works, except for it doesn’t. Everything goes well until ncurses comes up, and then all the UI elements are sent to be as garbage. They’re in the right place, and if I managed to find a Youtube Video of somebody walking through the process with screenshots, I might have been able to fake it (wouldn’t have been the first time I’ve blindly installed an OS, or had to reconfigure one manually when I’ve locked myself out just by typing commands at a headless keyboard), but alas, there really are no such videos I could find. There are hundreds of videos showing you how to use DD or some other tool for windows to copy an image onto an SD card though :(&lt;/p&gt;

&lt;p&gt;So, I needed to find a new serial interface client. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minicom&lt;/code&gt; came to the rescue, and is readily available on all Linux distributions, as well as in Homebrew for OS X. A quick command later and I’m able to connect into the device and get legible text back, though not as colorful and pretty as it might be on a standard monitor. I was almost giddy at this point, but my excitement quickly turned sour once again as soon as I realized my commands weren’t being sent. After all this work just to figure out how to install a fucking OS, I’m back at the same spot I initially started at, staring at an installation screen that isn’t responding to my commands.&lt;/p&gt;

&lt;p&gt;So, to recap, I had my Raspberry Pi running an installer and outputting to the serial console, and I could either send commands and not understand what I was typing or what I was aking for and responding with, or I could be mute, but read what it was asking for. What a fucking mess. I fucked around with using different terminal clients with GNU screen, fucked around with my encoding and locale settings, and fucked with all the configuration variables I could find in minicom, but nothing worked. My permissions on the local tty device wre fine (0666), and the fact that one program could send, but the other couldn’t made for a confusing debugging session.&lt;/p&gt;

&lt;p&gt;And, I guess a fair bit of warning, I’m not exactly sure what this command does outside of changing the tty flow control from hardware to software, but to solve my particular dilemma, running this command fixes everything:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;stty&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /dev/tty.usbserial-A182342O &lt;span class=&quot;nt&quot;&gt;-crtscts&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ixon&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ixoff&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now I can properly talk to my RPi.  I’ve finally got a root console on the device.&lt;/p&gt;

&lt;p&gt;I’m wondering why the installation took a couple hours to complete though, since I can’t remember Debian ever taking this long to install even with a NetInstall image. Either way, I can’t complain too much. And I get a chance to write a new blog post, since I’ve slacked on this for so long.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Multiple Ruby Versions, a battle between rbenv and RVM, CSH edition.</title>
        <link href="https://blog.hplogsdon.com/multiple-ruby-versions-a-battle-between-rbenv-and-rvm-csh-edition/"/>
        <updated>2012-01-26T18:51:06+00:00</updated>
        <id>https://blog.hplogsdon.com/multiple-ruby-versions-a-battle-between-rbenv-and-rvm-csh-edition/</id>
        <content type="html">&lt;p&gt;As a long time user of FreeBSD I’ve developed a liking for the C Shell. Since it’s the default root shell on FreeBSD, I’ve learned how to use it for the situations where I would end up in Single-User mode, or with a bare install that I needed to quickly configure without waiting for Bash and all of it’s many dependancies to compile from the Ports tree.&lt;/p&gt;

&lt;p&gt;Now, I do agree with many of the points that have been made over the years about &lt;a href=&quot;http://web.mit.edu/ghudson/info/csh.whynot&quot;&gt;CSH scripting being a poor programming tool&lt;/a&gt;, but that doesn’t mean that the shell itself is a bad tool. I would rather write shell scripts using the &lt;a href=&quot;http://en.wikipedia.org/wiki/Bourne_shell&quot;&gt;Bourne shell&lt;/a&gt;, which also comes in the base system of FreeBSD, but Bourne is not Bash, and Bash is certainly not Bourne. Don’t ask me why, but I’ve never liked Bash. Just my personal opinion. Unfortunately, liking a relatively unpopular OS (compared to the love-fest that is Linux), and preferring a somewhat uncommon shell leaves me in a awkward position when I find great shell tools that happen to be written in none other than Bash Script.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://rvm.beginrescueend.com/&quot;&gt;RVM&lt;/a&gt; is the first that really got to me. RVM is a great tool &lt;a href=&quot;http://blog.hplogsdon.com/more-ruby-on-os-x/&quot;&gt;I’ve written about before&lt;/a&gt;. I think most anyone who’s spent more than 3 hours playing with Ruby code knows about it. It’s just that essential. However, over the almost two years or so I’ve used it, it’s grown substantially is size and complexity. I’m not the only one that’s noticed that fact either. One of the only dependancies for RVM is the Bash shell (or a Bash-compatible shell, like zsh, which is a popular alternative these days).&lt;/p&gt;

&lt;p&gt;An amazing developer from 37Signals, &lt;a href=&quot;http://sstephenson.us/&quot;&gt;Sam Stephenson&lt;/a&gt;, who’s known for projects like the &lt;a href=&quot;http://www.prototypejs.org/&quot;&gt;Prototype Javascript Library&lt;/a&gt;, wrote an alternative, which turned out to be fairly &lt;a href=&quot;http://news.ycombinator.com/item?id=2874862&quot;&gt;controversial&lt;/a&gt;. This is &lt;a href=&quot;https://github.com/sstephenson/rbenv&quot;&gt;rbenv&lt;/a&gt;. A couple weeks before I started using RVM I wrote a &lt;a href=&quot;http://blog.hplogsdon.com/ruby19-and-18-side-by-side-on-os-x/&quot;&gt;blog post&lt;/a&gt; about method of installing two different versions of Ruby side-by-side on OS X, which basically just put the two versions in separate install paths, and a small script would rewrite symlinks of the binary executable programs hidden away somewhere to a common place in your PATH. Similarly, that’s all that RVM and rbenv do, without the symlinks, but by changing your PATH. You install a version of Ruby into a directory hidden from your PATH, and as requested they alter your path so that it picks up the requested version before anything else. RVM also overwrites other environmental variables to create what it calls Gemsets, which are “clean” directories you can install a group of Rubygems into. It’s fairly useful, but I don’t always need a clean gemset, and to be honest, it ends up adding a fair amount of complexity. I find myself running “rm -rf” a lot on whole gemsets, found in “$HOME/.rvm/gems”, and having to start over.&lt;/p&gt;

&lt;p&gt;I’m rambling a bit here, but what does this have to do with the shells? Well, RVM will not function in any way outside of Bash, since the RVM command is actually a Bash function, not a Bash script. rbenv takes a different approach, and along with a function, it will also use a simple script to load external command scripts. It’s very Unix-y, and that’s why I like it so much. It does one thing, alter your PATH variable to allow different Ruby installations to run, and it does it well. The &lt;a href=&quot;http://gembundler.com/&quot;&gt;Bundler&lt;/a&gt; gem takes care of most of the loading and management of Gems, even when using RVM, so there isn’t a huge need for Gemsets anymore either. There are only a few caveats that you have to be aware of when using rbenv with the C Shell.&lt;/p&gt;

&lt;p&gt;Installing new Ruby versions is really easy, and there is no difference than the README states. It’s actually loading rbenv that changes a bit. The README states to add a couple lines to your .bash_profile initialization script. Since we don’t use Bash, we’ll add our commands to .cshrc, and do some of the initialization “manually”. There isn’t a lot that goes on behind the scenes, so the manual initialization is all of one more line than doing it automatically. Here’s what the relevant lines in my .cshrc state:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;path &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.rbenv/shims &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.rbenv/bin &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
rbenv rehash&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;As you can see, I set the path to the shims and the bin directory in my rbenv working directory, “$HOME/.rbenv”, and then call rehash.&lt;/p&gt;

&lt;p&gt;And that’s it. Almost.&lt;/p&gt;

&lt;p&gt;Using rbenv from that point is exactly like the README states, except when you change versions. Anyone that does use the C Shell knows that after installing a new program into your path, you have to rehash the cache that knows which programs are where. rbenv, oddly, takes this same approach. It won’t know about new Ruby versions until you tell it to re-index it’s cache. This means that any time you change Ruby versions (which should really be all that often) you’ll have to manually run csh’s “rehash” command so it knows where to find the new Ruby tools.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Terminal.app Home and End keys and Vim</title>
        <link href="https://blog.hplogsdon.com/terminal-app-home-end-keys-and-vim/"/>
        <updated>2011-12-08T17:49:25+00:00</updated>
        <id>https://blog.hplogsdon.com/terminal-app-home-end-keys-and-vim/</id>
        <content type="html">&lt;p&gt;There are dozens of people complaining about Terminal.app’s handling of Home and End keys (and page up/down as well) on the internet, all with fixes. The reality is, Terminal.app on OS X doesn’t provide the correct keycodes out of the box, and the fix is really simple.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://theandystratton.com/2009/fixing-home-end-page-up-and-page-down-in-leopards-terminal&quot;&gt;This post on theandystratton.com&lt;/a&gt; from back in 2009 is one I’ve had to go to a couple of times to remember exactly how to enter in the correct keycodes in Terminal.app’s preferences. His method just takes the simple approach of aliasing the old terminal keycodes of CTRL+a and CTRL+e (home and end, respectively) into the home and end keys on the OS X keyboard. Unfortunately, those keycodes end up not working in VIM.&lt;/p&gt;

&lt;p&gt;A comment on that site then goes into detail on changing those keycodes to something different, (\033[7~ and \033[4~), which do work in VIM, but end up spitting out tildes in the terminal. So how can we get a compromise, to have home and end work in both Terminal.app and VIM running in terminal? Pretty easy, actually.&lt;/p&gt;

&lt;p&gt;The simple idea, re-alias the correct home/and keycodes into VIM’s already defined movement commands. The correct keycodes are the \001 and \005 commands in this case (ctrl+a and ctrl+e).&lt;/p&gt;

&lt;p&gt;VIM all by it’s lonesome uses the character ‘0’ (zero) to move to the beginning of the line, and the ‘$’ (US Cash symbol) to move to the end. By aliasing Home and End, we can then use the common keyboard functions to move effectively. The hardest part was figuring out how to ender in control sequences into a text file (our vimrc in this case).&lt;/p&gt;

&lt;p&gt;Here is what the vimrc directives look like:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot; Fix home and end in Terminal.app
&quot; end
map ^E $
imap ^E ^O$
&quot; home
map ^A g0
imap ^A ^Og0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But long story short, just entering in each character won’t work. For end’s normal map the correct character sequence is “ CTRL+v END “ in two separate steps. And for the insert remap (imap), it’s the same character sequence, then “ CTRL+v O $” (the letter o, not the number), which can be copied to home as well.&lt;/p&gt;

&lt;p&gt;CTRL+v is a special sequence in many terminals that basically notifies the shell that you will be entering a command sequence raw, and want to output the sequence, not run the sequence, similarly to escaping special characters line newlines (\n) or carriage returns (\r). If you ever use Vim to do a global replace of DOS newlines which appear as “^M”, instead of typing the Caret and a capital M, you would have to type “ :%s/CTRL+v M/\n/g “, which would show up on the screen as “ :%s/^M/\n/g”&lt;/p&gt;

&lt;p&gt;Anyways, hope that helps other people that happen to stumble on this.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Things I Wish I Had Known 10 Years Ago</title>
        <link href="https://blog.hplogsdon.com/things-i-wish-i-had-known-10-years-ago/"/>
        <updated>2011-07-01T21:07:09+00:00</updated>
        <id>https://blog.hplogsdon.com/things-i-wish-i-had-known-10-years-ago/</id>
        <content type="html">&lt;p&gt;If there’s one thing most people agree upon about me, it’s that I’m passionate about what I do. Whether that be my current day job or my hobbies, when I start something, I like to get it finished, and then figure out how I can do it better. That latter thought is a kicker though. How to do things better. There are thousands of self-help books, coaches and seminars you could participate in that are geared to helping people do everything better. But, what are some things that &lt;em&gt;won’t&lt;/em&gt; help you get better?&lt;/p&gt;

&lt;p&gt;Over the past 10 years, I’ve helped start and run the business I’m in today, and I’m currently starting to branch out and try something new completely on my own. During that time, I’ve come across a few pieces of information, either from others or by failing at something, that I’d like to share.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Verbal agreements are worse than no agreement.&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;If there is anything that working with other businesses and people has taught me, it’s that verbal agreements are designed to be broken somehow. Not that agreeing with others is a bad thing, its that they are not reliable. Trying to save your business by agreeing with another party that they will or will not do something is like trying to weather a flood by hanging onto an inflated party balloon. If an agreement is important enough for you, you need to make it enticing for the other party, and then &lt;em&gt;write the agreement down,&lt;/em&gt; so both parties know that there will be consequences if it is broken.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Self employment means spending 3 days out of the week collecting the money you made the other 2 days of the week.&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;It means just that. For every day you spend working on what you love, you will probably spend 150% of that time trying to get your clients to pay you. Going along with #1, this means that any contracts must be written, agreed upon, and signed to signify that both parties agree. Contracts should have limits as to how long payments can be deferred until they become past due, and there should be a defined penalty for late payments.&lt;/p&gt;

    &lt;p&gt;The 150% rule is not exact though, as you can be working on other projects during that time. It still doesn’t take away from the fact that finishing a job means that you will get to eat that week. It means you’ll get to eat, &lt;em&gt;sometime in the near future&lt;/em&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Learn how to stay organized.&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Being unorganized is messy. It also means you will miss appointments, forget a client’s project, and most importantly, make you look bad. Set up a system that not only reminds you of the things that you need to do, but can actually penalize you for failing to do them. Tough love towards yourself. If you master this, you will look like a superhero to others.&lt;/p&gt;

    &lt;p&gt;This is an area that many people suffer. Especially Programmers and Engineers. Most of the time, we just want to sit back and write great code and create cool things, but when it comes down to being reliable, we suck. This is probably the best area to master, as being reliable and dependable is the most important feature a client can look for.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Waste less time.&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Similar to #3, step back and take a look at how you work. When I first started working, I used to take every job sequentially. At first, this was a great idea to stay organized and not mix up jobs, but there would be times where I would be waiting for a machine or automated system to finish and I wouldn’t actually be working. Now, I have a fairly simple routine where I start working on other parts of the job during those periods, and actually have enough time to get the next project well underway well before the first project is finished. Repeat, and I never have points where I’m just sitting there, waiting for other people or machines to do their things.&lt;/p&gt;

    &lt;p&gt;In regards to programming, compile time, or running unit tests can take a long time. In compiling the Chromium project, my average computer that needs a bit more ram takes 14 minutes to do a “clean” compile (where no code has changed between each Make session). That’s a lot of time to waste. So don’t just sit there on Twitter or Facebook, or play lightsaber battles with your co-workers. Read through the TODO’s in the code, or scour the bug reports for something relevant for the area of code you are working on.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Own up to your mistakes.&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Fucking up is fun. We all do it, we all don’t want to do it, and we all ask ourselves “what if…” afterwards. Instead of dwelling on what you could have done differently, admit to yourself that whatever you did was wrong, and figure out exactly what happened, and why. But don’t take it any further than that. As soon as you know why everything exploded in your face, figure out how to avoid it &lt;em&gt;next time, not last time&lt;/em&gt;.&lt;/p&gt;

    &lt;p&gt;It takes real courage to be the one to stand in front of a crowd an admit that yes, you are the reason the web app went offline for 5 hours yesterday, because you deployed directly to production instead of testing your commit, or that you weren’t really paying attention and accidentally broke a part on a client’s watch. Owning up to your mistakes is interesting. It will get you attention, but everyone fears it will label you as a “breaker of stuff” when actually it shows that you are aware of what happened, have already assessed the situation yourself, and are prepared to fix what you did wrong.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Whatever you do, don’t be the one that never breaks things.&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;You don’t learn anything that way&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Make it clear that estimates are non-binding.&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Ah, estimates. Both a lifesaver, and the worst thing invented. When I give a client an estimate, I be sure to state that all estimates are non-binding, and any agreed price is subject to change, as well as give them a 15% or $50.00 margin of error, where if the price is to rise to the lowest of the two points, I’ll give them a call and confirm the new number. This covers any job up to about $450.00.&lt;/p&gt;

    &lt;p&gt;Long story short, you need to ensure your client knows this. Last thing you want is someone agreeing on a job for a few hundred, not realizing that your few is actually 700. Estimates should also be written and signed for as much as a dedicated price, like contracts are described in #2.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This certainly is not an exhaustive list, but it is a start. There are plenty of things I wish I would have known, but most are corner cases. These at least let me vent a little bit of my frustration from the past few weeks, and why I want to start a new business doing something entirely different.&lt;/p&gt;

&lt;p&gt;I’ll keep you informed, and we’ll see how it goes.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Unconventional Database Table Names in Ruby on Rails 3</title>
        <link href="https://blog.hplogsdon.com/unconventional-database-names-in-ruby-on-rails-3/"/>
        <updated>2011-04-03T01:02:14+00:00</updated>
        <id>https://blog.hplogsdon.com/unconventional-database-names-in-ruby-on-rails-3/</id>
        <content type="html">&lt;p&gt;One of the great things about Ruby on Rails is it’s “Opinionated Conventions”. Not having to worry about linking a model to a database table is one of the most brilliant ideas I have come across. I’m glad various other frameworks across many languages are following that path. Does it really matter if your table name is “posts” or “post”? Well, for me right now, yes. And it sucks. Thankfully Rails allows us to go against convention when we really need to.&lt;/p&gt;

&lt;p&gt;I’ve got a SQL database with some images stuck in there as binary blobs from a WordPress shopping cart plugin. Not the smartest idea in the world, but I guess it works for the plugin. Unfortunately, it doesn’t work with anything else unless I convert everything to that format. I actually need to migrate all the data in this database over to another application, which is a different PHP e-commerce application, and because I know Ruby fairly well, as well as ActiveRecord, the Rails ORM, I figured it would be pretty easy to plug in a simple script using a bunch of the Rails gems in the middle to transfer it all. I’ve run into a couple issues, mostly due to the way the WordPress plugin designed their database tables, which requires me to hack at my Rails-like script.&lt;/p&gt;

&lt;p&gt;I’m not using a full Rails application for this script, but I am loading a lot of the components of Rails. To make my life easier, I started a new Rails application, and slowly took out a few components at a time until I was left with a skeleton project consisting of some Rake tasks and ActiveRecord models, plus all their dependancies.&lt;/p&gt;

&lt;p&gt;Long story short, the current WordPress database has tables with a  prefix similar to “wp_q9rdw3_”. I’m assuming that the shared hosting provider that was hosting the WordPress site configured the WP database to have that prefix for the global WordPress install. Next, the plugin prefixes it’s tables with it’s name, which results in a table like “wp_q9rdw3_plugin_product”. Because I don’t care about the actual WordPress database, only the plugin data, I can set a Rails configuration variable in config/application.rb to have a global prefix of “wp_q9rdw3_plugin_”. Take note in the original table name though, it’s a singular name: “product” instead of “products”.&lt;/p&gt;

&lt;p&gt;Rails (ActiveRecord, specifically) also gives us an option to make our Rails database table names to be singular. This is pretty cool stuff, and I was actually surprised to see it in the API.&lt;/p&gt;

&lt;p&gt;So, instead of having to manually configure a unique and cryptic table name for every single one of my models, and then manually link each model together to figure out my relationships by specifying tables and fields (not very DRY, if you ask me) all I have to do is write 2 lines of code in config/application.rb:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module MyApp
	class Application &amp;lt; Rails::Application
		# Initial configuration stuff here...
		config.active_record.table_name_prefix = &apos;wp_q9rdw3_plugin_&apos;
		config.active_record.pluralize_table_names = false
	end
end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I love Rails.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>iOS applications without any Nib Files</title>
        <link href="https://blog.hplogsdon.com/ios-applications-without-any-nib-files/"/>
        <updated>2011-02-19T00:36:33+00:00</updated>
        <id>https://blog.hplogsdon.com/ios-applications-without-any-nib-files/</id>
        <content type="html">&lt;p&gt;I’m no expert UI designer, but my mind is better kept in code, not diagrams. When building iOS applications for the iPhone and iPad devices, Interface Builder is a great tool to get a bunch of stuff fleshed out quickly, but at least for myself, I get frustrated quickly when my project grows and I have to constantly switch between a half dozen windows trying to understand why one object isn’t updating or displaying correctly. One line of code would fix it, but since the entire interface is in a Nib, I don’t even know where to put that one line of code to keep my code clean.&lt;/p&gt;

&lt;p&gt;This is where this post comes in. What if you wanted to remove all your Nibs from your project. Everything is easy to implement directly in code, except for that MainWindow.xib that you seem to have to keep. As soon as you try to replace that, the app goes blank. We need to start at the beginning of the application lifecycle, which is in main.m.&lt;/p&gt;

&lt;p&gt;If you open up main.m, you’ll see the standard stuff that hardly ever changes:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;int main(int argc, char *argv[]) {
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
	int retVal = UIApplicationMain(argc, argv, nil, nil);
	[pool release];
	return retVal;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What does it all mean though? Since Objective C is a superset of C, int main() is the main run loop. Every C and Objective C program starts here. But it doesn’t look like it does a whole lot. NSAutoreleasePool is an object that controls and maintains the state of every object’s release/retain value. Anytime you allocate and initialize an object, your application’s pool object gets notified, and it increases the retain count on that object you just allocated. Whenever you release an object, the pool gets notified and it decreases the retain count. Autorelease is a little different, since it will go around and see if anyone (objects) have any of their hands holding the object, and if they do, it will pass, and if no one seems to have any connection to that object, the pool will release that object. Whenever an object’s retain count ends up with no one holding on to it, it calls dealloc. Everyone should know this by reading through Apple’s &lt;a href=&quot;http://developer.apple.com/library/ios/#documentation/general/conceptual/DevPedia-CocoaCore/MemoryManagement.html&quot;&gt;Memory Management&lt;/a&gt; documentation. The second to last statement is the pool releasing itself. When it’s “self” ends up with a retain count of 0, it exits cleanly. Not very spectacular, but it does a great job at it.&lt;/p&gt;

&lt;p&gt;But how do we stick all that Objective C stuff into the program? And more importantly, what about that whole MainWindow.nib thing we originally set out to do? Well, we have to look at the next line, which does a few things. For one, you can see it initializes an integer called retVal, which obviously holds the return value of the UIApplicationMan() function. Mac OS X Applications will be called NSApplication, but iOS applications will be UIApplication. They both work exactly the same way, at least right here. Going past the NS/UIApplicationMain call, they change quite a bit, but we don’t care about that right now. UIApplicationMain() is a standard C function that pulls in all the Objective C stuff, does all the heavy lifting and it ends up running it’s own mainloop inside of int main(). Whenever it quits, it returns an integer, which you can easily see where that ends up. If you check out the first two parameters for the UIApplicationMain(), you’ll see that they are verbatim passes of whatever arguments were passed to int main(). This lets all UIKit and AppKit applications be called from the terminal, which may be useful for debugging, and converting Cocoa apps to command line utilities. The next two parameters are used only in UIApplication programs and are probably nil in the example, but both of the arguments should be NString values, like @”SomeParameter”. NSApplication does something different here, which I’ll explain later.&lt;/p&gt;

&lt;p&gt;The first is the principalClassName. Basically, all UIKit and AppKit applications are one giant object called a UIApplication, like I mentioned above. This object can be subclassed and you can create your own application type. I can’t think of a use that would be anything but some weird edge-case, so unless you need to override it and have a valid use, you probably shouldn’t. If you pass nil to it, it automagically loads UIApplication on it’s own, so you don’t have to decide. This gets loaded via KVC/KVO.&lt;/p&gt;

&lt;p&gt;The second nil in the example is the Application Delegate, which gets loaded the same way as above. When you toss your application into it’s runloop, and it can’t find anything that says “Hay, I’ve been told I’m in charge of doing this thing”, it will quit. By default, iOS applications will look into their bundle at the Info.plist and grab the delegate in charge of the view of MainWindow.nib. If you open up MainWindow.xib in IB, you’ll see that there is an AppDelegate object in the list of objects, who’s class is MyAppAppDelegate. That basically means that when the application launches, the control is in the hands of the system. The system looks into the Info.plist, which says that the main window is MainWindow.nib, and that says that MyAppAppDelegate is in charge of delegating control over the process. A bit of back-and-forth, but it works well. If you delete MainWindow.xib from your project, your app will look into the Info.plist, and then get all confused because there is no MainWindow to look at, so replace the last argument of nil with whatever your AppDelegate is. You’ll also need to remove the “Main nib file base name” key-value pair fron Info.plist. I spend a few minutes at the start of every project cleaning my directories and project up, one of which is refactoring SomeApplicationNameAppDelegate to be named AppDelegate, unless I need more than one, which isn’t that common with how I do iOS programming. So for my example, I replace that line with:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;int retVal = UIApplicationMain(argc, argv, nil, @&quot;AppDelegate&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then, you should all know that AppDelegate ends up loading all the view controllers it needs at its applicationDidFinishLaunching method, and whatever you have configured to be your first/root view gets pushed to the screen. From here, it is some simple coding to get whatever you need.&lt;/p&gt;

&lt;p&gt;Hope that helps you understand the few little quirks and functions a iOS application runs through from the time you press the icon on the homescreen to the time applicationDidFinishLaunching gets called.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Mac OS 10.6.5 - /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument </title>
        <link href="https://blog.hplogsdon.com/mac-os-10-6-5-usrsbinapachectl-line-82-ulimit-open-files-cannot-modify-limit-invalid-argument/"/>
        <updated>2011-01-24T05:14:58+00:00</updated>
        <id>https://blog.hplogsdon.com/mac-os-10-6-5-usrsbinapachectl-line-82-ulimit-open-files-cannot-modify-limit-invalid-argument/</id>
        <content type="html">&lt;p&gt;It’s been a while since I’ve posted anything. Been a busy year so far. So busy, that I haven’t hacked at my apache configuration in a while, and have been focusing on frontends of applications and stayed away from the backends. Up until today. I ran into an issue that required me to reload my php.ini, by restarting apache. No big deal, except for this little error:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What the hell? A little digging around and I see that Mac OS 10.6.5 updated the included Apache package, including some bug fixes.  Apparently they left out a change that would have prevented this error. Luckily it is a quick fix, make a backup copy, and then open up /usr/sbin/apachectl in your favorite editor with root permissions and search for “ULIMIT_MAX_FILES”:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo cp /usr/sbin/apachectl /usr/sbin/apachectl.BAK
sudo vim /usr/sbin/apachectl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then remove everything in the quotes, as shown in this diff:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-diff&quot; data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;gh&quot;&gt;diff -rupN a/apachectl b/apachectl
&lt;/span&gt;&lt;span class=&quot;gd&quot;&gt;--- a/apachectl	2011-01-23 21:03:49.000000000 -0700
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+++ b/apachectl	2011-01-23 21:04:08.000000000 -0700
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;@@ -61,7 +61,7 @@&lt;/span&gt; STATUSURL=&quot;http://localhost:80/server-st
 # number of file descriptors allowed per child process. This is
 # critical for configurations that use many file descriptors,
 # such as mass vhosting, or a multithreaded server.
&lt;span class=&quot;gd&quot;&gt;-ULIMIT_MAX_FILES=&quot;ulimit -S -n `ulimit -H -n`&quot;
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+ULIMIT_MAX_FILES=&quot;&quot;
&lt;/span&gt; # --------------------                              --------------------
 # ||||||||||||||||||||   END CONFIGURATION SECTION  ||||||||||||||||||||&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then you’re good to go. If you are uncomfortable editing system commands in an editor, feel free to save that diff to your home directory as a file called apachectl.patch, or similar and run it with:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;patch -p1 &amp;lt; ~/apachectl.patch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That should take care of everything. For more information on diff files and patching, query:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;man patch
man diff
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or check out this article &lt;a href=&quot;http://stephenjungels.com/jungels.net/articles/diff-patch-ten-minutes.html&quot;&gt;The Ten Minute Guide to diff and patch&lt;/a&gt; which I’ll admit to referring to every once in a while when I need to create a patch by hand.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Installing MongoDB on OS X</title>
        <link href="https://blog.hplogsdon.com/installing-mongodb-on-os-x/"/>
        <updated>2010-11-24T04:17:40+00:00</updated>
        <id>https://blog.hplogsdon.com/installing-mongodb-on-os-x/</id>
        <content type="html">&lt;p&gt;I like compiling and installing programs and utilities by hand on my development machines. Today, I decided to try one of the “new” NoSQL solutions, namely &lt;a href=&quot;http://www.mongodb.org/&quot;&gt;MongoDB&lt;/a&gt;. Unsurprisingly, there were no surprises. I did end up creating a new user on my machine, and borrowed a plist LaunchDaemon from the Homebrew project to configure it. Heres the simple commands that can help you not have to worry about running the database as your user or having to start it up every time you reboot your machine.&lt;/p&gt;

&lt;p&gt;Installing MongoDB is stupidly easy. If you don’t care to compile it yourself, which requires the Boost Library as well, then you can download the pre-compiled binaries.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ curl -O http://fastdl.mongodb.org/osx/mongodb-osx-i386-1.6.4.tgz
$ cd /usr/local
$ tar -xz --strip-components 1 -f ~/mongodb-osx-i386-1.6.4.tgz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create the data directory. I want to put it in /private/var/db/, since that is where I have both PostgreSQL and MySQL’s data directories.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mkdir /private/var/db/mongo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Running it is a simple as typing mongod.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mongod --dbpath /var/db/mongo/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Getting it to run as its own user, as well as getting it to start up after every boot is a little more work. But not difficult at all. Lets start by creating a configuration file at /usr/local/etc/mongod.conf. The only thing we really need to put in it is an IP address to bind to, and the path to the data directory.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dbpath = /private/var/db/mongo
bind_ip = 127.0.0.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can test that by restarting the server without the dbpath flag, but adding –config and then the path to the config file you just wrote.&lt;/p&gt;

&lt;p&gt;Lets get this sucker running without us even knowing about it.&lt;/p&gt;

&lt;p&gt;Create a new plist file. Since I am running this as a system process, instead of a user process, it will go in /Library/LaunchDaemons. Per the standard, it should be named “org.mongodb.mongod.plist”, which is basically the group/organization (their web address) that wrote the software, and then the binary name that we are executing. If I recall, this is either borrowed from Java, or Java borrowed it. A simple convention either way. Toss this text in there.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&amp;gt;
&amp;lt;plist version=&quot;1.0&quot;&amp;gt;
	&amp;lt;dict&amp;gt;
		&amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;org.mongodb.mongod&amp;lt;/string&amp;gt;
		&amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;
		&amp;lt;array&amp;gt;
			&amp;lt;string&amp;gt;/usr/local/bin/mongod&amp;lt;/string&amp;gt;
			&amp;lt;string&amp;gt;run&amp;lt;/string&amp;gt;
			&amp;lt;string&amp;gt;--config&amp;lt;/string&amp;gt;
			&amp;lt;string&amp;gt;/usr/local/etc/mongod.conf&amp;lt;/string&amp;gt;
		&amp;lt;/array&amp;gt;
		&amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;
		&amp;lt;true/&amp;gt;
		&amp;lt;key&amp;gt;KeepAlive&amp;lt;/key&amp;gt;
		&amp;lt;true/&amp;gt;
		&amp;lt;key&amp;gt;UserName&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;_mongodb&amp;lt;/string&amp;gt;
		&amp;lt;key&amp;gt;WorkingDirectory&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;/private/var/db/mongo&amp;lt;/string&amp;gt;
		&amp;lt;key&amp;gt;StandardErrorPath&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;/private/var/log/mongodb/output.log&amp;lt;/string&amp;gt;
		&amp;lt;key&amp;gt;StandardOutPath&amp;lt;/key&amp;gt;
		&amp;lt;string&amp;gt;/private/var/log/mongodb/output.log&amp;lt;/string&amp;gt;
	&amp;lt;/dict&amp;gt;
&amp;lt;/plist&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You might notice we tell it to run as UserName _mongodb, which we havent created yet. Lets do that now. Other Unixes would just create a user. OS X is a little different. We want the user registered with the system. We have to do this manually, including choosing a spare User and Group ID. Lets figure out one that has not yet been taken.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dscl . -list /Groups PrimaryGroupID | awk &apos;{print $2}&apos; | sort -n
dscl . -list /Users UniqueID | awk &apos;{print $2}&apos; | sort -n
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I chose the number 114. If that is free on your system for both Group and User IDs, then go ahead and take it. System accounts generally are prefixed with an underscore, so we’ll do that as well as shown in the plist file.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo dscl . create /Users/_mongodb UniqueID 114
sudo dscl . create /Users/_mongodb PrimaryGroupID 114
sudo dscl . create /Users/_mongodb NFSHomeDirectory /private/var/db/mongo/
sudo dscl . create /Users/_mongodb RealName &quot;MongoDB Server&quot;
sudo dscl . create /Users/_mongodb Password &quot;*&quot;
sudo dscl . append /Users/_mongodb RecordName mongodb

sudo dscl . create /Groups/_mongodb
sudo dscl . create /Groups/_mongodb PrimaryGroupID 114
sudo dscl . append /Groups/_mongodb RecordName mongodb
sudo dscl . create /Groups/_mongodb RealName &quot;MongoDB Users&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then to finish it off, cleanly shutdown any mongod instances you may have running in separate terminals, and then chown the database datadir to your new user.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo chown -R _mongodb:_mongodb /private/var/db/mongo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and to clean up an error that will occur when you try to start it, create a directory to store your log files and either give it permission to write to the directory, or chown it outright.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mkdir /var/log/mongodb &amp;amp;&amp;amp; sudo chown _mongodb:_mongodb /var/log/mongo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And you’re done. Start up the server with the plist:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo launchctl load -w /Library/LaunchDaemons/org.mongodb.mongod.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then reconnect a client to it, without any configuration or dbdir flags.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mongo
MongoDB shell version: 1.6.4
connecting to: test
&amp;gt; db.foo.save( { a : 1 } )
&amp;gt; db.foo.find()
&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Congratulations. Everything should work, and it will shutdown and restart cleanly with your machine.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Tuning Freebsd for Apple Hardware</title>
        <link href="https://blog.hplogsdon.com/tuning-freebsd-for-apple-hardware/"/>
        <updated>2010-11-01T19:14:27+00:00</updated>
        <id>https://blog.hplogsdon.com/tuning-freebsd-for-apple-hardware/</id>
        <content type="html">&lt;p&gt;My last post, &lt;a href=&quot;http://hplogsdon.com/freebsd-on-apple-hardware-part-two/&quot;&gt;FreeBSD on Apple Hardware Part 2&lt;/a&gt;, went over how I installed FreeBSD on consumer Mac hardware. But FreeBSD, being a super awesome server platform, doesn’t run the greatest out of the box on desktop systems. Doing some simple Google searches turns up a vast array of people trying to run and configure it though. Here, I’ll try to combine a lot of those articles. For reference, I am configuring my macbookpro1,1 and imac7,1.&lt;/p&gt;

&lt;h2 id=&quot;power-management&quot;&gt;Power Management&lt;/h2&gt;
&lt;p&gt;At first, FreeBSD will make your hardware run fast and hot while idling. My MacBookPro can run about 3 hours from a full battery under OS X. By default, it will only run about 70 minutes under FreeBSD. powerd(8) can help with this. Configuring it to be adaptive will lower the CPU consumption. Turn on powerd(8) by /etc/rc.d/powerd, or by rebooting.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# /etc/rc.conf
powerd_enable=&quot;YES&quot;
powerd_flags=&quot;-a adaptive -b adaptive&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can check the battery status with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sysctl hw.acpi.battery&lt;/code&gt;. I think hw.acpi.battery.time is a percentage time, not a numeric time.&lt;/p&gt;

&lt;p&gt;I still have not had much success with suspend/resume. I’m working on that configuration, and will update this post later, or post something new. I haven’t had any success with my LCD brightness either. The macbookpro1,1 doesn’t seem to have the correct driver through ATI, but it appears that someone has written a backlight driver for those with later models (3,1 specifically). His or Her page is &lt;a href=&quot;http://www.lamaiziere.net/mbp_freebsd.html&quot;&gt;Macbookpro FreeBSD&lt;/a&gt;. I might end up seeing how related the driver is to my system and If I can hack it to work on mine. My C is a little weak though, so who knows.&lt;/p&gt;

&lt;h2 id=&quot;keyboard-backlight&quot;&gt;Keyboard Backlight&lt;/h2&gt;
&lt;p&gt;I have not scripted this to be responsive to the environment, but that is my next real project. You can check your ambient lighting sensors with&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sysctl dev.asmc.0.light.left
sysctl dev.asmc.0.light.right
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and change the keyboard backlight by modifying the value of&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sysctl dev.asmc.0.light.control
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to any integer between 0 and 255, 0 being off and 255 being full.&lt;/p&gt;

&lt;h2 id=&quot;wireless-networking&quot;&gt;Wireless Networking&lt;/h2&gt;
&lt;p&gt;To be honest, since my MacBook Pro has an atheros chip, &lt;a href=&quot;http://www.freebsd.org/doc/handbook/network-wireless.html&quot;&gt;The FreeBSD Handbook - Wireless Networking&lt;/a&gt; was all the information I needed. The only trouble I’ve run into is when I visit a location without auth-security. I end up creating a duplicate wlan cloned interface that connects directly with DHCP, and then restart /etc/rc.d/netif&lt;/p&gt;

&lt;p&gt;My iMac doesn’t move, and it connects via ethernet. No configuration there.&lt;/p&gt;

&lt;h2 id=&quot;tmpfs&quot;&gt;tmpfs&lt;/h2&gt;
&lt;p&gt;You may have noticed that I didn’t partition my disk to have a separate /tmp partition or slice. I use tmpfs. (It also didn’t have a seperate /usr/home or /home partition, but thats because I don’t yet care.)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# /boot/loader.conf
tmpfs_load=&quot;YES&quot;

# /etc/fstab
tmpfs    /tmp    tmpfs  rw,mode=0177   0   0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2 id=&quot;multitouch-trackpad&quot;&gt;MultiTouch Trackpad&lt;/h2&gt;
&lt;p&gt;I originally installed 8.1-RELEASE, but have since updated to 9.0-CURRENT. 9.0-CURRENT has included the atp(4) driver for Apple Touchpads. I recommend you download and update your system to -CURRENT, or 9.0-RELEASE, whenever that comes out.&lt;/p&gt;

&lt;h2 id=&quot;sound-and-audio&quot;&gt;Sound and Audio&lt;/h2&gt;
&lt;p&gt;Both my iMac and my MacBook Pro use snd_hda(4) as the driver. I’ve now compiled it directly into the kernel, but it can be easily loaded with&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# kldload snd_hda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;or by adding this line to /boot/loader.conf:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;snd_hda_load=&quot;YES&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But, with both computers, sound still didn’t work. Right now, a month or more after running BSD almost full time, at least on my MacBook Pro, it still isn’t working completely correctly. On my MacBook Pro, the lines I stick into /boot/device.hints to get my sound working through the speakers is:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hint.hdac.0.cad0.nid10.config=&quot;as=2 seq=2&quot;
hint.hdac.0.cad0.nid12.config=&quot;as=4 seq=1&quot;
hint.hdac.0.config=&quot;gpio0&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and in order to route it through the headphone jack, I have to stick these lines into /boot/device.hints:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hint.hdac.0.cad0.nid10.config=&quot;as=2 seq=2&quot;
hint.hdac.0.cad0.nid11.config=&quot;as=0 seq=2&quot;
hint.hdac.0.cad0.nid12.config=&quot;as=4 seq=1&quot;
hint.hdac.0.cad0.nid15.config=&quot;as=0 seq=2&quot;
hint.hdac.0.config=&quot;gpio0 ovref&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, there is a bit of duplication. I’m not completely sure how to combine these two groups to get speakers to work by default. Whenever I have the headphone jack lines in the device.hints file, the speakers quite working. Whenever I remove them, the speakers work again.&lt;/p&gt;

&lt;p&gt;And the fact that I have to reboot my fucking computer every time I make one change in order for the device to  reconfigured makes the  fine tuning of my speakers a bitch to do, so it might be a while until I figure it out.&lt;/p&gt;

&lt;p&gt;On my iMac, the sound in tinny. There is no bass sound, and that sucks. Also if I bring both PCM and VOL volumes up very high, and REC is up even a tiny bit, the speakers go haywire and the girlfriend starts throwing shit at me to turn it off. I haven’t given up on adjusting the sound, but it takes a lit of effort.&lt;/p&gt;

&lt;p&gt;I’ll continue to edit this post as more information comes up… I cant remember thing that I have done.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Recompiling PHP 5.3 on Snow Leopard</title>
        <link href="https://blog.hplogsdon.com/recompiling-php-5-3-on-snow-leopard/"/>
        <updated>2010-10-27T01:41:58+00:00</updated>
        <id>https://blog.hplogsdon.com/recompiling-php-5-3-on-snow-leopard/</id>
        <content type="html">&lt;p&gt;Despite my having FreeBSD dualboot systems, I still find myself in OS X quite a bit. Enough that I now require an expanded PHP version than the one that came with Snow Leopard. Basically, I can’t do any graphics work in freebsd, but code hacking works well. It’s a tradeoff.&lt;/p&gt;

&lt;p&gt;Here’s a quick post on my configuration parameters.&lt;/p&gt;

&lt;p&gt;Dependencies,&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;libjpeg &lt;a href=&quot;http://www.ijg.org/&quot;&gt;The Independent JPEG Group&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;MySQL &lt;a href=&quot;http://www.mysql.com/&quot;&gt;MySQL from Oracle&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;PCRE &lt;a href=&quot;&quot;&gt;PCRE&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;libmcrypt &lt;a href=&quot;http://mcrypt.hellug.gr/&quot;&gt;Mcrypt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS=&quot;-arch x86_64 -arch i386 -g -Os -pipe -no-cpp-precomp&quot; CCFLAGS=&quot;-arch x86_64 -arch i386 -g -Os -pipe&quot; CXXFLAGS=&quot;-arch x86_64 -arch i386 -g -Os -pipe&quot; LDFLAGS=&quot;-arch x86_64 -arch i386 -bind_at_load&quot; ./configure --prefix=/usr/local --mandir=/usr/local/share/man --infodir=/usr/local/share/info --disable-dependency-tracking --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --with-curl=/usr --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6 --with-ldap=/usr --with-ldap-sasl=/usr --enable-mbstring --enable-mbregex --with-mcrypt=/usr/local --with-mysql=/usr/local --with-mysqli=/usr/local/bin/mysql_config --with-pdo-mysql=/usr/local --with-mysql-sock=/var/mysql/mysql.sock --with-iodbc=/usr --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sockets --enable-sysvsem --enable-sysvshm --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr --with-pcre-regex=/usr/local --disable-short-tags
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Though, if you don’t feel the need to update the entire PHP release, then you can just do individual modules. Say you wanted to do the mcrypt extension. You’ll have to unpack the entire php distribution.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ~/src/php-5.3.3/
$ cd ext/mcrypt
$ /usr/bin/phpize
$ MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS=&apos;-O3 -fno-common -arch i386 -arch x86_64&apos; \
&amp;gt; LDFLAGS=&apos;-O3 -arch i386 -arch x86_64&apos; CXXFLAGS=&apos;-O3 -fno-common -arch i386 -arch x86_64&apos; \
&amp;gt;  ./configure --with-php-config=/Developer/SDKs/MacOSX10.6.sdk/usr/bin/php-config
$ make
$ sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then add that line to your php.ini and then restart apache&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;extension=mcrypt.so
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</content>
    </entry>
    
    <entry>
        <title>Domain Fidgeting</title>
        <link href="https://blog.hplogsdon.com/domain-fidgeting/"/>
        <updated>2010-10-14T20:49:07+00:00</updated>
        <id>https://blog.hplogsdon.com/domain-fidgeting/</id>
        <content type="html">&lt;p&gt;You probably haven’t noticed, but I moved this blog from hplogsdon.com to &lt;a href=&quot;http://blog.hplogsdon.com/&quot;&gt;blog.hplogsdon.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I moved my Wiki, that I hardly ever use, to &lt;a href=&quot;http://wiki.hplogsdon.com/&quot;&gt;wiki.hplogsdon.com&lt;/a&gt;, and for now, all my old links are 301 directed to the new subdomain. I want to start hacking on the root domain a little bit more. I’ve normally hacked away at my home computers and servers, but this gives me a little more comfort room and less headaches when I script something that sends out emails, as I hilariously stuck my home IP address on a mailserver blacklist while writing a script the other day that re-ran all of its tests, including sending an email to my gmail account, every time I saved it…&lt;/p&gt;

&lt;p&gt;I’m an idiot.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>FreeBSD on Apple Hardware Part Two </title>
        <link href="https://blog.hplogsdon.com/freebsd-on-apple-hardware-part-two/"/>
        <updated>2010-09-07T04:22:44+00:00</updated>
        <id>https://blog.hplogsdon.com/freebsd-on-apple-hardware-part-two/</id>
        <content type="html">&lt;p&gt;Some time ago, I attempted to install FreeBSD on my &lt;a href=&quot;http://hplogsdon.com/freebsd-os-x-dualboot/&quot;&gt;Apple MacBook Pro CoreDuo&lt;/a&gt;, but ended up getting frustrated with the booting process and wiped it clean. 7.0-RELEASE attempted to enable GUID Partition Table support, but it didn’t seem to be available or working until 7.1-RELEASE. Well, now that 8.1-RELEASE is out the door (for a while now) it seems that support is much better. I hadn’t had a chance to test it yet, but I became frustrated with my iMac over the past few months and last week it finally hit critical mass. Now seems to be the time to try this out and see if I can get a very usable FreeBSD desktop.&lt;/p&gt;

&lt;p&gt;Mac OS X comes out of the box with &lt;a href=&quot;http://en.wikipedia.org/wiki/Extensible_Firmware_Interface&quot;&gt;EFI booting&lt;/a&gt;, instead of Legacy BIOS firmware booting, and the disks are configured with &lt;a href=&quot;http://en.wikipedia.org/wiki/GUID_Partition_Table&quot;&gt;GUID Partition Tables (GPT)&lt;/a&gt;. EFI, on OS X, works by creating a small partition (200MB) as the first partition formatted as FAT32, which is hidden to users, and contains the image that gets loaded and goes ahead and starts to load other systems. In a very abstract idea, it is similar to GRUB2, where it looks for images available to it, and those images are the ones that control the connected OS. GPT replaces the legacy Master Boot Record, which has old restrictions like only 4 partitions per disk, and a maximum size of 2TB per partition. The former is the one that helps us out here, since we can load all our partitions on a single disk and not worry about much.&lt;/p&gt;

&lt;p&gt;A couple caveats. FreeBSD does not yet have compatibility to build an EFI image. We can work around this by loading an EFI image that in turn will look for legacy systems. FreeBSD does have compatibility to run on GPT disks, but the standard installer defaults to using fdisk and bsdlabel, which end up overwriting the partition table to be a GPT/MBR hybrid, and that can easily clobber and destroy OS X, which makes it impossible to boot FreeBSD and OS X, since without OS X, we cannot load the EFI image that will look for legacy systems. Its a Catch-22. Without OS X, we can’t load FreeBSD, and without FreeBSD, we’re where we started with.&lt;/p&gt;

&lt;p&gt;This is how we do things then. We need a FreeBSD CD or DVD that contains the LiveFS, “fixit”. This is any of the ISOs except FreeBSD-8.1-RELEASE-amd64-bootonly.iso and the memstick image. I’ve found that it is much easier to use the DVD, FreeBSD-8.1-RELEASE-amd64-dvd1.iso, though you have to deal with the 2GB+ download to begin with. If you have any image with the “fixit” console, you can use it to start, and then swap discs later. We also need to have a working installation of OS X. If you have been using OS X for a while, and want to keep your system intact, then you’re in the same boat as myself. We’ll try to keep it intact. But naturally, backup your data. You will also want to install &lt;a href=&quot;http://refit.sourceforge.net/&quot;&gt;rEFIt&lt;/a&gt; on your OS X install. I would recommend burning a CD of rEFIt as well, in case you trash your OS X install and want to boot into something.&lt;/p&gt;

&lt;p&gt;Boot the FreeBSD image, and go to the fixit option, loading the filesystem from disc. You’re going to use one command a lot. Read the manpage on it: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpart&lt;/code&gt;. It’s a fairly easy command, but please don’t blindly copy/paste these commands into your terminal. You need to know what device your computer has decided to label your disk as. It’s somewhere in /dev, mine is /dev/ad4. Take a look at what is on your disk:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# gpart show ad4
=&amp;gt;       34  508396695  ad4  GPT  (250G)
           34        409600      1  EFI   (200M)
   409634  195405320      2  apple-hfs  (93G)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That gives me just about 100GB on my OS X Install, but my disk is 250GB. I resized the disk using Bootcamp. You can do the same under Disk Utility.app or BootCamp Assistant to get your partition the size you need. Now we can start to create partitions for our different FreeSBD filesystems.&lt;/p&gt;

&lt;p&gt;Add a FreeBSD Boot partition to contain the bootcode. ‘-s’ specifies the size of the partition in 512 byte blocks.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# gpart add -t freebsd-boot -s 128 ad4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Add a FreeBSD Swap partition double the size of your physical RAM.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# gpart add -t freebsd-swap -s 8388608 ad4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then add your standard filesystems, sized for whatever you need. I used 1Gb for /var and / (root), and 20GB for /usr. I used the leftover space for /home.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# gpart add -t freebsd-root -s 2097152 ad4
# gpart add -t freebsd-var -s 2097152 ad4
# gpart add -t freebsd-usr -s 41942040 ad4
# gpart add -t freebsd-home ad4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lets see what our partitions look like:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# gpart show ad4
=&amp;gt;             34  508396695  ad4  GPT  (250G)
                34         409600    1  EFI  (200M)
        409634   195405320    2  apple-hfs  (93G)
  195814954               128    3  freebsd-boot  (64K)
  195815082       8388608    4  freebsd-swap  (4.0G)
  204203690       2097152    5  freebsd-root  (1.0G)
  206300842       2097152    6  freebsd-var  (1.0G)
  208397994     41942040    7  freebsd-usr  (20G)
  250340034   258056661    8  freebsd-home  (123G)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We need the bootcode and a Protective MBR written to the boot partition. The ‘-i’ flag tells gpart to write it to the 3rd index of ad4, or /dev/ad4p3.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# gpart bootcode -b /dist/boot/pmbr -p /dist/boot/gptboot -i 3 ad4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Those partitions aren’t formatted, so newfs them.
    # newfs ad4p5
    # newfs -U ad4p6
    # newfs -U ad4p7
    # newfs -U ad4p8&lt;/p&gt;

&lt;p&gt;Now you have your disk laid out to be installed to. Remember, we are doing a complete minimal manual install. We need a base system and Kernel. If you aren’t running a LiveFS image with the base and kernel packages, you need to switch to one that is, or download and extract the base and kernel manually.&lt;/p&gt;

&lt;p&gt;Lets mount our new filesystems first.
    # mount /dev/ad0p5 /mnt
    # cd /mnt
    # mkdir /mnt/var /mnt/usr /mnt/home
    # mount /dev/ad4p6 /mnt/var
    # mount /dev/ad4p7 /mnt/usr
    # mount /dev/ad4p8 /mnt/home&lt;/p&gt;

&lt;p&gt;If you’re running the full DVD like I ended up having to do, complete this step by extracting base and kernel from the disc. Otherwise skip to the next step to download them from the FreeBSD ftp server.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# cd /dist/8.1-RELEASE/base
# export DESTDIR=/mnt
# ./install.sh
 ...
# cd /dist/8.1-RELEASE/kernels
# ./install.sh GENERIC
# cd /mnt/boot
# rmdir kernel
# mv GENERIC kernel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you need to download the base and kernel, you need to get your interface up. Replace your interface name and IP addresses with your own:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# ifconfig msk0 10.0.0.20 netmask 255.255.255.0 up
# route add default 10.0.0.1
# echo &quot;nameserver 10.0.0.1&quot; &amp;gt; /etc/resolv.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then tediously fetch the distribution:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# mkdir /mnt/home/base
# cd /mnt/home/base
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/base/base.aa
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/base/base.ab
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/base/base.ac
...
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/base/base.bo
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/base/base.inf
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/base/base.mtree
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/base/install.sh
# chmod +x install.sh
# DESTDIR=/mnt
# export DESTDIR
# ./install.sh
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then do the same thing all over again for the GENERIC kernel&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# mkdir /mnt/home/kernels
# cd /mnt/home/kernels
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/kernels/generic.aa
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/kernels/generic.ab
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/kernels/generic.ac
...
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/kernels/generic.ca
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/kernels/generic.inf
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/kernels/generic.mtree
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/8.1-RELEASE/kernels/install.sh
# chmod +x install.sh
# DESTDIR=/mnt
# export DESTDIR
# ./install.sh GENERIC
...
# cd /mnt/boot
# rmdir kernel
# mv GENERIC kernel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And now we converge. Whatever method you chose, you should have a filesystem mounted with the base distribution and GENERIC kernel installed. Our install doesn’t yet know how to boot, so lets tell it where to mount our filesystems.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# cd /mnt/etc
# vi fstab
....
# Device                   Mountpoint      FStype   Options         Dump    Pass#
/dev/ad4s4              none                  swap       sw                   0          0
/dev/ad4s5              /                        ufs         rw                   1          1
/dev/ad4s6              /var                  ufs         rw                   2          2
/dev/ad4s7              /usr                  ufs         rw                   2          2
/dev/ad4s8              /home                ufs         rw                   2          2
/dev/acd0                /cdrom              cd9660   ro,noauto     0          0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You should have a working minimal, unconfigured, bootable FreeBSD installation. Unmount your harddrive’s filesystems and exit out of the fixit console. As you exit, sysinstall should automatically eject the DVD or CD, or do it manually while the machine reboots.&lt;/p&gt;

&lt;p&gt;rEFIt should boot up first. If it automatically goes to OS X, reboot the machine, and as you hear the OS X boot chime, press the option key. rEFIt should be an option. You need to sync your MBR with GPT. Choose the partition inspector option and when it asks, agree with the sync. I like to reboot again at this point, so choose that option from rEFIt, and then hold option again at the chime. Select the legacy OS, which is FreeBSD.&lt;/p&gt;

&lt;p&gt;You can either use sysinstall, or do everything manually, but you need to set up the basic system:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Set a root password.&lt;/li&gt;
  &lt;li&gt;Create and populate the /etc/rc.conf file.&lt;/li&gt;
  &lt;li&gt;Set your timezone.&lt;/li&gt;
  &lt;li&gt;Create a non-root user.&lt;/li&gt;
  &lt;li&gt;Install additional installation components like doc, games, info, manpages, proflibs, catpages, etc.&lt;/li&gt;
  &lt;li&gt;Install ports.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you have any questions, email me, or add a comment to this post.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Programming Lesson</title>
        <link href="https://blog.hplogsdon.com/programming-lesson/"/>
        <updated>2010-06-30T19:13:33+00:00</updated>
        <id>https://blog.hplogsdon.com/programming-lesson/</id>
        <content type="html">&lt;p&gt;I’ve always been on the lookout for good tutorials and educational materials on programming. I’m too cheap to personally go back to school to learn, and I know of enough people that haven’t ever graduated any CS course that do well. I think I can succeed the same way. Every once in a while I come across something pretty fantastic. Things like MIT’s Open Courseware are great, but a lot of times, blog posts and short how-to’s are better due to them being very specialized. I get bored with abstract ideas without any use for them.&lt;/p&gt;

&lt;p&gt;Well, on reddit the other day, I came across some guy’s personal sub-reddit. Where this guy, Carl Herold, goes and posts little tutorials and sequenced how-to’s on how to do a specific task. Check out his website &lt;a href=&quot;http://www.highercomputingforeveryone.com/&quot;&gt;Higher Computing For Everyone&lt;/a&gt; to sign up for his lessons, or go to his subreddit &lt;a href=&quot;http://bit.ly/h3QIF&quot;&gt;Carl Herold’s Programming&lt;/a&gt; and check out these great resources.&lt;/p&gt;

&lt;p&gt;And if you’re feeling generous, toss him a few couple bucks with a donation.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>More Ruby on OS X</title>
        <link href="https://blog.hplogsdon.com/more-ruby-on-os-x/"/>
        <updated>2010-04-14T22:17:57+00:00</updated>
        <id>https://blog.hplogsdon.com/more-ruby-on-os-x/</id>
        <content type="html">&lt;p&gt;In the last post, I outlined a simple way to adding to the Ruby.framework bundle the newer version of the Ruby Language, 1.9.&lt;/p&gt;

&lt;p&gt;Well, as I finished that up, I started hacking around with some other code, and a friend was trying to show me something neat with Ruby-HEAD… Well, that made it difficult to add a HEAD into the bundle, since the bundle is supposed to be pretty static and not prone to constant modifications. My way works for simple things (get 1.9, end).&lt;/p&gt;

&lt;p&gt;He suggested I try RVM. &lt;a href=&quot;http://rvm.beginrescueend.com/&quot;&gt;Ruby Version Manager&lt;/a&gt; is a simple little script that will download, configure, make and install specific versions, as well as patchlevels of the Ruby language into your $HOME directory.&lt;/p&gt;

&lt;p&gt;I havent delved into exactly how it works, but it looks like it dynamically updates your path to the bin directory of the versions installed into your $HOME. So even when you install a gem (say, mongrel) that installs an executable, it will run as the default version.&lt;/p&gt;

&lt;p&gt;You can also install specific “GemSets”, which is a fancy way of saying… set of gems.&lt;/p&gt;

&lt;p&gt;I highly suggest everyone who uses Ruby to take a look at it.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Ruby1.9 and 1.8 side by side on OS X SL</title>
        <link href="https://blog.hplogsdon.com/ruby19-and-18-side-by-side-on-os-x/"/>
        <updated>2010-03-31T23:41:28+00:00</updated>
        <id>https://blog.hplogsdon.com/ruby19-and-18-side-by-side-on-os-x/</id>
        <content type="html">&lt;p&gt;I broke down and installed Ruby 1.9.1 on my MacBook Pro today. It was rather simple, but there was one thing that I’ve learned to do, that I didn’t see anyone bother with.&lt;/p&gt;

&lt;p&gt;If you were to drop down into Terminal.app and look at the ruby executable&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/bin/ruby
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You’ll see it’s a little strange. Actually it isn’t at all. It’s a symlink. Where to? Where else but a Framework package! Yay OS X for being… strange.&lt;/p&gt;

&lt;p&gt;So one tutorial I came across when googling , namely &lt;a href=&quot;http://cardarella.blogspot.com/2009/04/ruby-18-and-19-living-together-on-mac.html&quot;&gt;this one&lt;/a&gt; say to just add a suffix of “19” to the configure script and call it good. Well, if you’re using Ruby, you’re probably opinionated (hand in hand kinda thing), and in my opinion, thats fucking lazy and will lead to headaches. You’ll have your shit strewn all across your filesystem.&lt;/p&gt;

&lt;p&gt;Dont do it.&lt;/p&gt;

&lt;p&gt;Instead, do something a little less conventional (for *nix), and install it as a specific version inside the framework.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p376.tar.gz
tar xzvf ruby-1.9.1-p376.tar.gz
mkdir ruby-1.9.1-p376.tar.gz/build
cd ruby-1.9.1-p376/build

../configure --prefix=/System/Library/Frameworks/Ruby.framework/Versions/1.9/usr --enable-shared

checking build system type...
...

make
sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which will put all the new ruby files in “/System/Library/Frameworks/Ruby.framework/Versions/1.9/usr”&lt;/p&gt;

&lt;p&gt;Then to change to have your default ruby installation be 1.9, run:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo rm /System/Library/Frameworks/Ruby.framework/Versions/Current
sudo ln -s 1.9 /System/Library/Frameworks/Ruby.framework/Versions/Current
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and your existing symlinks at /usr/bin/ruby /usr/bin/erb etc will follow the new path.&lt;/p&gt;

&lt;p&gt;I recommend this type of setup for almost any of the existing frameworks you wish to upgrade or try out new versions of.&lt;/p&gt;

&lt;p&gt;Note: this will only install your default architecture (i386 fro CoreDuo, x86_64 for C2D, ppc for PowerPC, etc). You’ll have to throw the environmental variables into your config line to get fat binaries up.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>I want it all</title>
        <link href="https://blog.hplogsdon.com/i-want-it-all/"/>
        <updated>2010-03-20T20:42:46+00:00</updated>
        <id>https://blog.hplogsdon.com/i-want-it-all/</id>
        <content type="html">&lt;p&gt;I use the website &lt;a href=&quot;http://www.binsearch.info/&quot;&gt;Binsearch&lt;/a&gt; a fair amount, specifically the Browse feature. A site like Binsearch makes it so I dont have to spend a lot of bandwidth and cpu power downloading and threading/sorting headers. Unfortunately, they seem to have a custom option that automatically groups similar threads together, usually by the same poster. I see its usefulness in combatting SPAM and what-not for text and discussion groups, but not for binaries.&lt;/p&gt;

&lt;p&gt;So I took 20 minutes and wrote a userscript to automatically redirect any request to their /browse.php page to one that includes the directive to load all ungrouped.&lt;/p&gt;

&lt;p&gt;Check it out here, where I’ve decided to store all my pretty userscripts: &lt;a href=&quot;http://hplogsdon.com/userscripts/&quot;&gt;http://hplogsdon.com/userscripts/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It has been fully tested on Chromium 5.0.359.0 (42183) (last nights build), and it seems simple enough that Opera and Firefox/Greasemonkey should not have a problem. If they do, let me know and I’ll actually test them. I just don’t care enough right now.&lt;/p&gt;

&lt;p&gt;Edit: after using it for a few minutes, I figure I should update it to automatically append the “all” option to any link to the /browse.php page so you dont have to load each new link twice. The guys at binsearch.info would probably appreciate it also. I’ll do that soon.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Changing Wordpress Passwords via SQL</title>
        <link href="https://blog.hplogsdon.com/changing-wordpress-passwords-via-sql/"/>
        <updated>2010-03-07T03:15:58+00:00</updated>
        <id>https://blog.hplogsdon.com/changing-wordpress-passwords-via-sql/</id>
        <content type="html">&lt;p&gt;Some time ago when I first started hacking WordPress (about v2.2 iirc) I can remember having to go into my MySQL terminal and replace the admin password due to me not changing the random string they gave you just after you installed it. It wasn’t fun to do*, but it worked. I also learned to change the default password string to something more memorable, or at least write the thing down somewhere. Back then, WordPress would use an MD5 hash as the password stored in the Database.&lt;/p&gt;

&lt;p&gt;Well, I havent had the need to do anything like that for a while, but a friend and fellow WordPress hacker recently asked if I had, or knew if it was possible to change the WordPress admin password from raw SQL. He had a SQL dump for a WordPress site he had completely archived some time ago and forgot the password when he went to restore it. Well, I said yeah, hop into the terminal and issue&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;md5 -s &quot;thepassword&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and then replace that with the string in the sql dump. Easy. Well, until he asked why the new MD5 hash was so much shorter than the old hash.&lt;/p&gt;

&lt;p&gt;Wordpress upgraded the password storing procedure between the time I needed to replace the password and whenever he archived the site to use a salt value with a hashing library called &lt;a href=&quot;http://www.openwall.com/phpass/&quot;&gt;PHPass&lt;/a&gt;. This requires a bit of a workaround to get running properly.&lt;/p&gt;

&lt;p&gt;So because I figure other people will be running into this problem in the future, I wrote up a standalone script that will give you a salted hash value which you can insert into your WordPress database via the MySQL terminal. The actual function is nearly a copy/paste from the function that WordPress uses when you create a new user, or change a user’s password.&lt;/p&gt;

&lt;p&gt;Here’s the relevant part of the code:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;?php global $wp_hasher; ?&amp;gt;
						&amp;lt;form action=&quot;#&quot; method=&quot;post&quot; accept-charset=&quot;utf-8&quot;&amp;gt;
						&amp;lt;input type=&quot;text&quot; name=&quot;password&quot; value=&quot;&quot;&amp;gt;
				&amp;lt;p&amp;gt;&amp;lt;input type=&quot;submit&quot; value=&quot;Generate ...&quot;&amp;gt;&amp;lt;/p&amp;gt;
				&amp;lt;/form&amp;gt;
&amp;lt;?php
if (empty($_POST[&apos;password&apos;])) {
		echo &quot;Password is empty&quot;;
} else {
		if (empty($wp_hasher)) {
				require_once(&apos;wp-includes/class-phpass.php&apos;);
				$wp_hasher = new PasswordHash(8, TRUE);
		}
		$pw_hash = $wp_hasher-&amp;gt;HashPassword($_POST[&apos;password&apos;]);
		echo &apos;Submitted password hashes to: &apos;. $pw_hash;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And you can find the final result here: &lt;a href=&quot;/password.php&quot;&gt;WP Password Hash Generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and if you want to copy it to use on your server, curl/wget it via this source link: &lt;a href=&quot;/password.phps&quot;&gt;WP Password Hash Generator - Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Actually it was rather fun cause I hadn’t done it before and it gave me insight on how WordPress structures the database.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>I'm dumb</title>
        <link href="https://blog.hplogsdon.com/im-dumb/"/>
        <updated>2010-03-03T05:22:43+00:00</updated>
        <id>https://blog.hplogsdon.com/im-dumb/</id>
        <content type="html">&lt;p&gt;I was doing some behind-the-scenes stuff a few days ago, and for whatever reason I reconfigured Apache to serve all my domains with&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;AllowOverride None
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;set…&lt;/p&gt;

&lt;p&gt;Hopefully everything works with mod_rewrite, and other configurations that depended on .htaccess files set up.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Facebook and Bitlbee</title>
        <link href="https://blog.hplogsdon.com/facebook-and-bitlbee/"/>
        <updated>2010-02-14T06:30:57+00:00</updated>
        <id>https://blog.hplogsdon.com/facebook-and-bitlbee/</id>
        <content type="html">&lt;p&gt;A few days ago I heard that facebook’s chat feature, which I had never actually used, had been “released” as an XMPP service. That meant people could technically use a standard IM client to connect to it, without having to be connected to facebook.com inside their web browser. I love the Unix philosophy of doing one thing and doing one thing well, so when I have to have 3 processes running that do essentially the same thing, but cant interact and do it all, I get annoyed.&lt;/p&gt;

&lt;p&gt;For all of my social chat uses, I want to go to one place. That place is Irssi, since I spend a lot of time in IRC channels. Keeping with the Unix philosophy, Irssi lets me chat to people. It delegates certain scripts to allow it to connect to other services, like Twitter with twirssi, and jabber (xmpp) with Bitlbee. Well, after trying to connect to Facebook’s chat, all my online “friends” would end up having names like u285623814… Not very useful on figuring out who that was. You could end up using&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;info u285623814
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;but thats a pain, and a chat program is supposed to let you chat, not figure out who you are chatting to.&lt;/p&gt;

&lt;p&gt;I ended up mentioning in a local open source channel and was linked to a blog written by another local open source geek who found a script to clear this up. Go to his site and grab the script, then load it into Irssi, and it will convert the userID to their qualified user name.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pthree.org/2010/02/13/facebook-chat-in-bitlbee/&quot;&gt;Facebook Chat In Bitlbee&lt;/a&gt;&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Too Small To Fail</title>
        <link href="https://blog.hplogsdon.com/too-small-to-fail/"/>
        <updated>2010-02-09T16:38:33+00:00</updated>
        <id>https://blog.hplogsdon.com/too-small-to-fail/</id>
        <content type="html">&lt;p&gt;So, the past few month I’ve built a few applications using Rails. They aren’t big applications by any means, but they are the old standbys I code up when I’m trying something new. I now have a custom Blog, Gallery, Shopping Cart/eCommerce and semi-Collaborative Task List.&lt;/p&gt;

&lt;p&gt;With the exception (depending on the day) of the eCommerce application, They are all rather quite small. They don’t do much, and thats a bad thing. One of the Conventions that Rails adheres to, or rather employs, is it’s not that great for small applications. It likes big things. So my Todo List, which realistically is not much more complicated than the scaffold generated project I linked to in my &lt;a href=&quot;http://hplogsdon.com/configuring-mongrel-and-mongrel-cluster/&quot;&gt;Earlier Post&lt;/a&gt;, tends to consume a lot of resources for the task its trying to accomplish. As I saw with the eCommerce, which isn’t all that big either since it is very basic, is that it consumes just about the same amount of resources when it has to do more extensive queries and logic. Overall, its a lot bigger than the task list, almost 3 times bigger, but relatively, its not big at all. So thats a potential downside to Rails. If you plan to stick with it for a long time, building rich, dynamic applications, Rails is awesome. But for menial tasks, it starts to falter. I’m saying this as a proponent of Rails. Hope everyone understands this point.&lt;/p&gt;

&lt;p&gt;I also decided recently to start pursuing a job in web development. I think its a fascinating area. And my current employment is making me think that a stable job is more important than a potentially lucrative position that I’ve been waiting 6 years to open up… I’m still young, and eventually, after 6 months to a year of ho-humming about it, I took the plunge and actually applied for a position. This company had me start a test application working with CakePHP, so they could understand my skill level. Like I’ve said earlier, PHP seems like a dull language to me. I really want to try one of the more “Fun” languages like Python or Ruby… but unfortunately, it seems that PHP and ASP.NET seems to rule the market right now in terms of job positions. So I figure this is a good entry point to get some decent skills and experience. After a while, I can start to use other languages on my own time, and develop a strong portfolio of knowledge.&lt;/p&gt;

&lt;p&gt;Back to CakePHP… Its modeled very similarly to Rails. Not by accident either. Which was fantastic, since my prior knowledge of the C language family has already, without knowing it, built up a strong understanding of PHP. So diving into Cake was rather easy since I already understood the language and I had a pretty good understanding of the conventions of the framework.&lt;/p&gt;

&lt;p&gt;As of now, I’ve been writing an application that will help print invoices. A recent project for a friend has me maintaining an eCommerce site, and the biggest downfall, besides being based out of a CMS and being difficult to modify, is there is no invoicing. So I found a good entry point into building an invoicing application. I think I may end up releasing some of the code for this on github, since I feel pretty confident in it. I may try to clean up some of the rails applications as well, but If you spend an afternoon scouring github, you’ll find dozens of incomplete, and basic applications for pretty much everything I’ve done. No need to clutter the internet with crap.&lt;/p&gt;

&lt;p&gt;Lets see how this goes… So far I feel good about it.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Addendum: RoR on FreeBSD</title>
        <link href="https://blog.hplogsdon.com/addendum-ror-on-freebsd/"/>
        <updated>2010-02-09T16:10:36+00:00</updated>
        <id>https://blog.hplogsdon.com/addendum-ror-on-freebsd/</id>
        <content type="html">&lt;p&gt;I realize that it has been 2 months since the series of posts I made about setting up a FreeBSD server to host your Rails applications, but I actually only noticed last week that I forgot to add the reference links to the other blogs I used when compiling the how-to when I reformatted the giant wall of text into smaller sections.&lt;/p&gt;

&lt;p&gt;So I apologize to the other manual, blog and wiki authors out there, and didn’t ever want to try to act like I was stealing content. Honest. No one’s said anything to me, but I need to give credit where credit is due.&lt;/p&gt;

&lt;p&gt;References:
&lt;a href=&quot;http://marklunds.com/articles/one/369&quot;&gt;Peter Marklund’s Ruby on Rails Deployment on FreeBSD&lt;/a&gt;
&lt;a href=&quot;http://wiki.rubyonrails.org/deployment/Apache-mongrel&quot;&gt;Apache + Mongrel =&amp;gt; Rails Wiki&lt;/a&gt;
&lt;a href=&quot;http://mongrel.rubyforge.org/wiki/Apache&quot;&gt;Apache - Mongrel Trac Wiki&lt;/a&gt;
&lt;a href=&quot;http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/&quot;&gt;Time for a grown-up server: Rails, Mongrel, Apache, Capistrano and You&lt;/a&gt;
&lt;a href=&quot;http://groups.google.com/group/rubyonrails-deployment&quot;&gt;Deploying Ruby on Rails - Google Groups&lt;/a&gt;
&lt;a href=&quot;http://books.google.com/books?id=Iu-2Me3nZeUC&amp;amp;lpg=PA97&amp;amp;ots=eDhVCj5pK5&amp;amp;pg=PP1#v=onepage&quot;&gt;BSD Hacks by Dru Lavigne (O’Reilly Books) - Google Books&lt;/a&gt;
&lt;a href=&quot;http://rubyonrails.org/deploy&quot;&gt;Ruby on Rails: Deploy&lt;/a&gt;
&lt;a href=&quot;http://www.freebsd.org/doc/en/books/handbook/&quot;&gt;The FreeBSD Handbook&lt;/a&gt;
&lt;a href=&quot;http://pragprog.com/titles/fr_deploy/deploying-rails-applications&quot;&gt;The Pragmatic Bookshelf | Deploying Rails Applications&lt;/a&gt;
&lt;a href=&quot;http://www.google.com&quot;&gt;Google&lt;/a&gt;&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Chromium Nightly Downloader</title>
        <link href="https://blog.hplogsdon.com/chromium-nightly-downloader/"/>
        <updated>2009-11-19T06:10:14+00:00</updated>
        <id>https://blog.hplogsdon.com/chromium-nightly-downloader/</id>
        <content type="html">&lt;p&gt;The past few posts have been a “I use this, but I extended its default functionality with this:” posts… Well this one is no different. I have slowly become fed up with Safari. Every update seems to make it run slower. I’ve noticed as the day wears on, it can take up to 30 seconds to load a new tab. WTF is that shit. So the next alternative is…. no, I don’t like FireFox. I even use a non-modified version for my browsing (no extensions) and it seems bulky and slow. Safari was really snappy a couple months ago.&lt;/p&gt;

&lt;p&gt;So Chromium has made some awesome strides as of late, and the nightly builds are pretty awesome. Super stable, incredibly, and fast all around. The only problem with the (almost hourly) builds is there are a lot of them, and I don’t want to be downloading a 20 meg file in order to start my day and night. So Script it right? Yes.&lt;/p&gt;

&lt;p&gt;Here is a hackjob script that downloads the LATEST from http://build.chromium.org/ , deletes the one in your Application directory, unzips the new one, and then puts it back into your Applications directory. Obviously, it only works on OS X. Launchpad makes their deb repo available for Ubuntu/Debian users, and I bet there is a RPM distribution somewhere.&lt;/p&gt;

&lt;p&gt;Check it out, and be sure TO READ IT before you run it. It is potentially damaging, has zero to no error handling, and was put together in all of 4 minutes. I take no Liability for any damages. It doesn’t even have a license. Can I even License ~6 lines of script code?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.hplogsdon.com/files/chromium-nightly.tar.gz&quot;&gt;chrome-nightly.sh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set it up into cron, or make a launch controller for it:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&amp;gt;
&amp;lt;plist version=&quot;1.0&quot;&amp;gt;
	&amp;lt;dict&amp;gt;
			&amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;
			&amp;lt;string&amp;gt;com.hplogsdon.NightlyChromiumDownloader&amp;lt;/string&amp;gt;
			&amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;
			&amp;lt;array&amp;gt;
					&amp;lt;string&amp;gt;/PATH/TO/SCRIPT&amp;lt;/string&amp;gt;
			&amp;lt;/array&amp;gt;
			&amp;lt;key&amp;gt;StartCalendarInterval&amp;lt;/key&amp;gt;
			&amp;lt;dict&amp;gt;
					&amp;lt;key&amp;gt;Hour&amp;lt;/key&amp;gt;
					&amp;lt;integer&amp;gt;3&amp;lt;/integer&amp;gt;
					&amp;lt;key&amp;gt;Minute&amp;lt;/key&amp;gt;
					&amp;lt;integer&amp;gt;15&amp;lt;/integer&amp;gt;
			&amp;lt;/dict&amp;gt;
	&amp;lt;/dict&amp;gt;
&amp;lt;/plist&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;save that as “com.hplogsdon.ChromiumNightlyDownloader.plist”. Move it into your LaunchAgents directory (~/Library/LaunchAgents) and then run:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;launchctl load -w /PATH/TO/com.hplogsdon.ChromiumNightlyDownloader.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thats also a Hack of a launch property list… it works however. Every morning at 3:15 AM it will run. If your Mac is on… Mine is so it works for me. remember to READ THE FILES IN THE ARCHIVE AND EDIT THE PATHS TO REPRESENT YOUR FILESYSTEM. You might have to chmod the script to make executable.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Rails and project.vim</title>
        <link href="https://blog.hplogsdon.com/rails-and-project-vim/"/>
        <updated>2009-11-18T21:51:37+00:00</updated>
        <id>https://blog.hplogsdon.com/rails-and-project-vim/</id>
        <content type="html">&lt;p&gt;I’ve been using project.vim for a while, but theres one thing that really annoys me about it: It doesn’t automatically add directories. So in a Rails application, it sucks.&lt;/p&gt;

&lt;p&gt;So load this into your .vimprojects when you start a new rails application and dont worry about it. Add new directories and files as you generate them, as needed.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.hplogsdon.com/files/dot.vimprojects&amp;quot;&amp;gt;&quot;&gt;.vimprojects&lt;/a&gt;&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Rails.vim</title>
        <link href="https://blog.hplogsdon.com/rails-vim/"/>
        <updated>2009-11-17T01:56:08+00:00</updated>
        <id>https://blog.hplogsdon.com/rails-vim/</id>
        <content type="html">&lt;p&gt;I’m not sure how I skipped over this one, but I just found &lt;a href=&quot;http://rails.vim.tpope.net/&quot;&gt;Rails.vim&lt;/a&gt;, a script for Rails specific highlighting, MVC file navigation and rails scripts evocation. I’ve always favored VIM over… anything, and when I started the latest project, a Rails app, I decided to try out TextMate.&lt;/p&gt;

&lt;p&gt;I really do like TextMate, but I have a hard time with search and replace, and saving files. Who knew saving your buffer would be so difficult. Everything ends up like this:&lt;/p&gt;

&lt;p&gt;“idef function:w”&lt;/p&gt;

&lt;p&gt;Hilarious. But not when it comes time to be productive.&lt;/p&gt;

&lt;p&gt;So I’m putting aside TextMate and booting up MacVim again.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Speeding up FreeBSD's boot</title>
        <link href="https://blog.hplogsdon.com/speeding-up-freebsds-boot/"/>
        <updated>2009-11-09T08:27:45+00:00</updated>
        <id>https://blog.hplogsdon.com/speeding-up-freebsds-boot/</id>
        <content type="html">&lt;p&gt;If you have been following my previous posts, you know that I’m configuring my first private production server. Servers tend to be headless, and I can’t see much benefit in dualbooting a server… so I always want to see about bypassing the options that are available for such a configuration. One is the boot loader. FreeBSD by default when using the FreeBSD Boot Manager (boot0), has a 10 second wait. Thats the screen that says&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;F1: FreeBSD
ESC to cancel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or something.&lt;/p&gt;

&lt;p&gt;Well, lets take that down to nothing. I want FreeBSD to boot. I’ll be making consistent backups of my virtual server image, so I’ll be able to roll back if something does go wrong and I’m unable to boot. Also, with the server, anything between a “shutdown -r now” command and sshd coming back online is foreign. I’ll have to trust that it “just works”. This includes boot3, which has its own 10 second delay. Lets get rid of it.&lt;/p&gt;

&lt;p&gt;Thats an entire 20 seconds of boot time thats waiting for user input, but the user isn’t at the screen to give input. Heres what we do.&lt;/p&gt;

&lt;p&gt;For boot0, there is a command called &lt;a href=&quot;http://www.freebsd.org/cgi/man.cgi?query=boot0cfg&amp;amp;manpath=FreeBSD+7.2-RELEASE&amp;amp;format=html&quot;&gt;boot0cfg(8)&lt;/a&gt; that will help… configure boot0, if you couldn’t already tell. Read the man page to see what it can do. The short answer for me is:&lt;/p&gt;

&lt;p&gt;# boot0cfg -t 2 /dev/da0&lt;/p&gt;

&lt;p&gt;Which tells the boot loader to wait 2 ticks, approximately 0.109 seconds, instead of the default 200 ticks, or so.&lt;/p&gt;

&lt;p&gt;For boot3, the final boot stage, there is one quick option you can add into /boot/loader.conf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;autoboot_wait=-1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which, by requesting negative one seconds, tells it not to even attempt to load the menu. Even at 0 seconds, the menu loads, but there it not enough time for the user to give input.&lt;/p&gt;

&lt;p&gt;A few quick commands can help speed up your process in the event that you need to force a reboot and want it to come up very quickly. Remember though, these can put you in a bad situation in the event you have a harddisk fail, or you need to enter into single user mode when running it local.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Configuring Mongrel and Mongrel Cluster</title>
        <link href="https://blog.hplogsdon.com/configuring-mongrel-and-mongrel-cluster/"/>
        <updated>2009-11-08T23:38:42+00:00</updated>
        <id>https://blog.hplogsdon.com/configuring-mongrel-and-mongrel-cluster/</id>
        <content type="html">&lt;p&gt;This is the second in a multipart series on how I configured a headless FreeBSD server when I moved to a VPS provider.&lt;/p&gt;

&lt;p&gt;You might have noticed that we were running WEBrick, which is fine for what we were doing, but I like setting up a cluster of Mongrels to dish out my apps.&lt;/p&gt;

&lt;p&gt;Mongrel is a great server for running Rails apps. You may ask why the hell we are setting up two servers, and the answer is quite simple. Apache cannot run Rails applications out of the box. We can setup Apache using mod_rails or mod_ruby the same as we can do mod_python or mod_perl, but I like Mongrel. Its purely a choice.&lt;/p&gt;

&lt;p&gt;From here, you can start using the command “gem install” to get things you need, or you can get them from ports. Your choice. Mine’s ports, which is literally a frontend for gem, when installing rubygems. We need both mongrel and mongrel_cluster.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/www/rubygem-mongrel
$ sudo make install clean
...
$ cd /usr/ports/www/rubygem-mongrel_cluster
$ sudo make install clean
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After that finishes, you should really be ready to go. Lets create our first application to run on the production server. The default “welcome to rails” application isn’t going to be sufficient enough. We need an actual application. I still want to keep this simple, so I’m going to borrow a really REALLY simple application from Rob Mayhew’s blog, of whom I have no affiliation with. Its a todo app, which is just that. Enter in a title, and text, and it will store it in the DB and spit it back out in a list. Check this out, and run it on your development machine if you want to test it. &lt;a href=&quot;http://robmayhew.com/rails-201-todo-list-tutorial/&quot;&gt;Rails 2.0.1 Todo List Tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets first create the application where you want all your stuff. I chose /usr/local/www/rails as my directory where I’ll end up placing all my Rails apps. Create it, then cd into it, and create a base for the app.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo mkdir /usr/local/www/rails
$ cd /usr/local/www/rails
$ sudo rails todo -d mysql
...
$ cd todo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create, and give permission to the application to access your databases, just like we did before:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mysql -u root -p
...
$ sudo vim config/database.yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then we can start on the application.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo script/generate scaffold Todo title:string body:text done:boolean due:datetime
$ sudo rake db:migrate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I will also modify the routes so its not living in a sub-directory in my URL, but note, this isn’t the complete step in configuring the routes. I’ll get to that in a minute. For now, don’t touch anything residing in your $APP_DIR/public directory.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;map.root :controller =&amp;gt; &quot;todos&quot;, :action =&amp;gt; &quot;index&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then, if you want, run script/server, or we can move right on to the heavy lifting: Mongrel. Theres a little more configuration we need to do. First off, Apache doesn’t know this application even exists. We won’t be able to get to it. Second, we want a TLD for this thing to point to. I don’t feel like going out and buying a new domain name just for this test, nor do I actually care to configure one of the many I already do own and bother with the DNS. I don’t want this live to the world. Not yet. And I don’t want to write a tutorial on how to do it. If you already have a fully qualified domain name pointing to the server, you can create a subdomain, or we can fake it. I’m going to fake it. We are gonna hack the world, and create our very own TLD called .dev. This shit is amazing &amp;lt;/sarcasm&amp;gt;&lt;/p&gt;

&lt;p&gt;Lets set up the virtual host. This is a pretty standard configuration for it, but consider it a starting point. Build on this, or something similar to this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/local/etc/apache22/vhosts
$ sudo vim rails-todo.conf

NameVirtualHost *:80

&amp;lt;proxy balancer://todo_cluster&amp;gt;
	BalancerMember http://127.0.0.1:8000
	BalancerMember http://127.0.0.1:8001
	BalancerMember http://127.0.0.1:8002
&amp;lt;/proxy&amp;gt;

&amp;lt;VirtualHost *:80&amp;gt;
	ServerAdmin admin@yourserver.tld
	ServerName todo.dev
	ServerAlias www.todo.dev
	DocumentRoot /usr/local/www/rails/todo/public
	&amp;lt;Directory &apos;/usr/local/www/rails/todo/public&apos;&amp;gt;
		Options FollowSymLinks
		AllowOverride None
		Order allow,deny
		Allow from all
	&amp;lt;/Directory&amp;gt;
	
	ProxyPass / balancer://todo_cluster/
	ProxyPassReverse / balancer://todo_cluster/
	
	RewriteEngine On
	
	RewriteRule ^/$ /index.html [QSA]
	
	RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
	RewriteRule ^/(.*)$ balancer://todo_cluster%{REQUEST_URI} [P,QSA,L]
	
	ErrorLog /usr/local/www/rails/todo/log/apache_error_log
	CustomLog /usr/local/www/rails/todo/log/apache_access_log combined
&amp;lt;/virtualhost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, that should load up next time you restart Apache, due to the wildcard include we added way back up when we configured Apache. Double check that it parses by running:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo apachectl -S
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You may need to include a virtual host for localhost. Do it in a separate config file though. Don’t be including multiple domains in one file, even localhost.&lt;/p&gt;

&lt;p&gt;Restart Apache for real this time, and go to the server, or at least try to. If you are on a separate machine, as in your production box is way off in whoknowswhere, or in the server closet of  your office (aka, its not localhost), then you wont get it it. Your machine doesn’t know how to translate http://www.todo.dev/ into an IP address, because that domain name doesn’t exist to anything except your head.&lt;/p&gt;

&lt;p&gt;If you are on a windows box, Google how to change your hosts file. Its somewhere in C:\Windows\system, iirc, but I don’t remember and I’m not your nanny or tudor.
For you normal people running a *nix box, or OS X, on your localhost, your workstation, open up your hosts file and add an entry for this fake domain.&lt;/p&gt;

&lt;p&gt;localhost $ sudo vim /etc/hosts&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;10.22.33.44        todo.dev www.todo.dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Obviously, change the IP address to the (Static) IP address of your new Production Server. If its inside your local network, then you can choose the LAN address, or if its outside, you will want the WAN address. Changes take effect immediately, so there is no reloading of some service to do.&lt;/p&gt;

&lt;p&gt;Now point the browser to that domain, and it should pull up. You aren’t running Mongrel yet, and even though we changed the routes, you should still be getting the “Welcome to Rails” page. Technically, you do not have a running Rails Application right now, you’re just showing a standard HTML page. You might notice that its missing all the images though, and externally linked CSS (which there is none of anyways). Thats because we didn’t delete the $APP_DIR/public/index.html file. Keep it for a second. Lets start up Mongrel:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/local/www/apps/todo
$ sudo mongrel_rails start -e production -p 8000 -a 127.0.0.1 -P tmp/pids/mongrel-1.pid
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Whenever I’m running Mongrel directly like this, I’ll open another shell and run this command:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/local/www/apps/todo
$ tail -f log/production.log 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But that is not entirely necessary. Up to you.&lt;/p&gt;

&lt;p&gt;Now reload the page in your browser, and you should see the Ruby logo image load up, as well as some others. If thats the case, then congratulations, you’re now (almost) your first production Rails application. Finally remove the index.html file from the public directory, then reboot the Mongrel instance. Whenever you modify anything in the public directory, you need to restart your server. You should never be modifying anything inside the production environment while the server is running either, but its only your application and your server, so I guess you can do whatever you want.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo rm public/index.html
$ ps aux | grep mongrel_rails
root  38614  0.0  0.7 75672  1708  p3  S+   10:27PM   0:09.36 /usr/local/bin/ruby18 /usr/local/bin/mongrel_rails ....
$ sudo kill -s USR2 38614
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;That may be slightly confusing to you. Kill is a command I use every so often, but when you break that down, you can see with “ps aux&lt;/td&gt;
      &lt;td&gt;grep mongrel_rails” we are able to get the process id (PID) of the instance of Mongrel, which is the number after the username that it is being run by. My instance was PID 38614. If you look at your shell that ran mongrel_rails, you can see that it lists some commands that you can send it while it is running.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;** Starting Mongrel listening at 127.0.0.1:8000
** Starting Rails with production environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM =&amp;gt; stop.  USR2 =&amp;gt; restart.  INT =&amp;gt; stop (no restart).
** Rails signals registered.  HUP =&amp;gt; reload (without restart).  It might not work well.
** Mongrel 1.1.5 available at 127.0.0.1:8000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So when we sent the command with kill, all it did was signal that it should restart. That only works if you are running Mongrel as a daemon though. If you are running it in the foreground, its a lot easier to send CTRL-C, and run the command again.&lt;/p&gt;

&lt;p&gt;So, once the server is reloaded, check your site again, and you should see the basic Todo List. Play with it some, enter in an item that you need to get done, like “Go To Bed”, or “Get another beer.”&lt;/p&gt;

&lt;p&gt;Finally, you get a complete Congratulations. Your server is now running live Rails Applications. Al you need to do is move it to a datacenter, assign it a real domain name, and adjust the configurations, namely the Apache vhost, to accept incoming connections.&lt;/p&gt;

&lt;p&gt;You may have noticed that we originally configured to have 3 instances of Mongrel running at once, so we can set that up now to be proper.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/local/www/apps/todo
$ sudo mongrel_rails cluster::configure -e production -p 8000 -N 3 -c /usr/local/www/apps/todo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This command will produce a configuration file called config/mongrel_cluster.yml for your Rails application. It instructs Mongrel to use the production enviroment, start at port 8000, and start 3 instances of mongrel_rails. To get that running, try this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo mongrel_rails cluster::start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And test the web server again. Hopefully you shouldn’t even know anything has changed. To stop Mongrel:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo mongrel_rails cluster::stop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Mongrel is great if you ever need to scale your application. Say it does become the next big thing. Everyone is hitting your website, and its being overloaded. Mongrel can’t keep up, but your hardware isn’t being taxed completely. Easily open up config/mongrel_cluster.yml, change the number of instances Mongrel should start up, and quickly restart your cluster. Then open up your hosts’s .conf file, and apply all those new instances ( http://127.0.0.1:8000 ) to the cluster configuration, and restart Apache. Within a matter of a minute, you can double/triple/quadruple the serving capabilities of your server, until your server becomes taxed, then you’ll need to upgrade that. And with a VPS, thats as easy as requesting it, and getting it delivered in a timely manner.&lt;/p&gt;

&lt;p&gt;There are a few more things to install with Rails, notably RMagick and ImageMagick, an SCM client service (and possibly server service if thats what you want, but not in this post), and maybe Capistrano to help deploy your applications properly. You can start  to tweak this setup to suit your needs. If you’re running this in a VM local to your workstation, like I am doing right now, right now when everything is working decently would be a good time to clone this as a default image, and then start tweaking it. If its screws up and you destroy any functionality, then you can easily restore to a working install.&lt;/p&gt;

&lt;p&gt;Lets see how this tutorial can help me better understand FreeBSD as a production server, and lets see if I can get a website that will get Pounded, Beaten and Brusied from a serious slashdot effect.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Installing Ruby, RubyGems, and Rails</title>
        <link href="https://blog.hplogsdon.com/installing-ruby-rubygems-and-rails/"/>
        <updated>2009-11-08T23:33:11+00:00</updated>
        <id>https://blog.hplogsdon.com/installing-ruby-rubygems-and-rails/</id>
        <content type="html">&lt;p&gt;This is the second in a multipart series on how I configured a headless FreeBSD server when I moved to a VPS provider.&lt;/p&gt;

&lt;p&gt;Now that you have a fully working FreeBSD Apache, MySQL, PHP server, we’re going to see how we go about getting Ruby on Rails applications running.&lt;/p&gt;

&lt;p&gt;In all, its relatively simple, though I ended up having trouble parsing through all the various HowTos posted around the internet and developing a configuration that worked for me. This may not be the ultimate best setup if you want to run the next Twitter application with millions of hits a day, but it will get you running your first “Hello World” application. Hopefully by the time you get that major application, you’ll better understand whats going on in your server to tweak it for your needs.&lt;/p&gt;

&lt;p&gt;The Ports are great at knowing dependancies for packages, but I like to be able to build the language Ruby before I get into the Rails portion of it.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/lang/ruby18
$ sudo make install clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If Ruby hangs at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Generating RI...&lt;/code&gt; then let it sit for a few minutes. Maybe up to a half hour. Or several hours. It will finally complete, and then we can continue on.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/www/rubygem-rails
$ sudo make install clean
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once Rails is installed, we won’t have a lot to configure. It all pretty much works out of the box. Lets try and run a test application.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mkdir ~/railsapps
$ cd ~/railsapps
$ rails myapp
$ cd myapp
$ ruby script/server
=&amp;gt; Booting WEBrick
=&amp;gt; Rails 2.3.4 application starting on http://0.0.0.0:3000
=&amp;gt; Call with -d to detach
=&amp;gt; Ctrl-C to shutdown server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and check to see that its running on http://$IPADDRESS:3000/ And click on the link “About your application’s environment” which will run a bit of rails code, which is just enough to either give indication of no problem, or an error. On this server, I must have missed the configuration to install sqlite3-ruby from ports. I’m getting a sqlite3-ruby not found error. So I’ll run:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/databases/rubygem-sqlite3
$ sudo make install clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then retest the application with sqlite. Now, I don’t want to run production from sqlite, but its really good to have it for simple tests. For production, I’ll be running mysql, so lets go ahead and set up some databases and a sample rails app for it.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.87 FreeBSD port: mysql-server-5.0.87

Type &apos;help;&apos; or &apos;\h&apos; for help. Type &apos;\c&apos; to clear the current input statement.

mysql&amp;gt; CREATE DATABASE myapp_development;
Query OK, 1 row affected (0.05 sec)

mysql&amp;gt; CREATE DATABASE myapp_test;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; CREATE DATABASE myapp_production;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; GRANT ALL PRIVILEGES ON myapp_development.* TO &apos;user&apos;@&apos;localhost&apos; IDENTIFIED BY &apos;p@ssw0rd&apos;;
Query OK, 0 rows affected (0.05 sec)

mysql&amp;gt; GRANT ALL PRIVILEGES ON myapp_test.* TO &apos;user&apos;@&apos;localhost&apos; IDENTIFIED BY &apos;p@ssw0rd&apos;;
Query OK, 0 rows affected (0.01 sec)

mysql&amp;gt; GRANT ALL PRIVILEGES ON myapp_production.* TO &apos;user&apos;@&apos;localhost&apos; IDENTIFIED BY &apos;p@ssw0rd&apos;;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql&amp;gt; EXIT;
Bye
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then create a new rails app that uses the databases we just set up:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ~/railsapps
$ rm -rf myapp
$ rails myapp -d mysql
$ cd myapp/
$ vim config/database.yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then type some simple commands to change things around to reflect our application’s databases:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;:%s/username: root/username: user/g
:%s/password:/password: p@ssw0rd/g
:wq!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&amp;lt;gloat&amp;gt;see how much easier VIM is than TextMate? hehe.&amp;lt;/gloat&amp;gt;
Then start up that server with:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ruby script/server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And do the same checks.&lt;/p&gt;

&lt;p&gt;If everything is good, then lets continue, otherwise debug your error messages and fix them before continuing. Also, since this will end up being a production server, you might want to consider deleting those databases, and that user’s grants. I like things clean, and there is no reason to have them anymore.&lt;/p&gt;

&lt;p&gt;If you don’t have any continuing issues, proceed to Part 4: &lt;a href=&quot;/configuring-mongrel-and-mongrel-cluster/&quot;&gt;Configuring Mongrel and Mongrel Cluster&lt;/a&gt;&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Configuring the FAMP Stack</title>
        <link href="https://blog.hplogsdon.com/configuring-the-famp-stack/"/>
        <updated>2009-11-08T23:31:46+00:00</updated>
        <id>https://blog.hplogsdon.com/configuring-the-famp-stack/</id>
        <content type="html">&lt;p&gt;This is the second in a multipart series on how I configured a headless FreeBSD server when I moved to a VPS provider.&lt;/p&gt;

&lt;p&gt;As noted earlier, I’m more concerned about running Rails apps in a Production environment, partly because I’ve never run any in a production environment, and i’ve never set up a production environment. However, with that said, I think it is hilariously dumb not to include other web language capabilities to the server. Evern though I’m not gung-ho about PHP, I’m also aware that it runs a significant portion of the application on the internets. I’m currently writing this blog post on WordPress, and I have no unbiased issues due to it. So before we get all complicated with Rails, lets get the standard basic FAMP server running and dishing out pages.&lt;/p&gt;

&lt;p&gt;I like to start with MySQL. Its a decent database system. Its common enough (read: everywhere) that I usually don’t have any problem favoring it. I’m also used to it more than anything else. If you want something else, skip over this section and choose your own flavor.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/databases/mysql50-server
$ sudo make install clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Go grab a beer while that does its thing.&lt;/p&gt;

&lt;p&gt;Install your mysql database that will be the template for all new databases to be copied from:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo /usr/local/bin/mysql_install_db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, start up the database server, but take a look at what was installed. Be sure to understand where the default socket is, and where the binaries were put, and what user mysqld will be run as.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo /usr/local/bin/mysqld_safe
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Get any error messages? If you didn’t, good on you. If you did, then thats perfectly normal. I don’t think I’ve ever not had an issue, albeit minor, when I’ve installed MySQL. In a new server shell, I usually tail the resulting error file, which is generally:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo tail -f /var/db/mysql/hostname.err
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which should bring up the error stating that mysql doesn’t have permission on the directory, and cannot find the socket. The most common fix for me has been:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo chown -R mysql /var/db/mysql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you have other errors, google the error message and see what other people have done to fix it. See if you can apply those same ideas to your issue.&lt;/p&gt;

&lt;p&gt;Try to start mysqld_safe again, keeping an eye on that error logfile. If everything works normally, close the logfile, and kill the process (killall -9 mysql), then configure your administrator (root) password:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo /usr/local/bin/mysqladmin -u root password &apos;newpassword&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On a development box, I have no problem keeping the root password blank. I jump in and out of the mysql console/shell so frequently, I usually can’t be bothered to put in a complicated password. But on production, this is designed to be secure, safe, and relatively static. Set up a good secure password. If you need to be going in and out of databases enough on the production machine, you’re doing it wrong.&lt;/p&gt;

&lt;p&gt;I originally thought that PHP gets installed before Apache, but Apache is a dependency of PHP, for pretty obvious reasons. Unfortuantely, when I started configuring it, it started to pull down apache1.3. I want Apache2.2, so I’ll go ahead and configure it now… But if I was to do that, I’d get this error:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;===&amp;gt;   apache-2.2.13 depends on package: libtool&amp;gt;=2.2 - not found
===&amp;gt;   Found libtool-1.5.26, but you need to upgrade to libtool&amp;gt;=2.2.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which ends up being somewhat complicated if you’ve never run into it before. (un)Fortunately, I have before, and it is all explained pretty nicely in “/usr/ports/UPDATING”:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;20090802:
AFFECTS: users of devel/libtool15 and devel/libltdl15
AUTHOR: mezz@FreeBSD.org

The devel/libtool15 and devel/libltdl15 ports have been moved to libtool22
and libltdl22, respectively, then updated to 2.2.6a. You will need to run
portmaster or portupgrade to properly perform the upgrade:

Portmaster:
-----------

portmaster -o devel/libtool22 devel/libtool15
portmaster -o devel/libltdl22 devel/libltdl15

Portupgrade:
------------

portupgrade -o devel/libtool22 libtool-1.5\*
portupgrade -o devel/libltdl22 libltdl-1.5\*

After that, you will need to rebuild all ports that depend on libltdl.
Since all dependent ports&apos; PORTREVISIONs have been bumped, you can run
portupgrade or portmaster with &apos;-a&apos; to complete the upgrade.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So lets continue on, I use portmaster, since it really is a tiny little shellscript, where as portupgrade has a larger database driven design. Run the commands given, and all should be well.&lt;/p&gt;

&lt;p&gt;Now we can start on getting Apache2.2 running:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/www/apache22/
$ sudo make install clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Its time for you to think about what you will need, and when you will need it. It doesn’t take much to go back and reconfigure and recompile Apache, but its best not to. Figure out what you want to do with it, and decide how to configure it now.&lt;/p&gt;

&lt;p&gt;Apache has great support for multiple sites using the virtual hosts configuration. Its dead simple to get multiple domains running off of one box, with individual IPs or even a shared IP. This post wont go into detail on how to set up Apache to serve multiple domains, but the server I am building will eventually host multiple domains out of port 80 with a shared IP, and will host a secure site out of port 443 on a separate IP address. It will be possible to host additional secure sites, but those will require their own IP address and cert. Because I want multiple domains, I’ll probably (read: guaranteed) end up running something like wordpress or drupal, which are both written in PHP. I’m not a fan of writing PHP, but PHP can, and has, been the foundation for some great applications. But thats a political viewpoint that has no foundation either way. This is your server now, so if you want PHP, then great, install it. Or put Perl or Python in the stack, or whatever you feel you will use.&lt;/p&gt;

&lt;p&gt;I’ll go ahead with PHP, you do whatever serves you best:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/lang/php5
$ sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For this machine, I won’t be building with any fastcgi support, nor any of the CGI only configurations, but I will enable “Build CGI version”, as well as “Build CLI version”. Probably not necessary, but thats what I’m doing. Be sure to build the Apache module as well.&lt;/p&gt;

&lt;p&gt;Now the standard FAMP stack is setup, but lets finish up all the configuration right now, make sure everything works before we include Rails configurations. I noticed on my install, mysql_enable and apache22_enable directives were not copied into my rc.conf file. Check to make sure they are, so whenever you reboot, they will start up.&lt;/p&gt;

&lt;p&gt;To check if PHP is working properly, toss this file into “/usr/local/www/apache22/data/”&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;?php
		phpinfo();
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And name it phpinfo.php . If it pulls up that same text, then you need to add the mime configurations for PHP files into httpd.conf.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On production servers, I don’t allow users to host websites and file out of their home directories. Back in the day, It was okay to do so, but these days, you might as well but a new domain name and set up your private WordPress blog. No reason to to have http://www.example.com/~user/&lt;/p&gt;

&lt;p&gt;For my virtual hosts configurations, I’ve had some boxes have enough virtual hosts to make my httpd-vhosts.conf file look pretty cumbersome, so I go ahead and do this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo mkdir /usr/local/etc/apache22/vhosts
$ sudo cp /usr/local/etc/apache22/extra/httpd-vhosts.conf /usr/local/etc/apache22/vhosts/example.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And update httpd.conf to reflect the changes:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Include etc/apache22/extra/*.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;then edit the example.conf file, commenting every active line, because I don’t really want anyone trying to access dummy-host.example.com on my servers. Now when I want to add a domain to serve, I can copy the file, edit it for the specific domain, reload Apache, and it will all work.&lt;/p&gt;

&lt;p&gt;Continue on to Part 3: &lt;a href=&quot;/installing-ruby-rubygems-and-rails/&quot;&gt;Installing Ruby, RubyGems, and Rails&lt;/a&gt;&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Configuring a headless FreeBSD server</title>
        <link href="https://blog.hplogsdon.com/configuring-a-headless-freebsd-server/"/>
        <updated>2009-11-08T23:31:41+00:00</updated>
        <id>https://blog.hplogsdon.com/configuring-a-headless-freebsd-server/</id>
        <content type="html">&lt;p&gt;This is the first in a multipart series on how I configured a headless FreeBSD server when I moved to a VPS provider.&lt;/p&gt;

&lt;p&gt;This post assumes that your provider has already set you up with a super minimal FreeBSD image that you have access to as root. Its first assumed that there are no user accounts, except root, and there is nothing installed that the “Minimal” option when selecting your install options did not provide to you.&lt;/p&gt;

&lt;p&gt;Onto the building. If you did not install FreeBSD to your disk on your own, and you have not already, be sure to change your Root user password. If you don’t already have a method of making hilariously complicated passwords, especially for root and administrator accounts, check out this snippet:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sitepass() {
		echo -n &quot;$@&quot; |  md5sum | sha1sum | sha224sum | sha256sum | sha384sum | sha512sum | gzip - | strings -n 1 | tr -d &quot;[:space:]&quot;  | tr -s &apos;[:print:]&apos; | tr &apos;!-~&apos; &apos;P-~!-O&apos; | rev | cut -b 2-11; history -d $(($HISTCMD-1));
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;via: &lt;a href=&quot;http://www.commandlinefu.com/commands/view/3690/generate-a-unique-and-secure-password-for-every-website-that-you-login-to&quot;&gt;CommandlineFu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before I set a user other than root, I grab my shell of choice&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# cd /usr/ports/shells/bash
# make install clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and then set up the user to my liking:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# adduser
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then just before I log out of root, I grab another essential piece:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# cd /usr/ports/security/sudo
# make install clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and add my newly created user to the sudoers file&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# vi /etc/sudoers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You might start to read ahead and notice that we will be using the sudo command quite frequently. This may also make you think that you should just stay as root. Well don’t. There is a fine line between becoming complacent with typing your password in frequently, to the point you don’t even remember doing it,&lt;/p&gt;

&lt;p&gt;Now, you’re probably like me, and anxious to get some applications up and running that actually do things a server is supposed to do, but we’re going to take a break. I grabbed the ports tree from the servers, not my installation disc, when I installed the OS, but I’m going to start compiling a lot of packages from source all at once. Last thing I need is to spend time building a port, only to find out in a day, or hour, or whatever from now that its not up to date. Lets fix that potential problem now. There are multiple ways to do this, but I use a simple one:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo portsnap fetch
...
$ sudo portsnap extract
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This ensures my tree is up to date, and everything I compile from here on out is going to be good.&lt;/p&gt;

&lt;p&gt;Once thats finished, I logout, then log back in as the user I just created. At this point, I also scp my public key for my local box into the server. For whatever reason, I like to pretend it is now headless and in some Colo facility thousands of miles away. Helps me make better judgments if I can’t boot it up and fix all the dumb mistakes I made by copy/pasting bad code and commands I have no idea what they do. I logout of the VM, so its at the login screen, minimize the VM, and its done. No more server sitting in front of me.&lt;/p&gt;

&lt;p&gt;I’m still a huge fan of VIM, so thats one thing I grab early on. I also have an archive of my favorite VIM scripts and my .vimrc easily available, so lets set that up. My only problem is it takes a while to compile from ports. Wouldn’t it be nice if I could detach that compiling session and continue configuration? Well you can, with GNU screen.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /usr/ports/sysutils/screen
$ sudo make install clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then continue on:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ screen
$ cd /usr/ports/editors/vim
$ sudo make config-recursive
$ sudo make install clean
C-a d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;“make config-recursive” goes through the port, and all its dependancies, and brings up the ncurses screen in advance, so you can safely detach and not have to check on it every few minutes.&lt;/p&gt;

&lt;p&gt;While Vim is compiling all its dependancies and whatnot, lets harden up a few things. Specifically SSHd. I already put my public key on the server, but I don’t even have a private key on the server. Lets make one:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ssh-keygen -t rsa
Generating public/private rsa key pair.
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And Best Practice: Use a goddamned passphrase. Not that a public/private key pair is entirely essential, but we’re configuring sshd, so we might as well get everything done here. Change some lines, based on your own preferences, in the sshd_config file.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo vim /etc/ssh/sshd_config

Change (and uncomment): Port 22
To: Port 2200 (or higher, or more random, your choice)

Change: Protocol 1
To: Protocol 2

Change: LoginGraceTime 2m
To: LoginGraceTime 10s

Change: #PermitRootLogin no
To: PermitRootLogin no
(This is arguable, but I don&apos;t care. I don&apos;t log in as root,
and so I don&apos;t allow it)

Change: MaxAuthTries 6
To: MaxAuthTries 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And whatever you feel is necessary. This isn’t a tutorial
on hardening your box. This is just a start to get myself
going from the ground up.&lt;/p&gt;

&lt;p&gt;Finally, run:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo /etc/rc.d/sshd restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then, &lt;strong&gt;IN ANOTHER FUCKING TERMINAL SESSION FROM A REMOTE MACHINE THAT HAS SENT ITS PUBLIC KEY TO THE SERVER AND WAS ADDED TO YOUR AUTHORIZED_KEYS FILE WHILE KEEPING YOUR CURRENT CONNECTION ACTIVE&lt;/strong&gt;, try to access the server via ssh.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;localhost $ ssh -p (whatever you set) user@server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you just locked yourself out of your box, let me know so I can laugh at you. thks.&lt;/p&gt;

&lt;p&gt;If you’re comfortable with whats there, lets continue on to Part 2: &lt;a href=&quot;/configuring-the-famp-stack/&quot;&gt;Configuring the FAMP Stack&lt;/a&gt;&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>Ruby on Rails on FreeBSD</title>
        <link href="https://blog.hplogsdon.com/ruby-on-rails-on-freebsd/"/>
        <updated>2009-11-08T23:31:32+00:00</updated>
        <id>https://blog.hplogsdon.com/ruby-on-rails-on-freebsd/</id>
        <content type="html">&lt;p&gt;I’m pretty sure this is going to turn into a long story short, turned long. Though thats mostly intentional this time.&lt;/p&gt;

&lt;p&gt;Virtualization is a pretty cool technology. Its an interesting idea to take 3 servers, like a Frontend Balancer, Web server, and database server, and toss them all into one. Well, even for taking a high end box and then setting it up to host a dozen or more private boxes with the entire web-stack running local. Its pretty cool.&lt;/p&gt;

&lt;p&gt;Well, I’m thinking about moving over to a VPS provider. In preparation of administrating my own production box, I decided to set one up in a VM. A Real Live (fake) Production Server.&lt;/p&gt;

&lt;p&gt;Well, its basically practice so I can remember how to set up the real box. This is my documentation.&lt;/p&gt;

&lt;p&gt;I’m still more of a fan of FreeBSD than any of the Linux Distros, I’ll be running through a setup of FreeBSD. I’ll also be running a generic kernel. Not that it matters very much, but its something to consider. Since I have a couple Ruby on Rails apps and the standard PHP stuff, I’ll be setting Rails and PHP up, MySQL for the database, and Apache for the webserver. I keep on hearing nice things about Nginx, but I don’t have any experience with it. I’ve also heard that MySQL is rather cumbersome, but thats what I’ve used. This configuration should be pretty generic, but my goal is to keep it clean.&lt;/p&gt;

&lt;p&gt;I’ve also developed a habit of installing FreeBSD from the netinstall disc, rather than the full DVD. I pretend its more up-to-date, even though it does make the inital install a tad longer, it doesn’t take hours to download. For the production, I install only the minimal configuration. If I find I need something later, I’ll grab it from ports or whatever. If you are following this tutorial along with me blindly, you probably will stumble a little. Google your hangup. Read the &lt;a href=&quot;http://www.freebsd.org/doc/en/books/handbook/&quot;&gt;FreeBSD Handbook&lt;/a&gt;. Then ask around, or leave a comment.&lt;/p&gt;

&lt;p&gt;This post has been split up into sections. It was becoming huge, so I’ve helped break it down into more manageable parts that don’t necessarily rely on each other.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;/configuring-a-headless-freebsd-server/&quot;&gt;Configuring a headless FreeBSD server&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/configuring-the-famp-stack/&quot;&gt;Configuring the FAMP Stack&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/installing-ruby-rubygems-and-rails/&quot;&gt;Installing Ruby, RubyGems, and Rails&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/configuring-mongrel-and-mongrel-cluster/&quot;&gt;Configuring Mongrel and Mongrel Cluster&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</content>
    </entry>
    
    <entry>
        <title>Its WINE, again honey....</title>
        <link href="https://blog.hplogsdon.com/its-wine-again-honey/"/>
        <updated>2009-09-30T01:24:28+00:00</updated>
        <id>https://blog.hplogsdon.com/its-wine-again-honey/</id>
        <content type="html">&lt;p&gt;I &lt;em&gt;almost&lt;/em&gt; get tired of trying to get WINE to run on my OSX system…&lt;/p&gt;

&lt;p&gt;I say almost, because its getting better, but issues still need to be ironed out. Particularly the old LibJPEG library. On Leopard I had a bitch of a time getting it to be picked up properly. Now on Snow Leopard, I almost had an issue. For whatever reason, it compiled as x86_64 by default. I figured this wasn’t a bad thing, but it was also 2AM. Well, WINE’s ./configure really didn’t like it. Thankfully the error was:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;configure: WARNING: libjpeg 32-bit development files not found, JPEG won&apos;t be supported.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Welp, 32 bit not found. No problem, I’ll just go ahead and recompile this to 32… aaaand break GD support in PHP. Great…&lt;/p&gt;

&lt;p&gt;So the end result ended up being a fat binary. Thats both x86_64 and i386 stuffed into the same package/binary. Trouble is, ./configure didn’t like doing “-arch x86_64 -arch i386” passed as the CFLAG. I’m no genius, but I’ve never manually made a fat binary. Didn’t take much really. I tore apart a Makefile I found and came up with this little bit:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ tar xzvf jpegsrc.v7.tar.gz
$ cd jpeg-7
$ mkdir -p build/i386 build/x86_64 build/ppc build/fat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I decided to include PPC, in case I needed to link against it in the future for a cross-compile I cant see myself doing.
This is where the fun begins:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd build/i386
$ CFLAGS=&quot;-O3 -g -arch i386&quot; ../../configure --prefix=&quot;/usr/local&quot; --enable-shared --disable-dependency-tracking &amp;amp;&amp;amp; make
$ cd ../x86_64
$ CFLAGS=&quot;-O3 -g -arch x86_64&quot; ../../configure --prefix=&quot;/usr/local&quot; --enable-shared --disable-dependency-tracking &amp;amp;&amp;amp; make
$ cd ../ppc
$ CFLAGS=&quot;-O3 -g -arch ppc&quot; ../../configure --prefix=&quot;/usr/local&quot; --enable-shared --disable-dependency-tracking &amp;amp;&amp;amp; make
$ cd ../fat
$ lipo -create ../*/.libs/libjpeg.a -output libjpeg.a
$ lipo -create ../*/.libs/libjpeg.7.dylib -output libjpeg.7.dylib
$ lipo -create ../*/wrjpgcom -output wrjpgcom
$ lipo -create ../*/jpegtrans -output jpegtrans
... and so on.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;OK, so now you have fat binaries of the library and tools.&lt;/p&gt;

&lt;p&gt;Anyways, I ended up installing the 64bit version outright, to make sure I wouldn’t miss anything via:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ../x86_64
$ sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;then I could manually, again, go back and move those fat binaries into place. If you paid any attention during “make install”, you’d easily notice where they go:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ../fat
$ sudo cp libjpeg.a /usr/local/lib/
$ sudo cp libjpeg.7.dylib /usr/local/lib/
$ sudo cp wrjpgcom /usr/local/bin/
$ sudo cp jpegtrans /usr/local/bin/
... and so on.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and voila, manually installed, and works great. Run&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;file /usr/local/lib/libjpeg.dylib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and verify the output.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Wipe and Reinstall is faster</title>
        <link href="https://blog.hplogsdon.com/wipe-and-reinstall-is-faster/"/>
        <updated>2009-09-24T07:13:14+00:00</updated>
        <id>https://blog.hplogsdon.com/wipe-and-reinstall-is-faster/</id>
        <content type="html">&lt;p&gt;I’ve moved this blog from one domain to another time again, partly because I didn’t want to renew that domain name for another year, when I really didn’t like it all that much.&lt;/p&gt;

&lt;p&gt;Figured I might run this for a while, then see how it goes. I’ll probably end up doing something completely different in a few months anyways. I don’t care. SEO isn’t the reason I’m doing this.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>ObjC in TextMate</title>
        <link href="https://blog.hplogsdon.com/objc-in-textmate/"/>
        <updated>2009-09-14T22:27:44+00:00</updated>
        <id>https://blog.hplogsdon.com/objc-in-textmate/</id>
        <content type="html">&lt;p&gt;I’ve been playing around with more Objective-C. Not much to say about it, other than the upgrade to SnowLeopard on my iMac has broken a few things, most notably, MacVim.&lt;/p&gt;

&lt;p&gt;I love &lt;a href=&quot;http://code.google.com/p/macvim/&quot;&gt;MacVim&lt;/a&gt;. Its so easy to use, and really took to time at all to learn. The most basic commands, :w and :q, are all you need to know to use it. Are you typing out a line with a few single words changed, such as a boilerplate HTML unordered list? Well, Yank that one line, Put it in for the next 5, and then do a replacement for those lines “:s/Link 1/Link2”, then the next line “:s/Link 1/Link 3”, and so on. You just saved yourself a bit of time by not typing out &amp;lt;li&amp;gt;&amp;lt;a href=”#”&amp;gt;Link 1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt; a million times, AND you learned a new command.&lt;/p&gt;

&lt;p&gt;Well, I fell back to TextMate, which isn’t all that much of a bad thing. Except a few plugins, I can get nearly the same functionality. I tried using ViMate.tmPlugin for a while, but its not quite the same thing. I have developed a (bad?) habit of saving a document by typing out “esc :w”, which isn’t implemented in the plugin. So the end of all my documents and source files would have a random “:w” at the end. Made for some hilarious debugging a couple nights ago.&lt;/p&gt;

&lt;p&gt;I use the c-support vim plugin (c.vim), which I’ve modified for objc, which loads up a template file whenever I create a new buffer inside vim with the extension *.m . A pretty nifty thing that auto adds my name, date created, and a line for description in the head of the file, all commented, so I can remember what I was doing when I go open it back up.&lt;/p&gt;

&lt;p&gt;I wanted the same thing inside TextMate, so I hacked together a tiny little bundle to do that. I had no idea how to create a bundle, so this is a hack, and may or may not work for everyone. If it does, great, if it doesn’t let me know and I’ll try to figure it out. Anyways, here it is:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://hplogsdon.com/files/objective-c-foundation-tool.zip&quot;&gt;objective-c-foundation-tool&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;EDIT: Or you can grab it from my GitHub page: &lt;a href=&quot;http://github.com/uxp/Objective-C-Foundation-Tool.tmbundle&quot;&gt;Objective-C Foundation Tool.tmbundle&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This has a language template for the main.c and Makefile of a simple ObjectiveC Foundation tool. As I start go get further into Cocoa, i’ll probably modify it to suit my expanding needs. If any of you modify it, feel free to show me what you did, so we both can learn from one another. It also has a keybinding for “cmd+B”, which starts the build process, similar to typing :make in vim.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>I don't do this for a living</title>
        <link href="https://blog.hplogsdon.com/i-dont-do-this-for-a-living/"/>
        <updated>2009-09-04T04:59:27+00:00</updated>
        <id>https://blog.hplogsdon.com/i-dont-do-this-for-a-living/</id>
        <content type="html">&lt;p&gt;I don’t do this for a living. None of it. I don’t really want to make a living off it either… But I’m slowly getting closer to the point where I could. Pretty easily…&lt;/p&gt;

&lt;p&gt;I was hired by someone close to me to design, install and configure a website. Specifically an eCommerce site… Uh, I’ve designed a few WordPress themes, done some halfass PHP scripting, and a bit of clientside scripting. I’m not really the one that you should be going for, but they wanted me to do it, cause they knew it was gonna be cheap (I dunno how much this shit costs to do), and they knew it would be a good learning experience, and they could dictate and come back to me with suggestions and criticism. Thats not a bad thing, for either of us.&lt;/p&gt;

&lt;p&gt;So for the past month (yeah, it was slow going at first) I tossed a few open source solutions on my development server, played with them each for a day or two, and eventually decided on one. Some factors include development ease and configuration ease, admin/store admin usability, and what language it was in. I played with a couple Python/Django solutions, and though I eventually settled on a PHP solution, I would have rather used the Django solution. I sat down a little while before and wrote a Django blog application in under an hour one night. Django is fucking awesome, mostly because it comes with the backend pre configured. All you do is gotta get some of the logic and controller written out, and its done (except for that whole “display content/data” part).&lt;/p&gt;

&lt;p&gt;So I ended up with a PHP solution. Mostly because I could easily script in some custom actions, like emailing the owners, for simple stuff like Stock levels, and whatnot. Once they get all the data imported into it, the store will run itself. I’ve even got it set up with the postal service to basically print shipping labels. Someone needs to manually put the product in a box, tape it, and then stick it on their front porch to have it picked up… Maybe I should start selling stuff…&lt;/p&gt;

&lt;p&gt;Well, I got it all “Done” last week. Gave me a good while to sit back and relax, do some work that isnt computers, for all of… 3 days. Yeah. 3 fucking days, and I get another assignment. My dad started to complain that his computer was running kinda slow… Great. A year old laptop. wtc is wrong. Well, I quickly put AVG on scan, went to lunch and saw when I came back that it had a Virus, trojan, or rootkit.&lt;/p&gt;

&lt;p&gt;I ended up taking it home with me, and found out that it was the UAC rootkit, with a Win32/Crypto trojan… and something else relatively harmless. Rootkit. Those are like Unicorns. I’ve never had to deal with one. The UAC also likes to livepatch any malware, rootkit or antivirus software you try and run on the infected machine so it wouldnt work. It was fun playing with it really. I’d go and delete the generated DLLs, and it would hide for a while, then reappear somewhere else. Cat and mouse all over the windows folder.&lt;/p&gt;

&lt;p&gt;I ended up running a few things from Ubuntu live to get to some stuff windows wanted to hide from me, then popped into safemode and finished up the cleaning with the standard GMER, ComboFix, and MalwareBytes combination. Its been a while since I’ve had to dig into a windows install. It was kinda fun. I just hate having to sit around while AVG or MBAM does a scan. That shit isn’t fun.&lt;/p&gt;

&lt;p&gt;So I got that all cleaned up, I think. Well the next day, the clicking that I’ve been hilariously ignoring got a little worse from my iMac. Its the harddrive. Even an idiot could tell. So I spent an hour or so imaging that disk to a safe location, then actually wiped the disk, reinstalled OS X, then upgraded to the new OS X, snow leopard. I actually bought it first, unlike what I did with leopard. I installed leopard pretty early, like the day it was released, then went out a while later and bought a disk, which sat in its packaging forever, until I needed to run a disk check… I shouldn’t do that shit.&lt;/p&gt;

&lt;p&gt;But I left the Mac running all night, and at 4:42AM it locked up on me. Haha. So today I dropped that off. It was still under warranty, so thats cool. Free HDD replacement.&lt;/p&gt;

&lt;p&gt;Lets see if running my dads laptop all night tonight will let that rootkit resurface. I’m pretty sure I wiped it, but we’ll find out soon enough. I backed up all his documents, so give me an hour and an energy drink and it’ll be squeaky clean if need-be.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Physical Access is Root Access</title>
        <link href="https://blog.hplogsdon.com/physical-access-is-root-access/"/>
        <updated>2009-08-21T14:29:45+00:00</updated>
        <id>https://blog.hplogsdon.com/physical-access-is-root-access/</id>
        <content type="html">&lt;p&gt;I always forget that physical access is akin to root access on a box.&lt;/p&gt;

&lt;p&gt;A couple weeks ago a friend dropped off an old laptop at my house. He said he was unable to get into the OS because he didn’t have and user passwords, or names. It was running an older Fedora release, which I neither remember, or care to remember what version. Funny thing is, I couldn’t get Ubuntu to boot off the LiveCD either. Ubuntu is generally my goto for a cheap (free) simple OS to run really quick. Probably because I usually have a new disc sitting around at all times.&lt;/p&gt;

&lt;p&gt;Well, Since Ubuntu didn’t boot, I grabbed a Fedora Core 10 live disc which actually booted just fine in under a half hour. Did I mention this was an old laptop? After spending maybe an hour trying to get anything to load in order to get to the HDD, I gave up. There was little on the disc he needed, and it was only 20GB, so I shut it down and tried something else. The second, which really should be my first goto live OS, &lt;a href=&quot;http://bsdeviant.org/&quot;&gt;BSDeviant&lt;/a&gt;. This is an amazing OS I have the pleasure of working with. I actually host the site, though I don’t work on the project. No one does anymore. It’s rather dead unfortunately.&lt;/p&gt;

&lt;p&gt;Well after a quick boot into BSDeviant, I was able to mount the HDD and edit the /etc/passwd and /etc/shadow files to completely remove the user password. I could then boot into Fedora and make a new password for the user of my specification.&lt;/p&gt;

&lt;p&gt;The process made me start to think. On my laptop, I have a bit of paranoia. Every few minutes I have a cronjob run a script that pings my server and gets a file via cURL. If the file is false, everything is golden. But if I modify the file to be true, as in “It is True my laptop has been stolen”, then it record the LAN and WAN IP address, takes a screenshot, lists all files that have been modified in the past 24 hours, and takes a capture of the webcam, tars it all up in an archive, then emails it to me, all behind the scenes. The only indication that its running is a half second blip of the LED indicator light when the webcam takes a picture of the user. Pretty nifty I might say.&lt;/p&gt;

&lt;p&gt;But if the thief has any sense, then he would never connect to the internet, so the script could never tell if the laptop is stolen, and he would probably do something similar, as in archive the disk image, and run his own OS, as a live CD or similar, and access all my files.&lt;/p&gt;

&lt;p&gt;Maybe I should start looking into encryption… Man I’m paranoid.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>SSHd Bruteforce Bots</title>
        <link href="https://blog.hplogsdon.com/sshd-bruteforce-bots/"/>
        <updated>2009-07-10T17:26:22+00:00</updated>
        <id>https://blog.hplogsdon.com/sshd-bruteforce-bots/</id>
        <content type="html">&lt;p&gt;Every few days I cat my logs on all my systems to see if anything should be fixed, repaired, patched, removed and whatnot. It only takes an hour or so, and I’ve come across a enough problems that I otherwise would not have noticed that only took a minute to fix, and helped the overall status of my system.&lt;/p&gt;

&lt;p&gt;Well, I had a simple firewall put up with PF on my FreeBSD box, but it didn’t do anything besides filter a couple ports and then block everything else. One port open, 22. This allowed this shit to basically spam my logs:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Jul 10 10:55:56 dukkha sshd[38567]: Invalid user simona from 203.172.142.245
Jul 10 10:56:01 dukkha sshd[38569]: Invalid user annalisa from 203.172.142.245
Jul 10 10:56:04 dukkha sshd[38574]: Invalid user diego from 203.172.142.245
Jul 10 10:56:11 dukkha sshd[38576]: Invalid user elena from 203.172.142.245
Jul 10 10:56:15 dukkha sshd[38578]: Invalid user luciano from 203.172.142.245
Jul 10 10:56:18 dukkha sshd[38580]: Invalid user marilena from 203.172.142.245
Jul 10 10:56:22 dukkha sshd[38582]: Invalid user htdocs from 203.172.142.245
Jul 10 10:56:26 dukkha sshd[38584]: Invalid user toiawase from 203.172.142.245
Jul 10 10:56:31 dukkha sshd[38586]: Invalid user storm from 203.172.142.245
Jul 10 10:56:35 dukkha sshd[38588]: Invalid user sysadmin from 203.172.142.245
Jul 10 10:56:38 dukkha sshd[38590]: Invalid user blitzcat from 203.172.142.245
Jul 10 10:56:42 dukkha sshd[38592]: Invalid user circ from 203.172.142.245
Jul 10 10:56:46 dukkha sshd[38594]: Invalid user ginny from 203.172.142.245
Jul 10 10:56:49 dukkha sshd[38596]: Invalid user ftp from 203.172.142.245
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which, really isn’t anything. But, knowing me, I decided to fix it. I wanted to blacklist the IPs automatically, but I’m really not a good programmer. Even for a simple cat/grep log script. But Google helps me out once again. I came across this article by “valiantsoul” (if that is his/her handle, who knows) which seems to be a rather old article. &lt;a href=&quot;http://home.earthlink.net/~valiantsoul/pf.html&quot;&gt;SSH Brute Force Blocker with PF on FreeBSD&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically, this changes one thing. Whenever the “/var/log/auth.log” file gets written to, a simple Perl script is run. All the script does is take the log, and with a bit of regex (god I love Perl Regular Expressions) looks to see if there are any “Invalid user $USER from $IPADDRESS” lines, or “Did not receive identification string from $IPADDRESS” lines, and then takes those IP addresses and adds them into a blacklist file, which is then addded to a &lt;blacklist&gt; table in the pf firewall. Pretty simple stuff, and I&apos;m rather surprised how easily I can understand the code also. Looks like I&apos;m not quite the illiterate retard afterall. (better not get too cocky hehe)&lt;/blacklist&gt;&lt;/p&gt;

&lt;p&gt;welp, thats about it. I might end up re-hosting the code. I get worried when sites are hosted by earthlink. Speaking of, the local alt-weekly paper was advertising an upcoming event where the website linked was to a geocities page or some shit. Hosting is cheap as fuck, I really don’t understand why people cant spring for 10 bux and change for a domainname and hosting for a couple months to a year.&amp;lt;/blacklist&amp;gt;&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Concurrent Python 3.0 and 2.5 Installs on OS X</title>
        <link href="https://blog.hplogsdon.com/concurrent-python-30-and-25-installs-on-os-x/"/>
        <updated>2009-06-12T00:03:17+00:00</updated>
        <id>https://blog.hplogsdon.com/concurrent-python-30-and-25-installs-on-os-x/</id>
        <content type="html">&lt;p&gt;Ran into an issue while needing Python 3.0.1, and OS X’s Python install is only 2.5.1 on Leopard.&lt;/p&gt;

&lt;p&gt;I didn’t want to screw with much, cause there are a lot of problems that could arise by yanking the 2.5 install and replacing it with a largely unsupported Python3.&lt;/p&gt;

&lt;p&gt;So I took about 3 seconds and a google search of “update python os x”, and came across &lt;a href=&quot;http://farmdev.com/thoughts/66/python-3-0-on-mac-os-x-alongside-2-6-2-5-etc-/&quot;&gt;Python 3.0 On Mac OS X (alongside 2.6, 2.5, etc)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, there are OS X Installers, but I like seeing where things go, and its actually kinda fun to compile stuff by hand. So thats what I did.&lt;/p&gt;

&lt;p&gt;And that link, while kinda old, is pretty good.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>OSX LaunchDaemons again</title>
        <link href="https://blog.hplogsdon.com/osx-launchdaemons-again/"/>
        <updated>2009-06-10T13:07:14+00:00</updated>
        <id>https://blog.hplogsdon.com/osx-launchdaemons-again/</id>
        <content type="html">&lt;p&gt;I can’t remember what I was trying to do, but running the command&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;launchctl unload -w /System/Library/LaunchDaemons/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Completely incapaitated my iMac. It was pretty cool.&lt;/p&gt;

&lt;p&gt;To resolve it, I had to boot up in singleuser mode with Command+S at the boot chime, run fdisk, then remount the drive with read/write permissions, and then run the reverse,&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/bin/launchctl load -w /System.....
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which, from singleuser mode, actually booted me back into the aqua desktop system. It was interesting. A couple of “let’s just be sure” reboots later, and I’m golden, until I run another retarded command as root.&lt;/p&gt;

&lt;p&gt;And since my iMac was rebooting, I seized to write this on my iPhone, and the wordpress app no longer has a save button? Wth.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Zend Framework</title>
        <link href="https://blog.hplogsdon.com/zend-framework/"/>
        <updated>2009-06-04T06:11:40+00:00</updated>
        <id>https://blog.hplogsdon.com/zend-framework/</id>
        <content type="html">&lt;p&gt;I’m gonna go ahead and write a second blog post today. Got shit else to do, really (actually thats a lie, there’s always something).&lt;/p&gt;

&lt;p&gt;A few years ago I was a big fan of World of Warcraft. It was a fun game, but I never really got involved in a guild. That was a major disappointment. By the time I hit 70 (I started playing a couple months before Burning Crusade), everyone on the server I was on had already hit 70 and were rolling around in their cool epics. I was never able to get a raid slot due to me being a fairly undergeared tank. By the time I did get a pretty decent equipment setup, It got boring. PVP sucked, and the game really had nothing to offer on PVE, cause everyone is a fucking babby. So I rolled a new character, a warlock, and he hit 70 really damn quick (lol overpowered) and then I started to raid, and was able to fit him out entirely on kara and crafted purps. Well, It then got boring again. So I quit, for maybe 5 months, then restarted for 3 months, and then finally quit.&lt;/p&gt;

&lt;p&gt;Well, MMOs are goddamned sweet. I’ve always liked online multiplayer games. Besides some weird RPGs, Final Fantasy XI (lol Macs/Linux), to be exact, there hasn’t been much I have wanted to play. Sometime before I did quit playing WoW, CCP, the company behind EVE Online decided to team with Cedega and release a Linux and Mac client. I downloaded it, and played it for a couple days, but due to the game being absolutely horrible, I never extended beyond the trial. There were some loose friends that played, and I never actually played with them, which is probably why I hated it. Over time, more friends started to play, and they all happened to be in a major PVP Alliance. Well, I became better friends with one of them, and he kept on telling me to play, but I didn’t really want to do another zombie grind to end-game again (did I tell you I maxed enchanting/tailoring, mining/blacksmith AND Jewelcrafting/Mining on 3 seperate WoW characters?). I don’t know what happened, but I ended up downloading EVE, and created a new trial account. Before I was a week into the game, I already was living in 0.0 space, in said major alliance, and happily blowing up other peoples ships in my little frigate. It was awesome.&lt;/p&gt;

&lt;p&gt;Then a couple months later, I activated another account. Figured one would be PVP oriented and the other be PVE, though it looks like my PVE character is a lot more balanced for both right now. Anyways, this alliance is big. Real big. I’m pretty sure a single guess would cover it. They need work done outside of eve, in the meta game. There is a lot of Meta in EVE. One major douchebag alliance was effectively removed from the game by one player who basically defected after a series of rather ironic events. That alliance is trying to make a come back, and despite them saying how they are winning this war, the numbers do not add up. But the leaders are trying to play the meta game, and win psychologically, which might, and actually seems to boost their member’s morale. Anyways, didn’t want to get into a goons vs. BoB thing, but I did.&lt;/p&gt;

&lt;p&gt;So the alliance I’m in needs coders. Building recruitment apps, API proxies, asset tracking apps, and a lot of other stuffs. And updating said apps. CCP, likes to update stuff a lot. This means URLS break, APIs become invalid, and databases get modified. So I joined up do start coding for them.&lt;/p&gt;

&lt;p&gt;The current chosen frameworks are Django/Python, Zend/PHP, and Ruby on Rails. I thought I’d do Zend, so Ive got a couple environments running locally. Localhost on my mac has a virtual domain for development, and then a staging server is on my BSD box. Truth be told, I also have a RoR and Django environment set up on localhost as well. I said in an earlier blog post (months) that I had a hard time with OOP, but sitting down with a framework which is basically a big collection of OOP classes and hashing out a project is an easy way to learn. I’m by no means fluent, but I have learned more about OOP in the past 4 days than I have in the past 4 months. P cool.&lt;/p&gt;

&lt;p&gt;Well its now late. I’ll be getting to bed.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Nothing To See Here</title>
        <link href="https://blog.hplogsdon.com/nothing-to-see-here/"/>
        <updated>2009-06-04T05:25:42+00:00</updated>
        <id>https://blog.hplogsdon.com/nothing-to-see-here/</id>
        <content type="html">&lt;p&gt;I need to remember this, so here it is.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;Directory &quot;/usr/local/www&quot;&amp;gt;
		AllowOverride None
		DirectoryIndex index.html
		DirectorySlash On
		Options None
		Order deny,allow
		Allow from 10.0.0.1/25
&amp;lt;/Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also, you know you are coding too much when while typing a blog out in wordpress, you constantly press esc at the end of a section or paragraph, and your final line ends in :wq!&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Website Development Screencasts and Podcasts</title>
        <link href="https://blog.hplogsdon.com/website-development-screencasts-and-podcasts/"/>
        <updated>2009-06-02T16:32:26+00:00</updated>
        <id>https://blog.hplogsdon.com/website-development-screencasts-and-podcasts/</id>
        <content type="html">&lt;p&gt;I always wonder why the hell people who write and compose screencasts, blogs, podcasts and other tutorials regarding web development on Mac OS X always begin by installing MAMP. Mamp is the Macintosh, Apache, MySQL, PHP/Perl/Python stack application. OS X has shipped with Apache and MySQL already installed and configured for quite a while and PHP already has an OS X package available that integrates the whole system nicely.&lt;/p&gt;

&lt;p&gt;Why increase your bloat by reinstalling it all? It bugs me.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Work sux</title>
        <link href="https://blog.hplogsdon.com/work-sux/"/>
        <updated>2009-05-26T17:40:07+00:00</updated>
        <id>https://blog.hplogsdon.com/work-sux/</id>
        <content type="html">&lt;p&gt;Well, I’m at work right now waiting for some stuff to go through the cleaner. I have two baskets ready to go, but the long weekend without running the cleaner has made it slow down quite a bit. It runs a little rough and the hydraulics get sticky after about 2 days, so Mondays are usually rough going, and the extra day has made it worse.&lt;/p&gt;

&lt;p&gt;In other news, I recently had an issue with my FreeBSD server box. At one point I wanted to run it both as a secure server, to stuff like SVN, and a insecure server for normal web page slinging. Well, realistically, I mucked up some configurations. http on port 80 would drop outgoing connections. https on 443 worked great though, however my certificate was self signed, which, for my use, was plenty fine, but it was annoying to review and accept the sketchy cert every session. I spent some time trying to resolve the issue, but at the end of the day, I concluded that it would actually be simpler to just download a more recent release ISO, and upgrade the box from scratch. I wanted to update it anyways. So a couple days ago I wiped the disk and reinstalled the OS. One of the greatest things about BSD and Linux is the ability with partitions and slices to basically do a clean wipe and install, yet retain your entire home directory.&lt;/p&gt;

&lt;p&gt;On other technology failure of mine, the terabyte WD MyBook I bought a little over a year ago started to fail a while ago. It was developing a click of death, and would fail to spin up after heating up after doing massive read/write sessions. I broke the enclosure open and stuck a small fan on the case, which worked for a while, but I couldn’t stand he noise. I was also flat out broke, so it took a while, but I managed to scrape together some cash over a few months and bought a new WD 7200rpm Caviar Black 1TB internal disk. The old one was the “green” version. NewEgg had mixed reviews on them, the greens, being kinda faulty. I dunno. It’s still under warranty, so I’ll probably send the disk in for RMA. But, my had 200 gigs free on my internal disk so I had to copy, swap disks on the enclosure controller, paste, and repeat a few times.&lt;/p&gt;

&lt;p&gt;Sidetrack: during the time the green disk was out of commission, I basically kept it completely disconnected. This means all music was inaccessable, and since iTunes is such a whiny bitch about accessable media I kept it shutdown. This also ment I was not updating the iPod nor the iPhone.&lt;/p&gt;

&lt;p&gt;So as I was moving files over I would notice that when cold, the new black drive clicks when spinning up, but doesn’t ever click after it’s a little warm. I’ll keep the old green drive around until I can guarantee this drive isn’t having an issue. It does have a fit when it’s vertical, and I don’t know if that’s common for the drive either. I really don’t want to RMA it either.&lt;/p&gt;

&lt;p&gt;I should really get a new motherboard/proc together for a NAS/media server. Also, any fucking asshole that posts shit for sale on CraigsList, like 3 ~7 year old IBM 2.6ghz, 2gb RAM, 36gig RAID1 servers, for 20 bux each, and doesn’t even bother to respond to replies (even if it’s gone) should FOAD. If you’re gonna bother posting an ad, please bother to reply to the listing, even after the things are sold and gone. You can delete it, you know. You make everyone look bad by not providing correspondence.&lt;/p&gt;

&lt;p&gt;So when I finally got everythig running again, my iPod ate shit. I’m not sure if it’s due to me having rockbox on it, or if it’s the drop it received the day prior to it’s demise. I think it’s a hardware issue because no matter what I try, I cannot write to the disk. The HDD sounds like it spins up fine and is wrking nomally, but fdisk and newfs are returning all sorts of write permissions and i/o errors. Manually creating the partition table is a bunch of failure.&lt;/p&gt;

&lt;p&gt;So I don’t really care too much. My iPhone works decently, and besides a handful of favorite albums, I don’t need 80Gigs of shit I haven’t listened to since high school. Most my listening is devoted to podcasts these days, which require frequent updating, and that presidential inaguration speech isn’t required to be with me all the time. Minimalist audio catalog itt. Besides, it’s got fucking widescreen. All my tv and movies are widescreen anymore. Also, I can fucking write my blog (like I am right now) while listening to shit. Just need to remember to recharge a bit more frequently.&lt;/p&gt;

&lt;p&gt;Oh yeah, so after the harddrive fix, I updated my iPhone, and nearly all my apps updated as well. The wordpress app has landscape mode, awesome, and Twitterrific 2.0.1 is just goddamned cool.  Probably gonna buy the full version, even though I don’t mind the ads. Square Enix released a new Final Fantasy based turn based strategy, as well as updated their older one that they ported from the iPod. So i’m damned bored at work (with work) but I’ve got shit to occupy my time.&lt;/p&gt;

&lt;p&gt;Well, I really should start to so somehing today, so I’ll finish up these couple jobs and not feel worthless again. And need to remind myself to get ahold of that friend to talk about a new job opportunity… in PHP programming. Might be fun and teach me some useful shit.&lt;/p&gt;

&lt;p&gt;edit: goddamned the iPhone autocorrect sucks, and I’m a fan of weird words.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>OS X Launch Daemons</title>
        <link href="https://blog.hplogsdon.com/os-x-launch-daemons/"/>
        <updated>2009-04-28T16:38:01+00:00</updated>
        <id>https://blog.hplogsdon.com/os-x-launch-daemons/</id>
        <content type="html">&lt;p&gt;So, after a long adventure playing with FreeBSD + KDE4.2 as a full time desktop operating system, I’ve fallen back to running OS X. I don’t know why really, but I have. Maybe a little more flexibility, though I would doubt it if I was told so. I also took that little p4 2.66GHz laptop and tossed Windows XP on it. Unfortunately, as a huge advocate of Open Source Software, XP is really quite cool. There have been quite a few applications I’ve like to run, but couldn’t unless I was actually running WinXP. Its nice to have a box that I can easily get to and run those applications now. Who knows what the future holds, but I’m pretty sure i’ll be back someday.&lt;/p&gt;

&lt;p&gt;Well, in the process of imaging my drives and doing some quite intensive housework with both my Macs, I cleaned off a bunch of stuff I no longer used. One of these was the media application &lt;a href=&quot;http://boxee.tv&quot;&gt;Boxee&lt;/a&gt;. I’d like to run a small box as a complete Media box, and have it all hooked up to the TV in the living room and such, but until I get some more cash, that is just a dream. I tried to run an &lt;a href=&quot;http://ubuntu.com&quot;&gt;Ubuntu&lt;/a&gt; system on the laptop, since its got s-video out, but to no avail. 512Megs of ram really is a limiting factor. Youtube videos stuttered quite a bit. Anyways, back to the Boxee thing, I removed the application, and like most OS X apps, all I did was delete the boxee.app package, which usually is enough to get it off. I wasn’t planning on never using it again, so I figured I could leave all the preferences and such. Well, as I started using OS X again, I would notice launchd every 10 seconds jump up to like 75% CPU usage for a seconds or two, then jump down again. After running ‘launchctl’ from the Terminal, and checking the logs, it seemed that ~/Library/LaunchAgents/tv.boxee.helper.plist was trying to launch the Boxee Daemon, not finding the binary, and then pausing for 10 seconds.&lt;/p&gt;

&lt;p&gt;4/28/09 11:09:31 AM com.apple.launchd[122] (tv.boxee.helper) Throttling respawn: Will start in 10 seconds
4/28/09 11:09:31 AM com.apple.launchd[122] (tv.boxee.helper) Throttling respawn: Will start in 10 seconds
4/28/09 11:09:41 AM com.apple.launchd[122] (tv.boxee.helper[462]) posix_spawnp(“/Applications/Boxee.app/Contents/Resources/Boxee/bin/boxeeservice”, …): No such file or directory&lt;/p&gt;

&lt;p&gt;I tried just removing the job from launchctl, but it would reappear every reboot, so I had to manually remove the plist file from my user’s Library LaunchAgents directory. All is well now.&lt;/p&gt;

&lt;p&gt;It makes me think about software engineering. Naturally, a program, especially in alpha/beta stage, can’t be completely stable, and this issue doesn’t make it “unstable”, but it is an issue that needs to be resolved. If a launcher can’t find its application to launch, it should fallback with an error and quit after a set period of time. Something like this is not going to resolve itself by chance.&lt;/p&gt;

&lt;p&gt;On a side note, a friend is doing some spring cleaning and decided to unload a bunch of software programming books on me. He went to school for a while to become a programmer, and had a job as one for a while, but has since decided he doesn’t want to anymore. Maybe I can learn stuff from them, maybe I wont. I’m not really a fan of Java, and theres a few books on it, and then some on CPP, includeing a 2nd edition Deitel &amp;amp; Deitel CPP, how to Program. Unfortuantely they are mostly out of date (cpp programs including stdio.h for example), but they still are useful.&lt;/p&gt;

&lt;p&gt;And I’m trying to get back into Obj-C programming, especially since I’ve given up the whole Kdevel C thing, for now. I might also try a little Python. I hear thats easy to learn… who knows.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Internet Arguments</title>
        <link href="https://blog.hplogsdon.com/internet-arguments/"/>
        <updated>2009-04-08T19:26:00+00:00</updated>
        <id>https://blog.hplogsdon.com/internet-arguments/</id>
        <content type="html">&lt;p&gt;I’ve been sick for the past couple of days. Somewhat ironic since I’ve basically quit smoking, except for the occasional habitual ones just before bed and after waking. Though it seems, or at least I feel, like I’m getting better faster then I have in the past. And thanks the the awesome fever, my head is all mucky and I’m under short temperment also.&lt;/p&gt;

&lt;p&gt;Anyways this morning after I showered I was checking my email and saw some random conversation about &lt;a href=&quot;http://twitter.com/&quot;&gt;Twitter&lt;/a&gt; going on in the local IRC channel. This newer person I have no idea who is outside of IRC said something, which basically repeated his/her opinion on other subjects:&lt;/p&gt;

&lt;p&gt;“what most people use it for is lame :( “
then:
“it is an effective way to pass around information, it’s just that 90% of that communication is completely useless crap :&quot;&lt;/p&gt;

&lt;p&gt;to which i replied:&lt;/p&gt;

&lt;p&gt;[1054.39] &amp;lt; @uxp&amp;gt; {name}, shut up. the world doesnt revolve around you. other people have every right to use any resource they have available for any purpose they see fit.&lt;/p&gt;

&lt;p&gt;which sparked this whole “I bet uxp uses twitter like a journal: ‘this morning i woke up’, ‘this afternoon i ate lunch’” which just pissed me off even more.&lt;/p&gt;

&lt;p&gt;I don’t even really know why I even stepped into the conversation. I’m not a fan of twitter. I think its pretty stupid. I also think blogging is pretty stupid. I feel that everyone has the right to do whatever they see fit to do, whether or not it “contributes” anything to society.  99% of everything passed through this particular IRC server is crap, and most people on it “should” be denied access so the people that want to use it to better themselves and others may do so without the distraction of the hurfblurf bullshit… but doing so denies other people from even attempting to do so.&lt;/p&gt;

&lt;p&gt;Anyways, I dunno. I also see the hypocrisy in myself telling this person to STFU because “I” don’t want to listen to his/her bullshit about no one caring about their feelings of the internet. I’m going to chalk it up to “you gotta spend money to make money” kind of stuff. Maybe I’ll have to be an ass every once in a while to make other people see that they are being assholes. (though its entirely the opposite I need to do) fuckit.&lt;/p&gt;

&lt;p&gt;I hate 90% of people on the internet. They shouldn’t have access to My Internet. Its special.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>FreeBSD on Apple MacBookPro Hardware</title>
        <link href="https://blog.hplogsdon.com/freebsd-on-apple-macbookpro-hardware/"/>
        <updated>2009-03-21T06:58:56+00:00</updated>
        <id>https://blog.hplogsdon.com/freebsd-on-apple-macbookpro-hardware/</id>
        <content type="html">&lt;p&gt;So, After taking nearly 24 hours of compiling, KDE-4.2.1 is installed and running.&lt;/p&gt;

&lt;p&gt;I’m having slight issues here and there with a few things. Mainly the sound isn’t working. Not a huge issue yet, mostly because I haven’t really ever been able to get sound to run right off the bat under FreeBSD. I’m looking into it. I found &lt;a href=&quot;http://forums.freebsd.org/archive/index.php/t-168.html&quot;&gt;this FreeBSD Forums page&lt;/a&gt; in the archives while looking into the sound issue, and “plamaiziere” mentions “- the sysinstall fdisk on 7.1 breaks all the disk if installed via bootcamp. You need to use 7.0 to install and after update the system.” I actually thought I saw this, and then realized I could download and install the 7.1-RELEASE instead of screwing around forever with an update. Meh. Whatever. Works now, and I’m mostly happy.&lt;/p&gt;

&lt;p&gt;I also have an issue with KDM not loading into KDE properly on occasion. If you enter in a wrong password, it gives you an error, but the correct password basically loads another instance of KDM, not KDE. I currently have the option turned off in /etc/ttys. I’m much too tired to continue playing with .conf files anymore, and I get get KDE running, so its a success. Oh, actually, I had a horrible issue getting the mouse working. I had forgotten how I usually roll, by loading the device (/dev/ums0) with moused via /etc/rc.conf and then using /dev/sysmouse under xorg.conf. Works great.&lt;/p&gt;

&lt;p&gt;Just a few minor issues to deal with, like my /home directory already being too small, (could I get away with wiping all but a basic OS X install?) but we can deal with that crap later. And the goddamned numlock key LED is stuck on. Its been forever since I turned it on, I was rather surprised to see a giant green light from the center of my keyboard (WTHWTFWTC IS THAT… oh. LED. heh :/ )&lt;/p&gt;

&lt;p&gt;Anyways. Bedtime. The old HP lappy is busy with portupgrade for the night (in 3 minutes an ncurses config screen will pop, bet ya 10 bux.) and I might end up moving that to 7.1-REL from 7.0-REL. If I get comfortable enough, I’ll do the server over the week. Its still running 6.3-STABLE though… Dont think Major revisions are too much different though.. Maybe a few more buildworlds kind of things. I haven’t looked into it yet.&lt;/p&gt;

&lt;p&gt;Oh, and I ran into this WINE bug, and love the fuckin commentary… From Google Groups &lt;a href=&quot;http://groups.google.com/group/lucky.freebsd.ports.bugs/browse_thread/thread/6d89cc9fa4b663bd&quot;&gt;132671&lt;/a&gt;&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Change from Wordpress to Drupal?</title>
        <link href="https://blog.hplogsdon.com/change-from-wordpress-to-drupal/"/>
        <updated>2009-03-19T02:23:03+00:00</updated>
        <id>https://blog.hplogsdon.com/change-from-wordpress-to-drupal/</id>
        <content type="html">&lt;p&gt;As Im thinking about stuff, and writing blogposts, I am being reminded to update my WordPress install. I’ve kind of not liked WordPress for a while, but it works VERY well. No reason to change what isn’t broken right? HAHA fuck that.&lt;/p&gt;

&lt;p&gt;Some IRC friends say that Drupal has recently gotten extremely awesome, and I am noticing more and more sites that run it… So I might end up moving this site over again… to drupal. Who knows. An install is an install, so besides fucking up the indexing of the site from google/yahoo/whoever, no harm…&lt;/p&gt;

&lt;p&gt;And I have about 4 different xHTML/CSS templates I’ve recently written for clients/friends/family that need Wordpress theme conversions, or CMS themes to be more general. Maybe I’ll try it later, after I get all this FreeBSD stuff taken care of.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>FreeBSD + OS X Dualboot</title>
        <link href="https://blog.hplogsdon.com/freebsd-os-x-dualboot/"/>
        <updated>2009-03-19T02:16:32+00:00</updated>
        <id>https://blog.hplogsdon.com/freebsd-os-x-dualboot/</id>
        <content type="html">&lt;p&gt;I decided to go ahead and try the dualboot of FreeBSD and OS X on my MacBookPro, Which was very silly of me.&lt;/p&gt;

&lt;p&gt;Here’s basically what I have done so far:&lt;/p&gt;

&lt;p&gt;1 ) Install rEFIt. Its an alternate boot menu for EFI systems, like Intel-Macs. Get it &lt;a href=&quot;http://refit.sourceforge.net/&quot;&gt;here at SourceForge&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2 ) OS X likes to be on a GUID Partition Disk. FreeBSD doesn’t. So I backup’d my OS X install by putting the MBP into FireWire Target Mode. Press T as the box chimes at boot. Then create a new image from the disk under Disk Utility. If you didn’t have a second Mac, you could also boot from an external install (install minimal OS X onto a GUID Firewire or USB disk) or boot from the Leopard install DVD.&lt;/p&gt;

&lt;p&gt;3 ) Defrag and Partition the HardDisk. An easy method is to format the disk, and restore using your backup image you just created. Or go out and buy software like iDefrag. Restoring a backup doesn’t actually defragment the data, but it does write it sequentially onto the disk, so you don’t have data at the end where you create the second partition.&lt;/p&gt;

&lt;p&gt;4 ) You want to repartition the disk, preferably as an MBR disk. I had a difficult time getting the disk to be a GUID/MBR hybrid, which I hear is possible. Disk Utility on the Mac works great for live resizing. I made a ~124GB Mac Partition and a 32GB FreeBSD partition on a 160Gig disk. This is more of a trial run, and if I really want to, I can wipe the Mac Partition and resize that area to be my entire /home directory. Bootcamp is nothing more than a frontend to resize your disk. Whatever booting capabilities it may enable in your EFI Firmware is taken care of by rEFIt.&lt;/p&gt;

&lt;p&gt;5 ) Reboot your machine a couple times and make sure you didn’t fuck up.&lt;/p&gt;

&lt;p&gt;6 ) Pop in the FreeBSD disk. I used 7.1-RELEASE. Install FreeBSD the way you would like to. I’m assuming you are competent in installing it. No, don’t ask me questions on how to install it. If you have questions though, feel free to find the answers here, in the &lt;a href=&quot;http://www.freebsd.org/doc/en/books/handbook/&quot;&gt;FreeBSD Handbook&lt;/a&gt;. It has helped me tremendously in the years I have been using FreeBSD.&lt;/p&gt;

&lt;p&gt;7 ) Repeat step 5. Twice. I’m a big fan of not reading directions until something fucks up. I learn better by poking and prodding, than reading something. Unless I know its going to destroy everything, or has the chance to, I take a wild stab at it and see if it works. So repeat step 5 again.&lt;/p&gt;

&lt;p&gt;8 ) Update everything. FreeBSD comes with great shit on the disk, but the past few times I have tried to install KDE from the ports, it bitches cause shit isn’t updated, and it takes a lot longer to do what I want cause I have to quit halfway and start over.&lt;/p&gt;

&lt;p&gt;Which is pretty much it. It’s harder to do than a windoes install, but its not more complicated. I haven’t tried a Linux install on any of these boxes, but I assume its nearly the same, and if its Ubuntu, its probably a lot easier.&lt;/p&gt;

&lt;p&gt;I’ll update this as I do more. Or do more posts, or whatever.&lt;/p&gt;

&lt;p&gt;Also, I completely gave up on that WINE under OSX crap. Thats one of the reasons I tried to do a FreeBSD/KDE4 install. Also, I’ve recently become a fan of &lt;a href=&quot;http://www.rockbox.org/&quot;&gt;RockBox&lt;/a&gt;. I put it on my 80GB iPod Video, and wouldn’t mind a more organized method of transferring files to it. I’ve tried syncing with Amarok on my HP Laptop, but long story short, the USB ports are busted. They have lifted up from the logic/mother/mainboard, which is one of the reasons I quit using it. Also, that laptop has a bcm43xx wireless card. Fuck that thing. Wish I knew more about hardware compatibility it when I bought it. It is a P4 2.33Ghz, I think, but only about 512M ram. They left trackpad button is broken off as well… If I had a bunch of money to toss at shit, I would totally put a minimum of 2GB ram (if it can even handle it) and fix the trackpad button, and even see if I could get an Atheros WiFi card… but its also heavy and bulky. No widescreen either, but thats not a dealbreaker. It’s great running fully upright next to my iMac with FreeBSD/KDE controlled with synergy. Use SSHFS to transfer files back and forth. Fantastic shit. Wish I would have set it up sooner.&lt;/p&gt;

&lt;p&gt;Welp, my MBP is still compiling KDE… Goddamned…. So far so good, but updates may or may not follow.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Resolving issues in OS X</title>
        <link href="https://blog.hplogsdon.com/resolving-issues-in-os-x/"/>
        <updated>2009-02-22T02:27:51+00:00</updated>
        <id>https://blog.hplogsdon.com/resolving-issues-in-os-x/</id>
        <content type="html">&lt;p&gt;LibJPEG has always been an issue.&lt;/p&gt;

&lt;p&gt;Always. I’ll admit that I need more experience under a POSIX environment. Luckily for me, I have hardware that I can easily use, and I’m not dumb enough to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo rm -rf /&lt;/code&gt;. Though I have done some 3AM dumbass maneuvers thinking it would solve all of my problems.&lt;/p&gt;

&lt;p&gt;I also just realised that I have not built the libjpeg shared libraries. Thats why im getting all sorts of complaints from WINE to GD, even though that shits installed. I know its installed. Also, OS X comes configured with libtools, but for some stupid reason libtools that comes with OS X spouts out this error:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;when I execute &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./configure --enabled-shared --enabled-static&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Fucking lame. Well I’m trying to figure out where the hell I can change shit to make it give me static libraries.&lt;/p&gt;

&lt;p&gt;Updates to follow&lt;/p&gt;

&lt;p&gt;Ninja Update: where is my hoodie, i need more snackfood, and Rogue American Amber is goddamned delicious. Wish they sold it in Utah. Goddamnit, wheres my hoodie.&lt;/p&gt;

&lt;p&gt;Ninja Update 2: it was in the girlfriends pile of clothes.&lt;/p&gt;

&lt;p&gt;Real Update: I’m trying to make libjpeg.dylib, as well as figure out why my builds of wine arent getting the proper updated versions of libGL/openGL&lt;/p&gt;

&lt;p&gt;the wine configure gives me this midway&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;checking for -lcups... libcups.2.dylib
checking for -lfontconfig... not found
checking for -lssl... libssl.0.9.7.dylib
checking for -lcrypto... libcrypto.0.9.7.dylib
checking for -ljpeg... not found
checking for -lpng... libpng.3.dylib
checking for -lodbc... not found
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which is where im stuck at right now.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>I hate WINE right now.</title>
        <link href="https://blog.hplogsdon.com/i-hate-wine-right-now/"/>
        <updated>2009-02-21T05:01:58+00:00</updated>
        <id>https://blog.hplogsdon.com/i-hate-wine-right-now/</id>
        <content type="html">&lt;p&gt;This snippet is for my own personal use. Im trying to run WINE under OS X. Not any of the fancy shmancy Darwine packages, I like the command line stuff. Looks like I STILL have an issue with OpenGL. Im running x.org’s X11, not Apples, as well as all the dependancies compiled by hand from source. and I still can’t get my shit together. I can’t figure it out. I’ll give it 2 more months before I either end up installing Ubuntu or FreeBSD/KDE on my iMac.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;angikara:~ uxp$ wine C:\\Program\ Files\\PlayOnline\\SquareEnix\\PlayOnlineViewer\\pol.exe
fixme:advapi:SetEntriesInAclA 1 0x33f87c 0x0 0x33f8b4
fixme:advapi:SetSecurityInfo stub
err:wgl:has_opengl  glx_version is 1.2 and GLX_SGIX_fbconfig extension is unsupported. Expect problems.
wine: Unhandled page fault on execute access to 0x00000000 at address 0x0 (thread 0009), starting debugger...
Unhandled exception: page fault on execute access to 0x00000000 in 32-bit code (0x00000000).
Register dump:
CS:0017 SS:001f DS:001f ES:001f FS:1007 GS:0037
EIP:00000000 ESP:0032f34c EBP:0032f3c8 EFLAGS:00010202(   - 00      - -RI1)
EAX:6080f000 EBX:6212b07e ECX:00000240 EDX:0032f3ac
ESI:00000000 EDI:6081f200
Stack dump:
0x0032f34c:  6212b217 6080f000 60230190 00008013
0x0032f35c:  0032f3ac 00126960 00126960 7b8193e1
0x0032f36c:  7b88224b 6052eff0 604ce0be 6216f1c8
0x0032f37c:  6216f1c8 0032f3ac 0032f440 00000000
0x0032f38c:  6080f000 00000000 00000000 6081f200
0x0032f39c:  7b882460 6052eff0 00000000 00000240
0200: sel=1007 base=7eef0000 limit=0000ffff 32-bit rw-
Backtrace:
=&amp;gt;0 0x00000000 (0x0032f3c8)
	1 0x62133a4d (0x0032f468)
	2 0x60508b89 (0x0032f4c8)
	3 0x627a8a0d (0x0032fa78)
	4 0x6282608f (0x0032fac8)
	5 0x61bda1ee in ddraw (+0x2a1ee) (0x0032fb68)
	6 0x61bdae1b in ddraw (+0x2ae1b) (0x0032fbc8)
0x00000000: -- no code accessible --
Modules:
Module	Address			Debug info	Name (16 modules)
PE	  400000-  477000	Deferred        pol
PE	10000000-1000e000	Deferred        polhook
PE	60180000-60184000	Deferred        advapi32
PE	60310000-60325000	Deferred        user32
PE	604b0000-604b4000	Deferred        gdi32
PE	605b0000-605fd000	Deferred        winmm
PE	60660000-60664000	Deferred        ole32
PE	619d0000-619d4000	Deferred        rpcrt4
PE	61a60000-61a64000	Deferred        oleaut32
PE	61bb0000-61c00000	Export          ddraw
PE	61c40000-61d2e000	Deferred        shell32
PE	61e20000-61e27000	Deferred        shlwapi
PE	61eb0000-61ec3000	Deferred        comctl32
PE	61fa0000-61fa4000	Deferred        version
PE	7b810000-7b889000	Deferred        kernel32
PE	7bc10000-7bc14000	Deferred        ntdll
Threads:
process  tid      prio (all id:s are in hex)
00000008 (D) C:\Program Files\PlayOnline\SquareEnix\PlayOnlineViewer\pol.exe
	0000001e    0
	00000009    0 &amp;lt;==
0000000c
	0000001b    0
	00000014    0
	00000013    0
	00000012    0
	0000000e    0
	0000000d    0
0000000f
	00000015    0
	00000011    0
	00000010    0
00000016
	0000001f    0
	00000017    0
00000018
	0000001d    0
	0000001c    0
	0000001a    0
	00000019    0
00000022
	00000023    0
Backtrace:
=&amp;gt;0 0x00000000 (0x0032f3c8)
	1 0x62133a4d (0x0032f468)
	2 0x60508b89 (0x0032f4c8)
	3 0x627a8a0d (0x0032fa78)
	4 0x6282608f (0x0032fac8)
	5 0x61bda1ee in ddraw (+0x2a1ee) (0x0032fb68)
	6 0x61bdae1b in ddraw (+0x2ae1b) (0x0032fbc8)

fixme:advapi:SetEntriesInAclA 1 0x33f86c 0x0 0x33f8b4
fixme:advapi:SetSecurityInfo stub
fixme:advapi:SetEntriesInAclA 1 0x33f88c 0x0 0x33f8d4
fixme:advapi:SetSecurityInfo stub

angikara:~ uxp$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That FreeBSD/KDE sounds tempting. Dualboot under Bootcamp just for shits? Or am I continually opening up new headaches?&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Point of View</title>
        <link href="https://blog.hplogsdon.com/point-of-view/"/>
        <updated>2009-01-27T19:45:54+00:00</updated>
        <id>https://blog.hplogsdon.com/point-of-view/</id>
        <content type="html">&lt;p&gt;This blog might turn into an essay and opinion paper about Zen and The Art of Motorcycle Maintenance. After paying just a little bit more attention to the audiobook I noticed that there are chapter breaks.&lt;/p&gt;

&lt;p&gt;Well somewhere in Chapter 4, the narrator recalls a story about repairing his friends loose handlebars. Long story short, he suggested using some aluminum from a beer can as shim material, where as his friend was appalled because he didn’t want a cheap beer can to be the “fix” for his expensive BMW bike. He then goes on about the difference of perspective between the substance of the aluminum metal quality and the appearance of a cheap beer can.&lt;/p&gt;

&lt;p&gt;Anyways, I had a friend Alex in elementary school. His mom remarried when we were in 4th grade, and then he moved out of our school area. I ended up getting in contact with him again, and hung out with him one last time. We did stupid kid things all day, then someone I can’t remember gave him a video. I’m not sure of the title, but it was about points of view. The movie was animated in the kind of “phantom tollbooth” 70’s era cartoon. From what I remember of the plot, the main character was from one place where their heads were pointed, and he had to travel somewhere where the people didn’t have points on their heads, like rounded heads, and shit. It was a lesson on point of view where everyone is the same, except their perspecive. Good movie. Especially when I still think about it 15 years later.&lt;/p&gt;

&lt;p&gt;That’s about it. This post didn’t have much of a point… no pun intended. srsly.&lt;/p&gt;

&lt;p&gt;EDIT: Oh fuck. check this out from Wikipedia. &lt;a href=&quot;http://en.wikipedia.org/wiki/The_Point!&quot;&gt;The Point!&lt;/a&gt; is a fable by American songwriter and musician Harry Nilsson about a boy named Oblio, the only round-headed person in The Pointed Village, where by law everyone and everything had to have a point.&lt;/p&gt;

&lt;p&gt;“I was on acid and I looked at the trees and I realized that they all came to points, and the little branches came to points, and the houses came to point. I thought, ‘Oh! Everything has a point, and if it doesn’t, then there’s a point to it.’” – Harry Nilsson[1]&lt;/p&gt;

&lt;p&gt;… fuck man. Everything ends up revolving around acid. Maybe thats why the movie stuck with me for so long.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Zen and The Art of Motorcycle Maintenance</title>
        <link href="https://blog.hplogsdon.com/zen-and-the-art-of-motorcycle-maintenance/"/>
        <updated>2009-01-26T21:22:44+00:00</updated>
        <id>https://blog.hplogsdon.com/zen-and-the-art-of-motorcycle-maintenance/</id>
        <content type="html">&lt;p&gt;I’m rereading &lt;a href=&quot;http://en.wikipedia.org/wiki/Zen_and_the_Art_of_Motorcycle_Maintenance&quot;&gt;Zen and The Art of Motorcycle Maintenance&lt;/a&gt;. Unfortunately the only copy I have is an audible copy, which is this proprietary audiobook format. It works great through iTunes and iPods, but I can’t transfer it anywhere else. I’ll probably end up stream-ripping it then re-chapterizing it for iTunes.&lt;/p&gt;

&lt;p&gt;I’m about 3 hours into it, which I have no idea the chapter equal, but it seems to make more sense every time I go though it. My &lt;a href=&quot;http://en.wikipedia.org/wiki/Vajrayana&quot;&gt;Vajrayana&lt;/a&gt; teacher was mentioning the same thing with the book she provided for the intro course, that every time she reads it, it makes more sense on a deeper level. One starts off shallow and as one progresses into new and deeper “tiers” for lack of a better definition, the earlier tiers will grow as well. Like a pyramid, almost. As one builds higher, the foundation must grow to support the new weight resting on top.&lt;/p&gt;

&lt;p&gt;It’s really a profound book. It also helps me understand where my friend, who is a philosophy major, comes from. Though I feel he likes knowing everything in all subjects, he also only grasps the shallowest levels in many of the areas we have in common. I would rather my knowledge run deep, and be skillfull of the things I do everyday, where as I feel he wants to be able to know enough of everything to be independant from the world in a Thoreau’s “Walden” kind of way. Such thinkers seem selfish and dis-loyal to me and I wonder if they cause more harm than good to both themselves and society. Only time will tell.&lt;/p&gt;

&lt;p&gt;Either way, I’m going to rest. Hopefully time will help me rid of this sickness the recent Salt Lake Winter Inversion lent me. Oh how I love and hate this city and it’s inhabitants.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Finished Migrating</title>
        <link href="https://blog.hplogsdon.com/finished-migrating/"/>
        <updated>2009-01-18T07:45:33+00:00</updated>
        <id>https://blog.hplogsdon.com/finished-migrating/</id>
        <content type="html">&lt;p&gt;Wow. I really do have to admit, as soon as you log into MySQL, get the database up, WordPress is already installed. Its rather quite slick. After that, its a couple of tweaks here and there and then its done. Well, its been 45 minutes or so, and I’d like to get to bed, so I will.&lt;/p&gt;

&lt;p&gt;I’ve noticed that my posts can go on and on, and the last site I changed shit around so there was only excerpts on the front page… so this is a reminder to myself to change the code so that only excerpts show, not 10 giant posts. And configure my WordPress iPhone App to sync with this server.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Wordpress Upgrade (kinda) and migration</title>
        <link href="https://blog.hplogsdon.com/wordpress-upgrade-kinda-and-migration/"/>
        <updated>2009-01-18T06:52:47+00:00</updated>
        <id>https://blog.hplogsdon.com/wordpress-upgrade-kinda-and-migration/</id>
        <content type="html">&lt;p&gt;So, quite a while ago I noticed that the back end of WordPress was complaining that there was a new version, v2.7, available and that I must upgrade now!!! or some shit. This was just after I finished the template of my new site design to go with the new domain. Oh, yeah. Im changing the domain that the (my) blog is under. I don’t give a fuck about google links going to 404s and shit.&lt;/p&gt;

&lt;p&gt;404 is kinda like an 808, ‘cept its constantly random. If you didn’t get that, fuck off kkthks.&lt;/p&gt;

&lt;p&gt;Anyways, this was probably a couple months ago, and it gave me motivation to complete the blog theme to be identical to the xHTML side. Well, motivation is awesome, except when you have a a couple dozen other projects. Long story short, I started it maybe 2 weeks ago (appx. the time of my last post regarding the site being obfuscated and me wanting to fix it), but “starting is a very loose term. I installed WordPress on my MacBookPro at the coffee shop, tried to find a “blank” WordPress theme to use as a base, and got distracted on the &lt;a href=&quot;http://developer.apple.com&quot;&gt;Apple Developer Site&lt;/a&gt; with Objective-C, and then subsequently started coding in Obj-C.&lt;/p&gt;

&lt;p&gt;Two things, Obj-C is fucking badass. I’m &lt;em&gt;STILL&lt;/em&gt; wrapping my head around the theory part of Object-Oriented Programming (thanks to &lt;a href=&quot;http://ocw.mit.edu/&quot;&gt;MIT Open CourseWare&lt;/a&gt;, &lt;a href=&quot;http://webcast.berkeley.edu/&quot;&gt;Berkeley Webcasts&lt;/a&gt; and some of the equivalents elsewhere)… And a really good blank WordPress theme is the Classic Theme that ships with the releases. I used to have a good tar of a “Blank” theme found on the web which I would build off of, but when it came down to it, the “Classic” theme is really well done with conventional namings of the div ids and shit. the blank one, iirc, was fucking stupid and I ended up having to go through the entire thing with sed commands (s/this/that/) to replace shit.&lt;/p&gt;

&lt;p&gt;Speaking of getting distracted on my MBP, I have &lt;a href=&quot;http://projects.tynsoe.org/en/geektool/&quot;&gt;GeekTool2&lt;/a&gt; installed on both my Macs. On my iMac, all that displays is a oneliner for my Load Avg. On the MBP, I have a month calendar, and a grep/sed/awk hack of the ‘top’ command which displays memory, cpu, and pid of the top 10 applications (sorted by mem use I think). I really need to get rid of those on the MBP, the load averages is really fucking useful, and I’d like to spend some time to sync some shit (like my iCals. getting a CalDAV server running didn’t work.) Well, getting distracted (see ^ ) is fucking easy on the mobile computers. I can be sitting somewhere and think of looking something up lets say under Wikipedia. So I quickly pull out the Mac, and click on Safari in the Dock. I use Spaces, A LOT, (virtual separated desktops like Gnome and KDE have had forever) and so it usually focuses me on another desktop wherever Safari is and oh shit there’s like 15 open tabs in 3 different windows. Hrm, should I save this one, close that one, bookmark this one. Fucking annoying. Oh wait, I really wanted to read this article I opened up in a “new window behind the current window”… I’ll just start reading.. and then its been 20 minutes, I’ve opened up 4 more tabs and what the fuck did I even want to look up… oh shit I cant even remember the site I wanted to look at.&lt;/p&gt;

&lt;p&gt;Thats my only gripe about mobile web devices, be it my iPhone, or my MBP, or fuck, I’ve even done that with the OLPC XO… Every time you open it, its got your last session. Sometimes, you don’t need that last session, but you think you do…&lt;/p&gt;

&lt;p&gt;Anyways. Less griping. holyfuck that was a giant distraction post.&lt;/p&gt;

&lt;p&gt;so I finally have the blog all themed, and the only step now is to upload the shit, then install wordpress on my web server and migrate the data over from this old site. I’m going to keep all the old posts. Its nearly midnight already, so I might do that tomorrow… but if I put it off it may be a few more days until I get around to it. Who knows… Going to go see how the girlfriend is doing right now and then decide from there. Speaking of which, I need to design something for her domain I bought months ago. :( always more projects…&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Blogging Twitter and self expression on the web.</title>
        <link href="https://blog.hplogsdon.com/blogging-twitter-and-self-expression-on-the-web/"/>
        <updated>2009-01-07T22:29:03+00:00</updated>
        <id>https://blog.hplogsdon.com/blogging-twitter-and-self-expression-on-the-web/</id>
        <content type="html">&lt;p&gt;I signed up for twitter. O.o&lt;/p&gt;

&lt;p&gt;My blog doesn’t even have a direct web address. Maybe I’ll learn something and go tonight to the coffee shop with my girl and toss the blog site up onto the server. I guess I don’t have any reward for having a blog. I’m too jaded to give a shit what you think. It’s more a journal for myself. I’ll just have to remember to password most I them that I actually do care about so I don’t forget to restrain myself web venting about techie peoples that probably have enough of a ass-ego that cares about what other people think about them ( read: geeks ).&lt;/p&gt;

&lt;p&gt;Anyways, Ive already learned that replying to something someone said over 12 hours ago is bad. It’s like taking a shit in the hallway between the breakroom and the vending machine. Silly me. Oh well, I’m going to go back to work.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Shared Hosting</title>
        <link href="https://blog.hplogsdon.com/shared-hosting/"/>
        <updated>2008-12-24T15:45:53+00:00</updated>
        <id>https://blog.hplogsdon.com/shared-hosting/</id>
        <content type="html">&lt;p&gt;So I only have one hosting provider for all my websites. I took full advantage of one of those companies that oversell their web hosting services and tossed a bunch of sites all up on one account. I haven’t had a problem with it up until now.&lt;/p&gt;

&lt;p&gt;Unfortunately it’s a shared server. Realistcally, that doesn’t matter much. Some day I would like to have my own Colo running a couple of virtual machines, one for webhosting, one for whatever, and so on, but for now, shared is cheap and works great.&lt;/p&gt;

&lt;p&gt;Well, works great up until somebody on the box decided to go ahead and poss off the wrong dude. It’s under a DDOS attack. Has been since about 7 last night. I will admit that while i’m have my own servers, I couldn’t admin them very well to be perfectly reliable and depend on them for business. Commercial ventures are one thing, hobbying is another. I am perfectly fine with pulling the plug on one of my boxes, but when it comes to the live box I pay to use, I expect the admins of that network to be as quick and reliable as can be. I just don’t know how long it can take to resolve a DDOS. Thats something Until then I just get to wait and see.&lt;/p&gt;

&lt;p&gt;Oh yeah… I’m starting to use my staging server as my primary server as well for the personal sites, like this one. Mostly cause this is more of a journal that I don’t give a shit if someone else reads. Oh well. Off to work I go, trying to come up with a good way to describe what a DDOS is to my dad, who just moved a new domain for a commercial venture onto that box’s account. “Why the he’ll isn’t this website loading? Did you break something?” ugh. I don’t want the responsibility of being an admin. I just want to code.&lt;/p&gt;

&lt;p&gt;Day++ and a merry Christmas to anyone reading this. I’m getting a lot of crawlers coming round, but still can’t find this site, hidden as it may be, popping up anywhere. Nor do I have any search engine referals to random people clicking through. Internet: Serious Shit.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>iPhone publishing</title>
        <link href="https://blog.hplogsdon.com/iphone-publishing/"/>
        <updated>2008-12-19T19:50:26+00:00</updated>
        <id>https://blog.hplogsdon.com/iphone-publishing/</id>
        <content type="html">&lt;p&gt;My girlfriend lost her phone on Wednesday… Well long story short we ended up buying two iPhones.&lt;/p&gt;

&lt;p&gt;Reminds me of the “Price for life” option I hear qwest advertising. In the fine print your price won’t ever go up if they increase rates, but it also will never go down either. Kinda like my old phone plan. So it ended up being cheaper per month to pay for two iPhones than to continue what we were find. And now i’m writing a blog post from my phone….&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Objective-C</title>
        <link href="https://blog.hplogsdon.com/objective-c/"/>
        <updated>2008-12-17T04:31:47+00:00</updated>
        <id>https://blog.hplogsdon.com/objective-c/</id>
        <content type="html">&lt;p&gt;I don’t know why I added another language to my list of things I really want to learn but will never have enough time to devote to it.
Back in the day I knew how to navigate my way through C code. It was around FreeBSD 4.2 (2001?) when I downloaded the kernel source. After untarring it I started to poke around inside trying to understand what I was looking at. Granted, I still don’t know what the hell goes on inside the kernel. Its one of those magical pieces of code I’d rather leave to the professionals. I’ll stick with the crap I write, at least for now.
Sooner or later, when C++ became all the rage, I tried to pick up on that, but Object-Oriented Programming never really made much sense. If I was in the middle of a class with a professor trying to jam it into my brain, I might have a better chance, but it still takes a little thinking to understand exactly what is going on. Inheritance is a bitch. Anyways, Since I knew more of C than C++, I would still write C code in the middle of my C++ programs. Not a huge deal, since its a subset, but its an issue. Well after the Macs entered into the picture and finding out Apple is nice enough to give not only Documentation for Cocoa and Objective-C, but an entire IDE based around the frameworks with an awesome Interface design suite… or rather, single application.&lt;/p&gt;

&lt;p&gt;Well come to find out that Objective-C is nothing more than an Objective framework on top of C. Makes my life easier. So I’ve been plowing though Kochan’s Programming in Objective-C book. Its a really nice transition from C to Obj-C. I can fall back and do a purely Functional based program without feeling like too much of a pussy for using &lt;code&gt;printf(&quot;\n&quot;);&lt;/code&gt; instead of &lt;code&gt;std::cout &amp;lt;&amp;lt; &quot;\n&quot;; &lt;/code&gt;
I dont know about you, but I think I’m finally understanding how OOP is working out. I’m still on Part I of his book, which uses “objc/Object.h” as the interface of the OOP. Part II will delve into more of the NeXTstep stuff like NSClassView, and all the other goodies, which is a step to the Cocoa framework. I’m starting to like this shit.&lt;/p&gt;

&lt;p&gt;But actually, I’m just giving my head a rest. My dad wants his website re-formatted and so I just spent a couple hours taking out my pigeon-shit hackjob from last year and recreating it with a decent implementation of a website, that even validates! I know I know, Validation isn’t everything, but I figure the less errors I have, and the less warning, and less chance of anything happening that I did not intend will make me a better programmer. Doesn’t matter if its HTML or x86 Assembly.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>the div tag</title>
        <link href="https://blog.hplogsdon.com/the-div-tag/"/>
        <updated>2008-12-09T16:18:48+00:00</updated>
        <id>https://blog.hplogsdon.com/the-div-tag/</id>
        <content type="html">&lt;p&gt;Haha. I just published the last post and then sat back to reread it. I feel that not enough people actually read what they write. Maybe anything entered into a text entry box will always appear to be grammatically correct and persuasive enough to turn the pope Jewish, but whatever.&lt;/p&gt;

&lt;p&gt;Anyways, I was looking over the design of this blog, which will be gone shortly and migrated to the new theme and site, and the only thing I could think of is “Oh hey, this will be easy. All I have to do is modify …. and then the site will be done!”&lt;/p&gt;

&lt;p&gt;I remember back when I first started to understand HTML back in like 1994 and the coooolest thing in the world was a site composed entirely of tables. A site would be ~4 HTML documents, a header, a sidebar/menu and a content page all linked together through the index document.&lt;/p&gt;

&lt;p&gt;HTML has come a long ways.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Dormancy</title>
        <link href="https://blog.hplogsdon.com/dormancy/"/>
        <updated>2008-12-09T15:43:41+00:00</updated>
        <id>https://blog.hplogsdon.com/dormancy/</id>
        <content type="html">&lt;p&gt;Good timing I guess. Its the morning right now, and I decided to look at the site to see if there was anything that I didn’t like. All in all it looks good. I’m happy I was able to build a site from scratch, but the site isn’t completely live yet. Its sitting on my staging server, and needs to be migrated over. There are a few projects of my own I’m in the middle of. I spent all last night going through some Objective-C code, which is nice. Having other things to go to is more of a good thing than a bad one. Sometimes I feel like I’m trying to do too much, but I don’t have any deadlines other than the arbitrary ones I set myself. When I’m working on a project it becomes hard to step back and see if I have hit my goals, sidetracked to new objectives that weren’t in the original plan, or even see if I’m doing it right. Being able to go to something else and use another part of my brain refreshes it for the next time I step back into the original project and realize that the difficult task of doing this method actually is quite easy, and why I spent 4 hours trying to do it the wrong way is rectified by spending 30 minutes doing it right.&lt;/p&gt;

&lt;p&gt;I’d like to be programming in one of the C languages. Either C, or C++, and now I’m looking into Objective-C. Objective-C really isnt that difficult or different, but the syntax and style of code is very unique. Now, when/if I get going really hard into it and start to develop an application that is usable (Calculators aren’t the best thing in the world, especially when everything is hard coded into the program) I’d like to share it, the code and the program, for the world. Thats where the site comes into play.&lt;/p&gt;

&lt;p&gt;I wouldn’t mind also doing some site design and developing as well. Properly coded xHTML/CSS isn’t hard, but it is challenging. As I’ve said before, I am more into the guts of an application, so I still have a lot to learn regarding design. There are quite a few podcast archives I’m going through, such as &lt;a href=&quot;http://creativesuitepodcast.com/&quot;&gt;Adobe Creative Suite Podcast&lt;/a&gt; and &lt;a href=&quot;http://thepublicbroadcast.com/aoc&quot;&gt;The Art of Code&lt;/a&gt;. Both are excellent tutorials on making a site functional, aesthetically pleasing and very dynamically intriguing. If you have any interest in sharing your personal tastes with the world, I’d recommend you check them out.&lt;/p&gt;

&lt;p&gt;Rant: Internet Explorer sucks ass. My pervious site had a few issues with IE6 and IE7, which were a bitch to figure out. Luckily I still have a sticker plastered to the bottom of an older HP laptop that gave me a WinXP Home license which I promptly set up a virtual machine with to help with a lot of the cross browser and platform issues that arise with web development. endrant&lt;/p&gt;

&lt;p&gt;Anyways, maybe I’ll start with the blog theme. I’d like to integrate it a little more closely with the root site layout, so I think there will be quite a bit of php wordpress hacking tonight. Lets see how it goes.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Molting</title>
        <link href="https://blog.hplogsdon.com/obj-c/"/>
        <updated>2008-11-24T22:05:39+00:00</updated>
        <id>https://blog.hplogsdon.com/obj-c/</id>
        <content type="html">&lt;p&gt;Changing again. I know that no one is reading this. I get occasional searches for SilverStripe theme help. The first time i assembled the site was through &lt;a href=&quot;http://www.silverstripe.com&quot;&gt;SilverStripe&lt;/a&gt; and had issues with the way SS laid out the structure of the site. They did some weird things which wasn’t all that different from the file system structure of a ‘nix box. But, I didn’t think it translated well to a web environment.&lt;/p&gt;

&lt;p&gt;Anyways the second revision was a blatant rip of someone else’s CSS template. This one is not. Its not as clean either. Actually, it is a lot cleaner in the code and elsewhere. It is not as visually clean. This brings up a really good point. Developers/Coders/Engineers have a very hard time being a coder and a designer. All the images on the site are hand crafted through Photoshop. I’ve never had a formal class that revolved around Image creation, editing or manipulation. I’ve also never had a formal course regarding CSS/xHTML, PHP, JavaScript or C/C++/Obj-C either. But I somehow manage. I’m learning everything from the ground up by trial and error. I might understand it better than some kid who took a bunch of CS courses through a local University and pelted out a standard c+. This site also validates. Yeah. How fucking crazy is that. Actually, I dont know if validating websites is hard, or causes more render errors. It seems that a lot of professionally (or what appear to be) done sites don’t validate. They still render properly (with an exception, or result of an exception), and they seem to work, so I guess W3C validation is more of a status symbol and not a basis for what is “correct”. Web Pages need to function. And if they function, then everything is well. Right?&lt;/p&gt;

&lt;p&gt;Program code, as opposed to HTML (Markup), can’t be wrong. Your compiler will give you an “Unmatched curly bracket at line 259, main.cpp”. Granted an unmatched &amp;lt;div&amp;gt; isnt any better, but you can still view the page (unless its a MAJOR div element). Program code fucks things up when its wrong. HTML just looks bad. And its interpreted. I’ve never been a fan of interpreted program code. JS, Ruby, Perl, Python, BASH, its all the same = garbage. They have their place and usage, but fuck compiled code like C/C++/Java (sometimes) seems so much more stable. I might just be spitting arrogance, but its my personal opinion. Fuck off. Java is an interesting exception. I’ve always hated Java programs. For web services, Java is pretty cool, but running clientside, it always seems too laggy and slow for me.&lt;/p&gt;

&lt;p&gt;I’m digressing.
TL;DR: I fucking hate designing. Coding is cool. I’ll code any day. Tell me to work on a UI, Fuck off.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Installing Software</title>
        <link href="https://blog.hplogsdon.com/installing-software/"/>
        <updated>2008-11-14T03:46:47+00:00</updated>
        <id>https://blog.hplogsdon.com/installing-software/</id>
        <content type="html">&lt;p&gt;Ugh. Trying to reinstall MySQL on my iMac. Leopard comes with a default, but its not up to date. Anyways, You know you need help, or a better paying job, when you have issues installing a new piece of software that comes in pre-compiled binary packages.&lt;/p&gt;

&lt;p&gt;I’d rather spend 4 hours compiling php and mysql than fuck around “trying” to get a binary package installed correctly for 3 hours. At least I can go to the bar in the middle of compiling time.&lt;/p&gt;

</content>
    </entry>
    
    <entry>
        <title>One more....</title>
        <link href="https://blog.hplogsdon.com/one-more/"/>
        <updated>2008-11-13T04:17:06+00:00</updated>
        <id>https://blog.hplogsdon.com/one-more/</id>
        <content type="html">&lt;p&gt;Being a technical geek, I haven’t had a blog in a long time, or rather, this is the first time I feel good about having a blog. Before, I’d have one that I’d install, put 2 posts up, then remove after 5 months of inactivity.&lt;/p&gt;

&lt;p&gt;Anyways, being about technical stuff, here’s a little something that I’m rather proud of. My ISP, &lt;a href=&quot;http://www.xmission.com&quot;&gt;XMission&lt;/a&gt; yesterday decided that they were going to replace some batteries in one of their UPS’s for whatever reason. So they did the necessary stuff, and then flipped the breaker that was labeled for that particular UPS, and then all hell broke loose. Long story short, the breaker was mislabeled. This caused a NetAPP server to crash, their DNS server to go down, and about 40% of the webhosting to go offline. It screwed shit up, and destroyed 2 harddrives on the NetAPP, causing them to resort to a backup 2 days shy of live. I didnt have anything hurt by this. I connected into my home box from work and noticed I had some downed connections on all my IRC clients, didnt think much of it, and reconnected.&lt;/p&gt;

&lt;p&gt;Either way, they go ahead and post details bout it, apologize and then fix everything. Completely Honest and Sincere about it. When I was using Comcast Cable as an ISP, I decided I wanted to buy my own modem. I did not want to use theirs and pay $5.00 a month for something worth $0.50 retail. About 6 months later my connection started acting funny. It would disconnect, then reconnect at like 10% throughput. I called them up and asked a tech to come out and test my lines, and they wanted to charge me $100 because it was my modem. I knew my modem was not bad. After the guy came out and said he couldn’t get a signal at my apartment on the line, and that the fuckup was somewhere down the line, not inside my apartment, they still sent my a bill for $100. This continued for 2 month until I canceled. It took 6 months to resolve the bill dispute, even after I canceled the account.&lt;/p&gt;

&lt;p&gt;Anyways, I fucking love XMission. Transparency, even for a slightly slower connection, is what keeps me using their service. If only I could force my county to adopt Fiber Infrastructure, or at least if I could get rid of Qwest, since they own the copper.&lt;/p&gt;
</content>
    </entry>
    
    <entry>
        <title>Update</title>
        <link href="https://blog.hplogsdon.com/update/"/>
        <updated>2008-11-13T03:53:17+00:00</updated>
        <id>https://blog.hplogsdon.com/update/</id>
        <content type="html">&lt;p&gt;So, despite me disliking Wordpress, I decided to use it. One think I do like about wordpress, is that a fucking senile old man can figure out how to write and post a blog in only a short while. This is probably why it is so popular. This is also why I dislike it.&lt;/p&gt;

&lt;p&gt;Either way, The site is all up. Got the MySQL database, popped the info into the wp-config.php file, and then there you go. I always forget to change the default password, which usually results in me tinkering with settings for 45 minutes, logging out and then yelling “FUCK” for 15 minutes at the top of my lungs before I sit back down, wipe the server of the install, and then re-install it.&lt;/p&gt;

&lt;p&gt;Let me know if you have any issues. Oh, and I finally revisted a friends blog. Check it out through the links on the right over —–»» there. Seems he uses WP as well, and is happy with a spam comment killer called Spam Karma 2, so its installed. I’m curious how well it works, so I let it display a pseudo-footer on the bottom of the blog posts to display how many its caught. This site isn’t very useful, nor has any real traffic. I’ve only gotten a couple of spam comments via another site on this same server, so i doubt i’ll be in the thousands, but who knows. I’m interested.&lt;/p&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;speaking of spam, check this out I ran across this morning before work: [BBC News&lt;/td&gt;
      &lt;td&gt;Study shows how spammers cash in](http://news.bbc.co.uk/1/hi/technology/7719281.stm)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</content>
    </entry>
    
    <entry>
        <title>WRT54G-TM Hacking</title>
        <link href="https://blog.hplogsdon.com/wrt54g-tm-hacking/"/>
        <updated>2008-11-13T03:34:29+00:00</updated>
        <id>https://blog.hplogsdon.com/wrt54g-tm-hacking/</id>
        <content type="html">&lt;p&gt;So, I’m a hacker at heart. I love the feeling that all boundaries are broken when you can peek into the insides of something static and make it much more dynamic to your own needs. This includes both hardware and software, and at times, organic devices.&lt;/p&gt;

&lt;p&gt;Some odd number of years ago, I needed a wireless router. I had just moved back home from the east coast and had a wireless enabled laptop that was tired of walking down and plugging into the cable modem. I went out and bought a Linksys WRT54G because I had heard good things about them. Unfortunately I had picked up a version 5, which was the first neutered version after a long line of easily modifiable releases. well, about 2 years ago, I decided to go for it, and took the long process of killing the firmware and loading dd-wrt, though it was still pretty useless. Short Story: The Memory limits only allowed for a stripped down version without many of the functions I really wanted. Though, dd-wrt made the router much more stable, and secure. I’ve used this as my primary router for years. It really wasn’t bad, but I wanted more.&lt;/p&gt;

&lt;p&gt;So a little over a year ago, I had read that T-Mobile was selling a custom version that was supreme in its hardware design. I thought about getting one for a while, but held off. That is until I found a coupon for 15% off anything in the “Official” stores. I immediately went in and picked one up. Just like my previous Linksys, this was another purchase that would require a little more effort than just a simple upload and flash to get dd-wrt on it. The &lt;a href=&quot;http://www.linux-mips.org/wiki/Common_Firmware_Environment&quot;&gt;CFE&lt;/a&gt; had some routine not present in previous versions that would resort to a backup version of the T-Mobile firmware that was loaded from the factory if you tried to flash something else to the router. To most, this means that the router is useless. To me, it ment I needed to try another way. The lovely people at Cisco decided to include a connection on the board that allows you to use a JTAG cable on the chip. You can then force flash the router with your firmware of choice. Basically, you erase the CFE and NVRAM and load a custom CFE onto the flash. Then you can TFTP the firmware onto the chip without the CFE going “Awe, fuck no!”&lt;/p&gt;

&lt;p&gt;This was over a year ago that the guys working on the dd-wrt project found this out, but I never really wanted to go through all the trouble of building a JTAG cable. Really stupid of me. I ended up moving into a house from my apartment and the wireless connection anywhere that wasn’t in the office with the older v5 router sucked. So I now had a reason to do it that would result in some useful results, other than, cause I wanted to. So I looked at the schematics for a cable and saw what hardware I needed to build it and it was all of! 4 goddamned resistors. Granted I could have made a super nice cable with a buffered connection, but I wasn’t going to use this more than once, maybe twice. So I went down to the local store and bought the resistors. In all of 10 minutes, it was completed.&lt;/p&gt;

&lt;p&gt;I grabbed my older laptop, which had a Parallel Port (Damn you Macs) and compiled the software. For some particular reason, I couldn’t compile the software under FreeBSD, so I ended up sticking a small build of Slackware on a partition and doing it under that. I didn’t calculate the transfer rate, but it seemed to be REALLY slow, like 2800 Baud. I’m curious now if the buffered cable would be faster. Anyways within a few hours, it was done.&lt;/p&gt;

&lt;p&gt;I use the new TM version router as my primary and then the older v5 router I’ve stuck in the living room as a repeater, or rather a Wireless Bridge. I get awesome reception, and my girlfriend likes it more when I’m stuck writing code in the living room while she watches TV as opposed to huddling myself away in the office.&lt;/p&gt;

&lt;p&gt;If you’d like more information about JTAGing your router, whether its to recover from a bad flash that bricked it, or if you have a TM router, check out this thread on the DD-WRT forums: &lt;a href=&quot;http://www.dd-wrt.com/phpBB2/viewtopic.php?t=17817&amp;amp;postdays=0&amp;amp;postorder=asc&amp;amp;start=0&amp;amp;sid=b61b68a4d5faa4eeedb92139bca89cca&quot;&gt;T-Mobile (US) HotSpot @Home Routers (Successed)&lt;/a&gt;&lt;/p&gt;
</content>
    </entry>
    </feed>