Proxying problem on Redhat

I had a problem proxying on Redhat.

I forgot that SELinux can be troublesome:

$ /usr/sbin/setsebool httpd_can_network_connect 1

Bash deploy to Weblogic

java -classpath /u01/apps/oracle/middleware/wlserver_10.3/server/lib/weblogic.jar weblogic.Deployer \
	 -adminurl t3://localhost:6001 \
	 -username weblogic \
	 -password welcome1 \
	 -name AppName \
	 -targets ServerCluster \
	 -undeploy \
	 || true
java -classpath /u01/apps/oracle/middleware/wlserver_10.3/server/lib/weblogic.jar weblogic.Deployer \
	 -adminurl t3://localhost:6001 \
	 -username weblogic \
	 -password welcome1 \
	 -name AppName \
	 -targets ServerCluster \
	 -deploy app-0.1-SNAPSHOT.war

Script to install rvm on MacOSX

#!/bin/bash -l
current_version=`ruby -v | awk '{print $2}'`
if [ $current_version != "1.9.2" ]; then
if [[ ! -x `which rvm` ]]; then
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm autolibs homebrew
rvm pkg install openssl
fi
rvm install 1.9.2
rvm reload
rvm --default use 1.9.2
fi

Simple disk space alert

We had a need to get alerts in case we are close to running out of disk space on multiple servers but we didn’t want to over complicate it with heavy processes and monitoring. My solution:

#!/bin/bash
CURRENT=$(df /u01 | grep /u01 | awk '{ print $4}' | sed 's/%//g')
THRESHOLD=1000000
TO=\
user1@example.com \
user2@example.com

if [ "$CURRENT" -lt "$THRESHOLD" ] ; then
mail -s 'Disk Space Alert' $TO << EOF
/u01 partition is running low on disk space. $CURRENT bytes left.
EOF

Drop that bad boy in /etc/cron.hourly and you got yourself a heartbeat baby!

Screw you too, gcc46

admin$ brew install gcc46
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-4.6.4/gcc-4.6.4.tar.bz2
Error: stack level too deep

Use gcc42, because stupid error.

admin$ brew install apple-gcc42
admin$ rvm install 1.9.3 --with-gcc=gcc-4.2