Skip to content

Instantly share code, notes, and snippets.

@tylerpace
tylerpace / whitelist.txt
Created November 30, 2017 16:23
Pihole Whitelists: /etc/pihole/whitelist.txt
raw.githubusercontent.com
mirror1.malwaredomains.com
sysctl.org
zeustracker.abuse.ch
s3.amazonaws.com
hosts-file.net
heapanalytics.com
cdn4.userzoom.com
manager.userzoom.com
clients4.google.com
import json
import logging
import requests
class HipChatHandler(logging.Handler):
def __init__(self, auth_token, room_id, level=logging.INFO):
super(self.__class__, self).__init__(level)
@tylerpace
tylerpace / start_containers.sh
Created May 19, 2017 15:12
Small script for bootstrapping containers to scan with Lumogon
docker run \
--label nginx \
--label com.example.foo=bar \
--label org.label-schema.vcs-url=https://github.com/nginxinc/docker-nginx \
--label org.label-schema.vcs-ref=sample-ref \
--name nginx -d -p 8081:80 nginx
docker run \
--label portainer \
--label com.example.bar=foo \
@tylerpace
tylerpace / add-container-inventory.sh
Last active April 27, 2017 22:11
DockerCon 2017 Demo Commands
#!/bin/bash
RED='\033[0;31m'
ORANGE='\033[0;33m'
GREEN='\033[0;32m'
END='\033[0m'
CONTAINER_NAME="inventory-${RANDOM}"
SOURCE_IMAGE="${1}"
DESTINATION_IMAGE="${2}"
@tylerpace
tylerpace / analysis.py
Last active February 8, 2017 23:39
Rough analysis of all available yum package names and version data on Feb 8 2017
import csv
import numpy as np
version_lengths = []
with open('packages.txt') as f:
for row in csv.reader(f):
split = row[0].split()
if len(split) == 3:
version_lengths.append(len(split[1]))
@tylerpace
tylerpace / gist:96c92913b856a5d3d44f185a50d5b661
Created February 8, 2017 17:48
yum list installed on centos7
[root@yqsh9qvcfkdrwkx ~]# yum list installed
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
Installed Packages
ModemManager-glib.x86_64 1.1.0-6.git20130913.el7 @anaconda
acl.x86_64 2.2.51-12.el7 @anaconda
aic94xx-firmware.noarch 30-6.el7 @anaconda
alsa-firmware.noarch 1.0.27-2.el7 @anaconda
alsa-lib.x86_64 1.0.27.2-3.el7 @anaconda
@tylerpace
tylerpace / pbkdf2.rb
Last active August 23, 2024 08:27
PBKDF2 SHA-512 Ruby script for creating Mac OS >= 10.7 password parameters that Puppet can manage
#!/usr/bin/env ruby
require 'openssl'
puts "enter the password that you would like to hash:\n"
password = gets
password = password.chomp
salt = OpenSSL::Random.random_bytes(32)
iterations = 40_000