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
function theme_precmd { | |
HOSTLEN=$(hostname -f|wc -c); | |
FREEM=$(free -h | tail -n 2 | head -n 1| awk '{print $4}' | cut -d "G" -f 1); | |
FREEMSP=$( echo $FREEM | wc -c); | |
FREEMS=$(( $FREESP + 5)); | |
FREEH=$(df -h | grep /home$ | awk '{print $5}'); | |
FREEHSP=$(echo $FREEH | wc -c); | |
local TERMWIDTH=$(( COLUMNS - ${ZLE_RPROMPT_INDENT}+$HOSTLEN-$FREEMS-$FREEHS+21 )) | |
PR_FILLBAR="" | |
PR_PWDLEN="" |
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
# zsh function alias that helps you remember where you left off working in a directory. | |
# useage: leftoff /etc | |
leftoff() { e=$(pwd);cd $1; IFS=$'\n' d=($(ls -t -1 $(pwd) | head -n 5));for a in ${d}; do c=$(ls -t ${a} | head -n 1); echo "${a}/${c}"; done;cd ${e} } |
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/bash | |
# Image size reducing script | |
# | |
# oxagast <=> Mark Stealer Whitehall | |
trap cleanup INT | |
function cleanup() | |
{ | |
echo "Cleaning up..." |
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
# duplicity backup | |
PASSPHRASE="" # change this | |
KEYID="" # change this | |
LOG="/var/log/backup.log" | |
KEEP="6" # change this | |
FULLAFTER="1M" # change this | |
SITEONE="rsync://marshall@conductor//backups/viscosity/" # site 1 (use pubkey auth) | |
SITETWO="file:///var/backups/system/viscosity/" # site 2 | |
echo "Starting backup to SITEONE..." | |
duplicity --progress --log-file $LOG --asynchronous-upload --full-if-older-than 1M --encrypt-key $KEYID \ |
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
# zerweinkel zsh theme | |
# by: oxagast | |
# | |
# Intricate yet elegent promp that displays a context line with your current: date, time, | |
# working directory, current external ip address (updated every 10 seconds), hostname, | |
# username, pty terminal, free memory, free hard drive space on /home, and a return | |
# for your last command on error. | |
function theme_precmd { | |
HOSTLEN=$(hostname -f|wc -c); |
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/bash | |
# | |
# Backup to nas and copy to other partition | |
# | |
# Marshall Whittaker / oxagast | |
# | |
logd=$(date "+%Y%m%d%H%M%S") | |
echo "$logd Starting backup:" | tee -a $log | |
# What to backup. | |
backup_files="/home/marshall" |
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/bash | |
# pujack | |
# a Jekyll static site pusher | |
# | |
# Designed by Marshall Whittaker / oxagast | |
# marshall@oxasploits.com | |
procs=4 | |
clvl=32 |
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
ping www.google.com -c 1 -W 2 | |
if [ $? -ne 0 ]; then | |
for INF in {0 .. 5}; do | |
systemctl stop openvpn@client | |
systemctl start openvpn@client; | |
sleep 1; | |
echo 'nameserver 8.8.8.8' > /etc/resolv.conf; | |
echo 'nameserver 8.8.4.4' > /etc/resolv.conf; | |
ping www.google.com -c 1 -W 2 | |
if [ $? -eq 0 ]; then |
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
movdir="/var/storage/Video/Movies/"; | |
outdir="/var/usb_backup/Conv/" | |
cd $outdir; | |
for movf in $(cd $movdir;ls -1 -A | sed -e s'/\.\///'); | |
do name=$(echo $movf | sed -e 's/\.*\....$//') | |
echo N | ffmpeg -i "$movdir$name".* -strict -2 -vcodec libx265 -crf 36 -c:a ac3 -ab 120k -ac 2 "${name}.mp4" | |
done |
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/bash | |
# hi, i'm sweep, a super minimal virus scan written in bash. | |
# put signaturers in sigs.1 file in the dir you run me from! | |
BIN=bash; | |
sweep() { | |
for MEM in $(cat /proc/$1/maps|grep -E \\[\|\\/|cut -c -26); | |
do | |
echo $MEM; |
NewerOlder