Posts List

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 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

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 have some time, I decided to finally setup drbd on the two nodes to keep the files always in sync. So below are my nodes with hostnames/ips and drive information

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

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

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 qdisc add dev eth0 root netem delay 1000ms When you are done you can delete it like tc qdisc del root dev eth0 I am sure there is a better tc command you can run to get better results but this worked.

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 MongoDB setup. I always thought MySQL was easy to setup replication on but MongoDB proves it just gets easier. This will expect you are using the official MongoDB provided RPMs from their repository.

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

Install all needed RPMS for a rpmbuild

Tweet Ever had this happen? [mzupan@laptop SPECS]$ rpmbuild -ba php.spec cat: /usr/include/httpd/.mmn: No such file or directory error: Failed build dependencies: curl-devel >= 7.9 is needed by php-5.2.11-2.fc12.src db4-devel is needed by php-5.2.11-2.fc12.src gmp-devel is needed by php-5.2.11-2.fc12.src expat-devel is needed by php-5.2.11-2.fc12.src httpd-devel >= 2.0.46-1 is needed by php-5.2.11-2.fc12.src sqlite-devel >= 3.0.0 is needed by php-5.2.11-2.fc12.src readline-devel is needed by php-5.2.11-2.fc12.src libc-client-devel is needed by php-5.2.11-2.fc12.src postgresql-devel is needed by php-5.

A better Jira init.d script for Redhat/CentOS

Tweet I wrote a bit better init.d script for Jira for Redhat/CentOS The first thing you want to do is create a sysconfig file. Below is the filename /etc/sysconfig/jira The file has the following contents in it # # The user Jira runs as # JIRA_USER=jira # # The home directory of Jira # JIRA_HOME=/opt/jira/current Now create the init.d script /etc/init.d/jira It has the following contents in it.

Init.d script for puppet-dashboard

Tweet In the #puppet IRC channel on freenode a user was asking if anyone knew of a init.d script for redhat/fedora for puppet-dashboard. I have a blog post about installing puppet-dashboard on Redhat/CentOS and I don’t think there is any init.d script out there. So time to write one The first thing you will create is the following file /etc/sysconfig/puppet-dashboard This is a simple file with the following in it