Damon Cortesi's blog

Musings of an entrepreneur.

Adium + Quicksilver Script

| Comments

For whatever reason (perhaps it’s the slowness of Twitterific, or the lack of any other application to satisfy my Twitter-craving) I wanted to be able to Tweet from Quicksilver. A quick Google led me to an AppleScript to Tweet from Quicksilver, but alas…it was a year old and not functional.

So, two hours later - allow me to present an updated version of the script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div class='bogus-wrapper'><notextile><figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>using terms from application "Quicksilver"
</span><span class='line'>  on process text im_text
</span><span class='line'>      repeat with im_delimiter_position from 1 to (length of im_text)
</span><span class='line'>          if character im_delimiter_position of im_text = ":" then exit repeat
</span><span class='line'>      end repeat
</span><span class='line'>      set im_contact_name to characters 1 thru (im_delimiter_position - 1) of im_text as string
</span><span class='line'>      set im_message to characters (im_delimiter_position + 2) thru (length of im_text) of im_text as string
</span><span class='line'>      tell application "Adium"
</span><span class='line'>          
</span><span class='line'>          set user to first contact whose (status type is available and display name starts with im_contact_name)
</span><span class='line'>          
</span><span class='line'>          if not (exists (chats whose contacts contains user)) then
</span><span class='line'>              tell account of user to (make new chat with contacts {user} with new chat window)
</span><span class='line'>          end if
</span><span class='line'>          
</span><span class='line'>          send (first chat whose contacts contains user) message im_message
</span><span class='line'>      end tell
</span><span class='line'>      return nothing
</span><span class='line'>  end process text
</span><span class='line'>end using terms from</span></code></pre></td></tr></table></div></figure></notextile></div>

The procedures for installation and usage are the same.

  • Paste the script into Script Editor and save it in
    1
    
    ~/Library/Application Support/Quicksilver/Actions
    as Send As IM.scpt.
  • Cmd+Space, period, “Contact name: Message”, tab, S, enter.

I now return you to your regular Twedule.

Twitter Stats

| Comments

Final Update to This Post For those not following along at home, I finally took Twitter Stats to the next level and released a webified version over at TweetStats.com. I, somewhat unfortunately, had to go with TweetStats as twitterstats.com was already taken. :( I made a post about it here and you can see an example of my stats on the site on the graphs page.

So I’ve been a user on Twitter for a little over a year, but it wasn’t until recently when I hit 2000 tweets that I wanted to see what my Twitter history looked like over that period. Ever being the statistics nerd, I pulled down all of my tweets and using a combination of curl, sed, grep, Excel, and Numbers, managed to generate some nice graphs.

Being the automation weenie that I am, I eventually hacked together a perl script that did everything except paste the data into Numbers.Although I won’t post it here (because I think the Twitterocracy would have a cow with how it’s implemented), you can DM me your email and I’ll send you the code and instructions. See below - bugs be damned, I’ve made it publicly available.

Basically, the script pulls down all your tweets and stores them in an csv file. It then runs some statistics on the csv file and then copies the resulting stats to the OS X clipboard to paste into each table within Numbers. If run with a pre-existing tweets csv file, the script will calculate the different between your current status count and only download the pages necessary, thus saving the Twitter servers from some bandwidth. ;)

For the record, here are mine. :-D @dacort's Twitter Stats

Update Thanks to kosmar for pointing out that I can actually do this entire thing without your password. Head => Wall. I’ll be updating it accordingly and hopefully even making a webservice out of it soon. :)

In addition to not needing your password, the script should also adjust the times for your tweets to whatever the system time is where you run the script.

Another update: I’ve also posted the script on my site and you can download it here: twitter_stats.zip. Feel free to contact me with any questions via twitter or web.dpc at dcortesi . com.

Many people have noticed a large after-lunch spike around 2pm. At least for me, this was due to Twitter being down most of the morning one day and then tweeting like crazy when it came back online.

BUG FOUND AND SQUASHED

There was a small bug that cropped up after I switched the script to not require your password. It accounts for the odd “[Tuesday|January|2pm] Peak” that people were seeing. This bug has now been fixed and an updated script is available. My apologies.

Unfortunately, if want the most accurate tweets, you will have to rm your csv file and run the script again.

Date::Calc aka failure on line 13 Some of you (on Tiger?) may be missing the Date::Calc module that I use to figure out weekdays. Although I tried to use as few perl modules as possible, this one was essential. Use the following command (thanks to a couple twitter peeps for the reference) to install:

1
sudo perl -MCPAN -e 'install Date::Calc'

and keep hitting ‘y’. ;)

Final (hopefully) Update on this page as it’s getting messy.

For those of you not on OS X with Numbers, there are a few options: @bck webified my code (w00t): Twitter Stats @mmc decided to use gnuplot: Twitter Stats in SVG Using GNUPlot @cbarrett modified it to utilize the Google Chart API: Twitter Stats with GChart @kejadlen reverse engineered my original script to Ruby: Twitter Stats in Ruby

I still want to write my own webified version (Google Chart aesthetics leave a little bit to be desired…), but I have yet to settle on an option that I like.

Rothenburg Ob Der Tauber

| Comments

Since German does not have the th-sound (as in thin), the proper pronunciation of the first syllable of the name is more or less like English wrote, while -burg is similar to “buak.” Source: Wikipedia.

This town not only brings you back hundreds of years, but it makes you feel like a little kid at the same time. I don’t know too many children that don’t get excited by the idea of knights and castles and such imaginations run rampant while wandering the cobble-stone-lined streets of this town.

Take yourself back 500 years - the sleepy guard on the lookout tower right at dusk. Fog rolling over the German hills and seeping through the forest. A light registers in the distance, then two. Then five-thousand more crest the hill as you run to the tower bell and start alerting the forces. Imagine that you can feel all of that standing on the lookout tower in Rothenburg and the only difference is that the two lights are vehicles far in the distance and the five-thousand are a neighboring town turning their lights on as dusk settles over the countryside. Imagine being on lookout duty!

That’s the magic of this town.

But perhaps it was the fact that you enter through a small door in a 30-foot high wall into a town straight out of medieval times. Perhaps it was the way I walked forward, turned left, and saw a guard tower that I almost broke into a run to get to. Perhaps it was the darkened hallways of the castle walls that made me feel like a soldier stealthily bypassing the defenses of the town. Perhaps it’s the extent that one can explore this town, parts of which are from 1250, and it doesn’t feel like it’s been changed since its creation. Am I supposed to be in here?

Ultimately, it’s the weight of many generations of history that are readily apparent even to the casual observer. I’ve already mentioned the castle walls and the lookout tower for the little boy in all of us. But take a step into St. Jacob’s church and immediately you are humbled by the beauty of this creation for God. Two altars, carved by a famous wood carver are unspeakably amazing creations of art. Hours along could be spent gazing at the detail that has been painstakingly carved such as to nearly bring the scenes to life. Differences in architectural styles can be seen as you gaze upwards to the ribbed arches and you see how masons began to realize the strength of arches and widen the windows as a result. The High Altar (1466) and stained glass windows 56 ft. high. Altar of the Holy Blood

The Christmas Market is also a draw for many towns in Germany at this time of year, Rothenburg not excluded. Gluhwein (mulled wine) is an important stable of all these markets and I couldn’t help but grin as I stood there sipping my gluhwein listening to carolers in some distant corner of a building. Passersby could obviously see the child-like glint in my eye as more than one person gave me the smile that says “I can tell you’re having a great time, are completely content, and it’s so evident…I must smile with you”. Or they could have just been poking fun at an obviously out of place American. I forgot to mention I was carrying an umbrella with “Deutschland” written all over because I didn’t have one of my own and had to pick up one at one of the many touristy shops. A view down into the town square

I will admit, the city is very touristy, but that in no way diminished its charm or spectacle for me. If anything, the desire to maintain authenticity (iron signs still have to be approved to hang outside businesses, at least on one street) furthers the experience.

The Medieval Crime Museum was also fairly interesting - I didn’t quite realize how well-established the protocol for torture originally was. Again, as a child that was interested in crime, criminals and medieval times, this town and its associated history could easily have kept me preoccupied for more than the time I allowed myself. Shame mask

I also chose to drive to Rothenburg, approximately an hour-long drive from where I’m staying. Had it not been raining steadily, I probably would have been hanging my head out the window like a dog checking out the beautiful German countryside and quaint little towns. I admittedly did stop a couple times just because the architecture is so unique and intriguing to me. The German road system is fairly easy to follow if you’ve planned your trip out ahead of time and you don’t deviate too much. Another quaint little German town

Again, feel free to check out the photos on flickr of Rothenburg.

Amsterdamalicious

| Comments

Sometimes you visit a place and feel instantly at home. You wander the streets within two days of arriving and already feel as if you know where you are and where you’re going and can get wherever you want to go.

This was Amsterdam for me.

I dropped in on a Wednesday night with absolutely no idea of what to expect from the city of the famed Red Light District and “coffee shops”. Nor had I even looked at a map of the city.

Cobble-stone streets and bicyclist after bicyclist whizzing by on the left and trams whizzing by on the right is the first image that pops to mind. I had about a day of wandering the city where I just felt my senses buffeted from all angles. The shock of open prostitution and the smell of legalized “soft drugs” combined with the tight streets where you must dodge bikers, cars and trains left me in a bit of a dazed state. After a canal boat tour and wandering around the city for a good couple hours, however, I regained my senses and started to feel at ease. The city feels a bit hectic at its heart, but once you allow yourself to relax everything seems copacetic.

Being fairly small and flat - Amsterdam is a walking and biking kind of city. Arriving on the train, I was amazed to see the gigantic bicycle parking structures but seeing as how the majority of the population utilize bikes to get around the city, it makes sense. I quickly learned that the bike lanes are almost as wide as some of the streets and there is no forgiveness for the inattentive tourist that does not pay attention to the bikers.

Amsterdam is a city for the explorer. It is a city for the person that relishes in finding the tiny, obscured alley that leads to a completely different world than the road you just stepped off of. The city is jam-packed, and as such every twist and turn affords a new surprise, a new smell, a new site. Amsterdam is also not for the weak at heart. Prostitution is legal. The Red Light District is real and marked on the tourist map. Drug dealers whisper different vices into your ear as you slide past them in the red-hued darkness at night. Various smells of other more recreational, legal drugs drift past your nostrils as you walk the streets. No, Amsterdam is not for those lacking a sense of adventure.

Perhaps a few of my favorite experiences. Restaurant Savini, located just steps from the hotel I stayed at, is a fantastic Italian restaurant. Stepping in flooded my mind with memories and good friends, who I then text messaged a quick hello from Amsterdam. I ate here one other time in my short stay and it was well worth it.

Cafe Pacifico - the first restaurant in Amsterdam to sell Mexican cuisine. Despite the absolutely terrible service (“That’s where our waiter was, flirting with girls at the bar.”), the food was excellent and living on a regular diet of beer and bratwurst the past week, a much appreciated change.

The beer tasting cafe I stumbled upon while wandering the city, called Cafe Gollem. Although I didn’t get a chance to step inside, the signs outside had me hooked at the mention of 200+ beers, 95% of which were Belgian. A cozy joint in the style of what are called Amsterdam “brown” bars, I could easily see losing myself in there several nights a week.

The church I took refuge in when it started raining - note that I am biased because I love church and cathedral architecture so I will sit in a church and just stare at the structures. A church I visited the day before Artsy-fartsy in the church.

The “Welcome to Detroit” sign in the center of town that mysteriously disappeared when I took others to show it the next day. Welcome to Detroit?

Finally, Begijnhof. A courtyard located just off the center plaza in Amsterdam that offers an amazing barrier to the hectic pace of the city. Quiet, surround by typical Amsterdam-style homes, with a church in the middle that was unfortunately closed to the public because of a concert. The church at Begijnhof Statue in the courtyard Lovely little courtyard

There are more photos up on my Flickr page of the trip: .

It was a fun trip, even with the additional train adventures. ;o)

Amsterdam

| Comments

Well I just arrived in Amsterdam and already, “window shopping” has taken on a whole new meaning. I had absolutely no clue what to expect of the city, but even the 15-minute walk from the station has confirmed pretty much everything I’d heard about it.

My cohort in crime and I walked out of the train station just before midnight with nary an idea of where to go. After extracting some money from the ATM and printing out a shady-looking map, we headed across the street dodging construction workers (again, midnight) and motorized bicycles zooming down the bicycle lane that’s so dedicated it’s actually just a mini street next to the regular one (which isn’t so big itself). We continued walking, trying to determine where we were but street signs seem to be rather sparse. Eventually we felt we had walked too far and, succumbing to our better male senses, walked into a random hotel and asked for directions. The guy at the front desk pulled up Google Maps and showed us where we had to go. About 8 head shops and 2 “red light” shops later, we were at our hotel.

Brief commentary - Until you see a scantily clad group of women standing in windows basically selling themselves in person…it just doesn’t seem real. Now I’ve been around this world for a while and even the sight of those women as I was walking by made me blush like a little kid. In any case…

We’re settled into the hotel now, after a fun ride up from where I’ve been staying in Germany…despite a three-hour delay. Meh. But luckily we missed our connection in Frankfurt (we think we should have just stayed on the train, but as neither of us understand much German…) and hung out in the airport for an hour and a half. I say luckily because the original train we were supposed to be on broke down and the passengers had to get toted back to the next one that we ended up having to catch.

Happy Turkey Day

| Comments

Happy Thanksgiving to all my friends and family. For only the second time in my life, I am spending Thanksgiving away from home. The first time was when I was visiting a friend in Venice and the reason this time has to do with a combination of seeing my family back in October, and my recent travel to and from Germany. I got back from Germany Monday, am here in Seattle for Turkey Day, and then I leave again for Germany on Monday for a good couple weeks.

Germany was, simply put, awesome. Knowing absolutely no German was a bit of challenge, but most Germans actually know enough English to help me along so it wasn’t really too much of a problem. I would go through phases of confidence, however. Like the second day I was there and I had looked up a few German phrases on about.com and headed out into the streets saying “Morgen!” to passerby and anybody else I had a chance to. Unfortunately, with such confidence comes the assumption from others that I was able to actually speak German. And when they would reply to me as such, I just kind of stared back at them with a big dumb American expression on my face. Oh well.

Seeing as how I didn’t know German, I eventually started ignoring most signage. This became a problem when I wanted to eat breakfast at the hotel I was staying at. I was actually staying in a co-workers apartment as he was out of the country, so I wasn’t familiar with the hotel. Little did I realize that even though the room I was staying in was located in one building, the actual hotel was down the street. This wouldn’t have been so bad were it not for the fact that the building I was staying in was also a hotel. But when I walked down to their front desk to drop off my laundry, the poor girl was quite confused. I eventually showed me room key and she grinned and said she would take care of it for me. Not really understanding what had just happened, I walked across the hallway and sat down for breakfast. The girl, again looking confused, came up to me and told me that I could have a much nicer breakfast if I went to the hotel I was actually staying at. oops

The weekend before I came home, I went to Dresden to take part in an Expat Blogger Meetup. This was really fun as I got to spend time in Dresden, a fantastic city, with several Americans that were already pretty familiar with Germany. One of the other Expats even grew up in Connecticut originally! Dresden, and all of Europe, is so full of history I feel I could wander around aimlessly for quite a long time. Driving on the autobahn was also fun - it’s nice to be amongst other drivers that are considerate and know the rules of the road.

I’m off to a turkey here in Seattle for now. Feel free to check out my Dresden trip on Flickr.

Socnets and Security

| Comments

There’s a meme going around about socnet ROT measurements and I got pinged by Clay Newton about socnet inputs into security metrics. It’s always interesting to discuss security and ROI, because one of the more elusive aspects of security. Having good security is generally compared to insurance. You don’t realize you need it until it’s too late. OR You pay and pay and pay for it, but never realize the need for it. So what’s the ROI? Not being hacked? How do you monitize that? ROI is hard enough to determine in general, nevermind on a social network where there’s no data. So allow me to ramble for a few brief moments.

Security metrics are somewhat difficult in general, especially if you’re trying to get detail on how much “hacking” is going on. People don’t like talking about being hacked in general, never-mind on a public network. I’ve tried tracking various security related keywords on twitter such as “hacked”, “security”, “hacker” etc and the resulting tweets are pretty limited. So let’s talk about security within social networks themselves.

What are the two primary concerns on social networks? The enormous!!! attack surface and the information disclosure.

Let’s take attack surface first. Organizations have their perimeters relatively well locked down these days. The internal networks are getting better, but still pretty soft. Nevertheless, any security research will tell you that the current target these days is the client, more specifically…the browser. Individuals are becoming much more connected. And attackers have realized that if you can attack the individual, you can gain access to a whole bunch else. Historically there have been a couple widescale attacks on social networks. The samy worm (October 2005) took advantage of an xss bug in MySpace’s site and affected over one million users in 5 hours. Now the samy worm was fairly benign, but there was another attack on MySpace that took advantage of the ad network and a vulnerability in windows metafile to install adware, keystroke loggers and who knows what else. Again, this attack likely affected over one million users. Even this past week, there was an issue with MySpace music pages. So we’ve seen that malware distribution through social networks is definitely possible. But, of course, social networks are getting more dynamic. With Facebook releasing their SDK and OpenSocial coming out, socnets are trying to make it easier to write applications that are portable across all networks. And the only difference between a malicious application and one that’s not…is the intent of the author.

The other concern, of course, is privacy. Imagine a low-profile worm, silently crawling across all networks gathering the information you’ve put about yourself on those networks and compiling it into a giant database. Think, just for a brief moment who you’ve given access to your life. You could build an immensely detailed picture of the past five years of my life by simply crawling the diferent social networks I’m on.

Think of all the hard work you’ve put into making each of your networks complete. MySpace - how many crimes (the most recent is the UW student being accused of murder) have been revealed becauuse of MySpace. OpenSocial - how long did it take to “hack” the first opensoc app? 45 minutes. Facebook - Facebook is “more mature” than MySpace, but it collects a lot more statistics about their users (I believe, because it’s beneficial to then join facebook networks). What if somebody could harvest all of that data. …and then sell it. How’s that for an ROI?! Twitter. To make twitter work, you have to tweet. To tweet, you have to expose information about yourself. To expand your network, you have open yourself up. Unless you already have a network.

So those are a couple of my immediate thoughts when the words security and socnet appear in the same sentence. I realize that didn’t quite address the original question, but I would be happy to answer any specific questions. For now, I must collapse on my German bed.

Germany

| Comments

So after approximately 21 hours of travel, I am sitting in my temporary accommodations in Germany. The trip was great, mostly because of the business class ticket that allowed me to eat non-stop and catch some good movies on the way over. I just wanted to say a quick hi that I’m excited to be here (this is my first trip to Germany) and I’m already having a great time. I went exploring a little bit tonight and got a little lost, but not really. My fantastic male sense of direction kept me tuned in at all times to where I was. ;-)

For now though, it’s time to catch up on some much-needed sleep.

How Design Impacts Security

| Comments

In my threat modeling and secure coding classes, as well as directly with my clients, I always stress the importance of introducing security as early as possibile in the software development lifecycle. In addition to raising awareness amongst the developers, doing so can help identify potential problems early in the development process as opposed to later when they will require more effort and more cost to fix properly. I recently experienced a real-world example of this that I wanted to share.

I’m working in a building downtown that uses proximity badges to secure offices on each floor. The elevator has a card reader as well, but it requires you to actually insert a different badge. This process is both cumbersome and unreliable. First because you are sliding a card into a fairly small slot and second because people need to jostle around the elevator so they can get directly in front of the slot in order to successfully use the card reader. In the morning rush, it’s not uncommon for your floor to have gone past before you get a chance to swipe your card.

So what do you think this results in?

You got it. In the morning rush one person gets on, slides their badge in and asks everybody which floor they’re going to.

So due to a poor design decision (low-efficiency access control device in a high-traffic area), that control is now effectively bypassed on a regular basis. Another layer of security does exist, but now you’re one step closer. Perhaps this is an acceptable risk to the original designers of this system given the security level of the building and the additional security, but unfortunately I don’t know to what extent they did consider this.

I’ll be making another post in the near future about how some of the design decisions on today’s sites are there to make users “feel” better about the security, rather than implementing effective measures themselves. Sounds familiar.

In Case You HAVE to Wake Up Early Tomorrow

| Comments

Thanks to the new Twitter Tracking, I came across a great blog called Sufficient Thrust that discusses various “life hacking” techniques. As somebody that’s always on the go but gets motivated at odd hours, the post about why I shouldn’t wake up early tomorrow peaked my interest. I frequently get motivated right around 11pm and keep kicking until 3am easily, so getting up early puts a pretty large shadow over my day.

Unfortunately, we do live in a 9-5 world and I often have clients where I need to be productive between those hours. So here are a few tips for forcing yourself to get work done. Note that everybody has different drivers, but these help me get through the day.

Don’t waste time There’s all manner of things to distract you and when you’re not in the flow, you’ll take every opportunity to procrastinate. Try to ignore those distractions and focus on what you need to get done. If you don’t, you’ll find that 3 hours have passed and you haven’t accomplished a damn thing. Unfortunately, this post is a direct result of that procrastination…

Get yourself in the groove I find that house music gets me in a very good groove. So when I need to be productive, I put on some giant headphones, crank the volume, and let the beat guide me to getting things done. There’s a podcast called Techtronic Sound that’s pretty good for this, but unfortunately there hasn’t been a new one in two months. Good tunes don’t always work, but it definitely helps drown out the other distractions in the office so I can focus on my work.

A little kick in the pants never hurt I don’t like to do it, but a little caffeine can definitely help get you fired up when you have absolutely no desire whatsoever to be so. Mountain Dew and Caramel Macchiato’s are my poison of choice, but every once in a while I’ll put down a Rockstar.

Switch things up Move to a different desk. Start writing notes using pen and paper. Go work in the Starbucks across the street. Anything to change up your routine to give you a little spark.

Be mean to people People will try to disturb you. We can’t help it, we’re social creatures. But sometimes when you’re trying to get in the flow, you need to ignore, fend off, or otherwise try to prevent them from infringing on your flowness.

Set small, reachable goals and reward yourself Give yourself small, easily attainable goals. Think increments of 1 hour. It’s good to get up and stretch anyway. Set a goal and a reward. For example: I can go get myself a coffee when I’m done writing these next 10 slides.

Ignore useless websites There are more than enough useless websites out there to distract us each day. DO NOT GO TO THESE SITES. They suck your time and energy away quicker than you can blink!

Although definitely not foolproof, these are the things I try to do when I need to get in the flow.

Next article of Marina’s that you should read - The Secret to a Successful All-nighter

Hack on.