God Gotchas #

February 25, 2009.

This is a reblog of a post from my new Ruby-themed tumblelog. I know it’s kind of cheap to repost your own stuff, but who cares.

I’ve spent a couple of hours today pulling my hair out while trying to get one of my background job scripts to work with god, the “easy to configure, easy to extend monitoring framework written in Ruby”.

Well, it took a while to make it work, tho. Yes, god is cool and simple and gets the job done. But there are some things that cost me hours and which I found out only by reading the source code.

So, I just want to quickly jot down some gotchas before I forget them again, running the risk of falling into the same traps again in the future.

  1. My script used the constant LOG to keep my Logger instance. Logging worked fine when I ran the script by itself, yet when god took over, it didn’t anymore. Actually, the script died rather quickly. As there was no logging at all going on, and all STDOUT output was suppressed, I came rather close to losing it. Turns out god itself is declaring a LOG constant of its own, which was done before my script had the chance, so when it attempted to initialize it, it would actually try to re-declare an existing constant, and we all know how well that works. ;)

  2. Once that was done, my script was logging just fine, but it didn’t produce any output whatsoever. Raah! Teeth were gnashed… there was definitely teeth gnashing going on. Even telling “my” Logger (the one inside my script) to write to a file didn’t produce anything. That was a fun hour, really. The reason for this behaviour: god is closing all open file descriptors when it sets up monitoring a script. Which included my script. Awesome! On the upside, it meant I could get rid of the part of my code dealing with different logger behaviours. Meaning less LOC! It doesn’t get any more agile than that, folks.

  3. In case you actually want to capture anything your original script is sending to STDOUT, there’s the not-really-documented God::Watch#log. Set it inside your God.watch block to specify a log file. (See example below.)

  4. If you need to set ENV variables, God::Watch#env is your friend. Accepts a hash with arbitrary key/value pairs. For example, I declare a few God.watch blocks, one for each value of an array (think “worker 1 to 5″), and I use God::Watch#env to pass the current value to the worker script. Works well.

  5. When you do a sudo god stop <watch>, make sure to give it a few moments before running sudo god start <watch> again, or you might end up with orphaned unmonitored scripts running rampant in the background.

  6. Running sudo god log without any further arguments will tell you that “You must specify a Task or Group name”. That’s actually a lie, as it only accepts task names. (A group is a number of related tasks. A task is a single monitoring watch.)

So, yeah.

Don’t get me wrong, please: It might not look like it, but once I had figured it all out, I’ve decided I actually like god. I like the feature set, it’s really easy to set up, and it works. I’m happy it exists.

This entry has been tagged with , , . Follow a tag to see related entries.

Comments

Se7en Things #

January 09, 2009.

Damn, Mookie tagged me. Well, why not.

Seven things weird and/or unknown about me:

  1. When I was 8 years old, I’ve developed an allergy to cats, more or less out of the blue. Which sucked, since I had two female cats at that time, Tina and Nena. (It was the 80s, gimme a break.) We had to give them away, and my room had to be renovated, as I became nearly asthmatic due to the omnipresent cat hair. Interestingly, becoming allergic to something you had no problems with before isn’t all that uncommon. Still, not a nice experience.
  2. I’m one quarter Polish. My granny was from Poland.
  3. I have a drivers license for small tanks. I’ve had the opportunity to participate in the driving school while I was in the Army (90’s), and went with it. :) So, I own a license for “Klasse F (Voll- und Halbkettenfahrzeuge) — F2 (bis 30t)” (up to 30 metric tons). I do not, however, own an actual tank, and quite frankly, I am not even sure whether I am allowed to steer a track-laying vehicle (like a tank) outside of the military now (regulations have changed quite a bit since then).
  4. I had a pet rat when I was 14. My parents hated it. :)
  5. The first computing device that was truly my own was an Atari 800XL. Awww yeah, bitches!
  6. I own not five, but six pairs of original Bavarian Lederhosen in various lengths and styles. About 12 years ago, when I moved to Munich, I valiantly declared that I would never ever dress in Bavarian clothing as it just felt wrong. This, of course, led to me ending up with two pairs at my next birthday, as two circles of friends both had the same idea. Things developed from there. I came to like them, even though I very rarely wear them.
  7. I tend to lie when asked by others to talk about things they might not know about me. A lot, actually.

Bonus!

  1. I once met Justin Timberlake. True story.

I’d like to thank the Academy

I’d like to tag everyone who feels like participating in this crazy new meme. For example Mike or Hendrik, who would both really surprise me would they take this thing and run with it. I doubt it, but you’ll never know. So… It’s a FFA. Find the rules over at Mookie’s place.

This entry has been tagged with , , . Follow a tag to see related entries.

Comments

2009 — My Grand Experiment #

January 06, 2009.

As mentioned earlier, Yahoo! decided to shut down its entire Munich engineering department. So since January 1st, I am officially out of a job.

What a downer… or is it?

After some deliberation and discussions with Dana, I’ve decided to concentrate on the bright side: I have a few ideas for products (read: websites), and now I finally have the time to work on them. I’ve always contemplated building them in my spare time while still being employed, but apart from a few small experiments (which were fun to write but are hardly my personal “next big thing”) that concept didn’t work out so well.

Thus, I’ve decided to concentrate on my own stuff in 2009 — full frontal self-employment. That’s right, I’m an entrepreneur now.1

I plan on spending about half a year to bring my ideas to life, and then taking on freelance jobs later on to bolster the income these site will (hopefully) generate. My ideas are related to gaming, both because it’s something I love and because I am definitely seeing a market there. I think my concept is sound, and I know I can build this …thing. It won’t be easy, but I have no problems working for my money. ;)

I don’t know whether it will work out or not, but I want, nay, need to try. The time certainly is as right as it gets. Actually, one could argue that I’ve waited a bit too long with my idea, since a “contender” appeared on the scene a short time ago.2 But I don’t see this as a showstopper, quite the contrary — it’s good to have competition as it keeps you on your toes. :)

So, 2009: it’s going to be my year. It’s a grand experiment, and while working alone I won’t be alone, as my wonderful wife and my friends are supporting me. Still, I don’t know yet whether I will succeed or if this kind of thing will be working for me. Quite honestly, this makes me a wee bit nervous.

Nonetheless, full steam ahead!

Yes I can.


  1. Actually, officially not yet, as there’s still a bit of paperwork to work through with a small number of different parties, but this won’t have any effect on the decision already made. 

  2. I could say he stole my idea, but that’d be bullshit: I didn’t tell it anyone, and besides — ideas are cheap, they only count when you pursue them. 

This entry has been tagged with , , , . Follow a tag to see related entries.

Comments

Mini Review: 2008 #

January 02, 2009.

  • I was promoted. Then I lost my job. But I came to a conclusion, and found new goals. (More on this later.)
  • I had planned on running 250km, then hit that goal in October, and ended up doing 400km.
  • My granny passed away, and I miss her.
  • My faith in the USA was partially restored (the Obama campaign and its success even gave me hope, and I don’t even “count”).
  • We’re done with the bulk of the renovating of our 2nd floor. I’ve installed the floor tilings. w00t!
  • I was overly surprised by a videogame — GTA IV. I’ve spent a lot of time on that one. Wonderful adult entertainment.
  • I got me an iPod touch — which turns out to be a good reading device, thanks to both Instapaper Pro and Stanza.
  • I’ve tried to bring Child’s Play to Germany, and failed. Oh well, it was the first round. Better luck in 2009.
  • I’ve launched a few smaller projects — Twitter Twerp Scan, escaloop (which I’ve shut down a few months later) and Random.li.
  • I came to love GitHub. Great site/service.

Verdict

  • A really good year.

Posts

I didn’t write as much as I had planned on doing, but nonetheless, here are a few of my “better” posts (subjective opinion, YMMV).

Have a good 2009.

This entry has been tagged with , , , , , , , , , . Follow a tag to see related entries.

Comments

On (e)Books #

December 04, 2008.

John Scalzi:

That said, these are gruesome times for publishing, and a lot of folks are not as well-positioned as I am. Imprints have vaporized, layoffs have begun, and it’s better-than-even odds that a number of authors and books are going to get shaved off of publishing lists. 2009 is also likely to be a singularly lousy time to be an aspiring debut author, as publishing houses consolidate their lists and focus their resources on established avenues (i.e., spend their money on people who are already bestsellers) rather than seeking out new folks. Basically, life’s gonna suck in publishing for the next year or possibly two.

I love my ebook reader (Stanza on the iPod as you can’t get the Kindle here in Germany yet), and I’d like to buy more ebooks. It’s a distribution channel which (I think) would be a pretty good way for the publishers to make additional money …if many of these files wouldn’t cost me as much or more than the dead-tree versions.

I mean, really: I like good novels as much as the next guy, and I am definitely willing to spend money on them. Also, I don’t like hardcovers for the price tags (yes, I think $25 is a lot of money). One would think that a digital version would cost substantially less than the hardcover, but it’s not always the case. Case in point: “Zoe’s Tale” by John Scalzi, currently on sale for $25 (ebook, FictionWise) and $17 (hardcover, Amazon).

I have no problems with paying $7 or $8 for an ebook, but anything over $10 is highway robbery.

Do not misunderstand me: yes, I am tempted to buy it, but I will fight the urge, because quite frankly, John’s a great writer, and I enjoy his novels very, very much. Also, I don’t think he’s the one dictating the price — so who’s responsible for these insane prices which seriously keep me from spending money?

(BTW: Yes, you might say “get the paperback”, but this is not my point. My point is: I want the digital edition, because it’s the version I prefer for various reasons.)

Anyways, I believe right now the publishing industry is facing the same problems as the music industry — they’re shooting themselves in the foot because they are either ignoring the possibilities of using a great distribution channel or actively sabotaging it by asking for completely disproportionate amounts of money.

Angry Carlo is angry.

(This is a slightly longer repost of a comment I’ve left on Whatever. After posting I wanted to make some clarifications, but couldn’t edit the comment, so here we go.)

This entry has been tagged with , , , . Follow a tag to see related entries.

Comments
photo of Carlo Zottmann Carlo Zottmann carlo@zottmann.org
München Germany
AIM YIM Jabber

You look like you have no time, but still need to find some Xmas gifts, but have no idea what to get them, right?

Then try my new site, random.li: fast-paced, crack S.W.A.T. team-style gift finding.

Go go go! No time to waste! :)