Mapping wifi access points in Portland
I’ve been logging GPS data for about a year and a half. I use an app on my Windows Mobile phone to log the GPS data, and my phone has a wifi antenna that stays in the “off” position most of the time. I met with @donpdonp the other day and he introduced me to the geomena.org project. I realized it should be possible to log access points along with my existing GPS logging. It was easy to install Airomap on my phone, so now I can log wifi points too!
So far I’ve only made about a dozen trips with the wifi antenna on, but I’ve already logged 2200 unique mac addresses, and 427 open access points. And this is only on my normal route to and from work, I haven’t made any special wardriving trips yet. Here is a heatmap visualization of the access points I’ve logged so far.

This uses a custom tileserver I wrote to provide an additional data layer to the map. Hotter spots on the map correspond to more open access points in that area.
This is a version which shows each access point as a marker on the map so you can click on them.

Wifi Access Points in Portland. Red: encrypted, Blue: open
Most of the access points appear to be in the middle of the street, because most have been seen only one time by my logger, which was in the middle of the street. As the access points are seen repeatedly from other positions, the points will adjust to a more accurate position. You can already see this happening for a few points which appear in the middle of blocks or on streets through which I did not drive.
Again, these maps are still in their infancy, since I’ve only logged a few days worth of points on very narrow routes. But it’s amazing that I’ve already driven by 2200 access points just in the normal course of the day. I’m looking forward to continuing logging data and eventually importing it into the geomena database. It’s easy to see how quickly we could map out the entire city with just a couple people running loggers!
An exciting month for Google
Posted by aaron in Uncategorized on December 8th, 2009
A recap of all the things Google has announced in this first week of December. The big ones are Google Goggles, new versions of Chrome, and real time searching, but they’ve also launched some less flashy things like a dictionary and public DNS service.

Augmented reality becomes a ... reality
Google Chrome for Mac and Linux
Vevo, a venture between major music labels and Youtube.

Liquid Galaxy: 8 screens of Google Earth
Liquid Galaxy, because eight screens are better than one.
Google Public DNS, at 8.8.8.8 and 8.8.4.4
So this is New York
The Apartment
I flew in to New York from Pittsburgh in the middle of the day. The public transportation system was relatively easy to figure out thanks to Google Maps, so I got on the train to Manhattan! I found my way to Al’s apartment a few blocks from Columbus Circle.

I stayed here for a week
Rent there is insanely expensive. It is a one-bedroom with a kitchen that was basically stuck along the wall to the living room. There isn’t even room for a full fridge, just a mini-fridge under the counter. Note to self: wait until you are rich before moving to NY.
The Food
I had some good Thai food at Room Service. I checked out Risotteria Restaurant on Josh’s recommendation. They had some pretty tasty gluten-free italian food, and breadsticks that actually tasted like breadsticks.
Cafe Gitane is a cute little French cafe in the NoLita neighborhood. I had a tasty couscous thing with hummus on top. It came in a cute little stack. This was also the first real cup of coffee I’d had in Manhattan!

The Coffee
I was very surprised at the lack of coffee shops and good coffee in Manhattan. I guess coming from the Pacific Northwest, I just assumed coffee was as popular everywhere. Mostly people were drinking “coffee in a Domo cup“, 7-11’s campaign which launched apparently right as I landed in NY. I was able to find two other places that somewhat resembled west-coast coffee shops, Gizzi’s Coffee, and Pecan. There was definitely a lack of good coffee. Or maybe an abundance of bad coffee.
The Bagels
Since I was in New York, I had to find an authentic New York bagel even though I barely eat gluten. I turned to yelp.com to search for the best place to get a bagel. I knew I would have somewhat of a reaction to the massive amount of wheat in the bagel, so I only wanted to do this once. One shot to find the perfect bagel in New York. Absolute Bagels had some pretty great reviews, so I went to check it out. It was not close, it was all the way at the other end of Central Park.

It turned out to be a little Chinese place. I was super skeptical as I walked in, but I had come this far, couldn’t turn back now. I asked them if I could have a bagel fresh out of the oven, not one from the display case. The guy tore one right off the hot stack and handed it to me. And yea, it was delicious.
Wall Street
Wall street was impressive. I don’t really know what I was expecting, but it was nothing like any idea I may have had about it. There were just so many buildings so close together, and everywhere I turned I’d see a big name like “New York Stock Exchange”, “Chase”, “Federal Reserve Bank”, etc. It also never occurred to me that the reason it’s called “Wall Street” is because it’s the street named “Wall.”

I still have no idea what those red glowing things are for. I can’t tell if they’re just decorative or if they have some sort of function.
The Subway
The Subway system, while very old-looking, is pretty great. I was always able to quickly figure out how to get from point A to point B, and the trains run frequently enough that I never had to wait long for one. The subways run to every part of Manhattan (and off Manhattan as well), and it never takes more than one or two to get anywhere. Once you’re underground, you don’t have to pay or swipe your pass again until you pop up somewhere.

I think this means they don’t want me crawling under the gate?
Unfortunately but not surprisingly, my GPS was not able to get a fix while underground. My GPS data looks pretty spotty for Manhattan, with little squiggles popping up just at the points where I went above ground.

I was able to walk around a bunch of neighborhoods, including East Harlem, Morningside Heights, Hell’s Kitchen, Little Italy, the Financial District, the Lower East Side, and I even made it to Brooklyn and checked out Williamsburg.
Flirting with Pittsburgh and the G20

Sidewalk Closed
I took the bus from the Pittsburgh airport to downtown, then caught a bus from downtown to Silas’ place. Of course since it was the second day of the G20, they had a big chunk of downtown completely blocked off with roadblocks and police. I’ve never seen so many different kinds of security in one place. City police, military, riot squad, private security, roadblocks, barbed-wire fences.


Private security force

Police Rescue Vehicle - I have no idea what the thing on top is for

It's not like there was actually anything going on
On our evening tour of the city, we drove by the University of Pittsburgh, apparently while the members of the G20 were getting a tour of campus as well. There was a ridiculous amount of security present, and helicopters flying overhead with giant spotlights shining down. We walked around a bit, staying well away from any groups of people so as not to be mistaken for a protester. You can find videos on Youtube of why we did not want to get involved in the protests.

Police roadblock at University of Pittsburgh
Here are the GPS logs from my brief tour of Pittsburgh! Silas had rented a Zipcar, so we were able to cover a lot of ground.

Tour of Pittsburgh
On a lighter note, I found a great Italian restaurant in the neighborhood. The cook was standing outside while I walked up, so I asked if he could make something vegetarian with polenta. A couple minutes later he had whipped up a tasty spinach and polenta dish.

Spinach Polenta
Failblog: Starbucks and Logan Airport
This one I just thought was mildly amusing. The screens that are supposed to tell you when the next flights are coming in are apparently Windows computers running Internet Explorer.

Internet Explorer error in overhead display
At the Starbucks in the Logan airport just outside the JetBlue terminal, I noticed this writing on the deli case:

Just because it has no corn syrup does not make it not unhealthy!
In case you can’t read the letters, it says:
- no artificial flavors
- no artificial trans fat
- no artificial dyes
- no high-fructose corn syrup
Also note the handwriting font, as if this somehow adds to the legitimacy of the statements.
I hope they don’t mind me running my GPS on the plane
Since I’ve already been logging GPS data for quite some time, I thought it’d be interesting to log as much data during flights as possible. Of the three flights so far, I’ve been able to log data on two of them. I think it has to do with the fact I had a window seat on both flights. I’m pretty sure the plane is shielded in a way that blocks the satellite signals. I’d be interested if anybody can fill me in on why this might be.
I put my phone into “airplane mode” so that it doesn’t broadcast anything, but turn on the GPS logger. I was able to keep a lock for the entire flight!

GPS at 30000 feet!

San Francisco to Long Beach

Takeoff from San Francisco
This is the beginning of the flight from San Francisco, loaded into Google Earth. It also includes taking the BART to the airport. The actual flight starts at the gap at the bottom.
I also have altitude data at every point, but I can’t seem to get Google Earth to display it. If you have any ideas please let me know!
Adventures in San Francisco
San Francisco’s BART and MUNI couldn’t be any easier to use! I had no trouble getting from the airport into the city. Once in the city, it was easy to get around as well.

Burmese Salad
On Tuesday night I met up with my grandma and uncle and had dinner at a Burmese restaurant. Their Burmese salad was quite good and quite strange as well.
Afterwards we went to the swanky Cliff House for a drink, and for the view. Unfortunately by the time we got there it was dark. and foggy. If you look really closely you can see a wave.

View from the Cliff House at night in the fog
On Wednesday night after the conference I walked around by the Fisherman’s Wharf a bit. I decided to look for any web or tech-related events happening but figured it would be a long shot to find something starting that night. A quick Google search later I found the Microformats meetup happening in less than an hour at 21st Amendment. Knowing nothing about who would be there or what to expect, I got on the next bus that direction, and hung out right outside the door.
Like any good stalker should, I spent a few minutes researching microformats and the people involved. I was able to find a couple names and photos of people who might be there, so I kept my eye out for someone to approach who resembled the tiny photos I found on my iPod. At 8:00 sharp, Tantek walked up and started poking around on his phone, which was a good clue. After a brief introduction I found myself having dinner with some great people!


Ariel and Tantek
Thanks for the great evening, guys! If I’m ever back in San Francisco I’ll look you up again!
Made it back to the house after a subway ride through the fog.

Did I mention it was foggy?
First stop: Long Beach airport. Did I step into a 70s movie?
The Long Beach airport wasn’t quite what I expected. Walking through the airport I feel like I’m in the middle of a 70’s movie. I got off the plane into the terminal which basically just had a bunch of “leave now” signs directing me out of the airport onto the street. The font used for the airline signs in the airport is old-school! 
Using Google maps on my phone, I located a coffee shop to hang out in for a few hours between flights and went to the bus stop. I was surprised when I saw the bus come 20 minutes early, so I got on. As soon as it left the airport loop I realized I was going the opposite direction. I took the bus down to Circle Center and saw a Chase branch.
I figured this was a good a time as any to break my $50 into small bills. I had to walk through a metal detector carrying my laptop bag and backpack full of metal to get inside. The tellers were arranged in a circle so that all the customers were on the outside. Is this a more effective layout for preventing a robbery?

How did I get here?
A couple blocks away was a coffee shop so I figured I’d crash there for a while and figure out how to get back to the airport.
Linux Software RAID and LVM
Posted by aaron in Hardware, Linux, Server Software on August 31st, 2009
I wanted to create a RAID 5 array with four 1tb drives. I only have three, but I have a 750gb and 320gb drive lying around. I figured there was probably a way to combine them into a 1tb drive that I could use with the others.
Using Linux’s LVM, I can create a logical partition from the two smaller drives as big as the 1tb drive.
$ pvdisplay
Lists all physical volumes managed by LVM. First we have to create the physical volumes for LVM. I prefer to create the volumes out of partitions, although you can do it from raw drives too.
First let’s use fdisk to create “Linux LVM” partitions on the two drives.
$ fdisk /dev/sdb Press "n" to create a new partition Press "t" to set the partition type, and enter "8e" for Linux LVM.
When creating the partition, accepting the defaults will make it use the whole drive. I want to use the entire 750 drive and only part of the 320 drive, so that in total it has the same number of blocks as the 1tb drives. So I first created the “Linux RAID” partitions on the 1tb drives so I could see how many cylinders it listed, which ended up being 121601. So I created a partition the full size of the 750 drive (91201 cylinders), then created a 121601-91201 cylinder partition on the 320 drive.
$ fdisk -l /dev/sdb Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Device Boot Start End Blocks Id System /dev/sdb1 1 30400 244187968+ 8e Linux LVM /dev/sdb2 30401 38913 68380672+ 83 Linux $ fdisk -l /dev/sdj Disk /dev/sdj: 750.1 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders Device Boot Start End Blocks Id System /dev/sdj1 1 91201 732572001 8e Linux LVM
Now that I have the two partitions ready, I moved on to LVM setup.
$ pvcreate /dev/sdb1 $ pvcreate /dev/sdj1
This sets up the two partitions as physical volumes for LVM.
Next is creating a logical volume group:
$ vgcreate vg_tb /dev/sdb1 /dev/sdj1
This creates a volume group called “vg_tb” using the two physical volumes sdb1 and sdj1.
Let’s take a look at what we have so far:
$ pvdisplay --- Physical volume --- PV Name /dev/sdb1 VG Name vg_tb PV Size 232.88 GB / not usable 832.50 KB Allocatable yes PE Size (KByte) 4096 Total PE 59616 Free PE 59616 Allocated PE 0 PV UUID 70hPKX-n11U-RcB6-0Kyt-1SOP-ni7E-2Y9hcE --- Physical volume --- PV Name /dev/sdj1 VG Name vg_tb PV Size 698.64 GB / not usable 2.34 MB Allocatable yes PE Size (KByte) 4096 Total PE 178850 Free PE 178850 Allocated PE 0 PV UUID PzFb9b-lapG-KdT3-78nh-Gq75-F0Lo-I3xCrl --- Physical volume --- PV Name /dev/sda2 VG Name VolGroup00 PV Size 111.60 GB / not usable 2.86 MB Allocatable yes PE Size (KByte) 32768 Total PE 3571 Free PE 1 Allocated PE 3570 PV UUID 1wM65Z-3QGd-vDiq-mq1R-YhEE-Ackp-hh3g13 $ vgdisplay --- Volume group --- VG Name vg_tb System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size 931.51 GB PE Size 4.00 MB Total PE 238466 Alloc PE / Size 0 / 0 Free PE / Size 238466 / 931.51 GB VG UUID olg9GP-x1sC-sFAD-TgWY-KIIx-YWNt-kL763n --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 111.59 GB PE Size 32.00 MB Total PE 3571 Alloc PE / Size 3570 / 111.56 GB Free PE / Size 1 / 32.00 MB VG UUID IZ25LV-oMOG-DwKK-QuFN-bqqp-ClUe-d71k5l
So far so good. The next step is to create a logical volume in the new volume group:
$ lvcreate vg_tb -n onetb -l 100%VG Logical volume "onetb" created
This creates a new logical volume called “onetb” in the “vg_tb” group using 100% of the group’s available space. Now let’s take a look at the list of logical volumes:
$ lvdisplay --- Logical volume --- LV Name /dev/vg_tb/onetb VG Name vg_tb LV UUID sQKaq9-D6Mv-p8it-vWGW-O7DX-FGmC-cl5FSh LV Write Access read/write LV Status available # open 0 LV Size 931.51 GB Current LE 238466 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2 --- Logical volume --- LV Name /dev/VolGroup00/LogVol00 VG Name VolGroup00 LV UUID G5hlbb-tA3S-qhTS-03us-f9dl-1Vxy-9vDSU5 LV Write Access read/write LV Status available # open 1 LV Size 109.62 GB Current LE 3508 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 VG Name VolGroup00 LV UUID 7NZrY9-1wSJ-4fRp-VPnM-V07u-9rj8-vmtxTx LV Write Access read/write LV Status available # open 1 LV Size 1.94 GB Current LE 62 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
You can ignore all of the VolGroup00 things, those are the auto-created volumes from when I installed Fedora.
At this point, I have a new device at /dev/vg_tb/onetb which is the same size as my 1tb drives, and I can use it exactly as I would use the 1tb partition at /dev/sdf1.
Now it’s time to create the RAID 5 array from these four volumes.
$ mdadm -v --create /dev/md1 --chunk=128 --level=5 --raid-devices=4 /dev/sdf1 /dev/sdh1 /dev/sdi1 /dev/vg_tb/onetb mdadm: layout defaults to left-symmetric mdadm: layout defaults to left-symmetric mdadm: layout defaults to left-symmetric mdadm: layout defaults to left-symmetric mdadm: layout defaults to left-symmetric mdadm: size set to 976756608K mdadm: array /dev/md1 started.
The array will begin syncing, and you can watch it by running:
$ watch -n 1 "cat /proc/mdstat" Personalities : [raid6] [raid5] [raid4] md1 : active raid5 dm-2[4] sdi1[2] sdh1[1] sdf1[0] 2930269824 blocks level 5, 128k chunk, algorithm 2 [4/3] [UUU_] [=>...................] recovery = 5.5% (54017536/976756608) finish=593.1min speed=25925K/sec md0 : active raid5 sdg1[0] sdc1[3] sde1[2] sdd1[1] 2197715712 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU] unused devices: <none> </none>
While this is syncing, we can create the ext3 filesystem.
$ mke2fs -j -b 4096 -m 0 -E stride=32,stripe-width=96 /dev/md1
This creates an ext2 filesystem with journaling (ext3), the block size is 4kb, and 0% of the blocks are reserved for the superuser. The stride is calculated as the raid block size / ext2 block size (128k / 4k = 32). The stripe width is calculated as the stride value times the number of data disks in the array. In a 4-disk RAID 5 array, there are three data disks, one being for the parity data.
This will take some time, and will significantly slow down the sync process. Mine dropped from 25mb/s to around 1mb/s. I figure I’ll let it create the filesystem so I can start copying data to it right away, and let it finish its sync on its own time.
While you’re at it, you should set up munin to monitor the SMART data from all the drives as well as the status of the array using my munin-raid-monitor plugin.
Additional Reading:
- http://linux-raid.osdl.org/index.php/RAID_setup
- http://bfish.xaedalus.net/2006/11/software-raid-5-in-ubuntu-with-mdadm/
- http://www.linuxquestions.org/questions/linux-hardware-18/how-can-i-override-the-5.00-reserved-for-the-super-user-mkfs.ext3-creates-616546/
- http://www.linuxconfig.org/Linux_lvm_-_Logical_Volume_Manager
- http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/LV_create.html
Workaround for Comcast blocking port 25
Comcast just started blocking port 25 outgoing. I have several computers at home configured to send email reports of cron jobs. Of course they do this by trying to send mail on port 25 from inside the house to my mail server outside. Now that Comcast is blocking that, I need some other way for my emails to be delivered.
The easiest solution I could come up with was to tell my mail server to listen on another port such as 587, and have my firewall route requests for port 25 to port 587. Here is the iptables rule to do that!
iptables -t nat -A PREROUTING -p tcp -i eth0 -d xx.xx.xx.xx --dport 25 -j DNAT --to-destination :587
Where xx.xx.xx.xx is the IP address of my mail server. Now all the computers inside think they are communicating with my mail server on port 25, but the firewall secretly passes the request on to port 587 instead.