Skip to content

Instantly share code, notes, and snippets.

View marklit's full-sized avatar

Mark Litwintschik marklit

View GitHub Profile
@simonhayward
simonhayward / gunicorn_settings.py
Created August 8, 2011 08:52
Gunicorn settings file
import multiprocessing
# The socket to bind.
bind = "127.0.0.1:8080"
# The maximum number of pending connections.
backlog = 2024
# The number of worker process for handling requests
workers = multiprocessing.cpu_count() * 2 + 1
# The type of workers to use. (sync|eventlet|gevent|tornado)
worker_class = 'gevent'
@kamermans
kamermans / install-hiphop-fresh.sh
Created July 12, 2011 16:46
Script for installing and compiling HipHop for PHP on a fresh install of Ubuntu 11.04 x64
#!/bin/bash
# HipHop for PHP scripted installation
# by Steve Kamerman, July 12, 2011
echo -e "\e[00;31m**** Installing Prerequisites\e[00m"
sudo apt-get --yes install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev wget memcached libreadline-dev libncurses-dev libmemcached-dev libicu-dev libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev
echo -e "\e[00;31m**** Getting HIPHOP in 5 seconds ****\e[00m"
@kamermans
kamermans / fail2ban-allstatus.sh
Created July 11, 2011 17:06
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@jmeridth
jmeridth / gitsetup.txt
Last active September 25, 2015 11:58
the commands I run just after installing Git (autocrlf false)
git config --global user.name username
git config --global user.email myemailaddress@work.com
git config --global core.whitespace cr-at-eol
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
git config --global push.default tracking
git config --global branch.autosetuprebase always
git config --global help.autocorrect 1
git config --global core.autocrlf false
-- PostgreSQL cheat sheet
--postgres is set up to use local.6 which is syslog'd to sflog001
--slow query log is /var/log/localmessages
--config files are always in /data/friend/*.conf
--vacuums are set via cfengine, we use both manual and auto. vacuums/analyze help with frozen id's being recouped, and thus TX'id's not going over 2b thus causing massing shutdown/reset. Fix it to exp/imp high TX tables.
--to log into psql: psql -U postgres -d <DB> (usually friend)