Skip to content


Using your mac without the mouse

How awesome are you with your keyboard on the Mac? The Mac is surprisingly easy to use without the mouse. Don’t believe me? Have a look at this video (15 minutes of unadulterated awesome) and then come on back over.

I covered many topics in a pretty rapid motion. So let me summarize them for you here.

You can select the menubar with ctrl-F2, the dock with ctrl-F3, and the menu extras area with ctrl-F8. You might have to include the fn key if you don’t have “Use F1, F2, etc. keys as standard function keys” selected in the Keyboard preference pane.

Launchbar is awesome. You really owe it to yourself to use this tool or something similar like Quicksilver, or the Google Quick Search Bar. Almost everything I do originates from Launchbar.

Finder is pretty accessible with the keyboard. You can move to different folders, open folders, and change your views easily.

Make sure to enable “Full Keyboard Access”. This will allow you to move around in dialogs and windows with your tab and arrow keys.

A newer tool called gleeBox allows you to take a “keyboard-centric approach to navigating the web”. I love this tool. There are versions for Chrome and Firefox.

I’m an avid user of gnu screen. You should be too. There is nothing worse than tab hell in my terminal. Speaking of terminals, I prefer iTerm over Terminal. iTerm is much more featured and allows for 256 colors. Hey Apple, it is 2010. I need more than 16 colors in my terminal.

For editing text, I suggest vim. THere is a slight learning curve, but once you get comfortable, vim is a keyboard lovers dream. You can navigate, explore and split windows with some not-to-hard-to-learn key combinations.

Normally you would resort to the moving windows around with the keyboard. With SizeUp you can move windows around and between desktops and monitors with few easy to learn keystrokes.

Now, I’ve given you a taste of what you can do without the mouse on the Mac. Anyone care to share any more tips I may have missed or not even known?

Posted in Smarticus Says.

Tagged with , , , , .


Creating macros in vim

Vim Macro Cheat Sheet

* Start recording a macro with q (register name). If you want to record a macro called x, then you hit qx.

* Start performing the actions for the macro. For this particular video, I yanked a line with yy, paste it with p, and
either incremented or decremented the first number in the line with Ctrl-A and Ctrl X respectively.

* After you are done recording the macro, use q to quit recording. Note, you can’t be insert mode for this to work

* To recall a macro, use @ (register name). To call macro x, you hit @x. You can run the macro multiple times if you
precede it with a number. 10@x

* To see the contents of the macro use :register. To see whats in register x, all you need to do is :reg x.

* Your macro should automatically persist across sessions if you haven’t modified your viminfo. To verify the contents of your viminfo, run :set viminfo?. If you see <50,s10 … this means that your registers can be 50 lines and 10KB.

Posted in Geek Vids.

Tagged with , .


Moving text around in vim

Are you still having problems moving text around in vim? Here are some pointers.

Cheat sheet

move lines with dd and p

Getting started with block mode

  • moving around with o and O
  • delete with x or d
  • yank with y – then put before with P and put after with p
  • yank and put after some short lines y$p
  • insert text into multiple lines with A and I

View the register with :registers

Indent an entire file with gg=G

Posted in Geek Vids.

Tagged with .


Build it from source

More and more, I’m noticing a depressing trend. I know I’m about to cringe or face palm whenever I read or hear, “I’m just used to building everything from source.” This is a super scary concept to me, because it gives me hints about what is coming up next.

In the computing world, there are quite a few solved problems. Maybe all these problems aren’t solved as eloquently as you might or expect, but generally what you are doing right now has probably been done before.

One of these problems that has been solved a countless number of times in package management. Almost all major Linux distributions use a package manager of some sort, and they all pretty much get all the easy points right. Even my Mac which I use for most of my productive work these days has a choice of a few different package management options.

While researching Rails 3 today, I came across a particular blog post. While scrolling through the comments, I came across this gem,

“I’m simply used to doing the source way”

Now, this is an innocent enough sounding statement on the surface. Of course it is pretty simple to untar and and ungzip source distribution. It is even pretty easy to run configure, make, and make install. What happens after is the painfully depressing part; how exactly do you know what version of what you have installed?

I’m actually not sure why this bothers me. Maybe it is the fact that is pretty damn simple to create packages using Portage, RPM, Deb, and believe it or not, it pretty damn simple to create packages on your Mac.

So the next time you install something by hand, take the few extra minutes to package it up to save yourself some future pain…. or


./configure --prefix /tmp && make && make install

Posted in yerdoinitwrong.

Tagged with .


Semantic Versioning

Today, I read about Semantic Versioning. As a first version, I think this document lays out a great plan for versioning software. One problem that I see is there is more than one great way to version software. X.Y.Z is good for software that you release to others, but for software like websites, X.Y.Z doesn’t work too well.

I’d like to propose another scheme (the name is tentative of course):

Website Semantic Version Specification

When moving a website to production, you must version it, so that you can either refer or rollback to a previous iteration. In order for everyone to be on the same page, I present not one, but two ways to version your website.

The first version is YYYYMMDDII, where YYYY is the four digit year, MM is the two digit month, DD, is the two digit day, and II is the two digit iteration. This allows for 100 unique iterations a day if you work that fast, and it also gives a general time when the website was released.

The second version is YYYYMMDDHHMM, where YYYY is the four digit year, MM is the two digit month, DD, is the two digit day. You also have HHMM which is the current time. The benefit of this method that you can see exactly when the website was released. A negative point in this case is that you will have to agree on the timezone beforehand, because it is always noon somewhere.

Posted in Smarticus Says.

Tagged with .


10 developer skills needed in 2010

  • 1. Being able to create lists

    Nothing says I know what I’m doing like creating a list of 10-25 items that are mostly bullshit.

  • 2. Arguing on the Internet

    It is sad stereotype. But arguing on the Internet is valid skill. And no one knows right like you do.

  • 3. Reading RSS feeds

    Why create stuff when you can read about stuff instead?

  • 4. Creating another useless project

    Of course we need another test framework in ruby. Get to hacking.

  • 5. Chest pounding about your favorite new programming language

    +++ +++ +++ +
    [
        > +++ +++ +
        > +++ +++ +++ +
        > +++
        > +
        < << < -
    ]
    >++ .
    >+.
    +++ +++ +.
    .
    +++ .
    >++ .
    < <+ +++ +++ +++ +++ ++.
    >.
    +++ .
    --- --- .
    --- --- --.
    >+.
    >.
    

    This is “Hello World” in BrainFuck, but you already knew that.

  • 6. Know how to create that next great social site

    Realtime collaboration of me showering in 2010. I know you can’t wait to create the next great mashup using my JSON API, Facebook and Twitter integration.

  • 7. Plan that great conference of just hallway tracks

    You and I both know this is where the real meat of the conference is. Why don’t we just cut to the chase?

  • 8. Pico

    Screw Vim, Textmate, or Emacs. If it is good enough for Pine, it should be good enough for you.

  • 9. Ego Surfing

    How long do you spend everyday searching for your name on Google? Work on cutting it down to half with twice the output.

  • 10. Ability to work more than 21 hours everyday

    Sleep is overrated. Imagine how may more lists you create if you slept less.

Posted in Smarticus Says.


Programmer vs Rap Star

In life, there are many parallels you can make. You can compare apples to oranges, rings on a tree to the complexities of your life, black to white, or the stages of child development to your seemingly hopeless career. One parallel that isn’t talked about enough is the surprising similarities between software developers and rap stars.

20080518043718!Rapper.png

Beef

Rap has had its fair share of beefs during the past 30 years including with Boogie Down Productions battling Marley Marl, LL Cool J trading jabs with Kool Moe Dee, Ice T and Cannibus, Biggie vs Tupac, Common vs Ice Cube, and 50 Cent taking on everyone he comes across.

In the software development world there have been many beefs. Our choices of text editors for one have created many drawn out and unneeded battles. We’ve had holy crusades over our preferred development languages. We’ve also have our wars between developers themselves with the competing Javascript proposals. There are even some silly people out there that think Windows is better than Linux. (go figure)

There are lessons that can be learned from our rap counterparts, and we should be wary of their results. Careers have been ended by just singing hooks on songs. Lives have also been lost. There is plenty of enough money, projects, and fame to go around. Anyone who is deserving can plant their stake in the ground and claim success with attacking or being attacked by someone else.

Bling Bling while drinking incredibly expensive champagne

Lots of people want to be superstars. In the rap world, it is customary to portray your self as a bigger than life version of your real persona. If you’ve sold a million records, it is expected that you have some exceedingly overpriced necklace that hangs down to your real jewels. People need to know you are coming, and gawk and stare, and point while you are there. Once you are gone, you must be talked about constantly. You don’t even need to be talented because that isn’t what’s important.

There are many programmers that enjoy and even expect the limelight. Perhaps they’ve written some great web framework, and expect to be noticed when they are at an event. Maybe they even think that an event really isn’t an event unless they there. Or even worse yet, maybe they think they are the event.

Looking good while doing nothing can only get you so far. How about some fries with my burger?

Slinging my rocks while wielding my glock

Gangster goes hand in hand with rap. Or so it seems. Someone has to be tougher than someone else. My block is tougher than your block, and my city is tougher than your city, and my coast is tougher than your coast. All we’ve proved with this over the past few years is that real people die, and real careers are made and killed. In reality it doesn’t matter because crappy rap doesn’t live in on particular place. It exists everywhere.

Believe it or not, there are some developers who think they have a little gangster in them. You know the type that rants on and on and on in their blogs about pretty much everything about nothing at all. This is actually a good thing. Diversity is good for programmer communities, and little controversy never hurt anyone who didn’t already have it coming to them.

It was so much better back in 1988

1989 was arguably the best year of Rap. So many great songs were released that year, that it will go down as the greatest year of rap ever.

Unfortunately in programming world, we have haven’t had a best year yet. Many great things were invented in the past that set us up for the position we are in right now. The problem is that all that old stuff is just that; old stuff. We need to move on and not get hung on things that were done. Everything may have been done, but everything hasn’t been done well yet. Keep scratching those itches, and pushing the bar a little more forward every day.

There will always be backpack rap

I’m a huge fan of backpack rap. Non mainstream rap is pretty much all I can stomach anymore. The great thing is that there is a place for both commercially motivated and underground rap. (not in my iTunes, but that is another topic for another time)

In programmer land, we need those people pushing those underground trends. Ruby was around for quite a few years before it became the extremely popular language it is today. We also need those folks who hack functional programming for fun, and logic programming while eating breakfast to keep on creating such cool stuff that most of us don’t understand.

You made it a hot line, I made it a hot song

Where would rap be without sampling? I’m a firm believer in sampling if everyone gets a cut of the riches. I love the familiarity of an old song embedded, cut, and mixed into a new song.

Developers do this all time. With open source, and all the social code collaboration sites out there, most likely the code you are looking for has been written, or is in the process of being written. Standing on the shoulders of the giants should be the law of the land. When you finish reading this, go fork some code, and send back some patches. Or don’t. It is all up to you.

Lessons Learned

Now, that we understand the similarities between rap and programming, what lessons can we learn?

  1. Always record more tracks.
  2. It doesn’t matter who wins. Its how you look while winning.
  3. Never get high off your own supply.
  4. If it isn’t fun, maybe you should go do something else.

Posted in Smarticus Says.

Tagged with .


The Motorola Droid almost a month in

So it has been almost a month, and the Motorola Droid reviews are starting to come in. The twitterverse has gotten a hold of a few reviews and unfortunately the prognosis is that the Droid sucks.

I’ve had a Droid since day one. I’m not going to review it in depth, because that has been done; over and over and over again.

I’m going to chime in with an alternative point of view. In my eyes, the Droid doesn’t suck. Actually it is pretty far from sucking. Let’s go over the features that I really like.

Multitasking

Yeah it does multitasks. I can read mail and receive tweets. I can add items to my calendar and read new SMS messages at the same time. I think other phones have set the bar pretty low for this. Being able to do more than one thing at a time should be a given, not the exception.

Verizon’s network

I was an AT&T/Cingular/Whatever customer for over 10 years. I can’t say that my phone service was terrible, but Verizon does seem to work in more places. I was in rural West Virginia over the weekend, and I was able to make and receive calls. Data didn’t work, but at least the phone wasn’t relegated to paper weight.

It’s different

The iPhone has grown very popular. I actually own all three models. Sometimes it is nice to have something that is a bit different. Especially when that different thing has merits of its own.

Now of course there are features which aren’t the greatest, but they aren’t stopping me from using the phone and liking it more and more every day.

The keyboard

Slide out keyboards on mobile phones are something like a holy war. Some folks love them, some folks swear against them. I really had no opinion for or against them. The first couple of days, the keyboard wasn’t too useful for me. Now I’ve learned how to type on it, I don’t find it too bad, but I still don’t use it all the time. I had a similar problem with the iPhone at first because its onscreen keyboard wasn’t intuitive to me until I got used to it.

The widgets

iPhone applications look better than Android apps. I’m sure this is because Apple takes pride in providing methods to create great looking apps. The Android apps aren’t exactly ugly, but I can see the argument that they are a step down from iPhone apps. Looks aside, I’ve found apps for all of my needs, and I don’t feel like I’ve had to compromise in any way. Looks are subjective and I’m sure everyone is going to have their own opinion.

The phone itself

I’m rough on my phones. I don’t like skins are holders or anything like that. My Droid feels a bit more sturdier than my iPhones of past, but the paint around the front bezel is starting to scratch off a bit. I’m sure this won’t be a big deal, because I’m sure I’ll only have this phone for less than another year.

Now, why did I switch to the Droid in the first place? Well the first reason I felt kind of boxed while in the Apple ecosystem. To use some of the greatest iPhone features, you have to have a subscription to MobileMe. You get most of these features free with Google. I’m sure that we’ll consider Google to be the great evil empire in the future, but for now, I don’t mind it too much.

Another reason I switched to the Droid was because of Google Voice. This don’t even work on the iPhone right now. I’m totally in love with the integration and truly enjoy having transcribed voicemails placed in my mail inbox.

Speaking of mail inboxes, Apple really has a crappy email app. For the past few years, Gmail has really grown on me, and having a truly mobile interface that works with multiple accounts simultaneously is big win. I’m sure most that have tried the Droid in the Verizon store weren’t even aware of this feature.

Another thing I like is choice. Yesterday I found out there is a multitouch browser for the Droid called Dolphin. I installed it with no fuss, and now i can pinch, pinch, pinch.

On the iPhone, you get access to Tweetie, which is arguably, the best Twitter client out there. I do miss the fact that I can’t get that on my phone, but I did find this app called Swift which works pretty damn well, and it will still check for tweets while I’m reading mail, chatting in Gtalk or doing something else.

So, I guess this gets down to, why am I writing this? The first reason is that I hate FUD. It doesn’t matter where it comes from. Other people can have other things that they like, and that is ok. The second reason is that I’m sure lots of you who are reading this would actually like the Droid. I just want folks to know that someone out there thinks his phone is hot, and can’t wait to see what comes in the future.

Posted in Smarticus Says.

Tagged with .


#pragprowrimo is here!

For years, I’ve been writing. I’ve written short stories, and tech guides for my jobs, and various random things for this blog. This month, I’m going to do something a little bit different; I’m going to participate in #pragprowrimo by writing a book. You’ll have to stay tuned to see what I come up with, but this is truly something I’ve been interested in for a while, and hope to give a good effort.

All feedback is welcomed of course. I’ll also welcome words of encouragement, and stories of anyone else I have inspired.

Posted in pragprowrimo.


#yerdoinitwrong episode 1: logging with syslog

We always give all of our best work to development. We create code we are proud to attach our name to, and then we throw it on production. When it gets to production, there are going to problems, and the first thing you are going to do is head to your logs. So why aren’t we taking more steps to have easier accessible logs?

Log management in Ruby on Rails isn’t very good out of the box. When your application starts getting any level of decent traffic, tailing the log isn’t very effective. Searching the log is even harder, and correlating data is pretty much out of the question. The good thing is that is pretty much a solved problem, so let’s review one potential solution.

With Ruby on Rails, you can easily swap our your logger. So instead of the instead of the standard Ruby logger, we’re going to swap in SyslogLogger gem from seattle.rb. Once you have either installed the gem or configured Ruby on Rails to install the gem, you can configure it in your environment.rb. (or one of your environment specific configuration files)

RAILS_DEFAULT_LOGGER = SyslogLogger.new
Rails::Initializer.run do |config|
  ...
  config.logger = RAILS_DEFAULT_LOGGER
end

Now Rails will send the logs to syslog. Next, you’ll want to configure syslog to send all your logs to a remote server we’ll talk about later

*.*	@remote.server

Make sure to restart your syslog server after making these changes.

Now why would we want to send out logs to a remote server? Because central log management is the bees knees of course.

When it comes to log management, nothing beats Splunk. Nothing. So that means we should send our logs to our Splunk server. The Splunk guides make configuring this easy, and their documentation is superb.

Now that you have Splunk configured, you should be receiving logs. The amount of options it gives you is absolutely breath taking, so I advise you to spend some time learning it.

Now if I’m doing it wrong let me know in the comments. Word.

Posted in yerdoinitwrong.

Tagged with , .