Apr 13

Biannual blog update

Every couple of years I seem to update my blog. So, here goes.

I just moved my web hosting to webfaction. The shortest version of the story is, I started a company and have been doing some Django programming and webfaction is really good for Python-based hosting and I realized some of what I’ve been missing out on. In fact, I’d used them many years ago to host a Plone site for the UU Fellowship of Winston-Salem. (Anyone who advertises that they host Plone sites is pretty hardcore.)

Looking under the hood, I feel better about webfaction because…

  • They let you run multiple “applications,” which you can tie to one or more “domains.” For example, ‘johnborwick.com’ (no ‘www’) is running a bare bones application that just forwards people to ‘www.johnborwick.com’.
  • They have their own WordPress installer, which makes me feel better than the Fantastico/whatever the replacement for Fantastico is called. For my old host, if you wanted to keep your site up-to-date with the package manager you’d wait for a few weeks before they got the upgrade script. (I have also started to feel more comfortable giving WordPress the permissions needed to update itself.)
  • If I want to start building simple services for people, I can easily set them up as new applications on my account. (Before, I’d used Google App Engine to build a few test apps, but you have to subtly change your apps to run in that environment and I’d read some FUD about the ability to scale/lack of control you have with GAE.)
  • I feel like I have a lot of control, but the framework makes good sense.
  • They are highly regarded.

Sep 12

FreeBSD on a Lenovo H430 desktop

I used to use FreeBSD a lot.  (FreeBSD is an alternative operating system, kind of like Linux.  It is the basis for OS X and many other things.)  However, ever since I stopped being a systems administrator I haven’t had a FreeBSD machine.  Well, last week our Apple Time Capsule (wireless base station + backup device) died, and I wanted to try to “roll my own” server that could be our wireless access point plus backup system and more.

The thing about FreeBSD is, you have to really learn a lot to use it.  To my knowledge, there aren’t many simple configuration tools beyond the “sysinstall” installation tool, and if you run into any problems you are on your own (to try and Google your issues and fix the problem).  In case it’s helpful for others, here is what I’ve learned about installing FreeBSD on a Lenovo H430 desktop computer.

Things I’ve learned

  • FreeBSD 9.0-RELEASE does NOT recognize the built-in wired or wireless network devices.  You have no network connectivity.
  • Use the amd64 version so you can use all 8 GB RAM.
  • FreeBSD 8.3-RELEASE recognizes the built-in wired network device (yay!) but doesn’t recognize the wireless network card (boo).
  • I scrapped the wireless network card and bought a TP-LINK TL-WN881ND wireless card.  HOWEVER, I then found this card doesn’t work with 8.3-RELEASE.  This FreeBSD forum thread recommends you  recompile your kernel to remove the 8.3-RELEASE drivers, pull the FreeBSD subversion HEAD or STABLE/9 versions, and load those modules.  This worked for STABLE/9 at the point this thread was written (April 2012) but doesn’t work today (September 2012).  John B’s solution?  Use ‘svn -r {2012-04-21}’ to pull STABLE/9 from April 21, 2012!
  • Audio does not work automatically but it is simple: the snd_hda driver
  • For my monitor, Xorg’s autoconfigure gave me a max resolution of 800×600 (yay!)  I once again had to find the horizonal sync and vertical refresh rates for my monitor.  Do you know how many times in my life I have had to search through technical specifications to find the hsync and vrefresh?  Hint: it’s a lot, and finding it is usually pretty hard because my monitor doesn’t work properly.

Current setup

For the TL-WN881ND card, I had to do a bunch:

Here’s how I built the if_ath and if_ath_pci drivers:

svn co -r {2012-04-21} {http://svn.freebsd.org/base/,}$PREFIX/sys/dev/ath
svn co -r {2012-04-21} {http://svn.freebsd.org/base/,}$PREFIX/sys/modules/ath
svn co -r {2012-04-21} {http://svn.freebsd.org/base/,}$PREFIX/sys/modules/ath_pci
( cd $PREFIX/sys/modules/ath && env CFLAGS=-I../../ make )
( cd $PREFIX/sys/modules/ath_pci && env CFLAGS=-I../../ make )

Built a custom kernel; here’s my unified diff from the GENERIC kernconf:

--- GENERIC 2012-03-03 01:15:13.000000000 -0500
+++ JOHNB-NOATH 2012-09-23 03:38:18.000000000 -0400
@@ -258,10 +258,10 @@
 device wlan_tkip # 802.11 TKIP support
 device wlan_amrr # AMRR transmit rate control algorithm
 device an # Aironet 4500/4800 802.11 wireless NICs.
-device ath # Atheros pci/cardbus NIC's
-device ath_hal # pci/cardbus chip support
+#device ath # Atheros pci/cardbus NIC's
+#device ath_hal # pci/cardbus chip support
 options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
-device ath_rate_sample # SampleRate tx rate control for ath
+#device ath_rate_sample # SampleRate tx rate control for ath
 device ral # Ralink Technology RT2500 wireless NICs.
 device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.

I’ve done several other things to the computer since, such as setting it up as a gateway (dnsmasq is awesome!!) and AFP server, but I think these were the main showstoppers.