MiniWeb

MiniWeb is a Http server library written in Java targeted for embedded projects. MiniWeb’s goals are to be small and lightweight as possible while providing simple and easy to use API. MiniWeb uses the very mature and robust Apache HttpComponents at its core. MiniWeb only supports what is necessary to get an embedded web project up and running quickly (no servlets).

Checkout the MiniWeb GitHub page

Example Usage

Create a server that serves files from “public” folder:

Controllers

Handle request programmatically is very simple with Controllers. The following example will respond the a request for /cgi/hello with the text world.

Query params

Controllers can even handle URL query params. For example:

Sending a /cgi/hello?param1=cool&bananas=5 and the value of param1Value would be “cool” and numBananas would be 5 as expected.

JSON REST Requests

Controllers can also be used to handle REST requests without all the overhead of parsing json manually. For example:

performing a POST to this endpoint with json: { "name": "awesome!" }. Note: the request must have a Content-Header header value set to application/json.

JSON REST Response

sending a response with JSON is also easy. Just add the @Body annotation to your handle methods.

SmartHUD

smarthudSmartHUD is an Android app paired with a small cradle device that is mounted to the inside of your car windshield. The system delivers important information to the driver like navigation instructions and text messages in a non-distracting manner. The system is hands-free and works with voice commands. You can tell SmartHUD to navigate somewhere, respond to text messages, and control music with your voice and you never have to take your eyes off the road. I am one of the co-founders and Android app author.

Checkout me presenting a live demo of the SmartHUD system at Drinks on Tap Mobile Meetup in Boston (Sep 21, 2013)

Android Lightweight Timer

Introducing: LightweightTimer. LightweightTimer allows to schedule tasks for repeated future execution. It pretty much serves the same purpose of Java’s Timer class, but does not require extra thread creation. Instead, LightweightTimer uses Android’s Handler class to schedule its tasks. This is important when creating Android apps because memory is at a premium, and creating a thread for every little repeating task you have seems wasteful. Also, the LightweightTimer has the added benifit of executing on the main thread, which is often what you want.
Continue reading

Common Linux Stuff

Here is a list of common linux commands that I always forget to use.

Add A New User

Create a regular user with a home dir

make that user a sudo-er

Create New Group

add a user to a group

Configure a Mailserver for your Tech Startup

So you just bought a domain name and now you need to setup email accounts for everyone in your Startup. Well, I guess you could go out and find email hosting. But who wants to spend about $2-$3 / month / mailbox? After all, this is Lean Startup right? Screw that! You call yourself a tech guy right? You are 1337! So setup your own email server!

This guide will walk though the steps to configuring a Mailserver hosted on Amazon EC2 using Ubutnu 12.04. By the end you will have working:

  • Unlimited email accounts with unlimited storage (depending on your VPS disk space of course)
  • Ability to setup as many alias/forward addresses (think support@, noreply@, etc)
  • IMAP and POP3 (but IMAP is way better, don’t use POP3)

Continue reading