Archive for the ‘ Uncategorized ’ Category

Stopping Curb From Segfaulting

Thursday, July 8th, 2010

While trying to get the curb gem up and running using Ruby 1.8.7p174, I kept getting segmentation faults. I Google’d around and really wasn’t able to come up with much other than lots of people saying not to use ports here. Since I don’t use Mac Ports, I use Homebrew, I figured this wasn’t an issue. I had also recently installed the latest XCode so I incorrectly assumed there was no issue there either. (Note: I am running on a freshly upgraded version of Mac OS X Snow Leopard).
(more…)

Creating Configuration Files With Ruby Templates

Wednesday, June 30th, 2010

I recently had a very repetitive configuration file that needed creating. There were approximately 50 config blocks of 10 lines each with only the host name changing with each block. So I decided to take a shortcut and do it in Ruby using ERB templates. This is so easy and literally save me hours worth of work.
(more…)

Random Tech Notes And Buzz Updates

Monday, June 28th, 2010

Since Google Buzz is Twitterish in the sense that you can post a quick note, but different in the sense that (amongst other things), it can be longer than 140 characters. So in that vein, I’m starting to try to make a habit of a quick post (a couple per week) of things I do to make my life easier. This goes both for SysAdmins and for Programmers.
(more…)

Using Unique Keys and Key Groups with Background Jobs in Gearman::Client

Wednesday, June 16th, 2010

While diving into Gearman using Gearman::Client with MySQL and libdrizzle (I know, a mouthful), I ran into what I thought was a bug. I was only able to add 1 background job of any type at a particular time. The launchpad “bug note,” which is available in its entirety here, is rightly labeled won’t fix.
(more…)

My First Drobo Experience

Wednesday, June 2nd, 2010

The Drobo is supposed to be one of those solutions that essentially pops out of the box and with very little effort, just works. I ordered my Drobo FS through an Amazon retailer. What I wasn’t expecting was an experience…
(more…)

Multiple Input Locations From Bash Into Ruby

Thursday, May 13th, 2010

I have been trying to figure out how, while using OptionParser to be able to check for files being input on the command line and if they don’t exist, check other input streams (like Bash). This initially wasn’t very easy since input streams are blocking. So with a little help from friends (thanks roberto), I was able to use his method of non-blocking IO and wrap it in a begin/rescue block. I also took a little advice given in this Stack Overflow question called Best Practices with STDIN in Ruby.
(more…)

Nagios notify-by-campfire Plugin

Thursday, May 6th, 2010

Since one of the core communication methods for my company amongst engineers is 37Signals Campfire and Nagios is one of our main monitoring tools for all of our applications and services, I thought it would be a good idea to combine the two. So with a few simple additions to the Nagios configuration and a Ruby Campfire script, you can get this up and running.
(more…)

Creating Dummy Packages On Debian

Tuesday, May 4th, 2010

One of my favorite things about Debian is its awesome package management system. Apt is one of the reasons I have used Debian for servers for so many years and eased my initial transition to Ubuntu (which as most people know was initially a Debian fork). Apt is a great tool as long as you aren’t building packages from source (and not making debs out of them). I have packaged a whole bunch of debs, but sometimes it just isn’t necessary. So if you haven’t used equivs, then you need to check it out.
(more…)

New Massachusetts Security Law Passed For Databases

Tuesday, April 27th, 2010

In case you haven’t heard about the new Massachusetts state law regarding consumer or client information in databases, you can read about it here, at Information Week, or just Google for “Massachusetts data security law”. And if you haven’t read about, then I strongly suggest you do. This is one of those instances where I believe their heart is in the right place, even if the execution/implementation wasn’t perfect.
(more…)

Should I Mock Kernel#exit

Monday, April 26th, 2010

I don’t know what the right answer is, so any insight would be appreciated. From Googling around, I came across this thread on StackOverflow which talks about Validating exits and aborts in Rspec. I have a few issues with this, namely that I am using shoulda and I don’t want to validate the exit, I want to stop it from happening inside of the test.
(more…)

ColorTail Gem

Tuesday, April 20th, 2010

One of the best ways to learn something new is to find a project in that realm and do it. I wanted to learn Ruby on Rails, so I wrote a web site. I wanted to learn Python, so I did a project in it for work. Now I want to get better at Ruby, so I wrote a gem. It’s usually not as simple as just picking a project though. It’s much easier to pick and complete a project if you are filling a need. So that’s what I did, I filled a need.
(more…)

A Few Words About Setting Up Postfix Multi Instance

Monday, April 12th, 2010

I work with email and Postfix. On every mailing machine I have Postfix setup on, I have at least 2 instances, sometimes more (in fact, sometimes its as many as 6 instances). I was recently setting up a new set of mailers and decided to give Postfix multi-instance seutp a try. It was excellent. There really isn’t too many complex setups that have a simple installation. And to that end, I give Postfix credit where credit is due. It usually takes a little more than just following the README.
(more…)

Monitoring Services with Nagios::Plugin

Wednesday, April 7th, 2010

There are a lot of people who say, “if it isn’t monitored, then it isn’t a service.” The problem is that I don’t think enough people outside of the systems world believe that or even understand why its said. I think the primary offenders here are developers. It isn’t because they don’t know better, but typically developers just want to get the application up and running and then move on to developing the next thing. I also think there is some fault on the side of the administrators and the managers not insisting that part of the completed version of a project includes monitoring. But I don’t want to harp on this as much as I would like to show just how easy it is to compensate here by taking advantage of Nagios::Plugin.
(more…)

Capistrano Hangs on Mac OS X Leopard

Monday, April 5th, 2010

I use Capistrano to deploy my webapps and have been for a while. I also deploy right from my laptop quite frequently. So I was a little taken aback when I could deploy in one place and not in another. It turned out that Capistrano was having issues with deploying to multiple servers. In fact, it turned out that the problem had the appearance of being Capistrano, but in actuality, it was Net-SSH. The whole issue can be tracked via the Lighthouse ticket here. I’m going to show you how to diagnose if you have this problem faster and how to fix it.
(more…)

DNS Staying With The Times

Wednesday, March 31st, 2010

My company signed a contract for a provider that uses TZO as their DNS provider. Now I have used TZO before (circa 2006-2007) and although their interface was archaic and there was no API, I accepted it because I was told they were reliable. As it happens, the service was fantastic and they are very reliable. I don’t think the service went down once the entire time I was using them. I ended up leaving the company and never saw the API or new interface come to fruition.
(more…)

Cluster SSH with cSSHx

Monday, March 29th, 2010

I am in the middle of building out a group of about 25 machines in a data center for my company. I hadn’t really dove into it on a micro level until a few days ago. I was moving around on individual machines that others were working on. When I had gotten to one of the “untouched” machines, I found that vim wasn’t installed. There was about 15 machines that were “untouched” and therefore were missing vim (along with other stuff). And seriously who wants to install a bunch of the same software on every machine after they’ve already been kickstarted?
(more…)

Setting Up daemontools on CentOS 5

Friday, March 26th, 2010

I recently had to setup daemontools on a CentOS system. I had set it up before but it had been a while. So I Google’d around and found very little and what little I did find wasn’t very helpful. So here is a quick and dirty on setting up daemontools. I even included the CentOS fix that I came across to make it compile. There is also a patch version (if you were building an RPM), but I prefer just making the change in this case; it’s much simpler.
(more…)

Count Instead of Sequence

Friday, March 26th, 2010

I use Bash one liners a lot. I think they are an important part of any programmers and sysadmins toolkit. If you can’t write a bash one liner, even a simple iterator, then you really need to learn. I promise it will make your life infinitely more pleasant.

Frequently I find myself writing things that require a loop or an increment of numbers. A good example would be like something that would walk over my web servers and check their uptime, load averages, etc. Using seq, that’s easy. But since Mac OS X doesn’t come with the seq command, I would previously improvise.
(more…)

Goodmail Adds Microsoft Domains

Wednesday, March 24th, 2010

On the same day that Goodmail removed Yahoo! from its pool, it added the vastness of Microsoft domains. These domains include hotmail.com, live.* and msn.com.

The addition of Microsoft to the Goodmail community is a good thing because it means that Microsoft is starting to play ball in the email community. However it comes as bittersweet with the loss of Yahoo!.
(more…)

Yahoo and Goodmail Cut the Cord (Temporarily)

Wednesday, March 24th, 2010

So as of today, Yahoo! will no longer be accepting Goodmail imprinted messages. There is currently no press release from Goodmail, but I am sure one will be forthcoming. The latest reference to the on goings is listed here in one of their recent blog posts.

Goodmail claims that they are doing everything possible to bring the relationship back to it previous state and it hopes it will be there shortly. I know that from the customer side. But as I said above, I am sure that will be in some form of an announcement coming out at some time today.
(more…)

Community Participation

Thursday, March 18th, 2010

The more I branch out my interests (or skill sets), the more I find myself joining communities. I am a part of Yelp (food/restaurants), StackOverflow (programming questions), Codaset (social coding), Facebook, LinkedIn (professional networking), Disqus (blog comment system), and the list goes on and on for many of my interests. There are lots of communities for almost all imaginable interests. The key thing here is not just that I am a part of these networks or communities that I am interested in, but that I am a contributor.
(more…)

Peertester Community Testing

Tuesday, March 16th, 2010

I am all about community and people participating in a community. Its the way social media succeeds. But there are non-social media communities out there too (yes I know that’s shocking). I was recently asked to participate in a beta testing for Peer Tester. I think this is an absolutely fantastic idea. Developers helping other developers test their apps. Hats off to the guys and gals over at Engine Yard for designing and putting this application together. Other than the fact that I got tired of looking at that olive green color after years in the military, this site is an great tool for developers.
(more…)

Changing Shoes For A Redesign

Tuesday, March 9th, 2010

The best way to rethink things is to be in the shoes of your users. Use your app how they use your app. Try to take a fresh look at your application like you’ve never seen it before. Would you change the location of the menu/navigation? Would you change the actual menus/navigation? Would you add a shortcut search box where there wasn’t one before? Maybe you remove the advertising or move the place that the ads are located so that they are less intrusive…

The idea is that every so often you need to take a step back. Looking at your application from your users perspective may well change how your entire application works. I’m not saying this from a statistical analysis of the way people click and heatmaps and all that good stuff (though they do have their applications), I’m saying just a pure usability test from another perspective. Where do the new users look? Where do they click? What’s the first thing they want to go to? Are you putting them through information overload?

So take a step back, change shoes and take a fresh look at your app. No statistics, no heatmaps, no preconceived notions about the problem you are trying to solve (I know this is easier said than done). Just remember why you wrote your app in the first place. Try the passion on for size again and see if that doesn’t stir things up a bit.

Speeding Up Your Selects and Sorts

Thursday, March 4th, 2010

When you are using a framework, they typically set your VARCHAR size automatically to 255. This is normally fine since you are letting the framework abstract you away from most of the SQL. But if you interact with your SQL, there is a way to get a decent speed increase on your SELECTs and ORDER BYs when you are working with VARCHARs.

The VARCHAR data type is only variable character size for storage, not for sorting and buffering. In fact, since the MySQL optimizer doesn’t know how big the data in that column can be, it has to allocate the maximum size possible for that column. So for sorting and buffering of the name and email columns below would take up 310 bytes per row.
(more…)

Database Read/Write Splitting in Frameworks/ORMs

Monday, March 1st, 2010

Although one of the primary ideas behind frameworks is to keep things as simple as possible, sometimes they create issues in the long run. What I am about to discuss is something of a luxury problem (as scaling usually is), but it is a problem nonetheless.

When initially starting a project, whether you are using Ruby on Rails (Ruby), Django (Python), CakePHP (PHP), Catalyst (Perl), or any of the other 100s of frameworks in any of the languages out there, the first and most important thing to do is to get it out the door. Once you have done that, it’s time to get users, fix bugs, and add features. After you have done all that and you have a great web app, its time to think scaling. (Yes I realize that I have trivialized this process immensely, but its for a point, I promise).
(more…)

Textmate Minimap Plugin

Thursday, February 25th, 2010

My editor of choice for most of what I do on the Mac (when I’m not in the shell using Vim) is Textmate. I recently came across a neat plugin called the Textmate Minimap. Essentially this plugin opens a map across the side of your Textmate window (like another drawer on the other side) and allows you to scroll full screens. You can move the editing window screen by screen in the minimap. This is equivalent to a visual page down.
(more…)

Philosophical Python

Friday, February 19th, 2010

Having spent a lot of time in the Perl world and even trying to write a Perl poem here and there, I decided to give some Python poetry a try. It turned out to be a bit more philosophical than poetic. But it compiles and that’s what counts; even though it doesn’t do anything useful (or anything at all).
(more…)

Sortfix Or A Next Generation Search Tool

Tuesday, February 16th, 2010

Although SortFix has been around for a while, I hadn’t heard of it until recently. I also didn’t really have a reason to give it a try because the vast majority of my Google searches were providing me with the results I was looking for.

The idea here is that you can do a normal search for something and then you will be presented with a screen that will allow you to narrow down your search using a graphical user interface (GUI). This will produce a search similar to something that a power searcher would do in Google. After doing this a few times, it becomes fairly evident how its done and one could start “power searching” on their own.
(more…)

Social Search's Effect on SEO

Friday, February 12th, 2010

There always seems to be something affecting your SEO rankings. Most recently, people have had issues with personalized search. Another kink in the chain may be social search.

The first thing is that Social Search can’t replace Hyptertext search (such as Google/Yahoo!/Bing/etc). Social search has 3 inherent drawbacks, time to receive information, credibility of the source, and subject/objectivity. Technically subjectivity is an issue with hypertext searches as well, but since the information is considered more permanent, people tend to be a little less opinionated and a little more objective (if the information is factual).
(more…)

Model Specific Formatted Search Results Using Thinking Sphinx

Monday, February 8th, 2010

Having recently implemented Thinking Sphinx on one of my web sites, I thought it would be cool to be able to search every indexed model. With Thinking Sphinx, it’s easy to have a bunch of different classes returned in the results. The tougher part is displaying them in a way that is organized (although admittedly not very DRY).
(more…)