Skip to content

Instantly share code, notes, and snippets.

@voodoonofx
voodoonofx / named.conf
Last active January 27, 2020 11:09
Named Config - voodoonofx.io
; /etc/named.conf
options {
listen-on port 53 { 173.82.207.201; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
@voodoonofx
voodoonofx / Cent7_base_install.sh
Last active January 26, 2020 09:03
CentOS 7 Base Install
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
# Set the hostname correctly
echo "Hello! Please tell me the desired hostname now: "
read thishostname
# Build OIIO for Centos 7.4.1708 with:
# OpenEXR >= 2.0
# libTIFF >= 3.9
RUN yum -y install https://centos7.iuscommunity.org/ius-release.rpm && \
yum -y install gcc gcc-c++ make boost-devel cmake3 autoconf automake libtool SDL-devel && \
yum -y install unzip bzip2 git vim-enhanced tmux wget less tree && \
yum -y install python36u python36u-devel python36u-pip
# yum -y install libtiff-devel nasm && \
@voodoonofx
voodoonofx / keybase.md
Created May 24, 2018 04:06
keybase.md

Keybase proof

I hereby claim:

  • I am voodoonofx on github.
  • I am voodoonofx (https://keybase.io/voodoonofx) on keybase.
  • I have a public key whose fingerprint is A90C E6BE C50D 5C42 07DD 3EE2 771C 1029 81CF 4988

To claim this, I am signing this object:

@voodoonofx
voodoonofx / TempTracker.py
Last active February 14, 2018 20:59
TempTracker.py
from __future__ import division
class TempTracker(object):
"""
A simple class to track recorded temperatures, with some methods to get useful measurements.
"""
_records = []
import collections
def flatten(thing):
"""
Given an arbitrarily nested list, flattens it into a giant list.
Args:
thing (:obj:`list`):
@voodoonofx
voodoonofx / install_pythons.sh
Last active December 19, 2015 01:14
Install Python 2.x and 3.x
#!/bin/bash
### Python
# Setup python from source, for multiple versions of it. This only works with whole version numbers, not alpha releases.
# CentOS requires these packages:
# sudo yum -y install gcc automake autoconf
# sudo yum -y install readline-devel ncurses-devel openssl-devel sqlite-devel tk-devel gdbm-devel bzip2-devel
# Ubuntu requires:
# sudo apt-get install libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
@voodoonofx
voodoonofx / supervisord3
Last active August 29, 2015 14:21
init.d/supervisor3 for CentOS
#!/bin/bash
# Downloaded from http://www.alphadevx.com/a/455-Installing-Supervisor-and-Superlance-on-CentOS#fn:2
. /etc/init.d/functions
DAEMON=/usr/bin/supervisord
PIDFILE=/var/run/supervisord.pid
CONFFILE=/etc/supervisord.conf
[ -x "$DAEMON" ] || exit 0
@voodoonofx
voodoonofx / test_subprocess.py
Last active September 20, 2022 23:05
subprocess.Popen Example
import subprocess
cmd = ['/full/path/to/python', '/full/path/to/your/process']
print('running command: "{0}"'.format(cmd)) # output the command.
# Here, we join the STDERR of the application with the STDOUT of the application.
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
outLines = [] # We use this just in case you want to see the output of the program later. It's not required.
for line in iter(process.stdout.readline, ''):
print line.rstrip()
@voodoonofx
voodoonofx / sort_dict_multiple_keys.py
Last active August 29, 2015 14:02
Sorting a list of dicts on a complex key
# This gist can be seen live on http://codepad.org/gVPznGJ8
my_structure = [
{
'name': 'david',
'key': {
'subkey': 'value2',
},
},
{