Skip to content

Instantly share code, notes, and snippets.

View jpuskar's full-sized avatar

John Puskar jpuskar

  • AmTrust
  • Cleveland, OH
View GitHub Profile
@jpuskar
jpuskar / virt-manager-macos.md
Created November 13, 2023 15:15 — forked from davesilva/virt-manager-macos.md
Remote virt-manager from Mac OS

If you have a Linux machine with KVM on it, you can manage those VMs remotely from a Mac using virt-manager.

Step 1: Allow your user non-root access to KVM

SSH to the Linux machine and add your SSH user to the libvirt group

sudo usermod -a -G libvirt $(whoami)
@jpuskar
jpuskar / audit.rules
Created October 21, 2022 21:05 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@jpuskar
jpuskar / deploy-offline-cdk-with-lxd.sh
Created April 3, 2022 19:38 — forked from ccamacho/deploy-offline-cdk-with-lxd.sh
canonical kubernetes offline deployment
#!/usr/bin/env bash
set -e
set -u
## Variables
set_vars(){
APT_MIRROR_HOST="mirror"
LXDKVM_SSTREAM_HOST="mirror"
JUJU_SSTREAM_HOST="mirror"
@jpuskar
jpuskar / snapshots.py
Created October 19, 2018 00:03 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
--[[
This allows you to bind any function-number key (F1-F24) to a "G" button on your mouse.
To add a binding, insert a new element in the bindings table below and save this script.
Script by tgp1994 (https://github.com/tgp1994)
]]
local bindings = {
G5 = "F13"
}
@jpuskar
jpuskar / why.sh
Created May 20, 2018 05:19 — forked from xiongchiamiov/why.sh
Use this when Amazon gives you an "Encoded authorization failure message" and you need to turn it into something readable. If you only get a request id... you're out of luck.
function decode-authorization-failure-message {
if [ $# -ne 1 ] || [ "$1" = -h ] || [ "$1" = --help ]; then
cat <<'EOT'
Usage: decode-authorization-failure-message <message>
Use this when Amazon gives you an "Encoded authorization failure message" and
you need to turn it into something readable.
EOT
return 1
fi
@jpuskar
jpuskar / why.sh
Created May 20, 2018 05:19 — forked from xiongchiamiov/why.sh
Use this when Amazon gives you an "Encoded authorization failure message" and you need to turn it into something readable. If you only get a request id... you're out of luck.
function decode-authorization-failure-message {
if [ $# -ne 1 ] || [ "$1" = -h ] || [ "$1" = --help ]; then
cat <<'EOT'
Usage: decode-authorization-failure-message <message>
Use this when Amazon gives you an "Encoded authorization failure message" and
you need to turn it into something readable.
EOT
return 1
fi
# redis interactive mode
redis-cli -c -h <fqdn> -p 6379
# > ping
# PONG
redis-cli -c -h <fqdn> -p 6379 --stat
# ------- data ------ --------------------- load -------------------- - child -
# keys mem clients blocked requests connections
# 2 6.24M 63 0 4067924801 (+0) 776668
@jpuskar
jpuskar / rsync_cheat_sheet.txt
Created April 14, 2018 14:43
Rsync cheat-sheet
# Copy big files, ignoring timestamps.
# -a, --archive
# * Equivalent to -rlptgoD (no -H,-A,-X)
# * Does not preserve hardlinks
# -r, --recursive
# -l, --links. Copy symlinks as symlinks.
# -p, --perms. Preserve permissions.
# -t, --times. Preserve modification times.
# -g, --group. Preserve group.
# -o, --owner. Preserve owner (super-user only).
@jpuskar
jpuskar / gist:d3ad5b14cea3202cd965e5824fca0beb
Created May 15, 2017 23:19 — forked from gambtho/gist:36a2f01e9e7d8c1b0046fb074f1a44ee
Zookeeper.service systemd script for zookeeper
from - http://davidssysadminnotes.blogspot.com/2016/01/installing-apache-kafka-and-zookeeper.html
[smack1]# vi /etc/systemd/system/kafka-zookeeper.service
[Unit]
Description=Apache Zookeeper server (Kafka)
Documentation=http://zookeeper.apache.org
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple