<< Previous | Home

Colorized Apache Ant Output at the OSX Bash Prompt

Readability rocks
Bookmark and Share

For years I've wanted colorized output from Apache Ant when compiling my Java projects. Until today I never really look into it. But a quick Google search lead me to Stack Overflow: Problem with Ant's AnsiColorLogger in Snow Leopard. While the existing answer works, it was slightly inellegant in its need for two changes:

  1. creation of an ant wrapper script
  2. adding an alias for ant to point to the wrapper script

By harnessing the raw power of Bash Functions (!) we can do this with a single line in the .profile file. No need to have a wrapper script.

ant () { command ant  -logger org.apache.tools.ant.listener.AnsiColorLogger "$@" | sed 's/2;//g' ; }

Ta da! Looks great!

Tags :

HP 2910al CPU spike due to 'Debug & Test' process

Things that make you go hmmm....
Bookmark and Share

Last night our Cacti monitoring system sent out a bunch of warnings regarding the CPU usage on our HP ProCurve 2910al switch. The CPU utilization climbed to nearly 100%, and was well above 50% for a few hours. This had never occurred before.

I logged onto the switch to discover what process was sucking up so much CPU.

HP2910al# show cpu

88 percent busy, from 119 sec ago
1 sec ave: 87 percent busy
5 sec ave: 88 percent busy
1 min ave: 88 percent busy


Task usage for last 9 sec
 % CPU | Description
-------+--------------------------
   9.5 | Idle
  90.5 | Debug & Test

Interesting. My Google searches found nothing valuable, other than this had occurred to other people too. No authoritative information seems to be out there. If it happens again I'll make a call out our HP rep.

Things that make you go hmmm....

Jumping on the 'Klout is Stupid' train...

Influential Inconsistancies
Bookmark and Share

I first learned of Klout a few months ago. "Might be interesting", I thought...and signed up. Fast forward to today, and there is a lot of noise about Klout, their recent algorithm changes, and all the snake-oil pawners with knickers in a twist.

In mid-August I noticed someone in my "Influences" that I did not know. That's strange. So I posed a question on the Klout community forums:

How can I be influenced by someone I am not following and have never heard of? On my "Influenced by" list is one person I don't know and don't follow. How is this possible?

Megan, a Klout Employee answers with Robert McNamara's ol' Fog of War approach: Never answer the question that is asked of you. Answer the question that you wish had been asked of you.

You can remove anyone from your influenced by list by hitting the "x" next to the person you want to remove in your influencers tab.

Question closed. Today that person is gone from my list. Whether it was an explicate action by Megan, or an algorithm change I don't know. But why were they ever there? Maybe its the leader of the illuminati who is influencing me and I didn't even know it. (Sarcasm.)

More entertaining are the topics people are allegedly influential on.

  • My wife is reportedly influential on only one topic: Germany. Really? She's been there once, for a weekend getaway to see old friends of mine in Kaiserslautern. Maybe Klout is grouping Switzerland in with Germany because it is sort of the same to many I-don't-get-out-much thinking folks. (We live in Zurich.)

  • Lincoln Stoll, a code wrangling buddy of mine, is influential about teeth. Wha??? He has no idea why.

  • Clive Thompson (no relation), a technology author I follow on Twitter is, to his surprise, influential about anthropology and the taliban.

"Klout measures influence online" says the website. Ummm...maybe not so much. I'm officially jumping on the "Klout is stupid" train.

Discrete Windows 7 Workstation for the Living Room

Small, discrete, usable Windows 7 Workstation Project
Bookmark and Share

We have had a need for a small, out of the way computer for some time. My wife's netbook runs Ubuntu, but she misses some of the Windows-based applications like the software updater for her Android phone. And the netbook can be painfully slow at times. We also had a list of other requirements, beyond running windows:

  • Small footprint: our flat is very small, we didn't want to waste space in our living area
  • Quiet: The sound of a fan running while we're not using the machine would be irritating
  • Low power: While our electricity is inclusive, efficiency is important for an always on machine
  • Low key: My wife and I have an almost pathological desire to hide all of the technology in our apartment
  • Quick: We are both impatient with slow user interfaces
With this in mind, I set out to build a family workstation. After some research and consideration, the parts list below came together:
  • Mobo: Intel D525MW, Atom D525 Dual Core, Mini-ITX (SFr.75)
  • Case: Jou Jye NU-057Wi, Mini-ITX, Vesa Halterung, 250 Watt (SFr.104)
  • System Drive: Intel SSD 320 Series 40GB, SATA-II, 2.5 Zoll (SFr.99)
  • Data Drive: Samsung HN-M101MBB, M8, 5400rpm, 8MB, 2.5 Zoll, 1TB, SATA (SFr.99)
  • Memory: Kingston ValueRAM, 2 GB, DDR3-1066, CL7, SODIMM (SFr.32)
  • OS: Microsoft Windows 7 Home Premium 32bit, OEM (SFr.94)
Total damage? ~SFr.510.

The Intel Atom motherboard was selected because of both the low cost and the passively cooled CPU heat sink. While the case Jou Jye is not cheap it did offer the most interesting option to reduce the technical clutter in our living space. Even with the relatively slow Atom CPU, the 4GB of RAM and SSD system drive make this puppy feel as fast as any workhorse system...as long as you are not running FFmpeg or any other CPU intensive application.

(larger picture)

Matching this new kit with existing keyboard, mouse, and monitor gives us a working system.

  • Keyboard & Mouse: A Logitec keyboard that has been laying around for ages, and a company mouse from xtendx
  • Monitor: A 19" NEC 1980SX (1280x1024) which I bought off ebay.co.uk in 2003 ago for £400. It was a professional photography display back then so it still looks better than average even today.
Add in a some time down at the local hardware store, a jigsaw, and a bit of elbow grease...and presto! A nice and tidy workstation. The desk is 40cm x 75cm at its widest, with a footprint of under 1/3rd of a meter. The computer case itself is built into the lower shelf. All of the cords are secured to the underside the the shelf including the power strip and ethernet cable.

(larger picture)

Sweet.

How to configure Ethernet Bonding with LACP on Debian Squeeze Linux

10GoE is still pricey. But you can get a 4Gbps connection inexpensively!
Bookmark and Share

Quick update: I built a Debian Squeeze box recently and initially used the same configuration as on my Debian Lenny box, which seemed to work. But problems developed afterwards. Specifically, the net-agent process would both multiple into many processes and take up every more CPU cycles over time. A "process leak", if you will. After months of monitoring, diagnostics, Googling and debate we found a solution which involves a different NIC configuration. Here it is...

So you need a fat network connection on your Debian 6 server, but a 10 GoE infrastructure is not in your budget? No fear! Link Aggregation Control Protocol is here to save the day!

This was both the problem I had, and the solution I learned to implement thanks to a question posted on serverfault.com (Multiplexed 1 Gbps Ethernet?) and some hours of research & experimentation.

Here's what I did:

  • Purchase a NIC capable of LACP with solid Linux driver support. I went with an Intel PRO/1000 PT Quad Port Server Adapter.
  • Purchase a Switch capable of LACP. It should be more than capable of handeling the bandwidth. We opted for an HP ProCurve 2510G-24.
  • Install ifenslave-2.6: apt-get install ifenslave-2.6
  • Purchase some network cables. Cat 6 if you can, Cat 5e if not.
  • Load the module, so we can proceed. modprobe bonding. There should be no errors. Confirm it is loaded with modprobe -l | grep bond
  • Edit /etc/network/interfaces to look something like this:
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    auto  bond0
    iface bond0 inet static
        bond-mode 4
        bond-miimon 100
        bond_xmit_hash_policy layer2+3
        bond_lacp_rate slow
        slaves eth1 eth2 eth3 eth4
        address     192.168.1.131
        gateway     192.168.1.1
        netmask     255.255.255.0
    
    
    
  • Plug in the network cables

    lacp with HP ProCurve 2510G-24 and Intel Pro/1000 PT Quad Port Adapter.jpg

  • Restart the network: /etc/init.d/network restart
  • Configure the switch to use the four ports as a single trunk. Here's how for an HP ProCurve:
  • Confirm that there are no errors
    1. The NIC and switch LEDs should be active
    2. dmesg will show what the kernal thinks of your new configuration
    3. ifconfig should show your bond0 interface up
    4. The interface should be pingable both internally and from other computer
  • Note: you should not be adding an alias to /etc/modprobe.d/arch/X86_64.conf or /etc/modules, like you would with Lenny.

Ta da!