The old blog
Posts
Notes on iPhone development, Linux, Django and infrastructure, written between 2008 and 2016.
-
Gitosis with wildcard support
Tweet At OpenSky I wanted a way to put config files into git. I started using gitosis for the git server. This was all great but for each new server I had to add the following ` Tweet At OpenSky I wanted a way to put …
-
Setup DRBD for master/master
Tweet At my job at OpenSky we have a common NFS share that is failed over to a slave nfs node if the master dies. It was setup so that the slave would just rsync from the master. This was done to save time. Not that I …
-
Bash: Turn a string into an array
Tweet I needed to turn a string into an array to loop through it. It is pretty simple SOLR_CORES="core1,core2,core3" declare -a CORES CORES=(`echo $SOLR_CORES | tr ',' ' '`) for CORE in ${CORES[@]} do stuff here done
-
Find the real MongoDB command for pyMongo
Tweet I am in the middle of writing a MongoDB plugin for cacti using pymongo and ran into a little issue. In the Mongo shell this works > db.stats() { "collections" : 19, "objects" : 145971, "dataSize" : 64785380, …
-
MySQL to MongoDB Migration Example
Tweet There’s a lot of buzz right no for noSQL solutions and one of the big ones is MongoDB. I was lucky enough to be sent to MongoNYC conference a month or so ago and it opened my eyes to why noSQL is the way to …
-
MongoDB Nagios plugin created
Tweet I have created a MongoDB plugin for Nagios. I also put it in a GitHub project so if you want to make changes you can easily fork the project and push changes right to my project …
-
Simulate network latency
Tweet I’ve been creating Nagios plugins for MongoDB and I needed to stimulate some network latency for testing my connect test. I wanted to simulate a 2 second connection lag so I ran the following command tc …
-
Setup MongoDB master/slave replication
Tweet I am recently getting into MongoDB. Thanks to my company (OpenSky) sending me to MongoNYC event. I am also tasked with setting up infrastructure to run MongoDB. So we are starting off with a simple master/slave …
-
Django fix for ‘User’ object has no attribute ‘backend
Tweet I was trying to auto login a user if I had their user object and was getting this error when I just called something like login(request, user) Well this is due to Django wanting to make sure you auth the user …
-
MySQL Database size
Tweet I found a nice query on the mysql mailing list for getting the total size of each database. SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( …