This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <zlib.h> | |
#include <sys/mman.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/zsh | |
runit="true" | |
while [ ${runit} = "true" ]; do | |
ps wwaux | grep dhclient | grep -q re0 | |
if [ ${?} -eq 0 ]; then | |
breakout="false" | |
while [ ${breakout} = "false" ]; do | |
breakout="true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/zsh | |
firmware="iwm3160fw" | |
driver="if_iwm" | |
wlandev="wlan0" | |
ifdev="iwm0" | |
ipv6="yes" | |
if [ ${UID} -gt 0 ]; then | |
echo "Run this as root, you idiot. Run ALL THE THINGS as root and you'll be perfectly safe." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARCH=amd64 | |
CDROM=/tmp/images/OPNsense-201506012201_OpenSSL-cdrom-amd64.iso | |
CONFIG_PKG=/usr/local/etc/pkg/repos/OPNsense.conf | |
CONFIG_XML=/usr/local/etc/config.xml | |
COREDIR=/usr/core | |
CPUS=8 | |
HOME=/root | |
IMAGESDIR=/tmp/images | |
LABEL=OPNsense | |
LC_CTYPE= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/zsh | |
repo="" | |
thing="" | |
usage() { | |
cat<<EOF | |
USAGE: ${0} -r <repo> -t <syncdir> | |
-r <repo>: repository (eg, /pkg/hardenedbsd-11-current-amd64) | |
-t <syncdir>: sync directory (eg, sync1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/zsh | |
amt="${1}" | |
if [ -z "${amt}" ]; then | |
echo "USAGE: ${0} [+-]amt" | |
exit 1 | |
fi | |
mixer vol ${amt} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
laptop-dev-01[shawn]:/home/shawn/tmp $ cat dlopen.c | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <dlfcn.h> | |
int main(int argc, char *argv[]) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
set -e | |
vms=("Jenkins" "GitLab" "Test VM") | |
date=$(date '+%F') | |
if [ ! -d ${date} ]; then | |
mkdir -p exports/${date} | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/zsh | |
echo '{ "version": 1 }' | |
echo '[' | |
echo '[]' | |
while true; do | |
cat <<EOF | |
,[ | |
{ | |
"name": "battery", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@:~ # ps wwaux | grep sshd | |
root 55516 0.0 0.0 12664 1804 - Is 17:27 0:00.07 /usr/sbin/sshd | |
root 90018 0.0 0.1 6488 2284 0 S+ 17:28 0:00.15 grep sshd | |
root@:~ # procstat -v 55516 | |
PID START END PRT RES PRES REF SHD FLAG TP PATH | |
55516 0x15d820000 0x15d867000 r-x 71 78 2 1 CN-- vn /usr/sbin/sshd | |
55516 0x15d877000 0x15d879000 rw- 2 0 1 0 C--- vn /usr/sbin/sshd | |
55516 0x15d879000 0x15d881000 rw- 8 8 1 0 C--- df | |
55516 0x1f0a0c000 0x1f0a24000 r-x 24 27 12 0 CN-- vn /libexec/ld-elf.so.1 | |
55516 0x1f0a24000 0x1f0a2c000 rw- 8 8 1 0 C--- df |