Compiling and Installing tmux on SmartOS.

Update: The SmartOS repository starting at 2012Q1 has Tmux1.6 that can be installed by simply running: pkgin in tmux. Here’s a link to the documentation on how to upgrade to 2012Q1.

Since SmartOS was released I’ve been meaning to take it for a spin and see if I like it. Over the weekend I used the Joyent Cloud to spin up a SmartOS64 instance and play with some configuration. The list of packages is OK but not incredible and some of them are pretty outdated. The version of pkgin that comes with SmartOS is missing the provides command which is a real pain in the ass when trying to compile from source.

I, honestly, wouldn’t have ever finished the install without the help of my co-worker Ryan S who, it seems, is really good at tracking down dependencies that are failing and all sorts of other Unix problems.

To install tmux on SmartOS you’ll need to compile some things yourself. You’ll need to compile and manually install:

  • zlib
  • libevent
  • tmux

The versions of zlib and libevent that come with the pkg repo Joyent provides DO NOT work to compile tmux because they’ve been compiled with the wrong ELFCLASS and you’ll just get this error:

ld: fatal: file /opt/local/lib/libz.so: wrong ELF class: ELFCLASS64

There are some packages that you’ll need to install before you can compile and install these modules:

  • python27
  • openssl
  • gcc-compiler
  • gcc-tools
  • gmake
  • gtar
  • gzip
  • libtool-base
  • ncurses

After those are installed you need to install zlib, libevent, and finally tmux:

Installing zlib:

  • wget http://zlib.net/zlib-1.2.6.tar.gz
  • tar xvf zlib-1.2.6.tar.gz
  • cd zlib-1.2.6
  • CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' ./configure --prefix=/opt/local
  • make && make install

Installing libevent:

  • wget https://github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz
  • tar xvf libevent-2.0.17
  • cd libevent-2.0.17
  • CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' ./configure --prefix=/opt/local
  • make && make install

Installing tmux:

  • wget http://downloads.sourceforge.net/tmux/tmux-1.6.tar.gz
  • tar xvf tmux-1.6.tar.gz
  • cd tmux-1.6
  • CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib -levent' ./configure --prefix=/opt/local
  • make && make install

You may run into a problem when doing the make step that looks like this:

gcc -DPACKAGE_NAME=\"tmux\" -DPACKAGE_TARNAME=\"tmux\" -DPACKAGE_VERSION=\"1.6\" -DPACKAGE_STRING=\"tmux\ 1.6\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"tmux\" -DVERSION=\"1.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_CURSES_H=1 -DHAVE_DIRENT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_NCURSES_H=1 -DHAVE_STDINT_H=1 -DHAVE_B64_NTOP=1 -DHAVE_LIBXNET=1 -DHAVE_CLOSEFROM=1 -DHAVE_DAEMON=1 -DHAVE_SETENV=1 -DHAVE_STRLCPY=1 -DHAVE_STRLCAT=1 -DHAVE_ASPRINTF=1 -DHAVE_STRCASESTR=1 -DHAVE_STRSEP=1 -DHAVE_DECL_OPTARG=0 -DHAVE_DECL_OPTIND=0 -DHAVE_DECL_OPTRESET=0 -DHAVE_BZERO=1 -DHAVE_DIRFD=1 -DHAVE_SYSCONF=1 -DHAVE___PROGNAME=1 -DHAVE_PROC_PID=1 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -iquote. -I/usr/local/include -D_XPG4_2 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -std=c99 -MT arguments.o -MD -MP -MF .deps/arguments.Tpo -c -o arguments.o arguments.c
In file included from /usr/include/sys/types.h:33:0,
from arguments.c:19:
/opt/local/lib/gcc/i386-pc-solaris2.11/4.6.1/include-fixed/sys/feature_tests.h:362:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
make: *** [arguments.o] Error 1

If you get that error just edit the Makefile and remove the -std=c99 line and run make again.

Now run tmux and you should have a fully functioning tmux installation.

Apparently it isn’t elementary.

I started watching the Sherlock TV series sometime last week. Since there are only 3 episodes per season I went through it quite quickly. It was an OK few hours of television but it had the same hole as any other Sherlock TV show, book, and movie.

  • Sherlock does INDUCTIVE reasoning NOT deductive reasoning.

So the whole branch of science he “created”

  1. Already exists, it’s called deductive logic.
  2. Is completely wrong. He uses inductive logic.

For some reason, people writing adventures for Mr. Holmes have been unable to understand the difference between induction and deduction since 1887. Apparently there’s some other branch of logic that it actually is, called abductive reasoning. From the description it’s basic induction, some guessing, and finally after one has acquired these “facts” actual deductive logic.

I’m, probably, one of the few people who is irritated by this, aside from Philosophy professors who have to re-teach students the definitions. If only the creators were smart enough to see the difference; they could have used the correct terms to make the series more original and correct.

So ist das Leben.

Context Switching Sucks

During my day job as a sysadmin I spend all of my time in a text context. I read and write Python, English, bash, and on a bad day some SQL. Switching between text and speech, when someone comes into my office to ask me a question, can completely derail whatever I was doing. Context switches like this are fairly expensive when it comes to working on a hard problem, multiple levels down. Ted Dziuba has a great article about this on his site. I’ve also found that switches between programming languages are painful i.e., going from writing Python to Java without some sort of break in between.

Luckily, I work at home with non-technical people so I don’t often need to give verbal stack traces. I do, however, go to school during the day. I’m a senior and my degree is in German so most of my classes are, at least partially, in German and I’m expected to participate in conversation and reading. The context switch from English to German is pretty rough most days, it is especially so when I’ve spent all morning in a text context.

One, very unfortunate, day I spent about 5 hours straight writing Python before going to the German class. No one else in the house was awake, the kids were at school, the girlfriend was up late so she was asleep when I woke up. I didn’t speak a single word to anyone all day; I spent the entirety of the morning writing code…I don’t think I even chatted in IRC, at all, I just programmed all morning. In class we were just doing conversation and reading aloud from the book, nothing else that day. Going from Python to English to German to English to German (repeatedly) gave me a massive headache. By the end of the class my brain felt like it had been put through a meat grinder.

I spent the rest of the workday (2 hours) trying to get back to where I was when I left, dynamic languages seem to require more information be kept in a “stack” in the programmer’s head than static languages do. I’d planned a bunch of stuff for after work that evening, finishing a novel that I’d been reading and some homework for the Java class…It never happened. After work I did nothing but watch TV and take Ibuprofen because my brain was so over worked from the context switching; I could hardly function.

I don’t have a good solution for handling context switches like that, yet. I’ve experimented with spending some time just talking to people before having to go to the German class, I’ve tried watching TV in English on my lunch break before going to class, and I’ve tried taking more frequent breaks during the morning (with frequent notes about where I was, in the code, and what I was doing there). The last experiment seemed to be the most helpful, I didn’t feel quite as bad after the switches but it isn’t a complete solution i.e., there is still some headache involved.

Good things from my Java class.

I’ve taken the Intro to Java class three times at SUU. The first two times I took it I had surgery and I wasn’t able to finish the class.

The first time

The first time was absolutely awful. The professor showed up to class the first day, told us to go to his class files and download his customized version of Wordpad that included a few batch scripts and other hackery to set the CLASSPATH correctly and open a terminal to the right directory for compiling.

Our book was about working with multimedia in Java. It wasn’t a “learning Java” book. We were assigned reading every day, it didn’t match up with what we were actually doing. We were also assigned reading of the Appendices that actually did match up with what we were doing.

Each class period we would spend 40 – 45 minutes writing code that the professor was writing on the overhead projector and 5 minutes finding out what our homework would be. Mostly the homework was taking the code we had written in class and modifying it in some way, basic script kiddie shit, not actual programming.

There were no quizzes.

The exams were in this format:

50 minutes:

  • 20 term definitions,

  • 15 multiple choice questions, and

  • 3 – 5 coding problems; no computers allowed.

The coding problems were written on paper, from memory, syntax and compile time errors counted as missed points. The midterm was 3 programs, each of them more than 25 lines of code.

It was total bullshit.

The second time

The second time wasn’t too bad, there was quite a bit of homework but I didn’t attend long enough to take a quiz or exam.

Setup

The class was set up so that we would spend the maximum amount of time practicing writing Java rather than learning about syntax and how compilers work. We got a 50 minute presentation on Java’s basic syntax, data types, and an approximation of how the compiler worked. It was just enough that we could use it as a reference when actually writing Java code.

We didn’t start out with Eclipse or Notepad like some classes do. We started with BlueJ, it’s just functional enough that you don’t have to worry about setting up a CLASSPATH for compiling or using the right Java SDK but it doesn’t give you too many hints about the code.

After we learned the syntax and some data types we went into a workshop format. We would show up to class and spend the time writing the different programs on the worksheet list; each of them designed to teach us one of the concepts we learned. After a couple simple exercises the difficulty would increase usually by using multiple concepts at the same time or combining multiple data types.

Once finished with each of the assignments we’d have to compile and pass them off for the professor.

Grading

Each assignment assigned as part of a workshop was worth from 1-8% of our grade, each quiz was worth 6% of our grade, the midterm was worth 20% of our grade, and the Final project was worth the rest of the remaining percentage. Nothing else mattered as long as you could write the code.

Quizzes

Each quiz, there were three total, was a programming problem. We had 45 minutes to code a solution to the problem listed on piece of paper that was handed out. The problem was usually one of the harder problems that were assigned during the workshop with information changed. They were pass/fail, a full 6% or 0%.

Midterm

The midterm was 5 parts: part one, multiple choice question set about Java syntax and data types; part two, accreditation question set (2 questions); parts three – five, the programming question from each of the three quizzes IF you didn’t pass them the first time. If you passed the quizzes the first time the midterm was about 6 minutes long.

Final

The final was just a final project. Pick something that is interesting or that you want to learn more about then discuss it with the professor and code it. We had about a month to build the final project with each class period being a workshop with the professor and tutor able to help with anything in the project.

This was the best, by far, of the programming classes I’ve taken. It allowed me to not show up to class as long as I understood what was going on and I was able to pass off the assignment which was a huge incentive to me. It was definitely worth the time I spent on it.

Problems reading and burning DVDs with a MacBook Pro

Over the last couple months I’ve been having more and more problems with my MBP reading and burning DVDs, honestly I’ve only tried to burn one DVD in the last two years so it may have been broken for longer. When I actually needed to burn a DVD, before the session could open, I would get an error that there was something wrong with the media and the disk would be ejected.

Numerous solutions I found online were to:

  1. Take the MBP apart, pull out the SuperDrive, take it apart, and clean the lens.
  2. Find a thin object and a smooth cloth to shove into the drive repeatedly to clean the lens.

I decided I would try option 2, while I was looking for a clean, soft cloth to use I was reminded by Katrina that shoving something into the drive is a really dumb thing to do. She suggested just using the canned air I keep in my desk to get rid of dust.

Aha! Finally a sane solution. I used the canned air, two full passes (up and down) trying to keep the airflow even, popped in a DVD that 3 hours ago wouldn’t read and it worked. I tried burning the DVD that I’d tried 20 minutes before and it worked.

So, the real solution to an MBP disk drive not working, MBP not reading DVDs, MBP SuperDrive not working, MBP DVD burn failed, and any number of other phrases is actually:

  1. Use canned air to clean the dust off the lens.

The Importance of Posting Solutions

About 10 days ago I ran into a technical problem (looking for the git source and git-manpages archives) that wasted hours of my time because I wasn’t able to find a worthwhile search result. I pulled up MarsEdit and wrote about the solution I found, in anger.

Within three days of writing the post; I had used it as a reference four times. Without posting the solution it would have been worse for me because I would have had to dig through the entire day’s browsing history or my bookmarks to find the page again.

I’m sure almost everyone in a technical field has been in this situation:

XKCD #979

The original poster never posts the solution to his or her problem which is incredibly frustrating if it is a one-off thing (as most hard IT problems are).

The Stack Exchange network has been great for getting solutions to some of the problems I’ve had and I’m quite happy searching through it for some types of answers but it’s not perfect for everything. Small, short problem solution sets don’t really fit in very well; you, basically, have to ask the question and then answer it yourself. Which is fine, but, seems a little bit too much work for a quick problem/solution.

There’s something cathartic about posting the problem and solution to a problem somewhere. It can be Twitter, Github, Stack Exchange, a personal blog, Tumblr, or any number of other places. The important thing is that you do post the question and answer, somewhere.

Since the problem has already been solved the opportunity costs of 5-10 minutes to write it up are very low. So, take some time and post your solutions to the problems you run into; save someone else the hours you spent researching and testing…then charge consulting fees!

Where did the kernel.org git archives go after the hack?

I’ve been building and rebuilding an RPM for git since the RPMs that are published by pbone are full of junk that I don’t want with it i.e., Gitweb, or missing pieces that I do want. The original RPM was built before Kernel.org was hacked (the full story can be found at [TheRegister](http://www.theregister.co.uk/2011/08/31/linux_kernel_security_breach/)) so the sources were pulled from [kernel.org](http://kernel.org/pub/software/scm/git/).

After the hack, the git sources are no longer stored in the same place. There are only a couple of old builds listed in the directory. WHAT THE FUCK? How can all of the sources for git just be gone with no explanation? I asked the same question, there’s not even a note, a bullet, a text file, or anything anywhere explaining why.

Building the manpages for git is a notorious bitch, I’ve tried building them ~10 times and each time fails with some error…after fixing 9 different problems I was pretty much done with it so I thought I’d just download the git-manapages-N.tar.(gz|bz2).

That was the second mistake. Those files were gone too. I know, I’ll just go to the Google Code [git-core downloads page](http://code.google.com/p/git-core/downloads/list)! Any release before 1.7.6 isn’t there. After a couple of hours searching Google, Blekko, and Bing I finally found a couple mirror sites:

[http://distfiles.exherbo.org/distfiles/](http://distfiles.exherbo.org/distfiles/)

[http://ftp.sh.cvut.cz/MIRRORS/sourcemage/mirror/?C=M;O=A](http://ftp.sh.cvut.cz/MIRRORS/sourcemage/mirror/?C=M;O=A)

Those are the only sites I’ve been able to find that have a full set of Git archives including the manpages! Hopefully, the next time someone needs a git archive that was released after 12 September 2011 his/her search will land them here where the links are readily available.

The packages I was looking for were: git-manpages-1.7.4.1.tar.bz2, git-1.7.4.1.tar.bz2, and git-htmldocs-1.7.4.1.tar.bz2. All of which are found there with a quick search.

Why I Changed My Mind About Jazz

In the move from 6th to 7th grade we were asked to pick between Art and Band. Those were the only two options. The rest of our six classes were chosen for us. Choosing band meant that for weeks during the summer we had to show up in the morning for practices, after picking an instrument to play, having the parents get it, and promising for several days at a time that, through thick and thin that the instrument would be safe.

Depending on the instrument the monthly bill could be between $8 and $55 a month for two to five years. If you’ve never looked at buying an instrument it can be really expensive, especially a brass instrument, for instance: [a nice trombone](http://www.musiciansfriend.com/brass-instruments/king-2102-2b-legend-series-trombone) is the price of a new iMac. Unlike an iMac you can’t just sit down and use the trombone, it takes hours of practice in order to be able to play anything that even resembles music. With all that in mind; I chose band and the drums. Drums only required the purchase of a pair of drum sticks $10 – $20. My rationale was, that, if I didn’t like it I could just quit and not be out tons of money or work.

Living in a small town in Utah meant that there weren’t very many radio stations and that there wasn’t a place to buy music of any kind less than 50 miles away. Sure I could download and pirate as much music as I wanted, provided I did it at school and had some way to get it home. (I didn’t have Internet in my house until after I was ~18. The only reason we got a connection then was because my Mother started a bookkeeping job that required Internet.) Keep in mind this was the early 2000s and Napster was just getting going heavily and no one had been sued, yet.

Since I couldn’t get music on my own I recruited a couple friends to get music from their Internet connections at home and burn me CDs. Starting out with Metallica and being influenced heavily by my older friends moved on quickly to Slipknot. I’d already had a solid background in Rap music from the many field trips I’d taken during Elementary school with some of my friends who’d moved in from Salt Lake City/West Valley so this was an entirely new direction, musically, for me.

Fast forward a year or two and I’m still in band and still playing music (a specific amount of Art credits are required to graduate high school), primarily jazz music. I hated it. Most of the songs were heavily influenced by our small brass section and large woodwind section. We had two trombones, three trumpets, three saxophones and seven clarinets. One of the trombone players was actually good but the other was only mediocre. Since we had the weak brass section we had to play songs that could make use of all seven clarinets and the four saxophones. I like saxophone music but not that much. That was my first real taste of jazz music.

Since that time I periodically heard Jazz music on the radio listening to those random radio stations that one can only find after Midnight on weekdays and while it was OK it was never good. The drums were repetitive and boring, the saxophone was playing the whole fucking song, and there was a quiet progressive bass line playing. So I’d change the station back to whatever trite nonsense was on the “hit” radio station and listen to that.

In high school itself my musical interests went from Metallica and Slipknot into the deeper ends of metal: black metal, death metal, power metal, and symphonic death metal. On a normal day you could find a mixed CD in my CD player (remember those?) with tracks from Iced Earth, Cradle of Filth, Dimmu Borgir, Demons and Wizards, Opeth, Rammstein, Therion, and any number of other northern european bands that you can’t pronounce. My interests stayed in this realm for the entirety of high school. I still listened to the rap music I had listen to when I was in elementary – junior high but not as frequently. In order to graduate early I decided that I was going to take “Early Morning Band”. Morning band happened every day at 6:30 a.m. And the percussion department was full, I’d have to learn to play another instrument in order to take the class. I chose Trombone, not because I liked it but because I hated Woodwinds. The band teacher had changed from the year previous so we had a new guy who played some weird instrument, a [cornet](http://www.musiciansfriend.com/brass-instruments/getzen-800-eterna-series-bb-cornet/463747), that we’d never heard of before and the guitar.

This band teacher was a lot different from our previous band teacher, he was kind of a dick, his wife was hot — most of the band loved when she stopped by, and he didn’t really give a fuck. He was much to worried about his own band that was about 2 hours away and just needed something to pay the bills while he started lining up gigs. I was able to get away with playing as one of two members of the trombone section (the other being the mediocre player mentioned above) without ever actually learning any of the songs. Sure I practiced really hard over the summer to be able to actually play, when I saw he didn’t give a fuck if I did or didn’t, I didn’t.

I got a whole credit out of the class before deciding that I was tired of waking up at 5:30 a.m. I was tired of catching the bus to school at 6:05 a.m. I was tired of not playing an instrument that I didn’t want to play and tired of the teacher, so, I decided I wasn’t going to do it again and passed the trombone down to my brother. I never had to play in front of anyone because I worked in the booth during the productions.

In my Junior year I found myself with half an art credit too few for graduation the next year so I did the only sane thing I could: I persuaded the band teacher (a new one since the dick was fired or left, whatever), administration, and advisor that if I were to follow the band teacher around doing technical stuff for him during that hour he would consider me enrolled in “Show Choir” which would fulfill my art credit so I could graduate. Anyone reading this that has known me for very long is likely laughing so hard his/her sides are about to split just imagining me in Show Choir.

Everyday I showed up at show choir, played around with the nice Roland recording equipment that the band had acquired from a bygone band teacher who thought it was must have, for about two weeks anyway. After the two weeks I decided that just singing for an hour would be more enjoyable so I asked the band teacher if I would be able to actually join the group (they had auditions and not everyone got in if they signed up) and after making sure I could match pitch and feel rhythm, he agreed. At this point we were preparing for the Christmas concert that the school puts on each year, so I showed up to class and sang Christmas songs for an hour a day now instead of playing with recording equipment.

I, much like Richard Dawkins, quite enjoy Christmas songs despite their religious tones so the class wasn’t as horrific as it could have been (It wasn’t an episode of Glee). Moving up to the concert I even had an out so I wouldn’t have to sing in front of people, I ran the light and sound booth with a couple of my friends. Anyone who has worked in a booth during a production of anything knows how hectic it can be but I still left minutes before we went on and joined up with the rest of the choir. We totally killed it. We were awesome. Numerous people congratulated us on how well we did after the concert was over. I’m not taking any of the credit for that but for the part I played in the whole.

This band teacher had quite an effect on me. Since I was part of the crew who ran the Booth we worked together on the school musical, practices for the concerts in my auditorium, and at numerous other occasions. It was the first time in my life I’d ever met someone who was so blatantly good at music. He had perfect pitch, he could just look at a note on a page and sing it or play it on a number of instruments. The first couple times I heard him yell from the booth, to the stage that the note the lead role was singing was the wrong note, it was something when it should have been an ‘A’ and then demonstrated, I laughed. I thought he was just trying to make himself seem useful. He wasn’t. He actually could hear the difference and without any warning or warm-up just sing it.

I’d heard of perfect pitch and dismissed it as people who seemed really good at something to people who didn’t know the difference. It’s real. It’s fucking unbelievable. I’ve you’ve never seen/heard anyone who has perfect pitch I suggest you find someone and pay for one lesson just to see/hear it for yourself. Having him there meant that our musical was great. It was definitely one of the best I’ve ever seen come from my high school. One day I asked him what music he listened to, I figured that since he was so good at it himself he’d have pretty high expectations and thus listen to some pretty good music. He told me that he really didn’t listen to much music because he found things about almost every song that bugged him. When he did listen to music it was usually Jazz, Alternative, or something similar.

Since I didn’t listen to that type of music I really didn’t even know what Alternative, as a genre, was. The Disney Tarzan movie had come out a year or two before this conversation and I remember sitting through the “Making of” Tarzan so I had heard that Phil Collins was one of the main people behind it, so I mentioned him. The band teacher didn’t like his music (I think his voice is too “tinny”). Finally I pushed him for some band names, thinking I’d download them and see what was so good about them. He gave me the name Oingo Boingo.

I thought that was a weird name so I didn’t bother until about a year later when I was living in Portland, OR with nothing to do and bored of all of my music. I got ahold of some Oingo Boingo and my first thoughts were that it was total shit. I listened to it on and off for a couple weeks and suddenly I started to really enjoy it. The lyrics were awesome, it had a full band, guitars, drums, and entire exotic percussion sections on some songs. Pandora came out around this time so I fed Oingo Boingo into Pandora and listened to similar artists. This is where I discovered Depeche Mode, Huey Lewis and the News (again, first time was, of course, American Psycho), The Fixx, and numerous other ‘80s bands that I found I really enjoyed.
Around this time I started watching Anime seriously (that phase only lasted a couple months), one of the first Anime shows I ever watched was “Cowboy Bebop”. I watched the entire series over a day and night, for those of you who don’t know most of the episodes use music terms and almost all the music in all of the episodes is Jazz. And I loved it. The music from “Cowboy Bebop” was wonderful. Sure there was still saxophone in the songs but it wasn’t as awful as it used to be.

A few years pass.

I love Musicals. Yeah, yeah, make your jokes and laugh but I still like musicals. When I first started seeing commercials for Glee I thought it would be good. I watched season 1, then season 2, and grudgingly season 3. There was nothing else to watch and I only liked the music bits, the high school drama shit is fucking retarded. I went to high school I thought it was dumb then, no way in hell do I want to watch that shit recreationally. I was on the prowl for new shows to watch and “True Blood” came up so I decided to give it a chance. The show was OK but I really enjoyed the music from the show so I started looking for more shows like it. I didn’t find much. I watched “Black Snake Moan” when searching for southern movies and the blues music in it was fantastic. I got the soundtrack, something I hadn’t done since The Matrix.

This brings us to the present. A couple weeks ago, on a tweet from Anthony Bourdain (http://twitter.com/#!/noreservations, May 30th, and fuck Twitter’s shitty search and un-linkable tweets) I took a look at Treme. I didn’t watch it at first, I saw that it was about New Orleans after the storm and since I didn’t know much about what had actually happened there I decided I’d add it to my Netflix queue and see if it was good when it got here.

It was fantastic, glorious even. The entire show, with all of the wreckage and ruined lives is still full of music and dancing. The idea of a second line after a funeral was intriguing. The idea of a second line, itself, was something that I never would have thought of. Where I’m from we have parades on July 4th, 24th (Utah’s birthday), maybe Thanksgiving, and maybe Christmas. The entire concept was so foreign to me. I couldn’t wait for the next disc to arrive. I watched the whole first season in a week and I enjoyed every episode. The thing about Treme is it is full of Jazz, something, as you can probably tell, I’ve hated for a long time. I’ve hated jazz since 2 − 3 years before Katrina hit New Orleans.

This Jazz is different. It’s something more than all the jazz I’ve heard previously. This jazz makes extensive use of the trombone, trumpets, and other brass instruments it isn’t just a saxophone playing with shitty drums in the back. (I really like the trombone’s sound, that’s why I picked it as my instrument when moving to morning band.) It’s so much different, so much better. I can sit and listen to this jazz for hours without being bored and changing the station. It’s dynamic, one of the things I’ve always loved about metal. To be fair it isn’t all Jazz, there’s some funk, big band, bounce, and ten other genres I’ve never heard of, but it is all New Orleans.

I’ve changed my mind about Jazz music because of Treme, it’s showed me that there is a lot more to Jazz than just the saxophone and shitty drums. There’s a whole other side to the genre that doesn’t suck. I tried, yesterday, to listen to jazz on the radio with my new found appreciation for the whole genre and it was exactly what I remembered from all those years ago. Total shit. To correct myself here, I’ll say that I changed my mind about jazz as long as it is New Orleans jazz; anything else just won’t cut it.

Republicans and Socialism

>In the U.S.A. Homeless go without eating.

>In the U.S.A. Elderly go without needed medicines.

>In the U.S.A. Mentally ill go without treatment.

>In the U.S.A. Troops go without proper equipment.

>In the U.S.A. Veterans go without benefits they were promised.

>Yet we donate billions to other countries before helping our own first. Have the guts to re-post this. 1% will re-post and 99% Won’t have the Guts

I’ve been seeing this message posted around on Facebook and other social networking sites quite often over the last month. Rather than replying to each message and falling for the [someone is wrong on the Internet](http://xkcd.com/386/) trap I’m just going to passive aggressively write about it on my blog.

I’ve also noted that all of the people who do post this hate Obama, are Republicans, and say they are Christians of some variety. That has to cause a lot of internal conflict. Whining that we don’t provide enough social programs while you and your party vote against them, seeing people in need and not helping them when your religion says you should, and telling everyone that they are too “chicken” to repost the same thing doesn’t seem very Jesus-like.

Don’t worry, I know you are just posting this because all of your friends posted it and it seemed like a good idea at the time. I know you aren’t really that dumb; that you don’t actually vote with your party AGAINST the very things you think are wrong with this country. I know that you actually fact-checked it and thought it would be ironic if you changed your political affiliations to Republican and religious views to Christian before posting this; I know I would.

>In the U.S.A. Homeless go without eating.

Yes, that’s right, because having homeless shelters and other social programs to help homeless people is SOCIALISM.

>In the U.S.A. Elderly go without needed medicines.

Yep, that’s because having a Government run healthcare system that can care for them and pay for their medicines is SOCIALISM.

>In the U.S.A. Mentally ill go without treatment.

Hm, this still falls under the Government run healthcare system but we can’t have that because it is SOCIALISM.
>In the U.S.A. Troops go without proper equipment.

It’s been 10 years (almost) since we started the war so I’m kind of fuzzy on exactly why we didn’t have proper equipment but I’m pretty sure it had something to do with a Republican President deciding that we needed to go to war NOW…then after we’d just started that war, decided that we needed to invade ANOTHER country so there wasn’t enough equipment to go around.

>In the U.S.A. Veterans go without benefits they were promised.

Here we are with that Government run healthcare thing again, which is exactly what the Veteran’s (VA) hospitals are. I’ve not met any Veterans that haven’t received the benefits that they were promised so I cannot fully comment on this one, however, as I’ve noted hospitals that deal especially with Veterans are Government run. That means they come from SOCIALISM.

>Yet we donate billions to other countries before helping our own first. Have the guts to re-post this. 1% will re-post and 99% Won’t have the Guts

We do donate billions to other countries, we also spend billions of dollars a month fighting those 2 wars that that one Republican President started. Think about just how much a billion dollars is, hint: it is a metric fuck load of money, from [CostofWar.com](http://costofwar.com/en/) you can see how much we’ve spent already, now look at how much [1 trillion dollars is](http://www.pagetutor.com/trillion/index.html).

We do help our own country first, we spend a substantial portion of the country’s budget on programs like Social Security, Medicaid, Medicare, Pensions, and Welfare, which are all used to help the people mentioned above and SOCIALISM. Take a look at the [proposed](http://www.nytimes.com/packages/html/newsgraphics/2011/0119-budget/index.html) [budget](http://www.usgovernmentspending.com/budget_pie_gs.php).

Also, note that these programs are paid for from your [FICA](http://en.wikipedia.org/wiki/Federal_Insurance_Contributions_Act_tax) taxes (Social Security and Medicare). Note that the amount we’ve spent on the war already is more than the amount that we need to run [Health and Human Services](http://www.nytimes.com/packages/html/newsgraphics/2011/0119-budget/index.html) for an entire year. Another side note, if the FICA tax increased by the amount each American spends on private health care (while working for a Corporation who meets employees half way on the premiums, for those of you who work for yourselves you know just how much money you have to spend on health care each month without a Corporation to match it) Government run health care would be possible.

I know I’m glad we hate that evil SOCIALISM so much, it would be RETARDED (see what I did there) to let poor people who can’t afford health care have it. Also, why should my tax dollars go to pay for some homeless person’s frost bite? It’s not like I made him homeless, that’s his own damn fault.

Don’t even get me started on old people, they are old, they’ve lived a long time, they’ll probably die soon why should I pay for them to have health care? Everyone knows that old people have all sorts of diseases and expensive medicines, I don’t want to pay for that. Wait, what? So what if these old people helped stop Hitler, or helped keep South Korea its own country, or built the companies that we are working for now? What have they done for me lately? Nothing but take my FICA taxes, that’s what.

The Military is evil because they are the product of SOCIALISM. I don’t know of a single corporation in the world that could actually staff a standing military with the equipment/personnel our Government can. Even the major ones that are “armies” Xe (Blackwater) and Haliburton don’t have any where near the amount of money it takes to run an actual armed force or provide national defense. The Military is completely funded by the people and tax dollars, SOCIALISM, kind of like public schools, SOCIALISM, first time home buyer loans, SOCIALISM, college grants, SOCIALISM, public fireworks, SOCIALISM, public roads including Interstate highways, SOCIALISM, state parks, SOCIALISM, national parks, SOCIALISM, city parks, SOCIALISM, almost all infrastructure, SOCIALISM, and Libraries, SOCIALISM. See how that evil socialism sneaks its way into everything you ever liked?

So, America, let’s get rid of this shitty socialism thing that has crippled our nation for so long. We don’t need it!

PostgreSQL CREATE LANGUAGE statements.

Over the last week, as part of my work, I needed to install, enable, and test 3 different procedural modules for PostgreSQL: PL/Tcl, Pl/Perl, and PL/pgSQL. By far the easiest was PL/pgSQL since it comes enabled by default on the database, a user simply needs to run:
CREATE LANGUAGE plpgsql;
After connecting to the database that you want it installed in, e.g., psql -U user.

This doesn’t work if your other languages aren’t installed into the database, you’ll get this error:

Same with PL/Tcl.
At this point you can spend a couple hours reading through this:

http://www.postgresql.org/docs/8.3/interactive/xplang-install.html

And this:

http://www.postgresql.org/docs/8.3/static/sql-createlanguage.html

You’ll get pretty much no where since the only information about installing a procedural language is one that is already installed (very helpful, thanks).

The documentation does allude to some of the helpful pieces in getting the procedural language installed but it doesn’t explicitly state what you are supposed to do. I’m going to do that now. You need to run this command:

From this command you can see that we currently have 3 languages installed PL/pgSQL, PL/C, and an internal language. Note: PL/Tcl and PL/Perl are not installed here, so they can’t be used with the CREATE LANGUAGE command. As long as you’ve installed the correct RPMs or .deb files you will be able to see them here:

This is a list of all of the languages available as a template in your database. Here’s where the docs stop being helpful at all: There is nothing telling you how to manually install pl/tcl or how to manually install pl/perl into a postgres database. Sure, the docs say, if you are installing PL/pgSQL then you can do x…but x doesn’t work the same for PL/Tcl or PL/Perl. There are pages of docs on the handler calls and validator information (this plus a couple thousand lines of C and you’ll have a great validator).

Here’s really how to do it:

CREATE LANGUAGE pltcl;
CREATE LANGUAGE plperl;

That’s it. Because these languages are installed in the pg_pltemplate they only require the create language command so after logging into your database and running the 2 commands above you’ll be able to add them to databases as the user like this:

So, now, look through the docs again – yes _all_ of them. I’ll wait. OK, back? Good, you may say “All of these steps are there; you should have just read more carefully”. True maybe I should have read more carefully, I spent hours going over the documentation and searching, BUT it was on different pages and scattered throughout the entire documentation set for PL and each of the different PLs.

A quick recap of what you need to do to install PL/Tcl manually:

1. Run: select * from pg_language;
2. See if your language is already installed.
3. If not, then you need to make sure it is installed in the system.
4. To see if it is installed in the system run: select * from pg_pltemplate;
5. If your modules are there run: CREATE LANGUAGE pltcl;
6. Log in as the database user and run create language pltcl; to install it for that database.

A quick recap of what you need to do to install PL/Perl manually:

1. Run: select * from pg_language;
2. See if your language is already installed.
3. If not, then you need to make sure it is installed in the system.
4. To see if it is installed in the system run: select * from pg_pltemplate;
5. If your modules are there run: CREATE LANGUAGE plperl;
6. Log in as the database user and run create language plperl; to install it for that database.

That’s it. You’re done. You can go about your business.