Zcentric

Blog

Posts

Gitosis with wildcard support

@Mike Zupan · Aug 25, 2010 · 1 min read

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 config files into git. I started using gitosis for the git server. This was all great but for each new …

Read More →

Setup DRBD for master/master

@Mike Zupan · Aug 23, 2010 · 2 min read

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 have some time, I decided to finally setup drbd on the two nodes to keep the files always in sync.

Read More →

Bash: Turn a string into an array

@Mike Zupan · Aug 13, 2010 · 1 min read

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

Read More →

Find the real MongoDB command for pyMongo

@Mike Zupan · Aug 13, 2010 · 1 min read

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, "storageSize" : 129544960, "numExtents" : 75, "indexes" : 69, "indexSize" : 25403392, "ok" : 1 } So in …

Read More →

MySQL to MongoDB Migration Example

@Mike Zupan · Jun 24, 2010 · 3 min read

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 go for most web applications. As the web is more and more based on user contributions our databases …

Read More →

MongoDB Nagios plugin created

@Mike Zupan · Jun 18, 2010 · 1 min read

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 http://github.com/mzupan/nagios-plugin-mongodb

Read More →

Simulate network latency

@Mike Zupan · Jun 10, 2010 · 1 min read

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 qdisc add dev eth0 root netem delay 1000ms When you are done you can delete it like tc qdisc del root …

Read More →

Setup MongoDB master/slave replication

@Mike Zupan · Jun 1, 2010 · 2 min read

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 MongoDB setup. I always thought MySQL was easy to setup replication on but MongoDB proves it just gets …

Read More →

Django fix for ‘User’ object has no attribute ‘backend

@Mike Zupan · May 12, 2010 · 1 min read

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 first. If you want to bypass this you can just use the following before login user.backend = …

Read More →

MySQL Database size

@Mike Zupan · May 5, 2010 · 1 min read

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( data_free )/ 1024 / 1024 "Free Space in MB" FROM information_schema.TABLES GROUP BY table_schema;

Read More →