Skip to content

Instantly share code, notes, and snippets.

View aputs's full-sized avatar

Allan Ralph Hutalla aputs

  • Earth
  • Philippines
View GitHub Profile
aputs / go-get-from-git+ssh-repository
Last active August 29, 2015 13:57
Go get from git+ssh repository
View go-get-from-git+ssh-repository
#add following lines in your .ssh/config
User git
IdentitiesOnly yes
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
aputs / nspawn-docker-image
Created November 7, 2014 11:50
run systemd-nspawn on btrfs docker image snapshot
View nspawn-docker-image
btrfs subvolume snapshot $docker_root/$subvolumes/$(docker inspect --format='{{.Id}}' $docker_image) $dest_dir
systemd-nspawn -D $dest_dir
aputs / ffmpeg_from_souce.txt
Created February 12, 2010 04:01
ffmpeg from souce
View ffmpeg_from_souce.txt
aptitude -y remove ffmpeg x264 libx264-dev
aptitude -y install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev
#install x264
git clone git://
cd x264
aputs / ubuntu_php5.3.2-dev+xcache+phpfpm+mysql.txt
Created February 12, 2010 04:08
ubuntu php 5.3.2-dev + xcache + phpfpm + mysql
View ubuntu_php5.3.2-dev+xcache+phpfpm+mysql.txt
#pre requisites
aptitude install -y build-essential libtool libltdl3-dev libgd2-xpm-dev libmcrypt-dev libxml2-dev libmysqlclient15-dev flex m4 awk automake autoconf bison make libbz2-dev libpcre3-dev libssl-dev zlib1g-dev vim re2c
aptitude install -y mysql-client mysql-client mysql-common mysql-server mysql-server mysql-server-core
aptitude install -y libtidy-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev zlib1g zlib1g-dev libfreetype6 libfreetype6-dev libbz2-dev libxpm4-dev libmcrypt-dev libmcrypt4
aptitude install -y libxml2-dev libevent-dev
#modify php-fpm config at /usr/local/etc/php-pfm.conf
#copy php-fpm init script under sapi/fpm/php-fpm to /etc/init.d/
#get php from svn
View active_record_to_mongo_mapper_migration.rb
# The basic idea is that we take the existing data via ActiveRecord
# and create new documents in MongoDB using MongoMapper.
# This method is necessary as we want to keep all the associations of existing dataset
# and by the way, clean up empty columns
# We rely on models still being ActiveRecord::Base, I bet you can figure out how the look like.
# And have the newer MongoDB ones here in a module, painful as we have to set the collection_name
# Don't put a +timestamps!+ into your MongoMapper models yet because this would change the updated_at if existing
# As you see in the MongoDB models, a few loose their indepence, e.g. Source as I
# plan to add other sources besides flickr, or Page and Album which only make sense in
# their parent Website
aputs / irbrc
Created April 12, 2010 16:30
irb with auto completion
View irbrc
require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
module Readline
module History
aputs / redis.spec
Created November 2, 2011 10:58
centos redis rpm spec
View redis.spec
%define pid_dir %{_localstatedir}/run/redis
%define pid_file %{pid_dir}/
Summary: redis
Name: redis
Version: 2.4.2
Release: 0
License: BSD
Group: Applications/Multimedia
aputs / bootstrap-fedora18-sh
Last active December 11, 2015 17:18
bootstrapping fedora 18 for use in LXC
View bootstrap-fedora18-sh
# bootstrap fedora18
#release=$(cat /etc/fedora-release | awk '/^Fedora/ {print $3}')
aputs /
Created January 25, 2013 16:14
bootstrap centos 6.3
# bootstrap centos6
#release=$(cat /etc/fedora-release | awk '/^Fedora/ {print $3}')