Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Add the EPEL repo if not added already
yum repolist | grep -i epel
if [ $? -ne 0 ]; then
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
fi
# Install the preqs
yum install gcc-c++ httpd python-devel python-pip python-sqlite2 \
@stupidbodo
stupidbodo / install.rabbitmq.sh
Last active December 23, 2015 07:29
Setup and Install Rabbitmq FAST Ubuntu 12.04
#!/bin/sh
# Setup Repo and Install
echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
apt-key add rabbitmq-signing-key-public.asc
apt-get update
apt-get install rabbitmq-server -y
service rabbitmq-server start
@stupidbodo
stupidbodo / snippet.js
Created September 23, 2013 09:35 — forked from necolas/snippet.js
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
# rsyslog v5 configuration file
#### MODULES ####
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
#$ModLoad immark # provides --MARK-- message capability
# Provides UDP syslog reception
$ModLoad imudp
@stupidbodo
stupidbodo / linux_logs_uses
Created October 8, 2013 18:14
Linux Logs and Uses
#!/bin/sh
# Linux Logs and Uses
/var/log/message # General message and system related stuff
/var/log/auth.log # Authenication logs
/var/log/kern.log # Kernel logs
/var/log/cron.log # Crond logs (cron job)
/var/log/maillog # Mail server logs
/var/log/qmail/ # Qmail log directory (more files inside this directory)

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@stupidbodo
stupidbodo / erlang_basics.sh
Last active December 25, 2015 12:09
Basics of Erlang
# erl arguments
# -pa Dir1 Dir2 ...
# What this does is add specified directories when you run erl. Standard usage below.
# Normally we would add main project ebin directory as well as deps ebin directory.
erl -pa deps/*/ebin ebin
# -smp [enable|auto|disable]
# SMP options. Auto means use enable when SMP is supported. Using auto is recommended!
erl -smp auto

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@stupidbodo
stupidbodo / APPNAME
Created October 14, 2013 13:52 — forked from eculver/APPNAME
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@stupidbodo
stupidbodo / erlang_vm_default_setting.sh
Created October 16, 2013 03:50
Erlang R16B01 VM Default Configuration Settings
##############################
### Flags
##############################
# SMP support. Options: [enable|auto|disable]
-smp
##############################
### Emulator Flags
##############################
# Max Number of process. Default: 262144