Planet Yakko

November 22, 2011

internet destroying laws

There are a few bills going through Congress right now and I encourage you to write you congress-critter to voice your opposition. They are:

  • H.R.3261 – Stop Online Piracy Act
  • S.968 – Preventing Real Online Threats to Economic Creativity and Theft of Intellectual Property Act of 2011
  • H.R.1981 – Protecting Children From Internet Pornographers Act of 2011

The SOPA and PROTECT-IP bills are very similar. Both would force your ISP to filter your Internet traffic and not allow you to go to “bad” sites. The problem is, if a site is even accused of hosting illegal music files, your ISP must prevent you from going to the site. No guilt of violation is required. In addition, the mechanism used to enforce this literally breaks the Internet and leaves you open to attack from viruses, malware, and outside attackers since you are no longer allowed to use DNS-SEC for protection. Nice. I sent similar letters to both NJ senators and to my NJ House rep, but this is the version for Bob Menendez, my NJ senator actually co-sponsoring the bill:

I am writing to you regarding your sponsorship of S.968 “Preventing Real Online Threats to Economic Creativity and Theft of Intellectual Property Act of 2011.” This is a horrible bill and I would like to see you withdraw your sponsorship of it.

On your own web page, from which I am sending this letter, you have links for me to become your Facebook friend, for me to watch your speeches and opinions on Youtube, and a Twitter feed so I may keep up with you. Each one of those three companies has come out very publicly against this bill. In fact, with the bill’s “assume guilty, take down site, then call lawyer” mantra, there is a very real chance that one of your endorsed sites will go offline for something that another person does. There is no safe-harbor provision as with the DMCA.

More troubling is the fact this will break the new Internet-protection mechanism called “DNS-SEC.” DNS interception and poisoning is a very real Internet attack, basically, the attackers give your machine their IP address instead of the real IP address during a DNS look up. Malware, viruses, and compromised upstream computers use DNS attacks to fool your computer into going to the wrong place. Your computer may think it is speaking with Facebook.com, but is is really talking to the attacker’s machine. This works because your machine will not know the difference. The attacker can forward all of your traffic to the real Facebook while keeping a copy for themselves. Imagine if they did this using a bank … or any .mil site. DNS-SEC is currently being rolled out on the Internet to prevent this attack. It would encrypt the traffic so that only the root servers or trusted servers could respond to the DNS look up query. But PROTECT-IP requires all upstream providers to filter DNS, ergo intercept and read it. So, you cannot use DNS-SEC to protect yourself.

Please, withdraw your support for this bill. It goes too far.

Though I didn’t point it out, the bill would also make unlicensed incidental background music illegal in an online video. So, if there is a radio playing when you upload video from a party, you would be guilty of a crime. For someone like Justin Bieber, the latest singing sensation who was discovered because he sang a song on Youtube, he would be guilty of violating the law, fined, and perhaps thrown in prison for 5 years — see www.freebieber.org.

The other bill is ostensibly said to protect children from predators. It would require your ISP to record most of your Internet traffic just in case. Sounds kinda big brother to me. Please, as a side effect, it will kill free Internet in coffee shops and parks. If you were a small coffee shop, you’d have to start checking the IDs of your customers, write down their information, match their web surfing to their machine, and log all of this data for a period of time. Would a Ma & Pa coffee shop do that? Imagine a park ranger in a city park walking over to people to check IDs. Won’t happen, so they’ll simply kill the free Internet. My letter to Albio Sires of NJ-13.

I wrote to you a few months ago about H.R. 1981, ‘the Protecting Children from Internet Pornographers Act of 2011′ and my thoughts about how the bill goes too far and will accomplish nothing. I’ve thought further and discovered another unintended consequence of the bill: it will kill free Internet access.

While on a vacation, I enjoyed free Internet at many small, family owned coffee shops in MA, NYC, and NJ. If this bill becomes law, those small businesses would need to start tracking all of the people who use their wireless connections. They’d have to check IDs, write down the information, record all traffic as mandated by law, ensure they’re not mixing each patrons’ data, and log it for some time. Or, they’d need to subscribe to some service that performs these checks at added cost. For a small business, would this be worth it?

Starbucks and McDonalds also offer free Internet today and may be able automate the ID checks to some degree. These big stores could have the user enter a valid credit card number to match to a name and allow the user to continue – they need not bill the person, only use the credit card as an ID card.

What happens if my credit card is stolen and used at Starbucks for ‘bad?’ What happens if a waiter at another place simply writes down my credit card number and only uses it to perform this ‘authorization check’ at Starbucks? To be absolutely certain, the big stores still need to manually validate IDs – which takes the time away from an employee. Do they now need ‘bouncers’ for Internet checks? It might be easier for them to simply discontinue Internet or to begin charging for it.

If a small shop did not do these tasks and one of their patrons went to an illegal site, would the owner of the store now be accused of viewing child pornography? Eventually, the charges would probably get dropped, but only have the owner was arrested, called a pervert in the media, sold the shop, and burned through their savings to pay for a lawyer.

Or, they just might stop offering free Internet. If this bill comes to a vote, please say no.

I encourage everyone to stand up for your rights and to prevent big brother from getting closer to reality.


November 21, 2011

Hurricane Monday

So, I’m slow.  I’m finally getting around to the last bit of pictures from Hurricane Irene, only a few months late.  Lots more pictures located here: veggiespam.com/foto/Hurricane-Irene-Monday/ for your viewing pleasure. There are basement pictures, street aftermath, even a guest appearance from our controversy-free mayor. The last one was slightly sarcastic if you didn’t notice.

We had 1.23 meters of water in the basement and it cost $300 to hire some guy on the street with some old rust bucket of a pump to help excise the liquid.  Our maintenance company, who gives us preferred rates, wanted $2000. One of our fellow building owners had some appropriate, but not family friendly comments over the situation.  After 6 hours of listening to the racket and clatter far into the night, how much water was removed?  Building width 7.6m times length 30.5m times water depth of 1.23m = 285 cubic meters = about 1/9 of Olympic swimming pool (i.e. 79,300 gallons).

We’re dry now… until global warming raises the ocean level more.  Maybe I should sell before that day comes.


November 06, 2011

Rye IPA

I brewed a Rye IPA yesterday.  This is my first attempt at using the WordPress Beer Recipe plugin.  Here goes nothing!

Click on the article title to see the full recipe.

Style Information

Name: Rye IPA
Category: American IPA
Type: Ale
 
OG: 1.056 - 1.075
FG: 1.010 - 1.018
Bitternes: 40 - 70
Color: 6 - 15

Grains & Extracts

Name Amount Notes
Marris Otter 13 lb
Malted Rye 3 lb
60 L Crystal 1.5 lb
Vienna 1 lb
Cara Pils .5 lb

Adjuncts

Name Type Use Amount Time Notes
Gypsum Water Agent Boil 1 Tsp 60 minutes
Irish Moss Fining Boil 1 Tsp 10 minutes
Yeast Nutrient Other Boil 1 Tsp 10 minutes

Yeasts

Name Amount Notes
Safale S-05 2 packages

Mash Steps

Name Step Type Step Time Temperature
5.75 Gallons Infusion 60 minutes 156° F
Sparge and then add 3.25 Gallons Infusion 25 minutes 180° F

Fermentation

Step Time Temperature Container Additions
Name: Amount
Notes
Primary 65° F Plastic Bucket

Profile

Estimated OG: 1.088
Estimated FG: 1.022
Estimated ABV: 8.74%
 
Actual OG: 1.072
Bitterness: 50 IBU
Estimated Color: 14 SRM

Beer Recipes Plugin by Brad Ledbetter

October 07, 2011

Friday.

What’s a Friday with out Rebecca…http://www.youtube.com/watch?v=kfVsfOSbJY0

 

And and nice beer from keg.io

 

 

 

 

September 13, 2011

keg.io

A few months ago (in March) a few guys from work and I thought it would be a great idea to get a kegerator for our office. It started out with brainstorming some pretty cool ideas. Being technology geeks we immediately decided that the kegerator needed and RFID reader to track who is drinking the keg. We did get some inspiration from the guys at yelp. (http://www.youtube.com/watch?v=BwVoir5HSo4)

After we decided on the auth method we then moved to the question “Should people be allowed to pour beer if they don’t have a card?” of course we came to an unanimous “No!” decision. So the next thing that was decided on was putting in a (closed by default) solenoid. Third, we had the issue of trying to figure out how much beer was poured and how much was left. The way we saw it there were two main ways to accomplish this. One being we could measure the weight of the keg / kegerator and calculate the difference after each pour. The other was to measure the flow going through the line during a pour. We decided on the latter. We then got a hall-effect flow sensor to measure flow. Lastly, We also wanted to know the temp of the beer / kegerator so we decided to get a temp sensor and put it in there as well.

Here is some coding in the kitchen. (Yeah, that’s a shot.)

After everyone decided all of the things that we wanted to see on this thing, we needed to put it all together. I decided the easiest and fastest way was creating an Arduino shield and using an Arduino Duemilanove. I worked on most of the hardware stuff and getting it all working. Two of the other guys(Dylan and Chris) decided to use Node.js to write the application, which turned out to be pretty nice besides a few serial library issues.

Here is a little description of the hardware:

“Starting from the top, the Arduino is powered by a usb cable plugged into the source computer it is running with. The Arduino has a custom made “shield” that allows the Arduino talk to the other components in the system. The shield was made out of a RadioShack pcb that was cut to fit into an arduino  shield. The shield has 3 io “ports” on it. The first is the 12v power source input. This is needed to run the 12v solenoid that allows flow access through the line. The second ports communicates with the UART based Parallax RFID Reader. This is a basic 125Khz RFID reader talking at 2400 baud. The third port allows communication with the temp sensor, solenoid, and flow rate sensor. I used Cat5 cable for the connection between these components and the Arduino shield.”

Here is a list of the hardware components:

Some Hardware pictures…
 

Software:

In the software side, as I mentioned earlier, we are using Node.js. Everything is open source and you can find it on github https://github.com/vnc/keg.io. Some cool features that we added to keg.io are twitter integration, and some gamification type badges we call “coasters”. A member of keg.io can earn these coasters by different drinking habits. One of the first badges a person will receive is the “Welcome Coaster” after drinking their first beer poured from the kegerator.

So…I’ll explain how everything works. We have come up with a very simple communication protocol for communication between the Arduino and the host computer over serial. When the Arduino is started it initially grabs the temperature of the temp sensor and sends this data to the host computer. It will continue to do this every 10 seconds (adjustable) to allow close to real time temperature of the kegerator. Now we have an RFID card reader that is waiting for input from the user. When a card is scanned it grabs the card ID and sends that to the host computer for validation. If the card is not registered in the database, the application will display a denied message. (Don’t you even think about drinking from our Keg!)  If the card is registered and the user is valid the host computer sends back a request to the Arduino to open the solenoid and allow the user to pour beer. At this time the web ui displays a welcome message and shows a picture and information about the user pouring beer. Once the user starts to pour the beer, the flow is measured by the flow sensor and the flow rate is sent every second to the host computer which tracks the rates and calculates the amount of beer poured for that session. After 3 seconds of no flow rate the solenoid is closed and the next user can proceed to scan and repeat the process. What would a cool application like this be without twitter integration? After a user finishes his/her pour keg.io tweets about it. Check it out here: http://twitter.com/#!/keg_io

Here’s what keg.io looks like (at time of writing):

 

Thanks to the people that have contributed to the project:

  • Dylan
  • Carl
  • Chris
  • Garrett
-C4

 

September 09, 2011

My experience customizing an Android phone

forward: Hi, everyone! Nate here, swapping posts with Travis. Or, if he ends up thinking for a while and kind of forgetting, then that's fine too! I hope to mold this outline into more of an article over the weekend. Look and feel: launchers If you're unhappy with Android, I recommend downloading ADW Launcher from [...]

September 02, 2011

Intro Guide to SSH, GNU Screen, and irssi

So I finally got tired of explaining what GNU Screen is and how to use irssi with it so you can idle on IRC nets.  To start, I'll draw a picture to help you visualize how this all works (I like drawing pictures, enjoy my MS Paint sillz). Obviously I'm assuming you (the client) is [...]

August 29, 2011

evening splashing

I’ve added a few videos, like of the fire truck making waves in my new door-front babbling brook, all of which can be found in my photo site.  My upstairs neighbors went for a walk, here is Elif with something in her shoe (water perhaps?).

How bad is/was the flooding?  Well, the image to the right (click on it for full size) shows the height of the Hudson River around 1015 at The Battery (see map) on the tip of Manhattan near my house from the US Gov Weather Site (site is constantly updated).

Here are a bunch of pictures from a local website; I’ve picked out four nice ones:

  • Click here to see a great picture 1.5 blocks from my house looking down towards me.  The guy in the far distance in the middle of the road is standing in the intersection at my house.
  • Here is an image on block over and one down from my house.
  • Not quite sure where this picture was taken, but row row your boat.
  • And finally, the ferry terminal, this is the land side of it, not the water side.

The wind has started again, seemingly more constant that before the storm hit.  And the sun actually shone its shinny face, if but only for a few minutes. Nevertheless, some streets are still impassable, like mine.

The flooding, wind, rain, and such has knocked out the Internet for a bit.  And since I have a viop-based telephone, that gets knocked out every-so-often too.  Plus, the cell service went down to one bar (OMG!) at one point.  But power has been fine, no flickers even.

I leave you with a comic: http://theoatmeal.com/comics/weather


August 28, 2011

morning breath

I just heard the fog horn of a large ship.  I certainly hope it remains at least a two blocks away.  Its wake may take out a few buildings.  I also heard a building fire alarm but couldn’t tell from which direction it came.  I just surprised I only heard one.

The flooding is hitting the front of the building, but not the side where the entrance to my apartment is.  They evacuated the city’s evacuation center last night, so I went to bed expecting a meter of water.  But, woke up with both power and Internet, though only one bar of signal on my cell phone.

The eye of the storm was calm, but now the rains have started again.  The map on the storm shows the extent with the eye centered around us – From Maine, to Washington, to Buffalo.  And now, the storm surge has started again.

Some pix: http://www.veggiespam.com/foto/Hurricane-Irene-Sunday-0900/ — click for full size.


storm of the evening

The police came by with an announcement over the loud speaker; it was garbled and unintelligible. I heard someone scream out their window “What?!”  Indeed Ma’am, what.

This is a live video of the pier at the end of my street http://www.erikthered.com/cam/ and is updated every ten minutes.  This camera is looking either NE or ENE towards midtown Manhattan.  The tall one on the right is the Empire State Building.  If you can’t see Manhattan or the pier through the rain sheer, go here http://www.wunderground.com/webcams/erikwx/1/show.html to see what it looks like during the daylight via the daily archive of the camera, including a videos. Yesterday was pretty.

The fire department SUV drove the wrong way down First Street, picked up the barricade left on the sidewalk during the storm last weekend, and proceeded blocked off Southbound Willow.  They don’t want to deal with idiots on that block as it always floods in every moderate storm.  To get an idea of the area, take a look at the Google Map to see aboutwhat I’m talking.

If you’re up for another map, here is the city’s wonderful flood map (click to make big).  My house is near the “triangle streets” at the bottom-center of the map.  Red; great. Now, how much red; how much rain?  That will be the question tonight.

And right now, the sky is dry.  But, the tornado watch right now makes it feel all Midwest-like.


August 27, 2011

storm of the late afternoon

As the camera panned down the beach, the news reporter said they used a bulldozer pushing sand to form a “Maginot Line” – what an amazing bit of amount of irony on the news.

Around 17:30, the rain finally started falling consistently, if only a light sprinkle, after a day of rain and dry in this super high humidity atmosphere.  An occasional nice breeze through the windows makes it bearable – at least until I’m forced to shut the windows.  Perhaps I’ll start to inflate the air mattress so that it may double as a raft; kitties will like that.

Batteries are charged in the cell phone, laptops (no Internet thought), iPad, a few flashlights, and an 18V drill / circular saw / sawzall.  Mmm… Sawzall.  And an old piece of plywood to shove on the windows if one breaks inward.  Since I have a USB TV tuner, I won’t need power and I can keep watching reruns of Baywatch to leave proper methods of dealing with water emergencies.  (Lesson learned: slo-mo running seems to help any situation – though I lack built-in floatation devices).

And do I have a non-electric can opener?  I wonder if Domino’s will deliver in 30 minutes or less or it’s free?  The city has outlawed liquor sales after 20:00, so I better get going if I’m to keep myself swimming in beer.  Otherwise I’ll have to switch to hard liquor.

Cats are fed.  Bathtub full of water. Me full of beer. It’s a good day.

Time for nachos.


the storm of the week

So, there is a bit of a small squall starting around here.  Irene, Ilean, Dixie’s Midnight Runners, meh.

So far, we’ve cleaned off the roof to keep projectiles from breaking skylights, put the trash cans into the utility room, and duct taped the Bilco doors to keep the rush of basement-bound water to a trickle.  Of course, with the 8 foot storm surge now being forecast, the duct tape may have been futile.

In fact, the fire depart drove by on the loud speaker ordering mandatory evacuations for the first floor of all buildings immediately.  Guess that means my coffee shop is now closed.  I appreciate the advanced warning too.  I wonder why they didn’t tell people to move cars, but may the fire department wants to practice with the Jaws-of-Life.

And Bacon!  There was two pounds of frozen bacon in the chiller – no more.  I have one pound in the fridge ready to re-heat by candle if necessary.  MMMmmm… bacon, the other pound is in my belly (more likely ¼lb since it cooked down).  And beer, I have about a case in the fridge.  But none in my carboys as those are now filled with water – sacrilege.

The cats were annoyed since I vacuumed this morning (part of cleaning and getting ready), so they’re still hiding.  Plus, the cat carrier is ready to go in an emergency and Opus will most likely keep hiding for fear of being unceremoniously shoved into it again as he was for a recent vet appointment.

So, high tide is is around 20:15 tonight. The worst part of the storm surge arrives at 20:15. The tide is extra high due to the New Moon. The soil is completely saturated from the near record precipitation this month. Oh yeah, and largest rainfall comes around 20:15 too.

So, let’s take bets – how high will the flooding get at my house?  Inches, Feet, Meters, Fathoms?

View This Poll

August 12, 2011

Free Calling with Google Voice and Asterisk

I've been playing with Asterisk and Google Voice for the better part of a year now, and just recently was finally able to get it all working the way I wanted it to. When Google started letting you make phone calls using Voice from Gmail, they opened up the ability to make phone calls over [...]

July 09, 2011

toorcon: Seattle

I meant to write about this last week but have been pretty busy with some other projects I have been working on. I have to say I had a great time at toorcon Seattle this year. Props to David for getting this event all put together.

There were definitely some good talks, which inspired me to do a bit more poking around. The first one I want to mention was the talk titled “Get Off of My Cloud: Cloud Credential Compromise and Exposure” This touched on amazon’s ec2 public AMI distribution and the security risks involved with using AMI’s not created by you. It brought up some interesting points and some issues that people may have overlooked. He mentioned that they have written some tools to “clean up” the AMI’s before sharing them out to the public. They didn’t release the scripts at the con and he mentioned that they weren’t publicly available yet so I went ahead an wrote some scripts (in bash) to look for the vulnerabilities when using an ami for the the first time, whether it a be a public ec2 AMI or an AMI that is put out by amazon.

The second talk that I found real interesting was the “We Are The Robots: Social Hacking With Bot Swarms” which talked about the connections made by users on twitter. They had a competition with bots on twitter to see what relationships bots can create between two other people and what information links them.

The last talk I that was interesting was “Highly concurrent Python for brute forcing and discovery”. I only have just started using python in some projects so this was a bit more advanced that I was used to but seriously great information. He talked about Python coroutines and epoll to build your own high performance brute forcing and discovery tools.

June 07, 2011

Make windows calls from linux.

I was recently taking a look a making remote calls from linux to a windows server. I found this nice little tool that makes this task pretty simple with winexe.  It’s basically like psexe but for linux. I was having problems getting version 0.80 working on some environments but v 0.90 seems to work on everything I have tried. (complied with a new version of glibc)  Here are the options.

winexe version 0.90This program may be freely redistributed under the terms of the GNU GPLUsage:

winexe [-?|--help] [--usage] [-d|--debuglevel DEBUGLEVEL]       [--debug-stderr] [-s|--configfile CONFIGFILE] [--option=name=value]        [-l|--log-basename LOGFILEBASE] [--leak-report] [--leak-report-full]        [-R|--name-resolve NAME-RESOLVE-ORDER]        [-O|--socket-options SOCKETOPTIONS] [-n|--netbiosname NETBIOSNAME]        [-W|--workgroup WORKGROUP] [--realm=REALM] [-i|--scope SCOPE]        [-m|--maxprotocol MAXPROTOCOL] [-U|--user [DOMAIN\]USERNAME[%PASSWORD]]        [-N|--no-pass] [--password=STRING] [-A|--authentication-file FILE]        [-S|--signing on|off|required] [-P|--machine-pass]        [--simple-bind-dn=STRING] [-k|--kerberos STRING]        [--use-security-mechanisms=STRING] [-V|--version] [--uninstall]        [--reinstall] [--system] [--runas=[DOMAIN\]USERNAME%PASSWORD]        [--interactive=0|1] [--ostype=0|1|2] //host command

Apparently it’s maintained by Stuart Henderson, but it looks somewhat dead? The site link doesn’t work. (returns blank page) http://eol.ovh.org/winexe/

Some ways to use it:

winexe -U DOMAIN/Username%Passwd //192.168.1.123 "ipconfig /all"
winexe -U DOMAIN/Username%Passwd //remote.com \
'cmd /C net stop SomeService && net start SomeService && echo AutoUpdates service restarted'

or get a shell,

winexe -U DOMAIN/Username%Passwd //remote.com 'cmd.exe'

or use it to configure synergy,

#!/bin/bash
OUT='winexe -U MAIN/User%Pass --runas MAIN/UserB%Pass //your-other-comp "ipconfig"'
IP=`$OUT |  grep "IPv4" | awk {'print $14'}`
synergyc $IP

This site also has some more info on it: http://opensourceinfo.blogspot.com/2010/01/winexe.html

 

 

 

May 25, 2011

Making remote server calls from PHP

I was doing some php scripting today and needed to call a remote server to see if it was running a certain process. It seems like a valid enough request. I spent some time looking into php’s exec() and system() functions to find a way to call ssh to login and run the command. I kept running into the problem of the ssh session needing to be interactive. I started to look around for other options in php to ssh to remote machine and saw the SSH2 Manual. This was great but needed the ssh2 extension to be installed and in my case it wasn’t and I didn’t want to have to install additional software. I then found the phpseclib library which worked out great. It’s easy to use and worked right out of the box without any other software needed. Check it out: http://phpseclib.sourceforge.net/

You can read the documentation on the site or use this simple test script to get it working.

<?php
require_once("Net/SSH2.php");
$passwd='sup3rs3cr3t';
$user='username';
$server='remoteserver.com';
$ssh = new Net_SSH2($server);
if (!$ssh-&gt;login($user, $passwd)) {
exit('Login Failed');
}
$who = $ssh-&gt;exec('whoami');
echo $who;
 
?>

May 23, 2011

php-cli awesomeness

I know, command line line php has been forever and it’s nothing new. I have been coding in php for over 5 years now but not until recently have I needed to use to use it for something more than web application development. In the past couple months I have been using the amazon AWS environment. There are a ton of tools built for AWS and a very good API but I have found some things that I have needed to do that arn’t made easy. One example is duplicating or copying an EC2 security group. Do to some infrastructure changes we wanted to duplicate an already existing security group with only minor changes. In our case the security group had a lot of custom firewall rules that would take too long to duplicate. So here is a script to copy EC2 groups:

&lt;?php
 
echo "\n";
 
echo "#######################\n";
 
echo "Copy EC2 Security Group\n";
 
echo "#######################\n";
 
echo "\n";
 
echo "Enter security group you want to copy FROM: ";
 
$handle = fopen ("php://stdin","r");
 
$grp1 = fgets($handle);
 
$grp1 = trim($grp1);
 
echo "\n";
 
echo "Enter security group you want to copy TO: ";
 
$handle = fopen ("php://stdin","r");
 
$grp2 = fgets($handle);
 
$grp2 = trim($grp2);
 
echo "\n";
 
echo "You are going to copy settings from ".$grp1." to ".$grp2." Is this correct? (y/n):";
 
$handle = fopen ("php://stdin","r");
 
$response = fgets($handle);
 
$response = trim($response);
 
//echo $response;
 
if($response == 'y'){
 
echo "Getting settings from ".$grp1."...\n";
 
$cmd = "ec2-describe-group ".$grp1;
 
exec($cmd, $lines);
 
echo "Copying group settings...\n";
 
foreach($lines as $line){
 
//echo $line."\n";
 
$values = explode("\t",$line);
 
//foreach($values as $value){
 
//echo $value."\n";
 
//}
 
if(isset($values[4])){
 
if($values[4] == "icmp"){
 
$cmd = "ec2-authorize ".$grp2." -P icmp ".$values[5].":".$values[6]." -u ".$values[1]." -o ".$values[11];
 
//echo $cmd;
 
exec($cmd);
 
}elseif($values[4] == "tcp"){
 
if(isset($values[10])){
 
$cmd = "ec2-authorize ".$grp2." -P tcp -p ".$values[5]." -u ".$values[1]." -o ".$values[11];
 
//echo $cmd."\n";
 
exec($cmd);
 
}else{
 
$cmd = "ec2-authorize ".$grp2." -P tcp -p ".$values[5]." -s ".$values[9];
 
//echo $cmd."\n";
 
exec($cmd);
 
}
 
}elseif($values[4] == "udp"){
 
if(isset($values[10])){
 
$cmd = "ec2-authorize ".$grp2." -P udp -p ".$values[5]." -u ".$values[1]." -o ".$values[11];
 
//echo $cmd."\n";
 
exec($cmd);
 
}else{
 
$cmd = "ec2-authorize ".$grp2." -P udp -p ".$values[5]." -s ".$values[9];
 
//echo $cmd."\n";
 
exec($cmd);
 
}
 
}
 
}
 
}
 
}else{
 
echo "quit";
 
exit;
 
}
 
?&gt;

March 13, 2011

Android Home Screen

I spent a fair amount of time setting up my current home screen.  I got the idea from this reddit post and followed this guide to start.  I made a lot of the icons myself, though some aren't mine.  Here's the images I used, feel free to do whatever with them.  You need Photoshop to [...]

February 10, 2011

Shark Attack!

First, I want to say that I am a big supporter of Grooveshark. I think it’s an awesome service and I have purchased merch from them. That being said, yesterday I started looking for a way to rip the songs from Grooveshark. It has been a while since I kept an up-to-date music collection.

The files that are streamed to your computer are temporarily stored on your local machine. This means that we can save the packets that are being sent to your computer as an actual audio file. First, we need to use a network protocol analyzer that will allow us to find the packets being sent the to the computer. This is where Wireshark comes in. We can start by downloading Wireshark and installing it. (not going to show you that here) Once we have it running, it should look like this: (May need to run as root)

Next we need to configure some settings. Since we know that we are accessing Grooveshark through a web page is a good bet that they are pushing these packets over http. We will limit the filter to only capture port 80 traffic since that’s all we really care about right now. Set this up in Capture -> Options. See below.

Now we can start the capture. Next go the the Grooveshark site and start playing a song. There will be a lot of packets showing up in your list. The main packet that you are looking for is one with a type of “audio/mpeg”. You can also make this easier if you use this filter: http.content_type == “audio/mpeg”

If you use the filter method then you should only see one packet show up. It should look something like this:

Right click on the packet and choose follow tcp stream. This should assemble all the related packets and bring up a summary asking you what you would like to do with the packets. On the right hand side there will be some options for how you would like to save your stream content. Choose “Raw” and click the “Save As” button. You can now save the file as whateveryouwant.mp3. You can now go to the folder that you saved it in and play the file in your favorite music player. (May need to chmod the file if was downloaded by root.)

Note: I found someone who has done the same thing when I was looking how to save the stream. So I can not take 100% credit for this.

Also: I looked into writing something to automate this process but there is already another project that is doing this. Check out http://groovedown.tasteless.us/

January 26, 2011

Rolling Ball

This is my second project for my video game design class. It's pretty simple, use wasd and the mouse to control the ball. The goal is to get to the top, but take some time and explore. Here's the Windows version if you don't want to play in the browser. And the source code if [...]

January 19, 2011

Apple TV with Compact Flash

I have been pretty busy these past couple months. I got a new job working with the Amazon AWS environment which has kept me pretty busy. I tried this compact flash swap a month ago with poor results. I tried it again last weekend with a faster compact flash card which was a lot better.

First I ordered a 2.5” ide 44pin to compact flash adapter and a Transcend 4gb 133 CF card. The read and write speeds on this card are terrible. I would not recommend this card for this purpose. They were listed on ebay as:

- CF Compact flash to 2.5″ IDE 44 pin Adapter SSD ($8.99)

- TRANSCEND 4 GB Compact Flash Card Type 133X NEW ($14.94)

I later bought a “PixelFlash 4gb 400x” card. Although this was a no-name brand (at least to me) it worked pretty well. The read and write speeds were decent and are similar to the internal HDD. I swapped it into the Apple TV and I’m running a the Beta4 of the Openelec OS


Rube Goldberg

Can't have 2 unity post per page, click the post to view it.

January 15, 2011

chicken on the go

The work engagement has mostly ended for this India trip. So now, we begin the fun by following suggests from some Secaucus friends that formerly lived in Delhi – get out of Delhi. The Indian state of Rajasthan is my destination with the city of Jaipur as my centre of operations. But, how to get there.

You can fly to Jaipur, take a slow train, or the slower still state-run bus service. Or, as suggested by Bob, “ride a bus with chickens.” So, I did. Unfortunately, no chickens on the ride, but I swear I saw some feathers on my seat. So, for 200 Rupees ($4.44), I took a 35-person bus about 234km with 60 wonderful people. Megabus to Boston is 303km at $22ish; so 7.2¢ vs 1.8¢ per km – bite it Megabus.

The bus was a normal bus like most others, except that they divided the vertical space in half in a very ‘we already have the spare parts’ flair. I had ample clearance sitting down – there was just someone laying above me. Plus we shared the same large window across both stories. In fact, that upper berth had no metal support as the person lay – if he leaned too against the plexiglas, he’d fall out the side.

Sleep'n on duh engine block

Didn’t have to worry too much about the safety glass on the bus’s door as I believe the bus didn’t have a door. No need for air conditioning that way. The bus had a front mount engine and the driver sat beside it (kinda like some school buses). Instead of wasting space with the enge, they mounted a padded carpet shelf over it to allow people to sit; leaving a small cutout for the gear shift.

Google says it would take 3h17m for this trip on National Highway 8. Google assumes things like people driving in lanes, constant speeds, zero construction, no dodging of horses, and even pavement. The is an example of a Google fail.

There is no word in Hindi for “expressway”. I don’t think there is a word for “freeway” or “turnpike” either. It was a four lane road with a divider in the middle most of the way. Over the length of NH-8, a single bridge was found at what could be almost described as interchange. Since there are no bridges, there are breaks in the dividers to allow u-turns, people crossing, and cross streets. Plus, in many of the villages and small cities, they are starting to build overpasses adding construction to the mix. Plus we had to pass three elephants. Google is wrong by about 2h30m hours in its calculations.

I hopped on the bus about 10:45 and arrived at 16:00 – so why 90 more minutes than what Google should have said? This wasn’t the express bus, so there were a bunch of stops. Sometimes, they included slowing down along a few crowds of people and shouting “jah-pour jah-pour jah-pour” like an auctioneer. For a few pickups and drop-offs, we didn’t even come to a complete stop; just leap. There were a few food vendors that got on for a single stop, selling samosas and other yummie smelling wares. But, on the advice of a wise sagess, never eat from the street vendors. Plus toll booths and a gas refill.

Then there was the big stop for a snack at a street side hole in the wall. And when in Rome, I decide to partake in a traditional India male rite of passage: just take a piss on the side of the road. Don’t try to be subtle and hide behind a tree – just stand there and go.

The stop also involved impromptu repair. Some guys crawled under the truck with a large reservoir grease gun to do something with the drive train or axle and hopefully not the brakes.

Was the chicken bus worth it? Yes. I will admit that I was anxious when I noticed the bus would be making stops. I wasn’t sure if the luggage compartment was locked (it was) and if someone would walk off with my bags. I might do it again, but without luggage and with a companion to assist in the adventure (preferably one that speaks Hindi).


January 14, 2011

Safe Journeys via Taxi

I have officially concluded that my mother can never visit India.  During her rides through the narrow streets of Hoboken or wide avenues of Manhattan, there is an audible gasp when traveling under the speed limit with ample clearance – both of which are still uncomfortable to her.  Mother’s reaction to three motorcycles weaving in the 50cm gap between my taxi and the three wheeled scooter carrying eight passengers may produce a short scream.  Add the rule-free traffic circles, roundabouts, and rotaries with the rare (but fun) figure-8 version and we’re moving into the oxycontin & xanax cocktail epi-shots territory.

AAAhhh, click for video

I filmed the whole commute but uploads are slow so you only get the first 2 minutes minutes – I’ll finish the other movies later (including the “dodge herd of cows” moment).   The ride between the hotel and office lasts 15-30 minutes, depending on traffic.  Of course, when the commute is bad, it is really bad: one days was over 90 minutes.  I could have got out and bought from the street vendors.

The first day ride from the airport to hotel was pleasant too.  Smokey fog with 0.25km visibility, freeway driving, and tractors that don’t quite reach freeway speed.  And out of all of these journeys, I only saw one accident – in the fog on day one.  Looked pretty bad with the car busting off a big truck’s wheel and the car’s engine compartment now being used as a replacement, but apparently no injuries.  And a few seconds later – lost in the fog again.


January 09, 2011

Asking for directions

That new aeroplane smell of my 777-200 seat with its ability to recline with stretched toes helped me to sleep a little. With bumps from each little fluffy cloud, I tend to wake up, so this transatlantic+transcontinental+transsemicontinental flight makes me a bit zombieish. This gives me ample opportunity to gaze out the window at some of the countries over which we flew: Canada, Norway, Sweden, Estonia, Russia, Kazakhstan, Turkmenistan, Afghanistan, Pakistan, and even India. When the clouds cleared, I felt like I was in Alaska since I could see Russia from my aeroplane.

We went over Afghanistan at 37000ft during the night. You could see many stars, but only a single light on the ground over the first half of the country. It was like over the Atlantic, seeing a few ships’ lights on occasion. Eerie. I’m pretty sure I could see Kabul and the villages to the south once we went near there. A very fine wispy web of tiny lights along the side of all the mountains. Once past it, nothing again until eastern Pakistan.

Flying over populate area at 15000ft, there were still not as many lights as you’d normally see in the US. Do we waste light by pointing it up? Are we too paranoid and need that extra light?

Now that I’m landed, the next adventure is the taxi ride!