Another set of PHP scripts written for myself that others may be able to take advantage of.
From the README introduction:
This is a PHP class to hopefully make writing PHP applications to consume “The Energy Detective” (TED) API a little easier.
Another set of PHP scripts written for myself that others may be able to take advantage of.
From the README introduction:
This is a PHP class to hopefully make writing PHP applications to consume “The Energy Detective” (TED) API a little easier.
I have received a few requests over the past couple of weeks for the smoothie recipe that I use. To give credit where credit is due, I got the recipe from my coworker, Mike. Here’s how I (we) do it. The only tools required are a drinking glass (preferably a large “sports cup” size like you get at sporting events or extra large drinks at fast food restaurants) and a decent blender.
Ingredients
Directions
It may not be to your liking at first, but it’s easy to experiment around to taste. Sometimes too much milk can make the smoothie a little too creamy. You can also substitute an avocado for a banana. It will make the smoothie a little less sweet, but don’t add any extra sugar because you probably still will not need it. Mike also likes to throw in some vegetables like spinach and carrots. I personally don’t care for what they do to the texture. The taste is fine, but the texture seems to come out a little chalky.
Enjoy!
It’s really nothing too special other than it’s handy (for me at least), and my first public project on GitHub. However, if you use Tarsnap and love to use stats and/or are excruciatingly paranoid about running out of money on your balance, you may find it useful. More details at my Tarsnap Monitor page and on the GitHub project page.
Last year, LifeHacker put up an article on how to cut glass bottles with a bottle cutter I bought on eBay. I have also made a few “DIY Mood-Lighting Wine Bottles” as well. Amy then had an idea to combine the all those ideas into a solar mood-lighting bottle that could sit on a window sill to charge throughout the day and glow at night. After a recent party, I got my hands on a small Hennessy bottle to give it a shot. Here’s what I did.
** USE COMMON SENSE AND ANY REASONABLE SAFETY PRECAUTIONS (GLOVES, GOGGLES, ETC) BEFORE ATTEMPTING THIS. I AM NOT RESPONSIBLE IF YOU HURT YOURSELF. THE ONLY PERSON RESPONSIBLE FOR YOU IS YOU. **
Step 0 – Find the path light and bottle
I can’t help you much here. I can tell you that I found the path lights at Lowe’s in the outdoor lighting aisle on a display in the aisle and not actually on the shelf. They’re very similar to the ones used in the sun jars except that this year’s model has a smaller solar panel and seemingly better battery life. Also, you are on your own for the bottle. I’m no expert on bottle cutting, but you can check the links in the opening paragraph to do it yourself or acquire one by other means. For the record, it’s not easy cutting a liquor bottle. They are usually not perfectly round and have seams in the glass that makes the glass crack all over. Fortunately I was able to use the bottle despite all the extra cracks in it. There are also some bottles that have a wide enough neck to allow you to drop the battery and board into the bottle. You’ll then probably want to drill a hole in the glass and run wires through so that you can leave the solar panel outside the bottle (maybe glued onto the back). This may also improve solar reception.
Step 3 – Remove the solar panel
Step 4 – Remove some more screws
Step 5 – Cutting away the housing
Step 6 – Trim the battery housing
Step 8 – (Optional) Extra hacking
It took a month or two for it to come in the mail, but we finally received our free energy conservation kit from TVA. All I did was do an online energy audit. It’s tough to beat free (as in beer) unless you really count the 15 minutes spent as money. It’s like a sampler kit of some energy efficient goodies. From the thank you card:
We appreciate your time and effort to complete the energy right® do-it-yourself home energy audit. To help you get started, please find an energy efficiency kit with tools to help build on the information included in your personalized audit report. Using all the contents of the energy efficiency kit could help provide a savings ranging from $2 to $4 on monthly power bills, depending on individual energy use. Following all of the recommendations from the personalized energy audit report could save as much as 20 percent on annual utility bills.
In this kit you will find a comprehensive “How to Save” brochure, two compact fluorescent light bulbs which use 75 percent less electricity and last 10 times longer than traditional light bulbs, as well as:
- Filter Whistle that sounds when the heating or cooling system filter is 80 percent clogged and needs to be changed
- Outlet and Light Switch Gaskets — insulation to help stop drafts and save energy
- Faucet Aerators (two) — water-saving filters that improve efficiency
- Hot Water Temperature Card that measures temperature of hot tap water and indicates if thermostat adjustment is needed to save money and prevent water scalds
- Energy Use Thermometer Gauge that helps check energy costs for heating and cooling; Each degree thermostats are set back eight hours a day can reduce heating bills by as much as 3 percent, and up to 5 percent on cooling bills.
Please feel free to help spread the word with family and friends about the home energy audit to help them start saving energy and money on power bills.
Once again, thank you. If you have any questions or would like more information on how to save energy, contact your local power company or visit www.energyright.com.
So, take a few minutes out of your day (maybe during an afternoon thunderstorm) and do the free online energy audit.
I know. It sounds like an advertisement. It basically is, but it’s free stuff, so you aren’t out any money. It’s also stuff that, in theory, will actually save you money in the long run!
Just wanted to put all this out there so that hopefully other people can find it. I’ll need this again as a reference for when I set up my wife’s laptop as well! Please note that anything documented here is how it worked for me on my laptop. If you have issues, look for any notes below. If you can’t find an answer, check Google. As a last-ditch effort, you can comment here, but I don’t know if I will have an answer or not. Oh, and each line in the fancy code blocks below starts with #. That way it will hopefully make it easier to read if something is word-wrapped. I forgot I had a GeSHi plug-in installed. Ignore the strikethrough stuff.
First off, get VirtualBox. As of the time of this post, the current version is 3.2.4. Install it per the instructions. The easy part is done!
Now, open Terminal. You will need to make the Bootcamp partition accessible to VirtualBox. Run the following command:
sudo chmod a+rw /dev/disk0s3
Next, we’ll need to build a VirtualBox vmdk image:
1 2 | cd /path/to/wherever/you/want/to/keep/files sudo VBoxManage internalcommands createrawvmdk -rawdisk /dev/disk0 -filename bootcamp.vmdk -partitions 3 |
And, finally, make the vmdk file accessible:
sudo chmod a+rw /path/to/bootcamp.vmdk
But, don’t get too excited yet. You’ll lose that whole “chmod a+rw” if you reboot. You can build an AppleScript that will do all that fancy stuff and then launch VirtualBox. Go ahead and start the AppleScript Editor and use the following code (replacing your_password_here with your password–it’s compiled, so I think it’s fairly safe):
1 2 3 | do shell script "chmod a+rw /dev/disk0s3" password "your_password_here" with administrator privileges do shell script "chmod a+rw /path/to/your/vmdks/*.vmdk" password "your_password_here" with administrator privileges do shell script "open -a VirtualBox" |
Save the AppleScript as an application. I named mine “VirtualBootcampBox”. If you want to give it an icon, you can download the applet.icns (icon borrowed from here) and copy it to the Contents/Resources directory of the application you created with AppleScript.
That should do it. Open the application that you created with AppleScript and point your new VirtualBox machine to the vmdk you created and have fun!
Wow. What a subject line! It’s a little technical magic, but fairly easy to do. I won’t cover installing Cacti or the SNMP daemon. There are plenty of guides for those. However, guides for creating and using the reverse SSH tunnel automagically are a little scattered, so I decided to document it for myself. This is all using Ubuntu 10.04 LTS server with Cacti 0.8.7e. I use daemontools to help keep the SSH tunnels up. Any references to “local” means the server that initiates the reverse SSH tunnel (usually behind a firewall). References to “remote” are the server running Cacti that can’t reach the “local” server(s) behind a firewall.
[UPDATE] I figured out how to do it for Windows! I’ve added it down at the bottom. [/UPDATE]
For *nix
On local, generate an SSH key. Do not enter a password. (I haven’t figured out how to make it automagically happen with ssh-agent yet).
sudo -u snmp ssh-keygen -t rsa
Local: copy the contents of /var/lib/snmp/.ssh/id_rsa.pub
sudo cat /var/lib/snmp/.ssh/id_rsa.pub
Remote: add the contents of id_rsa.pub above the authorized_keys
sudo pico -w /var/lib/snmp/.ssh/authorized_keys
Remote: prepend the following to the key you just added in authorized_keys. You may want to change the from option to include your local subnet/domain that your local machines are on. The command option makes sure that you really can’t do anything if someone unauthorized got access to the account.
from="*.epbfi.com",command="/bin/false",no-X11-forwarding,no-pty
Local: install and start daemontools
1 2 | sudo apt-get install daemontools-run sudo start svscan |
Local: create the daemontools service directory
sudo mkdir /etc/service/snmp-ssh-tunnel
Local: create the daemontools run script and set it to executable. Feel free to change the 16101 port and remote.server.tld to reflect your own remote port and server DNS name or IP address. I chose 1610x to reflect the usual SNMP port number plus a couple extra digits. *shrug* It’s all up to you!
1 2 | sudo echo -e '#!/bin/sh\n\nsetuidgid snmp ssh -nNT -R 16101:localhost:161 snmp@remote.server.tld' | sudo tee - /etc/service/snmp-ssh-tunnel/run sudo chmod +x /etc/service/snmp-ssh-tunnel/run |
That’s pretty much it for the technical stuff. Now, when you set up a host in Cacti, just use “tcp:localhost” for the Hostname field and put in the port number (in this case 16101) in the SNMP Port field.
It worked for me, so hopefully it will work for anyone else!
For Windows
It’s almost the same as the *nix setup. You’re creating a reverse SSH tunnel just the same. However, we’re just using the help of Net-SNMP to proxy the TCP SNMP from the SSH tunnel to the Windows UDP SNMP agent.
Install the windows SNMP agent (Simple Network Management Protocol). It’s usually under “Add/Remove Programs” and/or “Programs and Features”. Look for something along the lines of Windows Features. It changes for each version of Windows. I’m pretty sure it works for any version of Windows for and after 2000/XP.
Download and install Net-SNMP from http://www.net-snmp.org. You have to install it to the default C:\usr directory. It seems the scripts are hard-coded. The standard agent installation is fine. Follow any other recommended installation instructions. Just don’t do anything beyond that. No need to even try running snmpconf.
Download and install ActiveState’s ActivePerl (the free community edition) for Windows from http://www.activestate.com. Once again, follow any recommended installation instructions.
Download and install BitVise Tunnelier from http://www.bitvise.com/tunnelier. Follow any recommended installation instructions.
Create a C:\usr\etc\snmp\snmpd.conf text file and put the following in it. Just be sure to replace the “XXXXX” with your community name.
rocommunity XXXXX proxy 127.0.0.1 agentaddress tcp:127.0.0.1:161
Open a command prompt and run “snmpd -register”. This will register snmpd as a Windows service. If you’re running Vista/7/2008, it’ll probably come up with some of application crash error. Just click OK, close, or whatever to make it go away. Go to Windows Services and start the Net-SNMP Agent.
Now we need to get the tunnel set up. Launch Tunnelier. Enter the hostname, port, and username. Leave the Initial method as “none”. Now click on the “User keypair manager” under the authentication section. Click the “Generate New” button. Leave the password blank and the other defaults should be slot 1, ssh-rsa algorithm, 2048 bits, and enter something that will help identify this key in the comments. Click Generate and it will take you back to the keypair manager. Select the key and click Export. Leave “Export Public Key” checked, select “OpenSSH format” and click Export. This will ask you for a location to save the file. Put it anywhere you’re comfortable (your desktop is easiest) with and give it a “.txt” extension. Do the export process again except select “Export private key” and “Bitvise format” and store it somewhere convenient. Now, close the keypair manager and click Login. It will ask you to verify the host key. Click “Accept and Save” and then “Cancel” on the next popup. We just wanted to get the host key. Click on the “Host key manager” link under the server/port fields and export the host key in Bitvise format. Close the host key manager and exit out of Bitvise.
Open the key file that you exported earlier (with the “.txt” extension) and copy and paste that key into the authorized_key files just as you did (or would have done) in the *nix instructions above. You can delete this file now. Create a new directory somewhere on your local computer (I used C:\Tunnelier) and copy the private key and host key files to that directory.
And, finally, you will want to set up a scheduled task to run when your user is logged in to the Windows box. I can’t seem to get this running in any sort of daemon mode even after consulting with Bitvise’s help regarding running it as a service. So, for now, I’ll just stick with the run-on-login method. If you need help setting up some sort of auto-login, go to Start -> Run and then type in “control userpasswords2″. Select the username and enter the password and you’ll be able to auto-login. If this lacks certain security measures for you, you could set up a screensaver to run at 1 minute of idle time and enable password-protection when it exits. Oh, right, the scheduled task. Create a new (basic) scheduled task that will run on login. The path to executable is the full path to Tunnelier.exe. In my case, this is “C:\Program Files (x86)\Bitvise Tunnelier\Tunnelier.exe”. You may have to include the quotes to make sure Windows will recognize the full path. The arguments will be as follows (changing the appropriate paths, hosts, usernames, ports, etc as needed).
-host=remote.host.tld -user=snmp -s2c=127.0.0.1,16102,127.0.0.1,161 -loginOnStartup -reExecOnReconn=y -noRegistry -keypairFile="C:\Tunnelier\snmp-ssh-tunnel.key" -hostKeyFile="C:\Tunnelier\snmp-ssh-tunnel.hostkey" -proxy=n -openTerm=n -openSFTP=n -openRDP=n -exitOnLogout
Now, start your scheduled task (you have to start it this first time) and check for the remote connection. Do an snmpwalk to test and you should be ready to go.
It’s for sale! Details at 100alden.wgb.me. If you or someone you know of is looking for a new home in the North Chatt / Red Bank area, send them our way!
In 2007, the electricity usage at my house was at 27,751 kWh for the year. In 2008, it dropped 8.71% to 25,528. As of 2009 (just missing December), it is down by 17.73% to 19,877. If we were to go as high as December 2007 (2,642 kWh), we’d still be at a 13.36% shift down. However, I think we will most likely clock in around 2,000 (16.69% drop under 2008).
I’m not entirely sure how we managed that, though. In 2007, the place was a bachelor pad, so Justin’s electronics may have accounted for a bit higher usage. Justin moved out in December 2007, and Amy moved in February 2008. The first 3 months of 2008 were higher than those of 2007 and 2009, and I’m not sure how. Sometime around March 2008, our old 1960′s era refrigerator started screaming, so we bought a new refrigerator and instantly saw a drop in our electricity usage. So those new, fancy Energy Star certified appliances really do make a difference!
The strange thing is that we managed to add electronics to our digital collection and still saw significant reductions in 2009 and a little bit in 2008. We have added a receiver, Xbox 360, PS3, Wii, TiVo, 2 laptops, and 2 desktop computers to the mix in that time-span, but our consumption went down. Amy has been cooking more often, so even the usage of the kitchen appliances has gone up. AND we now keep the thermostat on a constant 72F year-round whereas it used to be at a mostly constant 70F. Needless to say, I’m still perplexed.
As far as energy-saving measures (they were more side-effects of other projects), we have replaced the storm door with a security storm door (2x panes of glass with plastic in the middle), replaced the door leading into the garage with a fiberglass door (instead of the hollow wood door) that also has a set of blinds in between two panes of glass. That’s about it as far as I can tell. I managed to finally close some storm windows that had been stuck for months (and years), but that was only this past weekend. I can tell a difference with the two new doors, though.
I have come up with a few more ideas that may help cut back for 2010:
That’s about all I can come up with for now. New low-E windows are too cost prohibitive. We have been replacing incandescent bulbs with CFLs whenever a bulb burns out. I also need to figure out a way to enclose the laundry room and maybe insulate it a little bit for those cold winter days where the dogs are outside or in the garage with their electric dog bed and heater. I think that even putting a ceiling over the laundry room will help retain heat that would otherwise be lost. It would also give us extra storage space over the laundry room.
Are there any other cost-effective ideas that are feasible and do not sacrifice the quality of life in our home? Is there such thing as a temperature-controlled outlet. Say, for instance, I want a heater to kick on when the ambient air temperature around an outlet (or device plugged into an outlet) goes below 45F. That would drastically help in the winter time when I forget to turn on the heater for the dogs in the morning or forget to turn it off at night.
* I have a tough time swallowing the whole “phantom” power theory. I purchased a Kill-a-watt and confirmed that devices like our cell phone chargers do not, in fact, consume electricity if they are plugged in with a phone attached. I have also tested the standby power of many of our electronics and the energy consumption is negligible there. About the only vampires that I am aware of are battery chargers for our gaming console controllers. I may consider putting them on a timer so that they don’t charge at night.
…he just doesn’t know it. But, hey, he responded to a Twitter post by one of the @PredFans participants! Oh, and if you didn’t know, he’s a HUGE New Jersey Devils fan and a pretty active Twitter user.
For those who do not know about @PredFans and ReTweetBot, it’s my little programming baby and the brain-child of fellow Predators fan Paul Nicholson (@pwnicholson on Twitter). The concept is pretty simple, it’s a bot that Paul conceived and I coded into reality that creates a common-interest community on Twitter proxied by a single Twitter account. I’ll use @PredFans as an example: Paul, myself, and a few hundred other Predators fans on Twitter follow a single account, @PredFans. The @PredFans bot looks for any @replies or direct messages sent to it and re-posts the @reply or direct message under the @PredFans account using “username: their twitter message #plus #some #hashtags”. If you go to the @PredFans page on Twitter, you can see it in action.
So, here are some screenshots of the tweets I’m talking about (clicky for linky):

There’s more about our ReTweetBot and how it works from a user perspective here.