SansCourier

Who needs Messengers or Serifs?

Programming Is an Art

Computer programming is an art, because it applies accumulated knowledge to the world, because it requires skill and ingenuity, and especially because it produces objects of beauty.

– Knuth

Winning Is Not a Sometime Thing

“Winning is not a sometime thing; it’s an all the time thing. You don’t win once in a while; you don’t do things right once in a while; you do them right all the time. Winning is a habit. Unfortunately, so is losing.”

Vince Lombardi

You Are

You are what you prove yourself to be capable of.

Here’s to the Craziest One.

This video is probably one of the most important reasons why I am, an Engineer, a creator, a dreamer.

Every year on the first day of the semester, one of my college teachers used to put this video for all the EE freshmen, I think he still does it, and though back then I thought it was a little bit cheesy; many years later, after working in so many diverse environment I look back and know he’s right.

We must Think Different.

Here’s to you Steve. 

Gumption

I like the word “gumption” because it’s so homely and so forlorn and so out of style it looks as if it needs a friend and isn’t likely to reject anyone who comes along. It’s an old Scottish word, once used a lot by pioneers, but which, like “kin,” seems to have all but dropped out of use. I like it also because it describes exactly what happens to someone who connects with Quality. He gets filled with gumption.

A person filled with gumption doesn’t sit around dissipating and stewing about things. He’s at the front of the train of his own awareness, watching to see what’s up the track and meeting it when it comes. That’s gumption.

Zen And The Art Of Motorcycle Maintenance

What the What Are SSH Fingerprint Randomarts and Why Should I Care?

You probably have seen this somewhere while playing with open ssh. This are called Randomart

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Generating public/private rsa key pair.
    The key fingerprint is:
    05:1e:1e:c1:ac:b9:d1:1c:6a:60:ce:0f:77:6c:78:47 you@i
    The key's randomart image is:
    +--[ RSA 2048]----+
    |       o=.       |
    |    o  o++E      |
    |   + . Ooo.      |
    |    + O B..      |
    |     = *S.       |
    |      o          |
    |                 |
    |                 |
    |                 |
    +-----------------+

    Generating public/private dsa key pair.
    The key fingerprint is:
    b6:dd:b7:1f:bc:25:31:d3:12:f4:92:1c:0b:93:5f:4b you@i
    The key's randomart image is:
    +--[ DSA 1024]----+
    |            o.o  |
    |            .= E.|
    |             .B.o|
    |              .= |
    |        S     = .|
    |       . o .  .= |
    |        . . . oo.|
    |             . o+|
    |              .o.|
    +-----------------+

“Images” taken from What is randomart?

So why is this interesting to us? Well lets suppose you have a long list of keys… Yeah just like the one at your servers ~/.ssh/known_hosts/ and you want to visualy check if you have a duplicate one

try this:

1
$ssh-keygen -lv -f ~/.ssh/known_hosts | less

Look both gist.github and github have the same key…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 gist.github.com,207.97.227.243 (RSA)
+--[ RSA 2048]----+
|        .        |
|       + .       |
|      . B .      |
|     o * +       |
|    X * S        |
|   + O o . .     |
|    .   E . o    |
|       . . o     |
|        . .      |
+-----------------+
2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 github.com,207.97.227.239 (RSA)
+--[ RSA 2048]----+
|        .        |
|       + .       |
|      . B .      |
|     o * +       |
|    X * S        |
|   + O o . .     |
|    .   E . o    |
|       . . o     |
|        . .      |
+-----------------+

try figuring that out without using the randomart

1
2
3
4
2048 1b:b8:c2:f4:7b:b5:44:be:fa:64:d6:eb:e6:2f:b8:fa 192.168.1.84 (RSA)
2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 gist.github.com,207.97.227.243 (RSA)
2048 a2:95:9a:aa:0a:3e:17:f4:ac:96:5b:13:3b:c8:0a:7c 192.168.2.17 (RSA)
2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 github.com,207.97.227.239 (RSA)

Also if you add this to your ~/.ssh/config:

1
VisualHostKey yes

Or add this option to your ssh command

1
$ssh -o VisualHostKey=yes your.host.name

you will see your servers randomart each time you login (handy to ensure you are deploying to the right server, hehe).

You can thank me later (or this guys). Or you know what, better give them a beer, they have earned it.

Vim Superpowers

Writing code with Vim is like playing the piano, when used by a beginner it looks like a nice toy to keep yourself entertained, but when used by a professional, you know this is one of the few instruments that allows you to write whole Symphonies.

This is your keyboard now

Yann espositos Vim guide is a great guide for those who want to tune their fingers and start writing awesome code. Worth a read or two.

Nathan says Vim tastes like Unix I agree.

And you could always learn the Seven Habits of Effective text editing

Wondering about git plugins and stuff? Try Janus

And don’t worry, no one completely groks vim

About you Emacs… Yeah I saw you in that movie but don’t worry, we’ll see each other in the sequel.

Meta: How to Setup a Rockstar Approved Box

Are you till using a PHP blog under apache as if it were still in 1998? Do you need an awesome C10k Approved host that can also host Python / Rails and any other framework you might need?

Follow this guide to setup a Rockstar production server that will make you look like one (Step two after getting a cool domain name to become a rockstar dev).

Grow up and break with your cheap hosting

Your cheap PHP hosting company is actually not so cheap, you can get a full linux box for the same amount of money, plus you can configure it to be a lean, mean, bit serving machine, that can withstand any Slashdot effect. (Reddit effect for you youngsters)

Some awesome providers: Slicehost Amazon EC2 Linode Heroku Joyent Google App Engine

Install Nginx

After installing a vanilla Ubuntu:

1
$ sudo apt-get install nginx

Setup Nginx

Edit /etc/nginx/sites-enabled/sanscourier.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
server {
          listen   80;
          server_name  sanscourier.com www.sanscourier.com;

          access_log  /var/log/access.log;

          location / {
                  root   ~/sanscourier;
                  index  index.html index.htm;
          }
          # redirect server error pages to the static page /50x.html

          error_page  404  /404.html;
          location = /404.html {
                  root   ~/sanscourier.com;
          }
          error_page  500 502 503 504  /50x.html;
          location = /50x.html {
                  root   ~/sanscourier.com;
          }
  }

Setup Octopress

Before the only reason to use a PHP blog was twofold: 1. To have your posts “safely” stored in a database. 2. So your readers can comment on your posts.

But as any old school sysadmin can tell you, scaling this setup starts easily and then becomes a big, boring chore involving CDNs, caches and other dirty tricks.

Octopress deals with this in an elegant manner: 1. Use a secure Git repo to store our posts. 2. Use disqus for commenting.

And lets face it, static websites make you look cool.

Setup rvm

In your server (or linux box or Mac running homebrew) (Why RVM? for the same reason we use Python’s virtualenvs, don’t dump where you eat, oh and yes you don’t need XCode nowadays.

1
2
3
4
5
6
7
8
9
10
11
12
13
$bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
  $rvm list known #(choose the latest one in the MRI list)
  $rvm install 1.9.3
  $rvm use 1.9.3

  $mkdir my_octopress_site
  $cd my_octopress_site
  $git init
  $git remote add octopress git://github.com/imathis/octopress.git
  $git pull octopress master
  $git remote add origin your/repository/url
  $git push origin master
>

Setup octopress

Why Ruby? Because rubyists are rockstars thats why. (Actually I’m mostly a Python guy, but who cares anyway? I was using HP before! so go and try the right tool for the job).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$mkdir my_octopress_site
  $cd my_octopress_site
  $git init
  $git remote add octopress git://github.com/imathis/octopress.git
  $git pull octopress master
  $git remote add origin your/repository/url
  $git push origin master
  $rvm rvmrc trust
  $rvm reload
  $gem install bundler
  $gem install rake
  $bundle install
  $rake install
  $git add .
  $git commit -m 'Installed Octopress theme'
  $git push

Write something and deploy it.

You shoulb probaly read this instead. But here’s a quick intro:

1
2
3
4
5
$rake new_post["whatever"]
Creating new post: source/_posts/[blah].markdown
  $vim source/_posts/[blah].markdown #or emacs you berkeley hippie
  $rake generate
  $rake deploy

Don’t forget to deploy to your ~/sanscourier.com/ folder or some other safe place.

Meet Gunicorn

Did you know you can have a production ready server for Django in four simple steps? Please thank Eric Holscher for the tip

  • Install django in a virtualenv
1
2
3
4
5
6
$easy_install virtualenv
  $virtualenv env/
  $. env/bin/activate
  $python easy_install pip
  $python pip install django
  $ython pip install gunicorn
  • Add ‘gunicorn’ to your installed apps
  • ./manage.py run_gunicorn -w 3 -/etc/gunicorn.conf.py
1
2
3
4
5
logfile = "/var/log/gunicorn.log"
  bind = "127.0.0.1:1337"
  workers = 3
  proc_name = "Django Revel"
  worker_class = "eventlet"

And make nginx forward traffic to it

1
2
3
4
5
6
7
8
9
server {
          listen 80;
          server_name  example.com;
          access_log  /var/log/nginx/example.log;

          location / {
                  proxy_pass   http://127.0.0.1:1337;
          }
  }

Buzz Isn’t Wave in Disguise but an Open Social Experiment (and What Makes It Tick)

As expected Google has done it again, they’ve released a nice new tool and now everyone is talking about it. And that’s great, but the problem is that like just like it happened with Google Wave few people understand its Technology and why it was created.

Google Wave was Created to Modernize Email just as easy as that. Google Engineers thought email was slow so they used an instant messaging protocol called XMPP that allows you to have your own private Google Talk and wrapped some “Cool but no one understand” features like video embedding, instant polls and similar.

Why Google did this? Easy they want to become a platform where all online collaboration is done, did it work, not so much mainly of UX errors.

Now, what about Buzz?

Well Buzz is based on a publishing protocol called PubSubHubBub (and that’s why you don’t let engineers come with snappy names) created for a single task, getting blog posts out is slow and boring.

First you put a post on your blog and then your subscribed users read the small version in their RSS feeds and if they want to talk about it they click on the page, go to the section and so and so. Its Boring.

The main reason its boring is that the users have to go and fetch the RSS Feed any given time, and the truth it would be quite nicer if it worked like the Push Messaging in cellphones, it notifies you only each time there is something new.

So PSHBB servers do exactly that, and with the nice feature that it can get synchronized among many servers, freeing the developer the hassle of scaling and similar chores.

So here Google is trying to be that, the center hub where all action takes place and it looks good. Specially because they decided to be disruptive they decided that your network, your friends are yours and not property of some evil corporation (if being disruptive isn’t) and they made this by using OpenSocial and other Open Data standards.

What does this mean to us users? It means that we don’t have to add our friends to Facebook to play Raise a pet/alien/farm, if they have Gmail they already can.

What does this mean to Google? That they now have this platform for OpenSocial apps, location based apps (yes, Google latitude was just like Wave, a cool tech without use) and personal publishing.

And where does this leave Twitter and Facebook? Well Twitter has a good established brand and lots of loyal customers (plus also many apps like foursquare, formspring and others) but just like Facebook everything comes down to privacy.

For users Twitter is like a bar (or starbucks), Facebook is, well a face book of your buddies and your blog is your support group where does Google Buzz fit here?

Can it be a single destination where all this activities happen? Not sure.

But one thing I’m sure, this isn’t wave, this is not another try to kill email, this is a try to change social media.