Skip to content

Instantly share code, notes, and snippets.

@NotAwful
NotAwful / ghostmv.sh
Last active October 10, 2018 22:45
Move files to known web-facing folder on a digitalocean ghost droplet and changes permissions to make the file accessible
#! /bin/sh
if [ ! -d "/var/www/ghost/content/images/other" ]; then
echo "creating /var/www/ghost/content/images/other"
sudo mkdir /var/www/ghost/content/images/other
sudo chown ghost:ghost /var/www/ghost/content/images/other
sudo chmod 755 /var/www/ghost/content/images/other
fi
echo "moving $1 to /var/www/ghost/content/images/other/$1"
@NotAwful
NotAwful / codeofconduct-steps.md
Last active August 30, 2017 01:22
Step-by-step guide to building a code of conduct.
  1. Decide what kind of people you want in the community. "Everyone" is not an option. As a community you are a group of like-minded people when it comes to at least one thing, and this is when you decide what that thing is. Write it down.
  2. Decide what kind of people you do not want in your community. This is going to take longer than step one. This question is harder than "I don't want people who are assholes into my group." Do you want to let sexist or misogynistic people into your community? Do you want to allow racists in? What about people who are very vocal about a specific social issue that you feel runs counter to the kind of people who you want in your community? Write down these broad groups of people.
  3. If you already have a community, run the groups you listed by everyone in your community. Let them add groups to your list under either column.
  4. Profile the groups of people you wrote down. What specific actions they take or specific views they hold that make you want/not want them in your commu
@NotAwful
NotAwful / pcapread.py
Last active April 24, 2017 15:56
#> python pcapread.py mypcap.pcap /full/path/to/GetoLite2-City.mmdb
#> python pcapread.py mypcap.pcap /full/path/to/GetoLite2-City.mmdb
import sys
import dpkt
import socket
import datetime
import geoip2.database
from dpkt.compat import compat_ord
def geoip(ipaddr):
db = geoip2.database.Reader(sys.argv[2])