May 17, 2012

Manic Innovation Challenge(Feb) : UBER Twitter Stats

Continuing my pursuit of the Manic Innovation Challenge I am proud to release my newest *dumb* idea: UBER Twitter Stats!

NEW UPDATE – Based on some tips (thanks: Brian Katz @bmkatz) some of the details haved changed below to make UBER Twitter Stats work a little easier. The same old command style still works. But the newer one is much easier.

animalWritten in 100% Ruby and running in the cloud, UBER Twitter allows you to ask me (technically my cloud-like proxy @myubertwit) for interesting recent stats about your Twitter account. It is really quite simple.

Send a tweet to my app account (@myubertwit) with the text: “<command>”. With the command being one of the following:

  1. My Word Count – Will reply with the top 20 words you used recently. This automatically strips out very common words. Shortcut: ‘mwc’
  2. Mention Word Count – This will reply with the same as the above but for tweets that mention or are to you. Shortct: ‘mmwc’
  3. Who I Mention – This will list the top 20 people you talk to or mention in your recent tweets. Shortcut: ‘wim’
  4. Who Mentions Me – This will reply back with the top 20 people who have mentioned you the most lately. Shortcut: ‘wmm’

If you get stuck just send @myubertwit ’help’ to get the instructions back in a tweet.

Depending on timing response may take up to a minute. Also, 90% of this work was written while I was chilling in a cigar bar with some friends. So while I do have *some* error handling, it ain’t much Smile. It should handle Twitter API limits and does a decent job of trying to iterate and gather as many tweets as possible. For some high volume users (Like @Beaker) it gets pretty close to a 1,000 tweets per request to analyze.

I WILL be releasing the source for this soon. I have to strip out some private stuff first. And this week I will be attending VMware Partner Exchange, Cloud Connect, and one other event along with a ton of meetings. Which means it might be a week or two before I have time to post to Github for everyone.

Feedback is king – let me know if you like it or if you have any good ideas to add!

.nick

The late recap post : AKA Top 7 things I learned in 2011

2011 was a banner year for me in accomplishing great things and learning new lessons. To recap my 2011 I thought I would share:

 

 Top 7 Things I Learned in 2011

 

1. I must be doing something right

This is the obligatory stats part of my list. Comparing 2011 to 2010 I doubled my visits, unique visitors, and pageviews. Time on site went up about 33% per visit which may just be because I cleaned up the look and made it easier to find stuff. The most interesting thing is my traffic has been much higher in the last half of this year. It is yet to be seen if I can keep this up in 2012. [Read more...]

Proving a another guy’s point : MacBook Air & Node.js as a Webserver

Ok, this is a real quick example of someone else’s idea. Namely Christofer Hoff of Juniper (infamous blog & twitter account) who in response to my tweet about my MacBook and a webserver (I am a Mac-newbie). Suggested I try using Node.js.

beaker_being_beaker

At first I was a little taken back. I think @Beaker thought I didn’t get the point (and I don’t more than I do).

beaker_being_beaker2

So I *cheated* and just turned on Web Sharing with the good tips from my other twitter buddies. But the Node.js idea bugged me because technically Chris is right. It should work fine.

So I did it. I installed the Node.js package for OSX (been using the Linux version) and fired up TextEdit and wrote this simple bit of code:

var http = require('http');
var fs = require('fs');
var path = require('path');
var rootpath = "/Users/lynxbat/Webroot";
 
console.log('*Starting');
http.createServer(function (request, response) {
 console.log('Server started');
 var pathToFile = rootpath + request.url;
 console.log ('File was requested: ' + pathToFile);
 path.exists(pathToFile, function(exists) {
 if (exists) {
  fs.readFile(pathToFile, function(error, content) {
   if (error) {
    response.writeHead(500);
    response.end();
   } else {
    response.writeHead(200, { 'Content-Type': 'application/x-gzip' });
    response.end(content);
   }});
   } else {
     response.writeHead(404);
     response.end();
   }});
}).listen(8010);
console.log('Server running at http://127.0.0.1:8010/');

I fired up the server:

node webserver.js

And opened my Safari browser to request a file I had dropped in my root directory.

Screen Shot 2011-12-19 at 4.18.55 PM

Which works perfectly. Output on cli:

*Starting
Server running at http://127.0.0.1:8010/
Server started
File was requested: /Users/lynxbat/Webroot/node-v0.6.6.pkg

Now in my case I am using the Webserver to hand out packages for installing as a local mirror for some VM’s I am building (big demo for Jan). So I hardcoded the MIME type and left response encoding unset. If you were looking to properly serve you should perhaps add some logic for switching types and responses based on the file extension. Kind of like a proper web server works.

So Chris was right. This works. Though I think proving him right probably isn’t a good habit to pick up.

.nick

IT, Silos, Cloud, & You : What do you want to be when Cloud grows up?

Senior Developers, Network Admins, Virtualization Architect, Security folks, and more – in the world of skilled labor in IT there sometimes seem to be more common boxes we like to place people in than most other fields. These boxes exist partly due to the fact that the CFO/HR/recruiting folks need nicely written job descriptions to map resources and maybe a little bit because of how people assume these position – through the fires of a limited education systems and bootstrap-yanking from the bottom. square_peg_in_round_hole_2Regardless of why, we organize skilled people into buckets in much the same way everyone else is world is either an accountant, attorney, marketing expert, business analyst, or any specialty therein.

[Read more...]

Now for something completely different : Ubuntu 11.10, KVM, & VLAN trunking

Sometimes the path to learn something means using very different tools along the way. In my case, I have been learning more on the developing virtual network world along with some of the new DevOps toolsets popping up.

As part of this I have started using KVM as a hypervisor on an Ubuntu 11.10 platform in a portion of my home lab. I have learned quickly that getting something simple done in vSphere can be a bit of a chore in the KVM world. But on the flipside, KVM has been a fun learning experience in understanding virtualization in a more raw format.

One of these challenges I have decided to share is a simple one. I was wanting to play with the Dell-created DevOps deployment tool: Crowbar. Crowbar is an wrapper for OpsCode Chef Server. While a pretty slick little utility to research in the cloud deployment and automation space; one glaring problem is it is designed to run on Dell PowerEdge servers. Since I don’t have PowerEdge servers lying around anymore I needed to run this in a virtual machine. This in itself isn’t a huge problem as a virtual machine can pretty much match most of the logical hardware pieces needed. But, the one problem I ran into was that Crowbar out of the box likes to have a couple interfaces with the ability to tag VLANs itself. In a bare-metal world connecting 802.1q trunk ports to a server is pretty common. And even in the VMware vSphere world you can create trunk portgroups for a guest VM using documented methods(See VGT). But the problem I ran into is how do I pass a trunk port through in KVM/QEMU when using the default bridge-utils setup (not using ovswitch in this case)? [Read more...]