Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jfeilbach on github.
  • I am argonaut (https://keybase.io/argonaut) on keybase.
  • I have a public key ASDSqaQKiPfTfZNrMA2xRwqpUDaYvKmuso9DBDqK7b6lcwo

To claim this, I am signing this object:

@jfeilbach
jfeilbach / cheat.md
Last active March 14, 2023 23:52
super fast tail to web cheat using netcat

tail log file to web via netcat

Server side

sudo yum install nc -y && (echo -e ‘HTTP/1.1 200 OK\nAccess-Control-Allow-Origin: *\nContent-type: text/event-stream\n’ && tail -f /var/log/squid/access.log | grep 10.120.13.31| sed -u -e ‘s/^/data: /;s/$/\n/’) | nc -l 8000

Client browser

new EventSource("http://${server}:8000/").onmessage = function(e) {
  console.log(e.data);
};
@jfeilbach
jfeilbach / get_promise_info.sh
Last active May 4, 2024 15:36
Promise Utility information dump
#!/bin/bash
# Dump information, logs, and stats about Promise disk array uing the Promise Utility cli
date=$(date +%Y-%m-%d)
log=~/Documents/promise-${date}.log
cmd='/usr/local/bin/promiseutil -L ${log} -C'
syslog='hostname'
echo -e "\nWill write to ${log}\n"
@jfeilbach
jfeilbach / grub.md
Last active January 20, 2025 00:58
Make Linux fast

In /etc/default/grub, modify:

noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off 

Then sudo update-grub

from https:// make-linux-fast-again.com/ This domain does not seem to be maintained any longer.

@jfeilbach
jfeilbach / gist:5094351d08c9ac1824aafdee64f2f3c0
Created April 5, 2020 04:44
get bitrate and convert to kilobits per second
val=$(ffprobe -v error -show_entries format=bit_rate -of default=noprint_wrappers=1:nokey=1 input.mkv)
echo "$(($val / 1000))" kb/s
@jfeilbach
jfeilbach / authorized_keys.sh
Created April 3, 2020 22:48
authorized_keys.sh
#!/bin/bash
# Version 1.0
# 2019-02-06
set -o errexit
set -o nounset
set -o pipefail
#set -x # remove '#' at start of this line for super-verbose debugging
BUCKET_NAME=""
@jfeilbach
jfeilbach / htoprc
Created March 22, 2020 19:22
cp /boot/extra/htoprc /root/.config/htop/htoprc for unRAID
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=1
hide_kernel_threads=1
hide_userland_threads=1
shadow_other_users=0
show_thread_names=0
@jfeilbach
jfeilbach / readopt.sh
Last active May 24, 2020 05:33
manually readopt all switches and access points on LAN if controller lost
#!/bin/bash
# version 1.2
# removed 192.168.1.11
# removed 192.168.1.14
# Readopt UniFi devices by UniFi controller
# The set-inform command is an alias on the remote host. Obviously we don't have the same env as a remote ssh login. The same is true for the info command.
# set-inform='mca-cli-op set-inform'
# info='mca-cli-op info'
addr='192.168.1.'
@jfeilbach
jfeilbach / tunnel.sh
Last active November 16, 2021 02:47
External update AWS SG TCP 22. Must pass $1
#!/bin/bash
# External call to add/remove TCP 22 from SG
# Environment variables
AWS_SSH_KEY=""
AWS_PROFILE=gov
AWS_DEFAULT_REGION=us-gov-west-1
AWS_DEFAULT_PROFILE=gov
AWS_CONFIG_FILE=~/.aws/config
AWS_SHARED_CREDENTIALS_FILE=~/.aws/credentials
# Reset
NC='\033[0m' # No color
# Regular Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple