RESTful Services Presentation @JavaZone Norway

Posted by Seon on September 18, 2007

Dan Diephouse (formerly of XFire, now with MuleSource) gave a presentation recently at JavaZone Norway and the PDF and MP3 are now available here.

I haven’t listened to the MP3 but the PDF had some good tidbits and gave some insight into Dan’s approach regarding RESTful services in an SOA environment. He doesn’t go into enough detail for my tastes (I like to see as much nitty gritty detail as possible) but it’s more than just a rehash of management-techno-speak so I appreciated it. There are some sections which are pretty basic (like explanation of SSL). There is also some good information about transactions and why we should approach them differently knowing some technical constraints in the HTTP protocol and stateless web communications. He briefly touches upon security issues also. All in all I wish he went into more detail, but it’s all good; another contribution to the RESTful services discussion and it’s pros/cons.

Update
Dan’s website mentioned in the PDF doesn’t seem to work (http://www.netzooidicom.com/blog).

  • Share/Bookmark

Prank Wars Recap

Posted by Seon on September 17, 2007

The boys at CollegeHumor have been escalating their pranks for the better part of this year (since February) and the latest prank (number 6) happened just last week. If you haven’t been keeping up you can watch them in order here starting from the first to the last.

I wonder how other people feel about these pranks. The first two were pretty innocent and drew some good laughs from me. The later ones were funny but also drew some groans of sympathy pain; Streeter and Amir are escalating the war very rapidly. Amir’s latest prank has set a precedent by introducing a second “victim.”; Sharon (Streeter’s GF) has is an innocent casualty of war. Where is the epilogue to this latest skirmish!? This might be better than reality TV.

  • Share/Bookmark

You Are Likely to be Eaten by a Grue

Posted by Seon on September 17, 2007

It Is Pitch Dark is the awesome video and song by MC Frontalot that pays homage to the classic Infocom text adventure game Zork. MC Frontalot cracks me up – I was first introduced to him by my friend Matt McNealy. This video brings back fond memories. I spent many hours after school playing the entire Zork series and most other Infocom games on my trusty 8086 with an amber monochrome monitor. Btw, nerdcore is hilariously fun and dorky.

Update:
Try it now! A port of the original here: http://thcnet.net/error/index.php

  • Share/Bookmark

Ngrep on OSX

Posted by Seon on September 03, 2007

I’ve replaced tcpmon with ngrep as my tool of preference for debugging service interaction while working with Mule. Tcpmon required modifications to service configurations in order pass data through the tcpmon proxies for monitoring. However ngrep is transparent and doesn’t require these configuration changes. It has a simple and fast text interface. No complicated gui to navigate. The output can be piped to grep or saved to file. Run on *nix and Win32. Sweet!

On OSX (version 10.4.10) I decided to compile and install the latest ngrep using the following steps…

1
2
3
4
5
6
7

wget http://prdownloads.sourceforge.net/ngrep/ngrep-1.45.tar.bz2?download
tar -jxvf ngrep-1.45.tar.bz2
cd ngrep-1.45
./configure --prefix=/usr/local
make
sudo make install

I use ifconfig to determine the interface I want to monitor with ngrep…

1
2
3
4
5
6
7
8
9

ifconfig

en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::216:cbff:feb7:5de%en1 prefixlen 64 scopeid 0x5 
        inet 172.16.1.3 netmask 0xffffff00 broadcast 172.16.1.255
        ether 00:16:cb:b7:05:de 
        media: autoselect status: active
        supported media: autoselect

Then startup ngrep on eth1 monitoring port 80. The -Wbyline detects linebreaks in the packet data…

1
2
3
4
5

sudo ngrep -Wbyline -d en1 port 80
Password:
interface: en1 (172.16.1.0/255.255.255.0)
filter: (ip) and ( port 80 )

Example ngrep output…

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54

####
T 172.16.1.3:57867 -> a.b.c.d:80 [AP]
GET /usage.html HTTP/1.1.
Host: ngrep.sourceforge.net.
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6.
Accept: HTTP Accept=text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5.
Accept-Language: en-us,en;q=0.5.
Accept-Encoding: gzip,deflate.
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7.
Keep-Alive: 300.
Connection: keep-alive.
Referer: http://ngrep.sourceforge.net/.
Cookie: __utmz=191645736.1188003977.1.1.utmccn=(referral)|utmcsr=jibx.sourceforge.net|utmcct=/mail-lists.html|utmcmd=referral; __utma=191645736.2030039243.1188003977.1188003977.1188003977.1.
.

##
T a.b.c.d:80 -> 172.16.1.3:57867 [A]
HTTP/1.0 200 OK.
Date: Mon, 03 Sep 2007 21:43:32 GMT.
Server: Apache/1.3.33 (Unix) PHP/4.3.10.
Last-Modified: Thu, 24 Feb 2005 04:41:08 GMT.
ETag: "219bb8-4827-421d5ae4".
Accept-Ranges: bytes.
Content-Length: 18471.
Content-Type: text/html.
X-Cache: MISS from sims.sofast.net.
Connection: keep-alive.
.
<?xml version="1.0" encoding="UTF-8"?>
<!doctype html public "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head><title>ngrep - network grep</title>
</head>

<style>

body {
text-align: center;
padding: 20px;
margin: 0;
background: #888;
color: #000;
font: 10px/15px verdana, geneva, helvetica, arial, sans-serif;
}

h2 {
text-align: center;
margin: auto;
width: 600px;
}

...snip...
  • Share/Bookmark

Code Syntax Highlighting Sample 1

Posted by Seon on September 03, 2007

A few code snippets using CodeRay filters for syntax highlighting.

lang=”ruby”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

require 'coderay'
class CodeMacro < FilteredColumn::Macros::Base
  def self.filter(attributes, inner_text = '', text = '')
    lang = attributes.delete(:lang)
    attributes[:line_numbers] = :table unless attributes.has_key?(:line_numbers)
    attributes.each do |key, value|
      attributes[key] = value == 'nil' ? nil : value.to_sym rescue nil
    end

    begin
      CodeRay.scan(inner_text, lang.to_sym).html(attributes)
    rescue ArgumentError
      CodeRay.scan(inner_text, lang.to_sym).html(:line_numbers => :table)
    rescue
      unless lang.blank?
        RAILS_DEFAULT_LOGGER.warn "CodeRay Error: #{$!.message}"
        RAILS_DEFAULT_LOGGER.debug $!.backtrace.join("n")
      end
      "<pre><code>#{inner_text}</code></pre>"
    end
  end
end

lang=”javascript”

1
2
3
4
5
6
7

fixIEOverlapping: function() {
  Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
  this.iefix.style.zIndex = 1;
  this.update.style.zIndex = 2;
  Element.show(this.iefix);
},
  • Share/Bookmark

Nothing Like a Rollercoaster

Posted by Seon on September 02, 2007

I completed my first tandem skydive this Saturday at Skydive Orange. It was an experience like nothing else I’ve ever had in my life. Some people might think it feels like riding a roller coaster but they are wrong; skydiving is very different and not similar to any rollercoaster ride you’ve taken. I can summarize my first skydiving experience in two words: Too Short. I am definitely going back for more.

Update

I confirmed that we were free falling at a speed of ~120mph. We hit terminal velocity pretty quickly, and there was zero sensation of acceleration hence the absence of the “roller coaster” feeling. My jump master was Kevin Gibson – he’s had 5000+ jumps in his lifetime.

  • Share/Bookmark

Airake Ruby Gem Released

Posted by Seon on September 01, 2007

My friend and coworker Gabe (of Slickr and Dclicio.us fame) has recently released a great ruby gem for generating rake tasks and templates for developing Adobe AIR apps. Check it out!

Airrake, Rake tasks and generators for Adobe AIR apps.

  • Share/Bookmark