pi@chia1:~ $ lsblk
...
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdd 8:48 0 3.7T 0 disk
├─sdd1 8:49 0 16M 0 part
└─sdd2 8:50 0 3.7T 0 part
...
pi@chia1:~ $ udisksctl mount -b /dev/sdd2
Mounted /dev/sdd2 at /media/pi/Farm-WDH19YVN.
This file contains hidden or 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/bash | |
## Usage: GUN_USER=gun GUN_ROOT=~gun/gun-pi-custom GUN_BRACH=master gun-service.sh | |
# Should be run as root (with sudo or directly) | |
[[ "$(whoami)" == "root" ]] || { echo "Must be run as root"; exit 1; } | |
# Setup default environment | |
[ -z "${GUN_USER}" ] && GUN_USER="pi" | |
GUN_DETECTED_USER_HOME=$(getent passwd ${GUN_USER} | cut -d: -f6) |
This file contains hidden or 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/bash -e | |
# Generates a detached tmate session, perfect to debug pipelines in-line | |
tmate -S /tmp/tmate.sock new-session -d | |
tmate -S /tmp/tmate.sock wait tmate-ready | |
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' | |
tmate -S /tmp/tmate.sock wait-for new-session |
This file contains hidden or 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
--- | |
# EXAMPLE: ansible-playbook -i inventory/local-vagrant/hosts --diff reboot.yml -e reboot_hosts=utility,dev,sandbox | |
- hosts: "{{reboot_hosts}}" | |
become: yes | |
# Reboot one at a time to enable play failure if any don't come back | |
serial: 1 | |
tasks: | |
- debug: | |
msg: "Rebooting {{inventory_hostname_short}}" |
This file contains hidden or 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/bash | |
echo -p $(pgrep $1 | tr '\n' '%' | sed 's@%$@@g;s@%@ -p @g') |
This file contains hidden or 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
# Per https://docs.docker.com/install/linux/docker-ce/centos/ | |
# Which should just be a single copy-paste resource | |
yum install -y yum-utils \ | |
device-mapper-persistent-data \ | |
lvm2 | |
yum-config-manager \ | |
--add-repo \ | |
https://download.docker.com/linux/centos/docker-ce.repo |
This file contains hidden or 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
occuranceCount = { } | |
# TY http://algo.pw/algo/64/python <3 | |
class AhoNode: | |
def __init__(self): | |
self.goto = {} | |
self.out = [] | |
self.fail = None | |
def aho_create_forest(patterns): |
This file contains hidden or 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@cac80a94d574 html]# diff mydoxygenconfig.original mydoxygenconfig | grep ">" | |
> OUTPUT_DIRECTORY = /var/www/html/doxygenout | |
> EXTRACT_ALL = YES | |
> EXTRACT_PRIVATE = YES | |
> EXTRACT_PACKAGE = YES | |
> EXTRACT_STATIC = YES | |
> EXTRACT_LOCAL_METHODS = YES | |
> FILE_PATTERNS = *.php *.inc *.module | |
> RECURSIVE = YES | |
> HAVE_DOT = YES |
This file contains hidden or 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
# Read super large byte by byte. Useful for when logs are full of null byte or CRAZY long lines. | |
import time, sys | |
def readBytes(filename, stopAt=0): | |
# Byte by Byte | |
linecnt = 0 | |
charlist = [] | |
with open(filename, "rb") as f: |