/images/avatar.png

Connecting to a Cisco VPN with OpenConnect on a Chromebook without Crouton

I have been looking at a Toshiba Chromebook 2 with Full HD screen for the last few months. The $300 price tag, my dying home laptop, and the good reviews convinced me to finally take the plunge and purchase it as a laptop for home use.

If you, like myself, have a Cisco VPN at work, you might find out that you can’t connect the Chromebook to your VPN. From what our network engineer found out it’s basically just some XAUTH mismatch. If you don’t know what that is, the basic take away is - you can’t connect without having additional software, OpenConnect. But how to run it in a Chromebook?

Premature optimization

In my many years as a software developer, this is one phrase which I have heard over and over:

“Don’t optimize your software prematurely.”

I have no idea where the phrase came from. I know that most software is shit because people don’t know any better. And generalities like this encourage people to write bad software. I will try to list a few things that I think make up a good developer culture.

PHP Comparisons

If there is something every developer (not just PHP) should know, it’s when to use a strict equality operator. Interestingly enough, using empty() in PHP has exact behavior as checking loose equality with == false. This whole thing was inspired (and partially ripped off of) the JavaScript Equality Table. The design caught my eye, more than anything. I’m kinda wishing most if not all languages would have this kind of basic reference. In fact, I find it to be a very useful way to document operators. I’m always kicking myself in the head when I go read some lua code which doesn’t use “!=”, but uses “=”, and then there’s other software where the ‘’ character doesn’t mean negation but regular expression (perl =~, nginx regex locations). It’s the little things. I think that CS knowledge is transferable from one language to the next. If you learn Java or PHP or any other arbitrary languages, you are not locked in to that language - you might have difficulty migrating to C# or LUA or Python, but you can take your logic with you. Your code might not be at the same high standard as your primary language, but it’s function will be.

Outperforming MySQL by hand

There is this SQL table, right? This is the part where you knowingly nod and prepare yourself for a long story about how a database is as good as the person designing it. Let’s call this table an access log. For the sake of argument, let’s also say it’s 30GB in size, has a 100 million rows, and only has an auto_increment PK ID field. Your task is, should you choose to accept it, to retrieve the last hour of entries in this log table.

So far there is a distinct lack of snakes

In the dashboard which I hacked together at MMC RTV Slovenia, I display a set of related flickr searches based on the current state of the system. So far, there’s a distinct lack of snakes, volcanoes, lava, fire, explosions and other things that might freak an engineer out as much as a server outage. Thoughts: I like how the hosts are clearly marked when one of their metrics goes over a threshold. The CPU based hosts are on the left two columns, network is in the third, server load in the fourth. The right columns (disk and swap usage) are descriptive but only for a daily report, not so much for a live dashboard. I can clearly see the marked hosts across the room, even if I would miss the background. Some metrics, especially API latency, really need to find their way onto the dashboard, replacing about half the indicators on it currently. I would really like to graph this in near real time (<5s), meaning some kind of partial updates, to graph this in 60 seconds and 5 minute intervals. I’m feeding the data from Ganglia, which is about as real time as data comes from. The obvious issues are clearly visible on the dashboard, which is the point. Ganglia’s web front end, even if updated frequently, is only useful for short term historical data. Since I have the host/cluster data, a few selected graphs can be easily viewed by clicking on a specific hosts indicator. From a design standpoint… it’s average. It’s half ubiquitous, and that’s the half I like. I should tweak the black border color to match the detected state, or maybe make the whole thing more “widget” like. Pay attention to spacing between indicators, readability of fonts,… Tweaking it, basically. I like it. I need to test it on an iPad. - Tit Petric

Flickr API

I’m currently applying for a Flickr API key, and this is what I put into the description for “HQ Dashboard”:

“I’m building a monitoring dashboard which includes statistics data from internal sources, some tweets and, hopefully, an assortment of Flickr backgrounds based on current monitoring conditions (ie., search for fire/destruction/storm/tornado when servers are being overloaded, and grass/meadows/happy/coffee if the monitoring says everything is fine). In this way I plan to use the Flickr search to provide a visual representation of the severity level currently being experienced.”