Skip to content

Instantly share code, notes, and snippets.

@eternaltyro
eternaltyro / recover_source_code.md
Created March 11, 2017 17:17 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@eternaltyro
eternaltyro / auditd.conf
Created February 21, 2017 09:18 — forked from sakalajuraj/auditd.conf
Logstash configuration for auditd messages received via syslog
# Content of the file /etc/logstash/conf.d/auditd.conf
# Tested on the CentOS 7 auditspd logs forwarded to logstash via rsyslog
input {
syslog {
type => AUDITD
port => xxxx
host => "xxx.xxx.xxx.xxx"
}
}
@eternaltyro
eternaltyro / ssl.rules
Created January 16, 2017 05:39 — forked from konklone/ssl.rules
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@eternaltyro
eternaltyro / vpn_psk_bingo.md
Created November 27, 2016 04:24 — forked from kennwhite/vpn_psk_bingo.md
Most VPN Services are Terrible
@eternaltyro
eternaltyro / nginx.conf
Created July 15, 2016 03:26 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@eternaltyro
eternaltyro / lxc-ubuntu.sh
Created August 31, 2012 09:58 — forked from dkulchenko/lxc-ubuntu
Script to generate LXC containers for EC2
#!/bin/bash
#
# template script for generating ubuntu precise container for LXC
#
# This script is based on lxc-debian (Daniel Lezcano <daniel.lezcano@free.fr>)
#
# Copyright © 2010 Wilhelm Meier
# Author: Wilhelm Meier <wilhelm.meier@fh-kl.de>