Skip to content

Instantly share code, notes, and snippets.

View ryanbarrett's full-sized avatar

ryanbarrett

View GitHub Profile
@ryanbarrett
ryanbarrett / check_file_size.py
Last active July 21, 2016 21:52
Nagios script to check file size with human readable input and output (in python). Similar to ./check_files.pl -F file.txt -s 5000000,10000000
import argparse,os
#Return OK, Warning, or Critical for nagios to parse.
argparser = argparse.ArgumentParser(description='Nagios script to check file size with human readable input and output (in python). Similar to ./check_files.pl -F file.txt -s 5000000,10000000',epilog="Thanks, Hope you like it. -Ryan")
argparser.add_argument('--missingfileok','-m',action='store_true',help='If the file does not exist return OK.')
argparser.add_argument('--file','-f',type=str,required=True,help='Pass in full path and file name i.e. --file /test/123/filename.txt ')
argparser.add_argument('--critical','-c',type=str,required=True,help='K,M, or G, defaults to bytes')
argparser.add_argument('--warning','-w',type=str,required=True,help='K,M, or G, defaults to bytes')
args = argparser.parse_args()
suffixes = ['K', 'M', 'G', 'T']
@ryanbarrett
ryanbarrett / check_ssl_certificate
Last active November 11, 2016 17:11
nagios check_ssl_certificate
#!/usr/bin/perl -w
#
# check_ssl_certificate
# Nagios script to check ssl certificate expirations
#
# Copyright (c) 2006-2008 David Alden <alden@math.ohio-state.edu>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
@ryanbarrett
ryanbarrett / effPasswordGen.py
Created January 11, 2017 03:36
Generate Passwords from the list of EFF dice passwords
import sys
import argparse
import random
import re
argparser = argparse.ArgumentParser(
description='Arguments that may be parsed.', epilog="Use good passwords")
argparser.add_argument('--words', default=5, type=int,
help='Number of words to return. e.g. --words 5 (default)')
argparser.add_argument('--filename', default='eff_large_wordlist.txt', type=str,
##############################################################################
# 01. Shell
##############################################################################
function __setprompt
{
local LAST_COMMAND=$? # Must come first!
# Define colors
local LIGHTGRAY="\033[0;37m"
local WHITE="\033[1;37m"
@ryanbarrett
ryanbarrett / uptime-kuma-docker-compose.yml
Created December 15, 2022 17:49
Uptime Kuma on port 80
# Simple docker-compose.yml
# You can change your port or volume location
version: '3.3'
services:
uptime-kuma:
image: louislam/uptime-kuma:1
container_name: uptime-kuma
volumes:
@ryanbarrett
ryanbarrett / show-me-rita.sh
Last active September 21, 2023 19:01
Active Countermeasures - Rita Notes
# ./show-me-rita.sh $DB
DB=$1
COMMANDS="beacons beacons-fqdn exploded-dns long-connections strobes useragents"
for SHOWCOMMAND in $COMMANDS
do
echo "exporting show-$SHOWCOMMAND to $SHOWCOMMAND-$DB.txt"
docker-compose run --rm rita show-$SHOWCOMMAND $DB > $SHOWCOMMAND-$DB.txt
done
# mkdir -p ${USERDIR:-$HOME}/docker/homeassistant/config
# mkdir -p ${USERDIR:-$HOME}/docker/matter-server/data
# docker pull ghcr.io/home-assistant/home-assistant:stable && docker pull ghcr.io/home-assistant-libs/python-matter-server:stable && docker-compose down && docker-compose up -d --force-recreate
version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes: