Skip to main content

Posts

Running Node.js alongside IIS on Windows

Most of the time when you are looking for a way to run Node.js as a production server on Windows you will just run into IISNode , now IISNode is a great thing ,but I'm a fan of choice and most importantly , not a fan of XML web config files. I wanted to run my node server on what ever port I wished,or maybe even a different server and just have IIS reroute the traffic from a particular URL to the node process(so a proxy), this allows you to still manage your own load balancing and possibly scale up from that point without having to bother with IIS again. So first things first you will want to download and install the URL Rewrite and ARR modules for IIS ARR (Application Request Routing) URL Rewrite Once thats done lets crack open IIS and open up Application Request Routing, then navigate to Server Proxy Settings and Check Enable Proxy and Apply. Now lets create an an application on our Default Website that will link our url to the node process, h...

Running Node.js alongside Apache

Reverse proxy Running node alongside Apache takes little effort, all it requires is a reverse proxy , which is way less of an effort to set up in Apache than it is in IIS  and a way to run your node process as a service.  To set up a reverse proxy in apache simply add the code in the following gist to the end of your httpd.conf ( located at /etc/apache2 on OSX ) just before the line:  Include /private/etc/apache2/other/*.conf . Loading Gist .... This will re-route any traffic from yourserver/node to yourserver:8080 . Of corse line 14 ( ProxyPass /node http://localhost:8080 ) can be edited according to your liking , but this is just an example. Thats it when it comes to the reverse proxy , all you have to do is restart apache and all requests to yourserver/node will now go to the node process running at yourserver:8080 . Forever Now that we have Apache rerouting the traffic to the right spot , we should set up the node server as a daemon...

Controlling an LED on an Arduino over HTTP

Prerequisites You will need node.js and npm installed , and should have at least some knowledge when it comes to node, if you do not , I suggest you try some example code in node before diving into controlling hardware with it.  You must have the Arduino IDE installed on your machine You must know how to get an LED working on pin 13 of an Arduino Set up the Arduino Wire up an LED to the Arduino on pin 13 and plug it into your development machine. Now we need to get it ready to talk to johnny-five. To do this simply follow the instructions under johnny-five's readme Set up the project  Create a folder on your development machine for the project , in this folder create the server.js and index.html files. Copy the code from the files in this gist  to the respective files. Loading .... We aren't done yet , we need johnny-five and the narf for this to work. In your project directory run the following command: npm install narf johnny-five If that su...

Innovation (You're doing it wrong)

The word Innovation , it drives me insane! I think I havent heard it used correctly this entire year. Apple uses it incorrectly a lot by calling improvement innovation, and people ridicule them for that. Yet those same people say things like "Patents hold back innovation". Just wait a minute? what ? Patents (saying this is my new idea and you cant use it) holds you back from inventing something completely new or different to what has been patented ? Well.. I don't even ... where did you buy your logic? Take it back , get a refund. Patents can hold back your ability to improve exsisting technology and being able to sell that as a product but im pretty sure the patent holder would pay you a nice sum for your improvement ideas(if you patent them of corse). Patents can work with improvement and if what you are doing is really innovation , there won't be an existing patent anyway.  So please , understand a word before you create a "buzz-phrase" aro...

Apple remote review

The Apple remote is a pretty simplistic device with limited features, it does what it does nothing more , nothing less. First impressions are that it's thin , really thin , its not only the thinnest remote I've ever held in my hand , but im pretty sure its one of the thinnest things produced by Apple that I have held in my hand. How does it work? When it comes to getting it to work , all I had to do was pull it out, point it at my Mac Mini and click play , you could say that "It Just Works". If iTunes isn't open when you click play , then it will be opened to the relavent place for you. This feature however has a downside ,if you have more than one Mac in the room this thing will control both , so when I had my laptop open and used the device ,musical chaos ensued. iTunes For the home user who wants to use it for iTunes the relevance of the device is questionable ,though it is handy to quickly grab and turn down the volume or change a song, the...

What programming language must you learn?

Every now and then(like every 2 nano-seconds) , a user will come onto a forum and ask: "What programming language should I learn?" Not long afterwards ,somebody will whip out their snake( python ) followed by everybody's own personal favorite language. The whole process is a mess and can leave a newcomer confused. An important thing to note is that the language you start with is probably not the language you will end up using. I personally started programming by messing around in Visual Basic 6 , Got my diploma in C# and C++(half lang). I now mainly work in Objective-C , but also implement PHP services among other things. Become a language agnostic programmer Once you have learned the basics of programming in any language , learning another language is much quicker. The part that takes time when learning a new language is not really the syntax, but the libraries that are used to get specific tasks done.  Knowing a full language and most of its ...

Half-Life 2 for OSX , how well does it run?

Earlier this week Valve advertised Half-Life 2 for the Mac with the best advert I have ever seen. They took the old 1984 Mac advert and re-created it using the source engine and characters from the game. As if the awesome(albeit 35 second) entertainment wasn't enough they offered the game at $3.40 for a limited period. It was not shortly afterwards that I made my first ever purchase on Steam(its kind of strange buying a game and not getting a box with it). The game purchase actually allows you to download the OSX or Windows version of the game , depending on the platform you are logged in to .This is great , because I have a PC with some decent gaming power and my Mac Mini (which I naturally wanted to test on) and wow ,the OSX version runs pretty darn well,especially considering that my mac mini is running only an intel HD3000. The current specs of my Mac Mini, the only non standard thing here is that I installed 8GB of Transcend Memory Performance I was ...