Skip to content

Instantly share code, notes, and snippets.

View JackZielke's full-sized avatar

Jack Zielke JackZielke

View GitHub Profile
@JackZielke
JackZielke / staticpass.sh
Last active August 19, 2017 17:24
Use random binary data to create various non-biased passwords
#!/bin/sh
# Source of random data
#DEV=/dev/urandom
#DEV=/dev/random
#DEV=/dev/hwrng
DEV=/var/run/rtl_entropy.fifo
# Remap unused characters
# OWASP will no longer look like alphanum
@JackZielke
JackZielke / pass.php
Created August 20, 2017 21:19
Generate a visual copy and paste friendly random password using OpenSSL and PHP
#!/usr/bin/php
<?php
$length = 10;
if ($argc > 1) {
if ($argv[1] == '-h' || $argv[1] == '--help') {
echo basename($argv[0]) . ' [-h|--help] [length]' . PHP_EOL;
echo 'length defaults to 10' . PHP_EOL;
exit;
@JackZielke
JackZielke / primel.sh
Last active February 26, 2022 16:57
Help find prime numbers for Primel https://converged.yt/primel/
#!/bin/bash
if test ! -e 5_digit_primes.txt.xz; then
echo 5_digit_primes.txt.xz does not exist
echo $0 requires this file
echo Please generate it with the following command
echo "seq 10007 99991|factor|grep '^\([^:]*\): \1$'|cut -d: -f1|xz -9e >5_digit_primes.txt.xz"
exit 2
fi
@JackZielke
JackZielke / chimes.zip
Last active February 19, 2022 22:44
Play Westminster Quarters / Cambridge Quarters and top of hour chimes via cron
This file has been truncated, but you can view the full file.
@JackZielke
JackZielke / script.sh
Created February 19, 2022 22:52
Run one copy of this script - oneliner
#!/bin/dash
# Is this script already running?
pidof -x $(basename $0) -o $$ >/dev/null && exit
@JackZielke
JackZielke / inches.sh
Created February 20, 2022 02:24
Generate a list of fractions and their decimal equivalents. Defaults to 1/64 increments.
#!/bin/bash
scale=3
if [ $# -lt 1 ]; then
fract=64
else
fract=$1
fi
@JackZielke
JackZielke / eshell.sh
Created February 20, 2022 02:49
Create a BusyBox based Emergency Shell
#!/bin/bash
###########################################################################
### Creates a BusyBox emergency shell in RAM
###
### Script by Jack Zielke <eshell@linuxcoffee.com>
### http://linuxcoffee.com/eshell
###
### BusyBox is maintained by Denys Vlasenko, and licensed under the GNU
### GENERAL PUBLIC LICENSE version 2.
@JackZielke
JackZielke / birthday.sh
Last active January 29, 2024 01:16
Generate unreadable Perl code to send messages in a nerdy way
#!/bin/bash
echo Happy Birthday!!
echo Have some perl:
{ error=$(php ~/scripts/scriptgen.php Happy Birthday $@!! 2>&1 1>&$out); } {out}>&1
echo https://linuxcoffee.com/perl/
if [ -n "$error" ]; then
echo $error
fi
@JackZielke
JackZielke / fix-mouse.sh
Last active February 20, 2022 05:40
Reset USB mouse when it stops working
#!/bin/bash
# must be run via sudo
cd /sys/bus/pci/drivers/ohci-pci
for i in ????:??:??.?;do echo -n "$i" >unbind;echo -n "$i" >bind;done
@JackZielke
JackZielke / printgraph.sh
Last active February 20, 2022 05:44
Create grids to print graph paper
#!/bin/bash
COLS=`tput cols`
ROWS=$[`tput lines`-1]
function printgraph() {
if [ $TYPE == hex ]; then
COUNT1=$[COLS/4]
COUNT2=$[ROWS/2]
else