Author: barce

  • Setting Up a newLISP Webserver

    How fast can you get on the web? With newLISP it’s about as fast as typing:

    newlisp -http -d 8080 -w /usr/home/www/httpdocs &

    How fast can you create a backdoor with newLISP?

    newlisp -p 1234 &

    If you telnet into port 1234 in localhost, you’ll see something that looks like this:

    Trying 127.0.0.1…
    Connected to localhost.
    Escape character is ‘^]’.
    newLISP v.10.0.0 on OSX IPv4 UTF-8.

    >

    This opens up a lot of possibilities for distributed computing.

    For example, you can set up a newLISP server that’s ready to respond to a newLISP client with this command:

    newlisp -c -d 1234

    Your newLISP client can have code that sends a computing problem to be solved to the server:

    (net-eval “localhost” 1234 “(+ 3 4)” 1000)

    Or let’s say you had a farm of newLISP servers:

    #!/usr/bin/newlisp

    (set ‘result (net-eval ‘(
    (“192.168.1.100” 4711 {(+ 3 4)})
    (“192.168.1.101” 4711 {(+ 5 6)})
    (“192.168.1.102” 4711 {(+ 7 8)})
    (“192.168.1.103” 4711 {(+ 9 10)})
    (“192.168.1.104” 4711 {(+ 11 12)})
    ) 1000))

    (println “result: ” result)

    (exit)

    If the above example reminds you of Gearman, you get +12 points.

  • The Infamous Zed Shaw Declares ACL Is Dead

    If you work with ACL, this may be the most important video you watch ever. Zed shows how ACL is not Turing complete, which explains all the problems you’ve been having with control lists.


    Zed Shaw – The ACL is Dead from CUSEC on Vimeo.

  • Setting Up An EC2 LAMP Server

    Pre-requisites:

    Now we’re ready to build an EC2 LAMP Server.

    cd .ec2

    You’ll find that a lot of ec2 stuff happens in the .ec2 directory.

    To list the possible servers that you can set up run:

    ec2-describe-images -a

    I ran

    ec2-describe-images -a | wc -l

    and got 1477 possible servers. Some are Windows.

    Let’s say we see this listing:

    IMAGE ami-1539dc7c level22-ec2-images/ubuntu-8.04-hardy-20080205a.manifest.xml

    If we want to start up the ubuntu server listed above we just type:

    ec2-run-instances ami-5647a33f -k ec2-keypair

    And then we run this command:

    ec2-describe-instances

    We should see either “pending” or the actual instance running with its FQDN listed in the 4th column. An example FQDN is this:

    ec2-173-33-159-95.compute-1.amazonaws.com

    And if we go to:
    http://ec2-173-33-159-95.compute-1.amazonaws.com/

    we should see a webserver.

    And if we ssh:

    ssh -i ec2-keypair ec2-173-33-159-95.compute-1.amazonaws.com

    we’ll get the root prompt:
    #~

    That’s basically it. Now you can go in and mess around with server settings.

    In the next blog post, we’ll look at how to save your custom server settings and set up using S3.

  • Amazon’s EC2 and S3 — Computing on the Cheap

    I was really inspired by the story of Pownce., and how they used S3 for storing media assets.

    I really liked how easy it was to share media with Pownce. Alas, it’s no more and shut down on December 15th of last year.

    What’s a guy to do? Well, using a combination of Transmit, a file upload and synchronization client, and S3 I can hack my own file sharing. I just upload the files I want to share and send the links to friends.

    Here’s a link to an S3 media asset.

    Once I felt comfortable about S3, I took the dive into EC2.

    Pros: You can have a server of your choice, in my case LAMP, running in less than 5 minutes.

    Cons: If the server crashes, all your data is gone.

    Solution: Use ESB for database storage and S3 to back up files and custom executables.

    How much does it cost?

    For 1 LAMP server with 1.7GiB RAM running with a virtual 1.7Ghz CPU, and about 160GiB of storage will run you about 10 cents an hour, which is not bad considering that a colo will charge you around $100 per 1U or 12.5 cents per hour, and you’re stuck with the hardware you have.

    The savings are even greater if you’re just setting up servers for prototyping and tearing them down. My last EC2 bills averaged at about $35 per month.

    The next few blog posts will go into more detail about how to set up your own EC2 virtual server, and the pitfalls I’ve run into.

  • OH HAI! Ads in UR RSS FEEDZ

    The NY Times now has ads in their RSS feeds. When did this happen? I’m off to research Pheedo who does the ads.

    OH HAI -- We'ze Ads
    OH HAI — We'ze Ads
  • Helping People Find Jobs

    At Codebelay we work with a number of recruiters who have helped secure jobs for a lot of our friends. Right now there are two recruiters who will loyally work for you in your corner.

    If you have expertise with Javascript, especially jquery, or SQL Server, or PHP, these are the folks to talk to.

  • 2008 Favorites

    These things were just my absolute favorite in 2008.

    • Github – Do you want to see nice graphs about your current coding project? Do you want to invite friends to code with you? As a consultant, there wasn’t a major client that I didn’t use Github for this year.
    • The iPhone 3G – Thank you, thank you, Michael Parekh for saying that it’s the computer of the future and that you shouldn’t be developing for the web without it in mind.
    • Grokking what Gearman is about.
    • The Blogger.com SxSW gloves schwag. Ya, it was warm and rainy when Blogger.com passed these out but it was so good in the fall and winter!
    • Katy Perry’s song “Hot N Cold

    Katy Perry on the Warped Tour

    What were your favorites of 2008?

  • Site Diversity FTW

    If it’s the thought that counts, think about how site diversification has helped out the Gawker Media and Nick Denton these past 6 months.

    This set of graphs says it all:

    Site Diversity FTW in the Gawker Network

    Happy Holidays!

  • Another Hackday Update: PHP unserialize doesn’t quite do it

    Wow, I had to use someone’s custom unserialize code because PHP’s unserialize doesn’t quite work multi-byte strings. 🙁 Time wasted: 3 hours.

    Here’s the function:

    function mb_unserialize($serial_str) {
    $out = preg_replace(‘!s:(\d+):”(.*?)”;!se’, ‘”s:”.strlen(“$2″).”:\”$2\”;”‘, $serial_str);
    return unserialize($out);
    }