205lb Max Clean & Jerk

1RM Clean and Jerk: 205lb

Body weight: 167lb

5/16/10

  • Share/Bookmark

142lb Max Snatch

1RM Snatch: 142lb

Body weight: 167lb

3/25/10

  • Share/Bookmark

MicroMiser Beta is now Granola!

Last Thursday on Earth Day, we at MiserWare released Granola, the production version of what was originally the MicroMiser Beta. For those who haven’t heard, Granola is free software for the reduction of energy consumption of PCs and laptops, available for both Microsoft Windows and Linux. Without affecting the performance of the system, powering the system off, or adding any hardware, Granola reduces power consumption 10 – 35% on most systems. To put that in perspective, if everyone in the world installed Granola and saved only 10%, it would be the equivalent of taking 7 million cars off the road.

Granola for Microsoft Windows

Please download and install Granola. It only takes a minute, it’s totally free, and it will help all of us make a serious environmental impact. Also, in the near future, we will be adding community-oriented features that allow users to track the savings of all of their computers and the computers of their friends and family. Stay tuned.

http://grano.la/

  • Share/Bookmark

190lb Max Clean & Jerk

1RM Clean and Jerk: 190lb

Body weight: 167lb

4/19/10

  • Share/Bookmark

HTTPS Certificate Verification in Python With urllib2

Everyone loves Python. I particularly feel encased in Python’s womb-like warmth and comfort when I am trying to do client-side communication with web servers or web services. Most of the magicĀ  has already been accomplished by the time I type import urllib2 – super simple and clean interfaces that seem to go increasingly deep as you need them. Request a page with a single line, do a GET or POST request with two lines, modify headers as needed, do secure communication with SSL; all of these things are simple and elegant, adding complexity only when needed for more complex goals.

Recently, I found a hole in this seemingly infinitely deep well of value added by urllib2. While the module will happily do SSL-secured communication for you, it fails to provide any easy way to verify server certificates. This is a critical feature, especially when using web services. For instance, if I wanted to use a service to version-check files on my system with files on a central server, allowing me to download the updates as needed, communicating with an unverified server could be disastrous. After poking around a bit online, I still hadn’t found anything useful in the urllib2 interface to help me accomplish this, so I started opening up the library files themselves. My goal was to use SSL with cert verification while still leveraging urllib2 for all of my high-level interface needs.

It turns out that it isn’t very difficult at all, despite the fact that the interfaces are not such that it is as easy as it could be to extend the functionality in this way. The ssl module already includes certificate verification, although you must supply your own trusted root certificates. These are easy to find, as it is in the interest of the CAs like Verisign and Thawte to publish these (for instance, your browser already has copies that it uses for certificate verification). The question then is how does one supply the appropriate parameters to the ssl.wrap_socket(...) function?

The answer is in this case, by subclassing the httplib.HTTPSConnection class to pass in the appropriate data. Here is an example:

class VerifiedHTTPSConnection(httplib.HTTPSConnection):
    def connect(self):
        # overrides the version in httplib so that we do
        #    certificate verification
        sock = socket.create_connection((self.host, self.port),
                                        self.timeout)
        if self._tunnel_host:
            self.sock = sock
            self._tunnel()
        # wrap the socket using verification with the root
        #    certs in trusted_root_certs
        self.sock = ssl.wrap_socket(sock,
                                    self.key_file,
                                    self.cert_file,
                                    cert_reqs=ssl.CERT_REQUIRED,
                                    ca_certs="trusted_root_certs")

The key is the two extra parameters, cert_reqs and ca_certs, in the call to wrap_socket. For a more complete discussion of the meaning of these parameters, please refer to the documentation.

The next step is integrating our new connection in such a way that allows us to use it with urllib2. This is done by installing a non-default HTTPS handler, by first subclassing the urllib2.HTTPSHandler class, then installing it as a handler in an OpenerDirector object using the urllib2.build_opener(...) function. Here is the example subclass:

# wraps https connections with ssl certificate verification
class VerifiedHTTPSHandler(urllib2.HTTPSHandler):
    def __init__(self, connection_class = VerifiedHTTPSConnection):
        self.specialized_conn_class = connection_class
        urllib2.HTTPSHandler.__init__(self)

    def https_open(self, req):
        return self.do_open(self.specialized_conn_class, req)

As you can see, I have added the connection class as a parameter to the constructor. Because of the way the handler classes are used, it would require substantially more work to be able to pass in the value of the ca_certs parameter to wrap_socket. Instead, you can just create different subclasses for different root certificate sets. This would be useful if you had a development server with a self-signed certificate and a production server with a CA-signed certificate, as you could swap them out at runtime or delivery time using the parameter to the constructor above.

With this class, you can either create an OpenerDirector object, or you can install a handler into urllib2 itself for use in the urlopen(...) function. Here is how to create the opener and use it to open a secure site with certificate verification:

https_handler = VerifiedHTTPSHandler()
url_opener = urllib2.build_opener(https_handler)
handle = url_opener.open('https://www.example.com')
response = handle.readlines()
handle.close()

If the certificate for example.com is not signed by one of the trusted authority keys in the file trusted_root_certs (from the VerifiedHTTPSConnection class), then the call to url_opener.open(...) will raise a urllib2.URLError exception with some debugging-type information from the ssl module. Otherwise, urllib2 functions just as normal, albeit now communication with a trusted source.

  • Share/Bookmark

MiserWare MicroMiser and Your Computer (Part 1)

Since we at MiserWare released the MicroMiser Beta for Windows in mid-January, we have had a massive influx of new users eager to try out the software. I personally think that the value of MicroMiser is obvious and resonates well with people: free software that will save you energy with no noticeable impact in the performance of your system. Essentially, it offers energy savings for free, without affecting the user experience.

Since the release though we’ve had several questions about what kind of energy savings one can expect; as an extension, I think people are interested in the actual technology that allows us to save energy without affecting performance. The underlying magic is a technology called dynamic voltage and frequency scaling or DVFS. It allows software running on a computer to lower the power of the CPU without turning the system off.

A good analog is a dimmer switch on your dining room light. When you are writing a letter at the table, you need the full light to be able to see your work, but when you are relaxing with a glass of wine after dinner, you don’t need the brightest available light. You turn down the dimmer to save energy (well, maybe not JUST to save energy) while you are relaxing.

DVFS works in a similar way. When your computer is working hard – for instance, when you are playing a game – the CPU needs to be at full speed so that it can work effectively. When your computer is “relaxing” – for instance, when you are browsing a web site – your CPU can “dim” itself by slowing down execution without you noticing. In the lower state, the CPU consumes less energy, thus making your computer more efficient. If you wanted to, you could switch between the “bright” and “dim” modes yourself to match your usage. In order to get the most efficient use of power in your computer system though, you would need to switch DVFS modes every time you changed your usage.

That is where MiserWare software comes in. Using sophisticated workload modeling and prediction algorithms, MicroMiser can determine when your computer is working and the CPU needs to be “bright” and when your computer is relaxing and the CPU can be “dim” without affecting your work. This allows MicroMiser to automatically change DVFS modes to save energy when you can while still running at full speed when you need it.

As you might guess, the difference between the states and by extension the savings you can experience with MicroMiser varies from system to system. On some test systems we have at MiserWare, we have seen system savings upwards of 40% in the lowest state, with average savings of 10%-30% depending on workload. In the next post, I’ll take a look at what variables appear in the formula for producing your savings, and how you can estimate them to see the range of your possible savings.

  • Share/Bookmark

How Facebook relationship status affects life outlook

Although I wouldn’t call the study rigorous, the Facebook Data Team has done an interesting analysis of the positivity and negativity of the status updates of English speaking people given their relationship status. In particular, arguably unsurprisingly, people who are listed as “In a Relationship” or “Married” have a substantially more positive outlook than those who aren’t. A bit more strikingly, people listed in open relationships are massively negative relative to all other groups, including “Single”. I guess all those philanderers I knew in college weren’t as happy as they seemed.

via

  • Share/Bookmark

Girl Scout cookies and nutrition

Recently in our basement-made-office we have experienced an influx in Girl Scout cookies, as the girls upstairs are all girl scouts, and our company was goodly enough to purchase some from them. Yesterday, one of my co-workers who is by all accounts in fantastic shape generally was lamenting his lack of restraint in eating a box and a half of the ironically named Caramel De Lites, formerly Samoas. These bits of chocolate, caramel, shortbread, and coconut are quite tasty and come in a box with 16 of the treats. After hearing my Jon complain about eating them, we took a look at the back of the box.

A serving size of 2 cookies (1/8th of a box) contains 140 calories, 13g of sugar, 7g of fat, with 6g of saturated fat; all told, Jon had just eaten 1680 calories, 156g of sugar, and 348% of his daily intake of saturated fat. By comparison, you would need to eat 5.6 McDonald’s cheeseburgers to get the calories, 3.55 Hot Carmel Sundaes for the sugar, and a whopping (no pun intended) 20.57 Large Fries to get the saturated fat.

Isn’t a bit odd that in a country with epidemic-level obesity we are sending out our daughters peddling foods like this? What sort of lesson are we teaching children by giving them a quota of junk food to sell? While I think that sending the girls out into the neighborhood to talk to their community and try and raise money is commendable (although it is arguable that much of this goes on anymore), wouldn’t they get the same benefits from going out and directly raising money for their organization? The net profit on a box of cookies that goes for $3.50 is around 50-60 cents; is it really that much easier to sell 10 boxes of cookies than to solicit a $5 donation?

  • Share/Bookmark

Learning Spanish

I recently saw a “friend” of mine (in the Facebook sense..there really should be a better word) join a group called “Why do WE have to learn spanish cause MEXICANS are in AMERICA ?!?!”. I pointed out that this was one of the most ridiculous things I had heard in a long time, not only because of the obvious neo-conservative, xenophobic undertones, and not only because of the complete lack of causal link between the foreign language requirement in schools and immegration, but also because in my experience learning a foreign language is an enriching and valuable experience.

I realized though, that saying that didn’t prove anything, so I searched a bit and found this link that not only extolls the benefits of learning a second language, but goes so far as to cite the research that was the basis for the findings. Very well put together, and very informative. It makes me want to actually pick up some tapes and learn Spanish.

  • Share/Bookmark

MiserWare MicroMiser Beta is now available for Windows

This morning my company MiserWare released the latest beta version of our personal energy-saving software, MicroMiser. MicroMiser is a cutting-edge application that can save up to 35% system energy with no noticeable performance impact. With this version, MicroMiser now has support for Microsoft Windows, in addition to Linux. Additionally, we are reopening the referral incentive program, allowing MicroMiser users to earn points for referring their friends and submitting machine information. Please consider trying out the beta and let us know your thoughts on the software. Click here to sign up for the MiserWare MicroMiser beta.

  • Share/Bookmark