bash date tricks

A quick usage note regarding the date util under bash. I sometimes want to convert between a unix timestamp and a formatted date string. I do it infrequently enough that I forget the syntax. This article is me writing down my notes. In the following example, I want to get timestamps and date strings for both today and yesterday. Why yesterday’s date? Because I want to get yesterday’s data from google analytics’ data API. I’ve see numerous examples getting day, month and year then subtracting one from the day and propagating the underflow through the month and year. Blech! If I have today’s timestamp, I simply subtract a days worth of seconds from today and violà, yesterday! ...

August 16, 2009 · kelly

Verdana Hates Pinyin

I stumbled across an article on lostlaowai.com www.lostlaowai.com/survival-chinese which lead me to poke around the site a bit. At the above URL, I noticed that some of the combining diacritical marks (tone marks) used in writing pinyin were not rendering properly. I had not seen this problem before. It didn’t make sense. Things that don’t make sense bug me. And being something of a character geek, I couldn’t let it go. So I tried to reproduce the problem in a test example. I couldn’t. That’s when I discovered a quirky Mac OS X copy+paste issue. I sensed there was a problem but the truth was elusive. You can’t see that copy+paste changes the string characters unless you look at a binary dump of the file (which I did). ...

August 8, 2009 · kelly

Blue Smoke IV

I’ve added this latest rendition of Blue Smoke to illustrate a point: The quantity and quality of non-video music is greater than that of video music. Okay. So it’s anecdotal. But this isn’t about science. It’s about sensation. In my world, the grooveshark player found every track but one: Helpless by Needle. But I’ll take Neil Young’s unplugged version. Not as good but does have a nice base coat of maudlin piano. And I prefer the Paul Weller’s Portishead remix of Wildwood. ...

May 29, 2009 · kelly

Blue Smoke III

Yet another version of blue smoke using the embedr.com player. No one has the video of Needle‘s cover of Neil Young’s Helpless. Shame. Needle has, in my opinion, the quintessential rendition. Anyway, Helpless didn’t make it it.

May 13, 2009 · kelly

Blue Smoke II

Another adaptation of blue smoke, this time using Yahoo Video as the source. Some of the videos were not found (Lenny, Helpless, Until the Morning). Lenny and Fade Into You are the lynchpins of Blue Smoke and my substitutions make this something I call “an interpretive playlist”. However, I like the Paul Weller cover. Raw, courageous, authentic. Best of luck, Dylan.

May 13, 2009 · kelly

Pensive II

An alternate view of the pensive playlist.

May 11, 2009 · kelly

Pensive

I’ve been pensive of late and frankly the weather is just too damn nice for that. Still, there is something gained by wrapping up from time to time in a blanket of introspection. I’m sharing here my pensive playlist.

May 11, 2009 · kelly

MacRoman encoding creeps into Maven

You’d think in this day and age that modern operating systems, especially OS X, would be set for UTF8 handling by default. Not so. My previous post, centos l10n problem, showed that CentOS defaults to set its locale LANG as POSIX rather than UTF8. Mac takes the lunacy one step further. Or should I say one step backwards in time. I use maven2 as my build manager. Normally, I ignore the stream of info at the beginning of a build, Either it succeeds (yeah) or it fails. Either way, I’ve been more interested in seeing the end result; You know, those last few lines rather than the first few lines. ...

April 9, 2009 · kelly

Failed to create poller with specified size

It had always bugged me that I got this warning on my OS X, MacBook Pro development system. (Well, it’s really an INFO, not a WARN but it bugged me nonetheless.) Apr 8, 2009 4:10:55 PM org.apache.coyote.ajp.AjpAprProtocol init INFO: Initializing Coyote AJP/1.3 on ajp-8009 <!-- snip --> Apr 8, 2009 4:10:58 PM org.apache.tomcat.util.net.AprEndpoint allocatePoller INFO: Failed to create poller with specified size of 8192 <!-- snip --> Apr 8, 2009 4:10:58 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 2703 ms ...

April 8, 2009 · kelly

UTF8 JDBC on Tomcat

I’ve had opportunity to once again visit the UTF8 chain of failure and thought I’d write about it. If for no other reason, it’s easier for me to find my notes when I shove them into a blog entry. I previously wrote about UTF8 on Tomcat. I pointed out that I needed to add an attribute to the connector element so that the mod_jk connection would be UTF8-ified. I neglected to also point out that I needed to UTF8-ified the database connection. ...

April 8, 2009 · kelly