Skip to content

Instantly share code, notes, and snippets.

@eternaltyro
eternaltyro / secrets-manager.js
Created July 8, 2019 12:29
AWS Secrets Manager sample code provided as placeholder in AWS console
// Use this code snippet in your app.
// If you need more information about configurations or implementing the sample code, visit the AWS docs:
// https://aws.amazon.com/developers/getting-started/nodejs/
// Load the AWS SDK
var AWS = require('aws-sdk'),
region = "us-east-1",
secretName = "prod_api_keypair",
secret,
decodedBinarySecret;
@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 / us-travel-checklist.md
Last active August 29, 2015 14:14
Travel Checklist for the US of A

== Monie

  • Cash - $250 USD in hand
  • Cash - $100 per day ( $15 for breakfast, $15 for lunch, $20 for dinner, $50 for transport/taxi)
  • Laundromats - $1 for washing a big load and $1 for drying a big load (in quarters)
  • Avoid room service - Expensive!
  • Travellers cheque - Note the serial numbers of the cheques down seperately and the toll-free number
  • In case the Cheque is lost, call the toll-free number and block it
  • Hotel rooms - $80 to $120 per day
  • International Debit/Credit Cards
@eternaltyro
eternaltyro / us-visa-doc-checklist.md
Last active December 16, 2019 06:54
US visa documentation checklist

== Visa documentation

  • Visa appointment confirmation
  • DS160 confirmation
  • Passport with validity = last day of stay + 6 months
  • Proof of visa fee payment
  • Visa payment account

== Establish employee credentials

@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>