Sharing a Screen Session

23
Jul

Anyone who has spent any time in a shell and has been cut off while working should know about screen. If not, then I recommend reading up on it (here or here). But I’m not here to tell you about screen as a general tool, I want to show you how to use it for screen sharing. I found a couple of forum posts and other scattered information, so here’s a little centralizing of information.

Stopping Curb From Segfaulting

08
Jul

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).

Creating Configuration Files With Ruby Templates

30
Jun

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.

Random Tech Notes And Buzz Updates

28
Jun

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.

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

16
Jun

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.

My First Drobo Experience

02
Jun

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…

Multiple Input Locations From Bash Into Ruby

13
May

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.

Nagios notify-by-campfire Plugin

06
May

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.

Creating Dummy Packages On Debian

04
May

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.

New Massachusetts Security Law Passed For Databases

27
Apr

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.

Should I Mock Kernel#exit

26
Apr

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.

ColorTail Gem

20
Apr

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.

A Few Words About Setting Up Postfix Multi Instance

12
Apr

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.

Monitoring Services with Nagios::Plugin

07
Apr

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.

Capistrano Hangs on Mac OS X Leopard

05
Apr

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.

DNS Staying With The Times

31
Mar

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.

Cluster SSH with cSSHx

29
Mar

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?

Setting Up daemontools on CentOS 5

26
Mar

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.

Count Instead of Sequence

26
Mar

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.

Goodmail Adds Microsoft Domains

24
Mar

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!.

Yahoo and Goodmail Cut the Cord (Temporarily)

24
Mar

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.

Community Participation

18
Mar

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.

Peertester Community Testing

16
Mar

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.

Changing Shoes For A Redesign

09
Mar

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

04
Mar

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.

Database Read/Write Splitting in Frameworks/ORMs

01
Mar

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).

Textmate Minimap Plugin

25
Feb

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.

Philosophical Python

19
Feb

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).

Sortfix Or A Next Generation Search Tool

16
Feb

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.

Social Search's Effect on SEO

12
Feb

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).