Skip to content

Instantly share code, notes, and snippets.

@papamoose
papamoose / gist:d22dec424d53c172a0bc39f2cf1f5ae0
Created November 3, 2017 16:24 — forked from kbarber/gist:6456420
Renewing a Puppet CA cert
Renew Puppet CA cert.
Not the perfect idea, but should alleviate the need to resign every cert.
What you need from existing puppet ssl directory:
ca/ca_crt.pem
ca/ca_key.pem
Create an openssl.cnf:
[ca]
@papamoose
papamoose / inject_nonfree_firmware.sh
Last active November 24, 2023 09:46
add non-free firmware into initrd.gz
#!/bin/bash
set -e
# trap keyboard interrupt (control-c)
trap control_c INT
# Must be run as root
# requires:
# - wget
# - pax
#!/bin/bash
# iPXE build depends
apt-get install -y liblzma-dev git build-essential
# clone iPXE
[ ! -d ./ipxe ] && git clone http://git.ipxe.org/ipxe.git
cd ipxe/src
make clean
sed -i 's/#undef\tDOWNLOAD_PROTO_HTTPS/#define\tDOWNLOAD_PROTO_HTTPS/' config/general.h
#!/bin/bash
# ARGV as array
input=("$@")
# filename is first argument
filename="${input[0]}"
# get array size
height=${#input[@]}
# /root/xfsprogs-3.1.9ubuntu2/include/xqm.h
# (('X'<<8)+(1)) | (('X'<<8)+(3))
# use strace to get above numbers: strace xfs_quota
#!/usr/bin/env python
# get quota information from XFS
import sys
from pwd import getpwnam
from ctypes import *
libc = cdll.LoadLibrary('libc.so.6')
@papamoose
papamoose / subprocess_example.py
Last active August 29, 2015 14:02
python subprocess how to
# http://www.bogotobogo.com/python/python_subprocess_module.php
#!/usr/bin/python
import subprocess
# Example 1
out = subprocess.Popen(['df', '-h'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = out.communicate()

Binding and Unbinding to Active Directory from Mac OS via Command Line

  • Open the Terminal Application
  • Type in sudo -i and type in your Mac Administrator account password. sudo gives you root level or administrator level privileges.

To View current Active Directory Settings

dsconfigad -show

To Unbind a Computer from an Active Directory Domain

@papamoose
papamoose / .screenrc
Created November 16, 2013 00:52
screenrc
shell -${SHELL}
caption always "%w"
startup_message off
defscrollback 10000