Every now and then I see one of those posts that shows what someone is carrying in their bag. I love those posts. I love seeing what people carry every day. I love comparing what they carry to what I carry every day. This is not one of those posts. This is the worst-case scenario, I don’t carry this every day. This is what I was carrying in my carry-on on a plane from San Antonio, Texas to where I live in Amsterdam. While the bulk of it was on a 777 from Chicago, the first few hours were on a Canadair jet which means I couldn’t carry any big bags for carry on, and yet this was all with me.
So here is whats in the bag, this time:
Panasonic GH1 with Really Right Stuff L Bracket
Panasonic GH2 with Panasonic 20mm/1.7
Panasonic 14-40mm lens
Panasonic 7-14mm lens
Panasonic 100-300mm lens
Nikon 20mm/2.8 mounted on Novoflex Nikon to MFT adapter
Nikon 50mm/1.4 mounted on Lensbaby Tilt Adapter
Cokin Filter Holder and various filter step-up rings
3 Singh-Ray Graduated Filters
Singh-Ray Vari-ND, Singh-Ray Polarizer
Hero GoPro HD with a few mounts
Really Right Stuff Rail and Panorama Head
Really Right Stuff BH-25
Extra GH1 battery (wish I could find the GH2 batteries)
2 96-LED lights
Zoom H1 Audio Recorder with Red Head Windscreen
Zoom H4n Audio Recorder with Red Head Windscreen
AudioTechnica Lavalier Microphone
Gitzo 1541t Traveler Tripod
Manfrotto 428 Leveller
Weifang WF-717A Video Head
GorillaPod (the big one and the small one)
Pixel Intervalometer for GH1/2
Chargers for GH1 and GH2 batteries
3rd Gen Kindle
Various drugs (all legal: Benadryl, Nytol, etc)
Various USB keys
15″ MacBook Pro
Mac SuperDrive DVD drive in external housing (since I have 2 internal drives)
2+ TB in various external drives
iPod Touch (used as remote for teleprompter for iPad, etc)
Zune 80 (since the iPod sucks for music)
Headphones (including DIY custom fit ear pieces)
TideToGo cleaning stick
In case you are wondering, yes, this was way too heavy and yes, TSA made me take almost all of it out of my bags.
Yesterday I started tackling a new problem in Python: How to parse a pcap file. The idea is to host something on Google App Engine and have it do the work. I started working with the Python library dpkt to open the pcap file. But pcap files show the source and destination ip addresses as binary packed decimals. That was a format I never heard of till now so I had no idea what to do with it. It turns out that socket.inet_ntoa will convert it to the string you are used to seeing, like 10.9.8.2.
Unfortunately, Google App Engine doesn’t provide the socket library. So I figured there had to be a way to build this functionality on my own. Let me tell you. Considering how much (erm, how little) I know about Python, this was no easy task. First I had to figure out what that library function does.
Well, the socket library in Python is simply a wrapper to the C socket library on the OS. Finding that source code ended up being fairly easy, but it didn’t really help me much. It wasn’t until I stumbled onto this article on StackOverflow that I started getting somewhere. But you may notice that that’s a Java example and I am looking for Python.
It was pretty trivial to translate that code from Java to Python:
But that wasn’t getting me what I needed. When I tried to use it, I got: TypeError: unsupported operand type(s) for >>: ‘str’ and ‘int’. It wasn’t making much sense to me. So I tried a bunch of things to try to understand what this number was. After a while I saw that the number I was getting from Wireshark via dpkt was ‘x01nx01’. Again, not making much sense.
It wasn’t until I went back to Wireshark that I started cluing in on the problem. I looked at the packet and found the section that mentioned the source IP address. It said 10.1.10.1. Clicking on that ip address highlighted the hex representation below: 0a010a01. From the classes I teach on parsing text files using Datagrabber which is part of our Alchemy product, I know that the hex representation of a newline is 0a. That explains the 0a or n in the middle of the src address above.
Now that I had a better understanding of what dpkt was spitting out for the ip address, I started looking for ways to convert that into a more usable format. Thats when I stumbled onto this StackOverflow discussion on converting hex strings to IP addresses. Struct.unpack(‘!I’,number) was the key.
The resulting function to replace socket.inet_ntoa is listed here:
number = struct.unpack('!I',orignumber)
When you learn something new, you must practice it every day before you really understand it. I started working with Python the other day, so I am forcing myself to practice by writing scripts for various things that come up. Today’s task was cleaning up one of the pages on this website.
One of the pages in the menu on top of this page is for my ConCall Numbers. Its a listing of the Orange Business Conferencing dial in numbers for many countries around the world, along with the participant pass code. I use this for the classes I give, as well as for meetings I need to set up. But the page has been pretty ugly for a long time.
The text had come from an email I received that listed out the numbers. I simply copied and pasted it from the email into the page HTML editor. Along with it came dozens of codes on every line. Fixing it just wasn’t a priority. But it turns out that fixing it was very easy with just a little bit of Python.
The result is shown here. Its still a boring list of numbers, but as you can see, its a lot nicer to look at.
It turns out that the script was very easy to create. I open a file, run three regex searches, and then write it to a new file. Once I had the file, I manually added a starting and ending <table> tag and I was done.
For those who are curious, here is the complete script. I am sure there is a better way to write this, but this was quick and easy, and it worked.
text = open(filename,'r').read()
text = re.sub('(&nbsp;s?)+', '</td><td>', text)
text = re.sub('<br />','</td></tr>n<tr><td>',text)
text = re.sub('<tr><td>s?</td><td>','<tr><td>',text)
if __name__ == '__main__':
As you are probably aware, technovangelist.com is hosted at SquareSpace.com. It hasn’t always been that way. I switched to SS about a year and a half ago when I got tired of self hosting using Community Server and Graffiti and various other home brew solutions. SS has the advantage of making it very easy to come up with a uniform style across your pages, with some customization in every area. It’s really a well designed solution and after this much time with them, I have no plans to leave. That said, I do have one beef with them: They don’t offer any server-side page generation techniques beyond the sidebars.
Take a look at the home page at technovangelist.com. I have the sidebar, plus 5 other areas of content, each pulling from a different RSS feed. There are 2 feeds from my blogs here at technovangelist and at faxsolutionsblog.opentext.com. There are 2 other feeds from my videos at vimeo and youtube. Finally there is a feed from my photoblog site, chromagenic.com. The home page at technovangelist really is the clearing house for the brand of ‘me’.
But I did it anyway for the first version of this page. I used the magical Google Feed API which did exactly what I wanted. Every time it ran, though, 1-2 seconds were required for drawing the page. There had to be a better way. The first thought was to design a client-side app for me to run every time one of my content sources updates. So I started going down that route, working on some test projects before starting the final Mac app that I wanted. That was last Saturday.
Then during one of my little research missions, trying to find something I needed for the app, I re-stumbled on Google App Engine. Here was a hosted location that could run my own custom server-side code. The original thought was to build the page at GAE, then do some sort of server-side include of the content. But then I thought I hit a bit of a wall: the app had to be written in Java or Python.
I hadn’t touched Java in 10 years. I last used it when I did some outsourced marketing projects with Sun Microsystems, building test apps that were used in instructional materials. But then I went .Net all the way working for Microsoft and then Captaris/Open Text. I felt re-learning Java was going to be a big hurdle to GAE. Python on the other hand was a bit more digestible. I didn’t know the language, but I have a few friends who spend all of their working days with the language. One of my best friends from my Microsoft days was a PM with IronPython. I felt Python was more accessible.
So I started looking in to it. I installed Aptana Studio 3 which comes with PyDev which allowed me to create and build Python scripts in as easy a way as possible. And I followed the fantastic series of videos that are part of Google’s Python Class. Go ahead and watch them. It will take you five hours and you’ll come away with a pretty good understanding of the language. So I started looking into Python on Saturday evening around 8PM, and by 5PM on Sunday I was beginning to build my GAE app to generate my home page. The only reason it took so long was that I had a Dim Sum lunch with friends for a few hours in the middle of it all.
The end result is a page that is generated in less than a second. And it’s a whole lot easier to manage too. But it’s not perfect yet. For now it involves a manual step. I’ll go to the GAE page and copy the page. Then go to edit my site, and paste the code in. The result is that for you, the home page is displayed as quickly as possible. And I have to run a single manual, 1-minute step every couple of weeks. In the near future (perhaps next weekend), I’d like to see about having it auto-update my SquareSpace site, or at least cache the content locally and figure a way to do some sort of server-side include.
It was a fun project and I was very happy to see a working solution by the end of the evening Sunday night. And learning Python has already proven to be a good investment. I am already leveraging it in some of the scripts I have written to automate the stuff I do at work. Maybe I’ll write up some of the details of those scripts, as well as more about what I actually created on GAE….another night…
Every now and then I am asked to go to places that are….um…questionable when it comes to safety and security. Or they are just countries I know nothing about. Some of those places I end up going to, others I have to decline the request. Thankfully my management understands that while I love traveling, there are some places that are too dangerous, and they trust my judgement. But even if I do decide to stay home for a good reason, I usually regret missing out on an adventure later on.
So how do I decide? Well, it all starts with a visit to two different websites:
- US State Department Travel Advisories – Choose the country in question from the drop down and read what they have to say. Now I realise that you have to read these carefully and not assume its all true. There is danger everywhere, even where I live in Amsterdam. If there is a single citizen killed in that country, there is risk of overemphasizing the risk here. But when they are full of doom and gloom, I have to pay attention.
- UK Foreign & Commonwealth Office Travel Advice – This is pretty much the same information from a British perspective. Since I carry both a US and UK passport, I like to check both sites.
Sometimes one site says its a place to avoid, and the other says its fine. Other times they both agree. I use the info I find there to help me come up with a good decision.
One of the next steps that I take is to find out what airlines fly to the region. This is usually done with a search on Google for “What airlines fly to [city name here]”. If I see well known airlines listed, then I feel better. So I start looking to see how much the airfares cost. Again, all of these things add to my list of information to make a good decision.
After all those steps, I’ll search Flickr for photos of the region, as well as info from Google Maps. I’ll put a public query out on Twitter. All helping me understand the place.
I had to go through this process just today to decide whether or not to go to Port Moresby in Papua New Guinea. I am still not decided, but its not looking good. The sites up top had nothing good to say. In fact they warned of violent crimes and kidnappings where the weapon of choice is a machete. Having grown up in Miami, I know what a machete is and the damage that can be done with one. Twitter responses warned that its pretty dangerous. So I am pretty sure I won’t go, but I am still looking for more info to help me decide.
Another recent questionable place included Aksay, Kazakhstan. Both US State and UK FCO said to be alert but that they were mostly safe. A family friend said the capital was fine and could be fun since a friend of his lived there. Flickr didn’t make it look too nice, but I wasn’t going to let that dissuade me. It wasn’t until I got to the airline choices that I got worried. Getting to the capital, Astana, would be fine. But the flights to Aksay were only on airlines banned from European travel due to lack of safety records. Travel by train was measured in number of days. It was the travel options that made me think twice and eventually decline the invitation. I still think it was a good decision, though I do regret not going….would have been a great adventure.
There are plenty of other countries I go to that are questionable and I have had a great time in most of them. I think no matter where I go, there is a chance of coming to an untimely end. But I try to avoid throwing myself into really bad situations and the information I gather from resources like these help me find and avoid those bad situations.