Skip to content

Instantly share code, notes, and snippets.

View ildus's full-sized avatar

Ildus Kurbangaliev ildus

View GitHub Profile
@ildus
ildus / vpnsetup.sh
Last active August 29, 2015 14:25 — forked from hwdsl2/.MOVED.md
IPsec L2TP VPN Auto Install Script for Ubuntu 14.04 & 12.04 and Debian 8 & 7
#!/bin/sh
#
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN server
# on a Ubuntu or Debian instance. Tested with Ubuntu 14.04 & 12.04 and Debian 8 & 7.
# With minor modifications, this script *can also be used* on dedicated servers
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN
# YOUR AMAZON EC2 INSTANCE STARTS!
#
@ildus
ildus / fin.conf
Last active August 29, 2015 14:04
server {
listen 80;
server_name fin.local;
root /usr/dev/finance;
index index.html;
}
пометить удаленные как локальные:
for b in `git branch -a | grep -Po '(?<=remotes/origin/).*'`; do git checkout $b; done
удалить удаленные по шаблону:
for b in `git ls-remote origin | grep -Po 'origin.*'`; do git push origin :$b; done
удалить локальные по шаблону:
for b in `git branch -a | grep -Po 'origin2.*'`; do git branch -D $b; done
@ildus
ildus / test_replication.py
Created July 20, 2014 14:26
Replication tester for postgresql, sends email if replication is broken
#!/usr/bin/env python
#coding: utf-8
import settings
import subprocess
def get_email_logger(addrs, subject, email_settings):
''' Returns logger that send email '''
@ildus
ildus / .bash_profile
Created May 11, 2014 12:12
.bash_profile, works in OSX 10.9.2
export WORKON_HOME=~/.envs
source /usr/local/bin/virtualenvwrapper.sh
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
export GOPATH=$HOME/dev/golang
export PATH=$PATH:$GOPATH/bin
source /usr/local/git/contrib/completion/git-completion.bash
source /usr/local/git/contrib/completion/git-prompt.sh
{
"custom_folder_icons": true,
"detect_indentation": false,
"draw_centered": false,
"font_face": "Consolas",
"font_size": 10,
"hide_snippets_on_completion": true,
"ignored_packages":
[
"Clojure",
sudo apt-get update
sudo apt-get install memcached python-dev python-pip sqlite3 libcairo2 \
libcairo2-dev python-cairo pkg-config
sudo pip install -U pip
sudo pip install uwsgi
sudo adduser graphite
sudo su graphite
cd ~
#!/usr/bin/env python
#coding: utf-8
from optparse import OptionParser
from datetime import date, datetime
import unidecode
import subprocess
import fcntl
import os
$ wget http://tengine.taobao.org/download/tengine-1.3.0.tar.gz
$ wget http://download.savannah.gnu.org/releases/libunwind/libunwind-1.0.1.tar.gz
$ wget http://gperftools.googlecode.com/files/gperftools-2.0.tar.gz
$ tar zxvf libunwind-1.0.1.tar.gz && cd libunwind-1.0.1
$ CFLAGS=-fPIC ./configure
$ make CFLAGS=-fPIC
$ sudo make CFLAGS=-fPIC install
$ cd ..
@ildus
ildus / .bashrc
Created September 17, 2013 14:24
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac