Deprecated Garbage Collections – Kenny Lee Chee Wei

A truckload of garbage by Kenny Lee Chee Wei

Codepad. Run code snippets online.

with 2 comments

Just discovered an online tool that allows me to run code snippets in many languages such as php, python, ruby, haskell, lua and many else. (See all http://codepad.org). Sure you can use irb for ruby, etc, provide you’ve install them on your box.

The results of code run are also available via a URL (Check out my ruby snippet. )

Well if someone doubts your code and is lazy to go over your desk when you argue that it works on your machine(yeah, it “always works” locally). Just send them that code result URL !

Advertisements

Written by kennii

August 20, 2008 at 5:27 am

Posted in Cool Tools

Tagged with ,

2 Responses

Subscribe to comments with RSS.

  1. Just checked it out, and wondered what mischief people could get up to with codepad? I thought the codepad guys would have thought of this and I decided to run a little experiment to check.

    First attempt was…

    (code pasted here, codepad only keeps it 24 hours.)
    require ‘net/http’

    host = “www.google.com.sg”

    puts “Hitting #{host}”
    http = Net::HTTP.new(host, 80)
    resp, data = http.get(‘/’, nil)

    puts “Received HTTP response code #{resp.code}”
    (end code)

    BTW, who can blame codepad for only keeping code for 24 hours? I wish I only had to live with my code 24 hours sometimes too…

    The code tries to send a HTTP GET to http://www.google.com.sg/ , but fails with “getaddrinfo: Name or service not known (SocketError)”

    So I went around name resolution and used the IP address for http://www.google.com.sg.

    (code)
    host = “208.67.216.230”
    (end code)

    This failed with “Disallowed system call: SYS_socketcall”

    Good work securing your service from general trouble makers guys! 🙂

    Disclaimer : I am not a troublemaker, looking out for them is one of the things I do.

    Scott

    September 12, 2008 at 1:54 pm

  2. I think they had an option to “Save this paste permanently” on the top right on the output page, but would require a user account with them =/

    Kenny Lee

    September 12, 2008 at 3:58 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: