Skip to content

Instantly share code, notes, and snippets.

Avatar

Elliott F Alives

View GitHub Profile
View convert_hevc.py
#!/usr/bin/python3
import json
import os
import subprocess
import sys
import time
def get_container_name():
@Alives
Alives / pfsense_backup.sh
Created Jan 7, 2019
pfsense backup script - Change constants at the top
View pfsense_backup.sh
#!/bin/bash
set -eo pipefail
PFSENSE_HOSTNAME=pfsense
DIR=/var/run/user/$(/usr/bin/id -u)/pfsense_backup
FILENAME=/root/backup/pfsense/config-pfsense-$(/bin/date +%Y%m%d_%H%M%S).xml
URL=https://pfsense.eyyit.com/diag_backup.php
CREDS=/root/creds/pfsense
LOGIN=$(/usr/bin/awk -F= '/login/ {print $NF}' $CREDS)
PASSWORD=$(/usr/bin/awk -F= '/password/ {print $NF}' $CREDS)
@Alives
Alives / lsyncd.service
Created Aug 28, 2017 — forked from sunsongxp/lsyncd.service
systemd-service file for lsyncd
View lsyncd.service
[Unit]
Description=Live Syncing (Mirror) Daemon
After=network.target
[Service]
Restart=always
Type=simple
Nice=19
#EnvironmentFile=-/etc/default/lsyncd
#ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd/lsyncd.conf.lua`'
View multi
function multi {
cmd=$1
shift
while [[ $cmd = "ssh" ]]; do
pre_check="$(echo $@ | tr ' ' '\n' | sed -e 's/^.*@//g' | \
xargs nmap -p 22 -PN -oG - | grep Port | grep -v open)"
test "${pre_check}x" != "x" && (clear; echo "$pre_check") || break
done
tmux send-keys -t 0 "$cmd ${@[1]}"
for ((pane = 1; pane < ${#@[@]}; pane++)); do