Skip to content

Instantly share code, notes, and snippets.

@sobolevn
sobolevn / iptables.sh
Created March 9, 2017 14:15 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
# -*- coding: utf-8 -*-
from split_settings.tools import optional, include
from components import CONFIG
# To change settings file: runserver --settings=bitcoins.other_settings
if CONFIG['DJANGO_SETTINGS_MODULE'] == 'bitcoins.settings':
testing = bool(CONFIG['_DJANGO_TESTING'])
@sobolevn
sobolevn / keybase.md
Last active March 18, 2016 17:45
keybase.md

Keybase proof

I hereby claim:

  • I am sobolevn on github.
  • I am sobolevn (https://keybase.io/sobolevn) on keybase.
  • I have a public key ASCNRwuPUk6CnbJ0fngAci6JEOXCDJuAzH3qWKrpCl7KKAo

To claim this, I am signing this object:

@sobolevn
sobolevn / migrate_postgresql_database.md
Created January 28, 2016 21:30 — forked from olivierlacan/migrate_postgresql_database.md
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important: