Unfortunately Vagrant deployments always have the NAT adapter on eth0, which can cause headaches at times, especially when doing a multiVM deployment! Most of the time you end up having to modify the recipe to make things work. In my humble opinion these changes kind of defeat the purpose of testing in Vagrant to begin with. So what to do ? We’ll you can use an Ohai plugin and override the node.ipaddress value ! So what we’ll do is make eth1pretend to be eth0 !
Now since I want to make sure my cookbooks are the same in development as production I will want to make sure we don’t use this plugin in production. That being the case we’ll go ahead and add some guards to ensure this is only loaded when we are on a VirtualBox VM. Just for good measure we’ll also check for the vagrant user, and make sure that there is in fact an eth1 adapter. I feel this is enough of a safe guard to ensure we only apply this plugin if running under Vagrant, and only when needed.
## spec file for VoxeoLabs Yum Repo#Summary: Voxeolabs repository configuration
Name: voxeolabs
Version: 0.0.1
Release: 1%{?dist}License: GPLv3
Group: System Environment/Base
URL: http://yum.voxeolabs.net/
Source0: http://yum.voxeolabs.net.s3.amazonaws.com/pub/voxeolabs-0.0.1.el.tgz
BuildRoot: %{_tmpdir}/%{name}-%{version}-%{release}Vendor: Voxeo Labs
Packager: John Dyer <jdyer@voxeo.com>
%description
This package contains the Voxeo Labs yum repo. It includes the GPG key as well as configuration for yum.
%prep
%setup -q
%build
%install
rm -rf $RPM_BUILD_ROOTmkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/
cp -p voxeo-labs.repo $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/
cp -p RPM-GPG-KEY-voxeo-labs $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/
%clean
rm -rf $RPM_BUILD_ROOT%files
%defattr(-,root,root,-)/etc/yum.repos.d/voxeo-labs.repo
/etc/pki/rpm-gpg/RPM-GPG-KEY-voxeo-labs
%post
yum clean all
%changelog
* Sun Aug 27 2012 John Dyer <jdyer@voxeo.com> 0.0.1
- Initial release
Now because we use Amazon AMI’s on AWS, which is el6, and CentOS5 a few other places, I want the post install step to fix the repo to point to the right place on our YUM server. We will do this by checking a few files to determin our version of CentOS and then update the repo file. We do this because Amazon Linux, which is pretty much el6, returns ‘amzn’ for $releasever, which can be problematic.
1234567891011121314151617181920212223242526272829
%post
# Retrieve Platform and Platform Versionif[ -f "/etc/redhat-release"];
thenplatform=$(sed 's/^\(.\+\) release.*/\1/' /etc/redhat-release | tr '[A-Z]''[a-z]')platform_version=$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release)# If /etc/redhat-release exists, we act like RHEL by defaultif["$platform"="fedora"];
then# Change platform version for use below.platform_version="6.0"fiplatform="el"elif[ -f "/etc/system-release"];
thenplatform=$(sed 's/^\(.\+\) release.\+/\1/' /etc/system-release | tr '[A-Z]''[a-z]')platform_version=$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/system-release | tr '[A-Z]''[a-z]')# amazon is built off of fedora, so act like RHELif["$platform"="amazon linux ami"];
thenplatform="el"platform_version="6.0"fifised -i -e "s/\$releasever/`echo $platform_version | cut -d. -f1`/g" /etc/yum.repos.d/voxeo-labs.repo
In the end your spec script should look something like this:
The Plain old telephone service (POTS) we are all used to is almost a hundred years old so when it comes to audio codecs you get pretty much the bottom of the barrel. When doing IVR you will want to make sure you convert all your media to the lowest common denominator, which is generally 8bit, 8Khz Mono. Doing this w/ SOX is pretty simple
1234
for i in *.wav
dosox $i -r 8000 -U -b 8 new-files/$(basename $i)done
Thats pretty much it ! If you are using OSX you can get SOX by installing Homebrew and running:
So I will start by saying that Tropo maintains a very redundant, and fault tollerent network, however we do understand that people still need to do their due dilligance and implement monitoring just to be safe. So yesterday we had a developer that wanted do just this, they wanted to monitor Tropo’s SBC’s to ensure they were responding to requests as expected. The only problem here is that Tropo’s SBC’s don’t implelment OPTIONS and all the plugins for Nagios seem to use OPTIONS in their tests, however one seems to allow you to specify the response code for a passing test. This plugin is the NagiosSIP plugin, and via the -c ( SIP_CODE) flag we can set a 501 ( SIP/501 Not Implemented) as a passing test, since a 501 would signify a responding SBC. Check out below for an example of just what I mean:
So I had a need to install Asterisk the other day on my laptop and doing the atypical:
123
./configure
make
make install
Gave me a whole bunch of suck
12345678
snmp/agent.c: In function ‘init_asterisk_mib’:
snmp/agent.c:835: error: ‘RONLY’ undeclared (first use in this function)snmp/agent.c:835: error: (Each undeclared identifier is reported only once
snmp/agent.c:835: error: for each function it appears in.)make[1]: *** [snmp/agent.o] Error 1
make[1]: *** Waiting for unfinished jobs....
[LD] chan_unistim.o -> chan_unistim.so
make: *** [res] Error 2
Little bit of digging led to a bunch of solution thats didn’t seem to work, but after a little bit of trail and error I found a quick, and working solution, which I figured I would share
12345
./configure --host=x86_64-darwin
make menuselect ( remove res_snmp under Resource Modules )sudo make -j 4
sudo make install
sudo make samples
Looking for an easy way to get AWS pricing programitcaially? Just use the following three URI’s to get a JSON feed of transfer costs, as well as Reserved and On-Demand instance pricing:
The ELB command line tools are pretty nice, and they are actually required to get a lot of important information which is unfortunately missing from the AWS ELB UI. Installation is actually quite simple, first go ahead and download the zip from here, and then just go ahead and do the following:
10:50:24 jdyer@aleph.local Downloads elb-describe-lbs -h 127 ↵
SYNOPSIS
elb-describe-lbs
[LoadBalancerNames [LoadBalancerNames ...]][General Options]DESCRIPTION
Describes the state and properties of LoadBalancers
Had a case the other day where I needed to create users accounts in a specific fashion. If I had less then 25 users I would use letters for the test accounts (eg: usera, userb, ect), if there were more then 25 I would use numbered accounts (eg: user1, user2, ect ) The problem was there could be any number of user accounts and I wanted to keep to this schema.
Unfortunately Enumerable wasn’t going to make this as easy as most things are in ruby, like this wasn’t going to work:
1
"a".upto(5)
However I figured I could just switch to their ascii equivalent and then this would be easy!
Upgrading to Chef Server ( 0.10.8 ) is dead simple, takes probably 30 seconds.
123
for s in server server-webui solr expander; do sudo /etc/init.d/chef-${s} stop; done
sudo gem update chef chef-server --no-ri --no-rdoc
for s in server server-webui solr expander; do sudo /etc/init.d/chef-${s} start; done
If you want you can backup the server first using Seth’s backup script ( here ). Installing, and running it, is dead simple: