Skip to content

Instantly share code, notes, and snippets.

View chorrell's full-sized avatar

Christopher Horrell chorrell

View GitHub Profile
#!/bin/bash
DBPATH=/home/hybrid/mysql_backups
MYSQLDMP=/opt/local/bin/mysqldump
FIND=/opt/local/bin/find
DATE=`date "+%Y-%m-%d"`
$MYSQLDMP --opt --skip-add-locks --user=hybrid_dbuser --password= xxxxxx --default-character-set=utf8 hybrid_forumdb | gzip > ${DBPATH}/hybrid_forumdb-${DATE}.gz
chown hybrid:hybrid ${DBPATH}/hybrid_forumdb-${DATE}.gz
# Deletes old backups
@chorrell
chorrell / add-node.sh
Created April 12, 2012 17:44
add new version of nodejs to a SmartMachine
#!/usr/bin/env bash
#
# Add new version of nodejs to a SmartMachine
#
# Check to see if script is being run as the root user
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Aborting..." 1>&2
exit 1
@chorrell
chorrell / ipf.conf
Created May 7, 2012 12:22
Example IPFilter config
# Allow all out going connections
pass out from Your.Public.IP to any keep state
# SSH
pass in quick from any to Your.Public.IP port=22
# SMTP
pass in quick from any to Your.Public.IP port=25
# HTTP
@chorrell
chorrell / install-collectd.sh
Created May 9, 2012 19:19
Installing collectd-5.0.3 on a smartosplus64-3.1.0 machine
mkdir src
cd src
curl -O http://collectd.org/files/collectd-5.0.3.tar.gz
tar xvzf collectd-5.0.3.tar.gz
cd collectd-5.0.3
pkgin -f up
pkgin -y install gcc-compiler
@chorrell
chorrell / add-node.sh
Created May 29, 2012 14:02
Add new version of nodejs to a nodejs or no.de SmartMachine
#!/usr/bin/env bash
#
# Add new version of nodejs to a nodejs or no.de SmartMachine
#
# Check to see if script is being run as the root user
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Aborting..." 1>&2
exit 1
@chorrell
chorrell / gist:2969266
Created June 21, 2012 23:35
output of ./configure --prefix=/opt/local for id3lib-3.8.3]
[root@smartos64-1-6-3 ~/src/id3lib-3.8.3]# ./configure --prefix=/opt/local
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
@chorrell
chorrell / install.sh
Created June 29, 2012 23:16
Installing Ruby through rvm and Passenger for Nginx on a SmartMachine
#!/bin/bash
export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
# enable xtrace for debugging
#set -o xtrace
echo " "
echo "Setting up the deploy user"
echo "------------------------------------------------------"
groupadd -g 1008 deploy
@chorrell
chorrell / gist:3180044
Created July 26, 2012 03:18
Install taglib-ruby gem on a 64 bit SmartMachine
# Download the required TagLib lib
mkdir src
cd src
curl -OL https://github.com/downloads/taglib/taglib/taglib-1.7.2.tar.gz
tar xvf taglib-1.7.2.tar.gz
cd taglib-1.7.2
# Make sure cmake and gcc are installed
pkgin -y install cmake
@chorrell
chorrell / gist:3182892
Created July 26, 2012 15:57
Install gearmand-0.33 on smartos64 1.6.3 SmartMachine
curl -OLk https://launchpad.net/gearmand/trunk/0.33/+download/gearmand-0.33.tar.gz
tar xvf gearmand-0.33.tar.gz
cd gearmand-0.33
pkgin -y install libevent boost-headers boost-libs gcc-compiler gmake curl
export CFLAGS='-m64 -I/opt/local/include'
export CPPFLAGS='-I/opt/local/include -D_REENTRANT -I/usr/include'
export CXXFLAGS='-m64 -L/opt/local/lib/amd64'
export LDFLAGS='-m64 -I/opt/local/include -L/opt/local/lib -L/opt/local/lib/amd64'
@chorrell
chorrell / gist:3295245
Created August 8, 2012 14:01
add ffmpeg-php to a smartosplus64 3.1.0 SmartMachine
# Install ffmpeg and autoconf from the pkgsrc repos
pkgin update
pkgin -y install ffmpeg autoconf gcc-compiler
mkdir src
cd src
# Download ffmpeg-php
curl -L -O http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2