Placebo Effect

02 November 2009

Recently i was in need of a small webserver for embedded use in my ongoing irc project. I couldn’t seem to find a simple enough one to handle sessions/media. So i decided to start a small project called placebohttp.

placebo

Placebo is super simple

PlaceboHttpServer server = new PlaceboHttpServer(80);
server.start();

while (true)
{
        // Blocks until request is made to http server.
        HttpRequest request = server.getNextRequest();

        HttpResponse response = new HttpResponse();
        response.setContentType("text/html");
        response.setData("<html><body><h1>Hello World</h1></body></html>")

        request.sendResponse(response);
}

Handling sessions is just about as easy, however you do have to know a bit of threading. The server has another method known as getNextSession() which will block until a new user session is started. Once the first call to getNextSession() is made the server starts initializing sessions for all requests and directs all HttpRequest objects to the individual session object. The PlaceboSession object then has its own getNextRequest() method to handle incoming requests from that session. This is great if you want to treat each person accessing your website like a persistent connection.

Can i just play with it?

Placebo also has a standalone cli mode, nothing fancy just your basic webserver. However i did implement a cool feature where zip/jar/war files are treated like a normal file path.

so imagine you have a complete website zipped in fun.zip…

the following url would be valid http://localhost/fun.zip/index.html

To Download the latest build:
http://hg.openstatic.org/placebohttp/downloads/

Usage:

$ gij -jar placebohttp.jar --help
             or
$ java -jar placebohttp.jar --help

I highly recommend the following method…

$ hg clone http://hg.openstatic.org/placebohttp
$ cd placebohttp
$ make
$ ./placebohttp --help

Fun With DDWRT

24 October 2009

So i was curious about playing with ddwrt, but i don’t happen to have a ddwrt compatible router. So I thought to myself, ddwrt is just a linux distro.

So After a little poking around ddwrt’s website i found that they have an x86 image.

dd-wrt_public_serial.image / x86
dd-wrt_public_vga.image / x86

now I’ve always been a fan of virtualbox, but kudo’s again to virtualbox for kicking ass.

$ VBoxManage convertfromraw dd-wrt_public_vga.image ddwrt.vdi –format VDI

Now I’d go into setting up a virtual machine in virtualbox, but its really really easy. So Just know that the vdi is your hard disk image.

To login
username: root
password: admin

ddwrt

Repository Setup

04 September 2009

Bitbucket.org

I’ve been in love with mercurial for quite some time now and i’ve been slowly getting all my projects under version control. I Finally got around to setting up the CNAME entry for my repository hosted on bitbucket.org. I will be slowly moving alot of my projects there. Please feel free to poke around.

http://hg.openstatic.org/

IRC Server

25 August 2009

So for quite some time now i have been working on an IRC server from scratch. Of course the language i decided to go with is java and its 100% gcj compatible. The project is definitely still in its alpha stages but its moving along nicely.

The following commands are implemented so far…
NOTICE, PRIVMSG, WHOIS, ISON, JOIN, PART, MOTD, LIST, AWAY, TOPIC, MODE, NICK, KICK, INVITE, WHO, QUIT, USER

Now you may notice i have not implemented any of the server to server or ban features yet, I have been working on a middleware layer to allow functionality beyond normal irc. I hope to allow the server to have full database functionality as well as a web portal for administration. Certain features must be delayed until this layer is completed.

Currently the project is privately posted on bitbucket and as soon as it gets to the point where i feel it is good enough to share, i will open it up to the public.

Stay Tuned for more news.

Apache Tomcat For OSX

02 February 2009

So, i decided to package the latest version of tomcat for OSX.


View Full Article

Hopefully this will help for people just looking to play around with tomcat on OSX

Content!

15 December 2008

Lately I’ve been really too into electronic music to do any good programming, but I’ve decided that my website shouldn’t suffer. So from this point forward, i’m just gonna post content based on whatever i’m interested in at the time.

Here are the beginnings of my electronic music section

Ubuntu 8.10

23 October 2008

So…

01 October 2008

I’ve been kinda lazy as of late, and have not spent much time on the internet. However with the coming winter i will probably on my computer much more, and hopefully I can generate some content.

In other news, Kevin Mitnick was detained. I find it ironic that the FBI was the reason for his release. Also I can’t believe how many Mitnick haters there are out there. If you read some of the comments on that article, some people are outright vicious.

Also the economic crisis could be more fun…..

If only somebody crossed line rider with google finance

Back..

07 August 2008

Missing in Action
Sorry for the lack of updates for a while. I have been a bit busy. I’ve started some new hobbies (and revived some old ones) that will hopefully be beneficial to the content of my site. In the meanwhile I’ve also purchased an Eee PC (highly recommended) so hopefully i will be able to update more on the go.

Hackers On Planet Earth
The Last Hope was good, and the badge was pretty cool. For those of you who have not already read about it go here, the badge had an rfid transmitter that was used to track your location throughout the con. However this was only available to attendees who pre-registered. Since then i’ve read a few blogs (that clearly didn’t understand the point of this) that claim that it was so the government could track you. However, this was not the case (AMD Project). Also good news http://www.thenexthope.org/

openstatic.org related news
Going forward I will be slowly creating some sort of hardware/hobby related section.

The Last HOPE

18 July 2008

I’ll be there tomarrow.

The Last HOPE

Tear..