The Bazaak Startup Setup
At Bazaak we build applications for social networking. Building these applications requires some basic tools, mostly around hosting and serving the applications. This is what we’ve found to be an effective and inexpensive solution for getting started.
- You want as much control over your environment as you can get, EC2 allows you that, $72 a month per basic instance, add instances as you need to grow, throw an ha_proxy in front if needed.
- Get ElasticFox for Firefox, and you do have firebug, right?
- We start with an AMI built by RightScale running CentOS 5.2 (our L) and then add the A,M & P (Apache, MYSQL, and PHP), also memecached and some other niceties. Configure apache with mod_deflate, e-accelerator and anything else you’ll need. Yum is great (runs on anything cent / redhat / fedora ish) and can get you going with these really fast.
- DNS is run through Nettica.com, $10 per domain, per year. DNS is one of those things that I don’t mess with, a nice hosted solution on a cluster of servers for $10 a year is a no brainer.
- Each app gets three subs of our bazaak.com domain, production is the app name (minibook.bazaak.com for example), dev is dev.app name, and beta and testing is done at beta.app name.
- EBS is a great solution for handling the “impermenance” of ami instances on EC2, you can move and symlink your config and log files into your EBS volume and create a new image with your changes, this allows you after a crash to re-start an instance, link your ebs back on and you are off and rolling in about a minute. This can probably be automated on another instance if you want to get really fancy.
- Fogbugz is free for small use, up to two users. Do it, now. Tracking bugs, features, tests, etc is the kind of thing you want to have handy and centralized. You can even port customer’s support request emails into it.
EC2: mounting EBS in CentOS
I’m writing this more as a future reference for myself and anyone that starts searching for specific howto stuff for ec2. The setup process is pretty well documented elsewhere, so I’m going to start into the post setup setup.
Today’s episode: Mounting your EBS in Cent:
Create your EBS (elasticfox is great for this) and link it to your instance.
Next run-> mkfs.ext3 /dev/sdb (or whatever sd* you want to use, you have to use the one you set in elasticfox)
then -> echo “/dev/sdb /vol ext3 noatime 0 0″ >> /etc/fstab
then -> create the directory for vol (mkdir /vol)
then -> mount vol (mount/vol)
Check to see that all has worked with df –si
April 18th, 2009 - Posted in ec2 | |
Blinking Project: Wifi
Intrepid doesn’t ship with drivers for the stock card in the wind and most comments will tell you just to replace the card with one that is supported out of the box, I am stubborn when it comes to these kinds of things and don’t want to replace a perfectly good card. You can compile your own or you can do a wrapper, either works, but this was the easiest way for me.
February 7th, 2009 - Posted in Uncategorized | |
Blinking Project: MSI Wind u100 and the idea behind it
I’ve been setting up an MSI wind u100 (This one) this week for the first “blinking” project. 10″ led backlit screen, 160gb hd, wifi, all in all a very cool little machine.
Blinking
The plan for this machine is to strip away some of the off the shelf easiness that modern GUIs give you. The idea is to bring someone only familiar with os x or windows and allow them to learn from a more basic level, to see and learn the underpinnings. I am setting up the machine to be an everyday driver (eventually) and then turning those things off, taking it back down to the frame rails. Eventually when they’ve gotten a handle on whats going on the basic levels, I can step them into using gnome and then eventually unlock the rest of the “daily driver” conveniences. The day one interface is what we had 20 years ago, a blinking cursor waiting for you to ask it to act. I’ll definitely be talking more and more about this as it progresses.
Eventually the wind will dual boot ubuntu and another unix based os. Ubuntu gives me the option to strip away gnome and come down to just a cli, and the, um, other os will be the everyday home of the “blinkee” when they’ve graduated out. This install is really simple when you have a dvd drive, I don’t. Not that I couldn’t go out and get one, but I really don’t see the need after this initial setup, I haven’t touched the optical drive in my MBP in months, and that was just to rip a few old cds. I will be setting several of these up over the next few months so I wanted something that was easily reproducible as well. The search was on to find an alternative.
On Facebook, codeigniter and errors
When you throw an error in codeigniter, it gives you helpful little error pages. Helpful, that is, if you are building for a domain rather than building a facebook app. Those error pages will generate a decidedly un-helpful facebook errors because they have body tags (and probably other stuff that’s not going to make it through fb’s re-interpreting). The solution, though, is sweetly simple:
(fbml apps only, iframe you’re likely not having this problem)
In your errors directory change the markup for error_404, error_db, error_general and error_php to something like this
<fb:error>
<fb:message><?=$heading?></fb:message>
<?=$message?>
</fb:error>
Nothing else, just that line, and when you see that error on the facebook side it will be styled just like an error from fb itself.
January 26th, 2009 - Posted in Uncategorized | |
EC2: Transmit Public-Key Authentication
Looking through the Google results it doesn’t seem that there is an entry that simply spells out how to connect to an ec2 instance with Transmit, so here it is:
Edit your ~/.ssh/config file (or create one if you don’t already have it) and add an entry that looks like this (variable areas are marked like this {variable})
Host {the shortcut name that you want to use to connect to the instance}
User {the user you will connect with, for instance root}
Port 22
Hostname {host name or ip address}
IdentityFile {location of your private key file, for example ~/.ssh/id_rsa-gsg-keypair}
TCPKeepAlive yes
IdentitiesOnly yes
And thats it, you should be able to connect to your instance (or any server you have private-key authentication setup on) with Transmit. Simply use the shortcut name that you entered after “host” in the server field in the transmit connection screen and leave the password and user fields blank. MAKE SURE that you are using sftp and that you have poked a hole in the firewall on port 22 with the ec2 tools (ec2-authorize -p 22).
January 17th, 2009 - Posted in ec2 | |
PDPworks 2.1
A big update for PDPworks is live. PDPworks 2.1 has search enhancements, improved reports and much more.

It’s live at PDPworks.com
December 2nd, 2008 - Posted in Uncategorized | |
Web App Setup
I’ve written some web apps. I dabble in other languages, but the “production” stuff is currently all PHP. I use my own framework and I thought it might be interesting to share my setup in hopes that someone might either find it interesting or might share their solutions to make some of this stuff easier.
A little about my as of yet unnamed framework: It’s an MVC design, which basically boils down to “let’s keep distinct things apart”.
- I look at models as being the place things are created, edited, or destroyed. Some may keep these isolated to just database interaction, I don’t.
- You don’t talk to the database in a controller, nor do you create a graphic, pdf, etc. so they live in their own models.
- Views don’t have code in them (notable exception of loops and of course, variable slugs)
- To this end, Smarty is the Templating Engine, Can be done “lighter” but I have come to like it.
- I use JQuery for javascripty goodness. I strive to get it to be unobtrusive, I will get there.
- Controllers tend to be very terse affairs. They are simply classes whose methods pass information to and from models and then setup the correct view.
- mod_rewrite turns pretty urls into a string that more or less looks like this http://domain.com/user/$controller/$method/$action/$params
- The recipe for this rewrite is unattractive at best and could use some pretty-ing.
- This means that only controller methods are addressable, and also means that if you use the correct url string that any controller method is accessible.
- This url scheme is how the calls are addressed to the guts of the app, with this you can strip off the interface and give it a different one if needed. It’s kind of close to a rest API.
- A good portion of one application is devoted to creating PDF reports. We’ve used several pdf generators for this over the years, the newest being pdflib. We chose this for its utf support, which our last generator lacked.
I create separate builds rather than doing a continuous update, this allows a really easy backout situation in case something goes wrong with an update, the whole app can be swung back to the previous build. I symlink the builds so that apache doesn’t have to be restarted, you simply move the target of the symlink to the new build and the domain follows the link. I look forward to someday making this capistrano-ified
We use a dev->test->production testing model, when the test build is deemed suitably tested, the link for production is moved to the test build. One other change is necessary, the configuration must be changed to production status from test status. This moves all the proper items into production mode, such as pointing to the correct production data.
Web Workflow
In an effort to write more, I am making an effort to blog more. So to do that I am going back to personal topics that I read elsewhere and enjoyed and interpreting them for myself. The first product of this is below.
A few years ago Steven Frank of Panic fame wrote a post (now lost to the world) about his web workflow at the time. Interestingly over time his company’s products have become a large part of my workflow. I thought I’d put it down in writing, and maybe revise it as things change. It’s not ideal and always a work in progress, but it might be interesting to someone, if even just to an older version of me. I will write a post about the application setups some time in the future.
Text is edited in Coda, which replaced TextMate for most of my work with its initial release and replaced the rest of it with 1.5. It took some initial reconfiguring of muscle memory to switch editors, but I am happy with the result. I do the css by hand, and don’t mess with the css editng portion of Coda all that often, when I do it’s for the color well, or perhaps to remember the syntax of a rule I don’t often use. I do use textmate for editing config files on remote servers, this is solely due to laziness as it is set up as my default text editor in transmit.
Speaking of Transmit, I have found the integrated file transfer portions of coda to be sufficient and often a bit faster than stand alone transmit. For remote clean-up and looking around the file system of the remote servers I will revert to transmit, it feels like home.
I’ve bounced between versioning systems and imagine that this is the place most likely to change in the future. I started on svn and then dumped it wholesale for git (and liked it). I have some projects still in git, however with the release of coda 1.5, I jumped my primary projects back to svn, as it’s the only versioning system it currently supports. There is probably a whole other post in this topic alone, but svn seems completely overwrought for a single user and git does much better, but I imagine that there is a place out there for a single user versioning system that is built into the editor. Something like Time Machine for source files, that simply holds on to every save and gives you a quick diff of the changes. I don’t even need commit messages with this, just a quick way to look through and see what changed and when. Until then it’s svn for some and git for others. They are both locally hosted.
For years I used the command line to manage my databases. This worked fine, until I realized that I am an enormous data integrity liability before 10am. I started using Navicat after that, and since most of my updates are for single lines, it really does work well. Navicat does have a tendency to be crashy, and it will spit up a hairball daily, but I have not found a decent replacement, nor have I REALLY looked. It does what it says it does (unless of course you upgrade to leopard and it quietly fails to back up for a month, but I’m not bitter).
Backup is done in two modes, local “drive fail” mode, and offsite “house fail” mode. Local is time machine to a portable usb drive, remote is a superduper bootable diskimage saved off every two weeks and sneaker-netted (is that a word?) to another location. This is also a place that I imagine will be updated in the future (PLEASE!!!). Remote backup really needs to get easier.
I create and edit most of the image files in Fireworks. Some of the more complex vector stuff is done in Illustrator and then taken through fireworks to prep for web use. Pdf templates are also created through illustrator. Unless there is a reason or need for a specific file format, I use png. I don’t have many places where flash is important anymore, a single “printable” item in PDPworks and one old client site. Flash (at least flash 8 ) is horrendous on the Macintosh.
Documentation is done through a wiki, specifically Dokuwiki. Most of the servers are running fedora.
New & Shiny
We dropped into the Apple Store in Boulder this morning to look at the shiny new macbook crop. Cool new unibody stuff, no buttons and entirely nothing new. I’m not saying that they aren’t newer, or in some way marginally faster, they are indeed those things, but they don’t DO anything new.
My MBP is more than a match for anything I throw at it anymore. Heck, it’s something in the range of 40 times the machines I used in “the old days” to do much more computationally expensive rendering and imaging stuff. All I do now is text editing and some simple vector graphics stuff now and then.
I don’t want to go back to the old days when powerpcs were the new kid on the block, but I got a really distinct feeling that commoditization (maybe better said as intel-ization) has begun to hurt rather than help not only the apple ecosystem’s “differentness” but maybe also it’s creativity.
When a buttonless trackpad and a new manufacturing process are the big changes it just doesn’t seem to peak my interest like it used to. Now show me a little mac tablet or a dock that wirelessly connects my currently wired paraphenalia (usb, monitor…) and I might get peaked again.
October 18th, 2008 - Posted in Mac | |

