Skip to content

Instantly share code, notes, and snippets.

View aheadley's full-sized avatar

Alex Headley aheadley

View GitHub Profile
function _pc () {
local LOAD=$(cut -f1 -d' ' < /proc/loadavg)
local iLOAD=${LOAD%%.*}
if [ $iLOAD -lt $(($PROCS * 2)) ]; then
local TWIDTH=$(tput cols)
local PADDING='='
local TIMESTAMP="$(date '+%Y-%m-%dT%H:%M:%S%z')"
local MEAT="[${TIMESTAMP}|${USER}@${HOSTNAME}(${PROCS}@${LOAD})"
if [ $TWIDTH -ge 80 ]; then
if [ $(( ${#MEAT} + ${#PWD} + 2 )) -gt $TWIDTH ]; then
#!/usr/bin/perl
# @source http://www.ssec.wisc.edu/~scottn/Lustre_ZFS_notes/script/check_md1200.pl
# @source http://wiki.lustre.org/ZFS_JBOD_Monitoring
#This script requires sg3_utils
# Scott Nolin
# UW SSEC
# 6/1/2014
attrs==18.2.0
certifi==2018.11.29
chardet==3.0.4
Click==7.0
idna==2.8
pysubs2==0.2.3
requests==2.21.0
urllib3==1.24.1
Whoosh==2.7.4
[h264 @ 0x644f040] mb_type 119 in P slice too large at 113 16itrate=4927.9kbits/s speed=1.11x
[h264 @ 0x644f040] error while decoding MB 113 16
[h264 @ 0x644f040] concealing 6176 DC, 6176 AC, 6176 MV errors in P frame
[h264 @ 0x644f040] negative number of zero coeffs at 63 45
[h264 @ 0x644f040] error while decoding MB 63 45
[h264 @ 0x644f040] concealing 2746 DC, 2746 AC, 2746 MV errors in P frame
[h264 @ 0x63cfbc0] Invalid level prefix4kB time=00:00:24.54 bitrate=4890.8kbits/s speed=1.11x
[h264 @ 0x63cfbc0] error while decoding MB 90 64
[h264 @ 0x63cfbc0] concealing 439 DC, 439 AC, 439 MV errors in P frame
[h264 @ 0x63cfbc0] mb_type 41 in P slice too large at 8 58
@aheadley
aheadley / reddit-reader.py
Last active November 16, 2018 18:02
A stupid script to read reddit threads out loud
#!/usr/bin/env python3
import hashlib
import tempfile
import os
import os.path
import urllib.parse
import re
import functools
import logging
@aheadley
aheadley / README.md
Last active November 18, 2021 02:16
Some scripts to help with turning a CentOS 7 VM into a template in Proxmox

EL7 VM Templatization for Proxmox

Description

These are some handy tools to turn a VM into a template, so that creating a new VM is as simple as (full) clone and boot. There are several assumptions made that may not necessarily match with anyone else's environment:

  • CentOS 7 minimal install (will probably work on any flavor of EL7)
  • DHCP server available
  • rootfs (/) is on the last partition of the primary disk, and is a primary partition
  • a centos user exists on the VM (this is not a hard requirement, nothing bad will happen if it's not true)
FROM ubuntu:16.04
RUN apt-get -y update
RUN apt-get -y install gcc gdb curl wget git-core \
python python-dev python-dbg \
python-imaging python-imaging-dbg \
python-numpy python-pip
WORKDIR /root
$ gcc-ar -h
Usage: /usr/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
/usr/bin/ar -M [<mri-script]
commands:
d - delete file(s) from the archive
m[ab] - move file(s) in the archive
p - print file(s) found in the archive
q[f] - quick append file(s) to the archive
r[ab][f][u] - replace existing or insert new file(s) into the archive
s - act as ranlib
@aheadley
aheadley / run.py
Last active November 22, 2017 21:24
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
from sc2.ids.unit_typeid import UnitTypeId
from sc2.tmpfix import creation_ability_from_unit_id
from sc2.ids.ability_id import AbilityId
@aheadley
aheadley / Dockerfile.game
Last active November 20, 2017 21:54
Docker container of a headless Linux Starcraft2 instance for bot development
FROM frolvlad/alpine-glibc
ARG GAME_VERSION=3.17
ENV GAME_VERSION ${GAME_VERSION:-3.17}
ARG GAME_PORT=12000
ENV GAME_PORT ${GAME_PORT:-12000}
ARG GAME_DATA_VERSION=56787
ENV GAME_DATA_VERSION ${GAME_DATA_VERSION:-56787}