Sunday, March 04, 2012

Lots of Stuff

I spent a good amount of time in front of my television. Watching shows (cable and Netflix streaming) or playing video games. The TV occupies a large portion of my life. Good? Bad? Who knows. But that isn't the topic for today...

Lately, I've been fascinated watching the show Hoarders on A&E. The show is like a train wreck -- you just can't stop watching. It is a bit sad once you truly understand that hoarding is a psychological disorder, but it is so hard to stop watching. The things that people collect, that get hoarded, the condition of the house, etc ... there is always something new on the show.

But here is where the "Stuff" from my post title comes in. There are a number of shows on that focus on "stuff". Hoarders is one show, but TLC has a similar show named Hoarding: Buried Alive. The show title is a bit crazy, given that it actually happens.

It doesn't stop there. Those two shows are about people collecting. But there are shows on the other side of the equation, too. Hoarding is about acquiring, but the stuff (sometimes) needs to go away, too. Storage Wars is about lockers that get auctioned off when people don't pay their bill. In many cases, the lockers were owned by hoarders, and all kinds of awesome stuff is found in there.

And then you have the show, American Pickers. The show is extremely fascinating. Mike and Frank find lots of stuff in peoples' hoards, but they concentrate on old items, and the history behind them. As a big History Channel fan, American Pickers is an interesting lens into history. Old cars, music legends, bicycles, cars, and other memorabilia.

The stuff that people accumulate is incredibly fascinating, and these shows provide a broad view into history, people, and an endless variety of "stuff".

Monday, October 31, 2011

Installing Zabbix on Mac OS (Leopard)

My friend Sam Ruby dabbles in a lot of technology, and he tends to do writeups on his blog as he experiments with the stuff. I figured to take a page from his book, and share my own issues/troubles getting Zabbix up and running on my MacBook (running Leopard).

I grabbed the 1.8.8 tarball and unpacked it. For my scenario, I needed the server, the agent, and the frontend (but not the proxy). For simplicity in testing, and because I don't need to monitor bunches o' boxes, I decided to go with SQLite for the database. Zabbix uses the standard "configure/make/make install" pattern, so no hassle so far.

Burp. The compilation failed. Investigating, I found that I needed to apply the patch from ZBX-4085. The build completed, so started to look at the frontend.

The Frontend is written in PHP, which is natively available (along with Apache) on my laptop. With some configuration, I got the frontend to load in my browser. There is a click-through GPL license (huh?) and then a really awesome page that checks your setup. I quickly realized that the builtin PHP was not going to work. Sigh.

I've got MacPorts installed on my laptop, so I just continued with that. Homebrew is all the new rage with the kids, but it doesn't have builtin recipes for PHP. There are a few out on the 'net, but I really didn't want to monkey with that stuff.

Lots of packages were needed: php5, php5-gd, php5-mbstring, php5-sockets, php5-sqlite3, sqlite3. A hojillion dependencies were installed, including another copy of Apache (sigh).

Reloading the setup page, it continued to say SQLite wasn't installed. Looking at the frontend source, it was using a function named sqlite3_open(). With some investigation, I found an email describing the SQLite interfaces for PHP. Zabbix was using an unmaintained version. Rather than monkeying with that, I just edited the code to use the preferred PHP SQLite interface, and filed issue ZBX-4289 to push my changes upstream.

Finally, I needed to tweak /opt/local/etc/php5/php.ini for the recommended Zabbix settings (after copying php.ini-development to php.ini). This included some timezone settings, timeouts, upload sizes, etc. The Zabbix setup page is quite good about guiding you here.

So I created my initial SQLite .db file based on the instructions from the manual and pointed the Zabbix configuration page at it (taking a moment to realize it wanted the pathname put into the database field of the form). The test connection worked and then Zabbix saved the configuration file into frontends/php/conf/zabbix.conf.php. It looks like there is a "download" option for that configuration file, which I presume appears when the conf directory is not writeable. The Apache server (running from MacPorts now, using the MacPorts PHP) was running as myself, so it had no problem writing that configuration file.

Next up: wrestling with the zabbix-server. The first annoying problem was that you cannot give it a configuration file in the current directory. It fails trying to lock "." for some dumb reason. Solution: pass an absolute path to the custom configuration file (the default is in /etc or somesuch, which I didn't want to monkey with). Getting the server running was very frustrating because it spawns multiple processes which communicate using shared memory. It kept failing with errors about not being able to allocate the shared memory segments. After some research, I found that Mac OS defaults to some pretty small limits. Given that I wasn't about to reconfigure my kernel (using sysctl and some recipes I found on the web), I went to rejigger all the various cache sizes in the zabbix_server.conf file.

It ended up that I had to drop all the sizes to their minimum 128k setting: CacheSizeHistoryCacheSizeTrendCacheSizeHistoryTextCacheSize. Each were set to 131072. Finally, the server started. Whew.

When I returned to the frontend to "Finish" the installation and bring up the console... it hung. No response from the server. Huge sigh. With a bunch of investigation, I found that something was holding an exclusive lock on the whole damned SQLite file. Nothing else could write to it (and it seems the frontend likes to test its writability by creating/dropping a dummy table).

Fuck. Time to scrap the whole damned "simple SQLite" idea. Fine... I've used MySQL before, so I went with that. Back to MacPorts to install MySQL, the server, and the PHP driver for MySQL. Then I fired it up, created a "zabbix" user, loaded in all the tables, and zapped the zabbix.conf.php file to trigger reconfiguration (after noting to restart Apache to pick up the PHP changes).

The frontend looked happy now, so I tweaked the server's configuration file for MySQL and restarted the server. No workee. Damn. Forgot to reconfigure the server using --with-mysql=/opt/local/lib/mysql5/bin/mysql_config. After reconfiguring, the link failed with unsatisfied references to iconv(), iconv_open(), and iconv_close(). The MySQL interface in the server needs these for some UTF-8 conversions. The builtin Mac OS libiconv should work, but my MacPorts copy of libiconv was interfering, and these functions are named libiconv(), libiconv_open(), and libiconv_close(). My patience was ending, so I was not about to delve into autoconf bullshit and conditional compilation and all that. I simply edited src/libs/zbxcommon/str.c to call the libiconv* versions of the functions. The compile and link succeeded, and I re-installed the newly built server.

Yay! The server restarted, and the website loads up with a nifty little default console.

After a day to get this sucker installed, now I gotta start figuring out how to use it. Oh, joy.

I hope this post will help some future person treading these waters. Good luck!

ps. I may have missed some steps or packages to install or whatever. YMMV, but I think that I've got most of it down. Zabbix is supposed to be some hotness, and I do like its custom agent capability. But hoo-wee. Not a simple package to bring up (I hope it will be easier on a recent Ubuntu, than it was on my creaky Leopard install).

Monday, August 15, 2011

Blast from the past: removing the GIL

Way back in 1996, I created a patch to remove the GIL from Python's interpreter (version 1.4!). Dave Beazley just picked up the patch and tore it apart, and writing a fantastic blog post. It is quite nostalgic for me, from back in the day when I was working at Microsoft on their electronic commerce efforts.

[ I commented on Dave's post; it provides some context that you may also be interested in reading ]

Monday, November 29, 2010

Open Languages are Not Required

I just posted again to Apache Asserts on Computerworld UK: Open Languages are Not Required.

And please note that I'm speaking primarily to enterprise (internal) software developers, who are the vast majority of developers on the planet. They shouldn't really have to worry about the language that they use for their development. Having an open language is critical for us FLOSS developers, but that is an entirely separate discussion. (hat tip to webmink, to clarify my point here)


Note: the publish date is wrong (says last month); dunno what's up with that.

Update: corrected link after the publish date was fixed.

Friday, October 29, 2010

Are You An Open Source Friend?

The Apache Software Foundation was invited to find some people for Computerworld UK to write for a new blog named "Apache Asserts". Myself and a few others were selected to post our thoughts on open source, the enterprise, and whatever else we may find interesting.

My first post has been published... check it out!

Sunday, August 15, 2010

Android uses Java? Um... no

I've seen a lot of misinformation over the weekend, talking about the Oracle/Google lawsuit. Many of these blog posts and article talks about how "Android uses Java". Heh. That simply isn't true.

Android applications are written using the Java programming language. True. But those applications run on the Dalvik virtual machine. Not the Java virtual machine. Source code is owned/copyright by the author and is entirely unbound from any intellectual property concerns based around the syntax/grammar of that language.

Class libraries? Not Java either. Much of the core libraries come from Apache Harmony, and the rest are libraries that Google wrote. Given that Apache was never provided access to the Java Compatibility Kit, Harmony is not labeled as "Java-certified". Also note that Harmony is a clean-room implementation of the Java class libraries.

So, people: stop saying that Android "uses Java". It doesn't.

(obviously, some of these various components may trample on Oracle's patents; I have no idea, and that is an entirely separate question)

Wednesday, August 04, 2010

Outcomes

Nights out with a friend can be quite interesting. Especially if they are single and "looking". I've found there are generally three possible outcomes with these nights out:

  1. The Cock-Block.
    Your friend is trying to hook up or otherwise get especially friendly with somebody, but you monopolize the "target's" attention in some way to distract them from your friend's intent. Obviously, this outcome is "poor", unless you're some kind of dickhead that doesn't want your friend departing early with the target. Quite selfish, to try and keep them out with you. Of course, there are all sorts of minor rules variants here, that are rather crass: e.g if you're both interested in the target, who steps forward, who holds back? It's simply best to avoid this scenario because it never turns out well.
  2. The Wingman.
    Oh yah. We all know this one... the friend who props up the other and makes them ever more desirable. Talk up their strengths, ensure that the person-of-interest gets excited to know more about your friend. This is the ideal outcome, especially if they make some kind of lasting connection.
  3. The Bus-Tosser.
    This isn't nearly as bad as the Cock-Block, but your friend isn't going to be all that happy with you. At least for a short while. This is where you think your friend is interested in somebody, so you move into Wingman mode. Provide lots of opportunity for the two to talk and hang out, provide some good commentary, etc. Like any good Wingman would do. But afterwards, you find out your friend was not interested. At all. This is the "thanks for throwing me under the bus" maneuver, putting your friend into harms way. Especially if the purported target is interested and giving undue attention to your friend. ... Thankfully, in the long run, this provides lots of laughable material for how you sucked as a myopic Wingman.
I think the best answer all around is to simply go out and have a great time with your friend. Anything that will involve a possible third person can fall into a poor outcome, or simply distract from an awesome evening with a friend.