Skip to content

Instantly share code, notes, and snippets.

@hfase01
hfase01 / twitter-bot
Last active August 29, 2015 14:00
init.d script for chatterbox w/RVM
#!/bin/sh
### BEGIN INIT INFO
# Provides: Twitter-Bot
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Starts the Twitter retweet bot.
### END INIT INFO
@hfase01
hfase01 / listppa
Last active January 4, 2016 15:19
#!/bin/bash
#########
##
## This script simply lists the installed PPA's on Ubuntu.
##
## To run this script right from GitHub use the following command.
##
## ~$ curl -s https://gist.github.com/hfase01/8639779/raw/listppa | sh
##
##########
@hfase01
hfase01 / buildcm
Last active December 19, 2015 18:18
This is a small executable meant to be installed in a **/bin/ directory and sourced from an interactive prompt from the base directory of a CM10.1 or Carbon repo to build and archive the source.
#!/bin/bash -e
DEV="xt897c"
SAVEDIR="~/ANDROID-BUILDS"
OUTPUTDIR="$(date '+%m-%d-%Y')"
if [ ! -d "$SAVEDIR" ]; then
mkdir -p "$SAVEDIR"
fi
source $PWD/build/envsetup.sh
if [ ! -d "$SAVEDIR/$OUTPUTDIR" ]; then
mkdir -p "$SAVEDIR/$OUTPUTDIR"
#!/bin/bash
###############################################################################
# simple script to set some parameters to increase performance on a mdadm
# raid5 or raid6. Ajust the ## parameters ##-section to your system!
#
# WARNING: depending on stripesize and the number of devices the array might
# use QUITE a lot of memory after optimization!
#
# 27may2010 by Alexander Peganz
###############################################################################
@hfase01
hfase01 / maek.sh
Created May 20, 2013 18:25
This is a "fork" of Shabbypenguin's Android kernel build script. Here I will be working on this to make it easier to use..
#!/bin/bash
[ $# -eq 0 ] && { echo "Usage:
$0 Kernel-name [Stock,CM,CM101]"; exit 1; }
# These setup our build enviroment
THREADS=$(expr 4 + $(grep processor /proc/cpuinfo | wc -l))
DEFCONFIG=msm8960_mmi_defconfig
ARCH="ARCH=arm"
# CROSS="CROSS_COMPILE=/home/hans/Desktop/xt897-kernel/toolchains/arm-eabi-4.4.3/bin/arm-eabi-"
CROSS="CROSS_COMPILE=/home/hans/Desktop/xt897-kernel/toolchains/gcc-linaro-arm-linux-gnueabihf-4.7-2013.02-01-20130221_linux/bin/arm-linux-gnueabihf-"
#!/usr/bin/env bash
set -o verbose
sudo apt-get install -y git git-core wget curl gcc checkinstall libxml2-dev libxslt-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev libicu-dev redis-server openssh-server python-dev python-pip libyaml-dev postfix
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
@hfase01
hfase01 / _none_
Created October 12, 2012 21:56
Push, Pull, Fetch whatever, all repository's in a folder. :D
for dir in $PWD/* ; do (cd $dir && git fetch --all) ; done
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@hfase01
hfase01 / post-receive
Created October 1, 2012 14:54 — forked from yortz/post-receive
Basic git post-receive hook file to deploy a Rails app.
#!/bin/bash
APP_NAME="your-app-name-goes-here"
APP_PATH=/home/deploy/${APP_NAME}
# Production environment
export RAILS_ENV="production"
# This loads RVM into a shell session. Uncomment if you're using RVM system wide.
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm"
@hfase01
hfase01 / post-receive-deploy.rb
Created October 1, 2012 14:47 — forked from karmi/post-receive-deploy.rb
Example script to deploy a Rails application via Git post-receive hook
#!/usr/bin/env ruby
# Example script to deploy a Rails application via Git post-receive hook
#
# INSTALL
#
# $ curl http://gist.github.com/442106.txt -o post-receive
# $ mv post-receive path/to/to/your/repo.git/hooks/post-receive
# $ chmod +x post-receive