Connecting the dots…

Thoughts on Web Development, Scalability and Application Architecture

Category: Web Development

Hand coding a multi-part request and POSTing

Posting a quick note to myself about how to hand to handcode a multipart request. Required for a REST server/client that I am currently writing. I needed this so that I can post a json object and the associated image in the same post without the typical php name=value paradigm and read from the php://input [...]

VirtualBox: Sharing OSX host folder on your ubuntu guest

I finally resolved the last bit of annoyance of Virtualbox Related to sharing folders. So here are the steps $ # Create a holder on your host osx $ mkdir -p /websites/topsecretproject/trunk $ # turn off the VM if its on or skip this step $ VBoxManage controlvm ‘ubuntu-x11′ poweroff $ # Share this folder [...]

nginx configuration for symfony projects

Documenting my ngnix configuration for new symfony projects, if you got ideas for tweaking this further do leave a comment. server { listen 80; server_name be.aha.sulphur.local; root /websites/aha-be/trunk/web; index index.php; charset utf-8; access_log /var/log/nginx/be.aha.sulphur.access.log; location / { root /websites/aha-be/trunk/web; index index.php; if (-f $request_filename) { expires max; break; } if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css)$") { rewrite [...]

Upstart conf file for php-fpm

Thanks to a messed up vm, I am migrating my dev to a new 10.04 ubuntu vm (which is great since I can now move away from 8.04 JEOS vms). I am taking this opportunity to move to php5.3 and nginx with php running as FCGI where possible. I have in my previous posts talked [...]

VirtualBox port forwarding, running headless and disabling GDM on 10.04

Phew that was a long heading. Things have changed in VirtualBox 3.2.4, setting up port forwarding is lot easier now and more readable. Adding notes for setting up and configuring my linux dev vm. Install or import a new appliance and disable gdm, if all you need to do is run a couple of services [...]

Post a file using CURL/PHP

Streams are pretty much the forgotten features in php, I don’t see many people making use of it, partially because it works transparently under the hood when we use php’s functions to read/write from the disk or network. I shall write about how you can create custom stream handlers and protocols in php in userland [...]

php 5.3.x / php-fpm / nginx

I have started moving my dev environments from apache to ngnix for various reasons, mostly because ngnix has a smaller footprint and lets me get more out of low memory vms. I would probably write another post later about the reasons for switching from apache to ngnix for now, here are my notes for getting [...]

Parsing massive XML documents using XMLReader

I recently had the need to parse a massive (2gb) xml file and read it back to the database, the standard approach of SimpleXML and Dom was not going to work. I wanted to use XMLReader for this purpose. So here are the quick notes for helping anyone getting upto speed of what the quick [...]

Fixing backspace in screen in terminal on OSX

Screen is awesome, I am surprised I never bothered to learn about it earlier. It all stemmed from the fact that I was working on a pretty low powered VM and couldn’t afford to open multiple xterms on it. Later when I started SSH’ing into it the screen utility came in pretty handy, however when [...]

phing phplint out of memory

Had a funny problem at work today, my php.ini was set to 1G however the script would still fail saying it couldn’t allocate 32bytes of memory which was a bit odd. A little investigation showed that at lib/php/phing/Phing.php // should return memory limit in MB $mem_limit = (int) ini_get(‘memory_limit’); if ($mem_limit < 32) { // [...]