Skip to content

Instantly share code, notes, and snippets.

View oxagast's full-sized avatar
🔨
Probably breaking your code.

Mark Stealer Whitehall oxagast

🔨
Probably breaking your code.
View GitHub Profile
@oxagast
oxagast / exploit_rss.rb
Created January 13, 2025 23:47
Generates an RSS feed of newly added exploits
#!/usr/bin/ruby
require "rss"
urlbase = "https://oxasploits.com"
rss = RSS::Maker.make("atom") do |maker|
maker.channel.author = "oxagast"
maker.channel.updated = Time.now.to_s
maker.channel.about = urlbase + "/exploits/"
maker.channel.title = "The Oxasploits Exploit Feed"
Dir.glob('sploits/*.md') do |md_filename|
maker.items.new_item do |item|
@oxagast
oxagast / btrfs-snaptime.sh
Last active January 1, 2025 18:55
BTRFS Snapshot helper for backup cronjobs.
#!/bin/bash
# oxagast
#
# these are the user definable vars defaults
LEAVEN=3 # the number of snapshots trailing the one you created that aren't deleted
REDO=0
CR=0
RO=0
#
# generates date
@oxagast
oxagast / conn_chk.yaml
Last active November 16, 2024 02:34
Ansible online connectivity check
# Creator: oxagast
#
# usage:
# ansible-playbook -i inventory.yml conn_chk.yml --extra-vars "hostname=google.com"
# or..
# ansible-playbook -i inventory.yml conn_chk.yml
---
@oxagast
oxagast / zerweinkel.zsh-theme
Created July 31, 2024 23:15
Black and white Zsh theme with prompt info
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=""
@oxagast
oxagast / leftoff.zsh
Created March 27, 2024 18:14
What was I doing again? A alias that helps you remember where you left off working.
# 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} }
@oxagast
oxagast / img_reduce.sh
Last active January 10, 2024 00:57
Batch image file size reducer
#!/bin/bash
# Image size reducing script
#
# oxagast <=> Mark Stealer Whitehall
trap cleanup INT
function cleanup()
{
echo "Cleaning up..."
@oxagast
oxagast / backup.sh
Last active September 28, 2023 16:03
# 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 \
# 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);
#!/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"
@oxagast
oxagast / pujack.sh
Last active November 1, 2023 12:18
Push a jekyll website to webserver.
#!/bin/bash
# pujack
# a Jekyll static site pusher
#
# Designed by Marshall Whittaker / oxagast
# marshall@oxasploits.com
procs=4
clvl=32