Archive

Posts Tagged ‘environment’

Buying a fuel-efficient used car versus a new Prius

April 28th, 2009

As one who drives a 2000 Honda Civic, which in many real-world driving tests gets almost exactly 30 MPG consistently (I keep pump logs), I wonder if I would actually create a net reduction in gas consumption by buying a Prius or other car. Now, I’m assuming a new Prius, but buying a used one is perfectly valid, and is outside the scope of this article. If you want to do that, more power to you – that’s a good choice hands down. Yet, most people I know would opt for a new one. Based on various seemingly valid estimates, it takes 113,322,000 BTUs to create and import a brand new Prius. It takes 0 BTUs to park a used Honda Civic on a lot until someone buys it.

So, for the data used to obtain this, I looked all over for real road tests of the Prius fuel economy.  This one seemed to fit well with everything else I’d been reading, giving an average range of 42.6-45.2 MPG.  So, I’m going to say 43 MPG.

The Prius uses enough gas to create 2639.53 BTUs per mile.  The Civic: 3783.33.  At these rates, and coupled with the initial component of the BTUs used to manufacture and import the Prius, we come up with the following:

2639.53x + 113322000 = 3783.33x

x = 99075.01

Graphing this in gnuplot, we get the following:

plotSo, one would have to drive almost 100,000 miles to get an advantage over simply buying a used Civic.  Interesting.  Here’s the GNUPlot Plot File for anyone that’s interested.


Uncategorized , , , , , , , , ,

DNS for bash

March 31st, 2008

Today, I decided I wanted a network service that propagated variables and aliases to every login shell that subscribed to it. This is dangerous on a large scale, but perfectly acceptable on my small home network where everyone trusts everyone else.

First, I got Camping installed, bringing back fond memories of Ruby development. I then copied off the blog example, and created TreeHugger, a 427 line script that provides a web interface to edit the variables, and a plain text output for the shells to source.

This script, when run, allows some simple MVC actions to an sqlite3 database.

Example Screenshot

As you can see, I have some aliases here I want to send to all the subscribing hosts. Eventually, I want to add some detection functionality to the database (mostly reverse DNS lookups for host rule referencing). I just have to access /out to get my desired output:


# Treehugger Configuration
# Aliases
alias ai='sudo apt-get install'
alias aup='sudo apt-get update'
alias aug='sudo apt-get upgrade'

# Environment Variables

Now, to get this into bash. I looked into making the date command spit out pretty unique timestamps. Turns out you can do this with the nanoseconds format:


$ date +%s%N
1206926780157462141

I made it so wget saves the treehugger config to a tempfile using the somewhat random seed above as a filename suffix, and then I have my shell source it:


FILENAME=/tmp/treehugger-`date +%s%N`; 2>/dev/null wget -O $FILENAME  http://rofl.who/treehugger/out && source $FILENAME && rm $FILENAME

And now I have nice aliases on my laptop served up from my desktop as fresh as the shell:


hank@davros:~$ alias
alias ai='sudo apt-get install'
alias aug='sudo apt-get upgrade'
alias aup='sudo apt-get update'
alias ls='ls --color=auto'


Uncategorized , , , , , , , ,

Killing Caps Lock

March 22nd, 2007

As seen here:


    Option  "XkbOptions"    "ctrl:nocaps"

Horray. Awesomeness. Changes the caps lock key to a control key in Linux via xorg.conf.


Uncategorized , , , ,