Skip to content

Instantly share code, notes, and snippets.

View greggyNapalm's full-sized avatar

Gregory Komissarov greggyNapalm

  • Saint-Petersburg
View GitHub Profile
@schtobia
schtobia / nginx_client_cn_auth.conf
Last active August 22, 2023 11:18
CN-based client authentification with nginx. This emulates Apache's SSLRequire (%{SSL_CLIENT_S_DN_CN} in {"Really Me"})
map $ssl_client_s_dn $ssl_client_s_dn_cn {
default "";
~/CN=(?<CN>[^/]+) $CN;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
@greggyNapalm
greggyNapalm / mac_os_10_8_java.rst
Created August 23, 2012 08:09
mac os mountain lion JAVA
@greggyNapalm
greggyNapalm / gist:3141448
Last active October 7, 2015 09:18
Tank on 12.04/precise additional packets
#aptitude install $(< file.txt)
python-virtualenv
virtualenvwrapper
python-dev
libevent-dev
tmux
lsof
vim
git-core
htop
@ctavan
ctavan / install_graylog.sh
Created July 12, 2012 10:09
Install mongodb, elasticsearch, graylog2, logstash on Ubuntu 12.04
#!/bin/bash
# WARNING: Don't use this in production since all passwords are kept at their default.
# mongodb
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo -e "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen\n" > /etc/apt/sources.list.d/mongodb-10gen.list
apt-get update
apt-get install -y mongodb-10gen
@svetlyak40wt
svetlyak40wt / flask_mongodb_dbshell.py
Created June 26, 2012 07:02
./manage.py dbshell for Flask + MongoDB
import subprocess
import myproject
from flaskext.script import Manager
manager = Manager(app)
@manager.command
def dbshell():
db = myproject.get_db()
@kennethreitz
kennethreitz / flaskapp.py
Created June 9, 2012 15:38
My typical flask app base
# -*- coding: utf-8 -*-
import os
from flask import Flask
from flask_heroku import Heroku
from flask_sslify import SSLify
from raven.contrib.flask import Sentry
from flask.ext.celery import Celery
@greggyNapalm
greggyNapalm / gist:2473116
Created April 23, 2012 19:03
Ubuntu 12 LTS; postinstall
# remove unnecessary
#-------------------
sudo /etc/init.d/apparmor stop
sudo update-rc.d -f apparmor remove
sudo mv /etc/motd /etc/motd_orig
# upgrade packets
sudo aptitude update && aptitude upgrade
@greggyNapalm
greggyNapalm / gist:2413028
Created April 18, 2012 11:37
linux errno codes
# @see /usr/include/asm-generic/errno-base.h
#ifndef _ASM_GENERIC_ERRNO_BASE_H
#define _ASM_GENERIC_ERRNO_BASE_H
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
@greggyNapalm
greggyNapalm / gist:2359365
Created April 11, 2012 13:42
Ubuntu 10 LTS; postinstall
# remove apparmor
sudo /etc/init.d/apparmor kill
sudo update-rc.d -f apparmor remove
# add aptitude and upgrade packets
sudo apt-get install aptitude
sudo aptitude update; aptitude upgrade
sudo aptitude install openssh-server
@greggyNapalm
greggyNapalm / gist:2282306
Last active October 2, 2015 17:08
python dev env; linux
#----------------------
# Ubuntu 8.04 LTS/hardy
#----------------------
# to build python from source
# apt-get install zlib1g-dev
# to build extensions
apt-get install build-essential
apt-get install python-dev