Skip to content

Instantly share code, notes, and snippets.

View jpuskar's full-sized avatar

John Puskar jpuskar

  • AmTrust
  • Cleveland, OH
View GitHub Profile
@gbakeman
gbakeman / defaultprofile.lua
Created December 20, 2017 21:42
Logitech Gaming Software F-key binding script
--[[
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 = {
G7 = "F13",
G8 = "F14"
}
@StevenACoffman
StevenACoffman / fluent-filebeat-comparison.md
Last active June 29, 2026 21:26
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
@tirumaraiselvan
tirumaraiselvan / setupadmissionwebhook.md
Last active April 9, 2025 18:25
Setup admission webhooks in Kubernetes

Enable authentication via Candid

This means that users with an account that Candid recognizes can access the controller as long as they have appropriate permissions granted. Note that Candid usernames are given an @external suffix to distinguish them from controller-local usernames.

Note that identity-url can only be set at bootstrap time and cannot be changed later.

The allow-model-access=true setting allows users to access models

@xan7r
xan7r / decryptKerbTicket.py
Last active December 29, 2025 20:21
Decrypt kerberos tickets and parse out authorization data
#!/usr/bin/env python2
# NOTE: this script was created for educational purposes to assist learning about kerberos tickets.
# Likely to have a few bugs that cause it to fail to decrypt some TGT or Service tickets.
#
# Recommended Instructions:
# Obtain valid kerberos tickets using Rubeus or mimikatz "sekurlsa::tickets /export"
# Optionally convert tickets to ccache format using kekeo "misc::convert ccache <ticketName.kirbi>"
# Obtain appropriate aes256 key using dcsync (krbtgt for TGT or usually target computer account for Service Ticket)
# Run this script to decrypt:
# ./decryptKerbTicket.py -k 5c7ee0b8f0ffeedbeefdeadbeeff1eefc7d313620feedbeefdeadbeefafd601e -t ./Administrator@TESTLAB.LOCAL_krbtgt~TESTLAB.LOCAL@TESTLAB.LOCAL.ccaches
@stuart-warren
stuart-warren / webhook.py
Created November 29, 2018 10:53
kubernetes mutating admission webhook (Python)
#!/usr/bin/env python
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
import base64
import json
import logging
import os
import os.path
import ssl
@sudermanjr
sudermanjr / auditLog.yaml
Created January 18, 2019 16:49
Kops cluster spec snippet enabling audit logging.
spec:
fileAssets:
- name: auditPolicyFile
path: /srv/kubernetes/audit.yaml
roles:
- Master
content: |
apiVersion: audit.k8s.io/v1beta1
kind: Policy
rules:
@flaviotorres
flaviotorres / supermicro_redfish
Created January 23, 2019 01:49
Supermicro redfish power on off
SERVER="my-server"
USER="ADMIN"
PASS="ADMIN"
# ON
curl -si -u $USER:$PASS -k -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"Action": "Reset", "ResetType": "On"}' https://$SERVER/redfish/v1/Systems/1/Actions/ComputerSystem.Reset
#OFF
curl -si -u $USER:$PASS -k -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"Action": "Reset", "ResetType": "ForceOff"}' https://$SERVER/redfish/v1/Systems/1/Actions/ComputerSystem.Reset
@plockaby
plockaby / database.py
Last active January 7, 2024 15:49
Python Flask Connection Pool
import logging
import psycopg2
from psycopg2.extras import RealDictCursor
from psycopg2.extensions import TRANSACTION_STATUS_UNKNOWN, TRANSACTION_STATUS_IDLE
from flask import g
import threading
import tenacity
import uuid
import pwd
import os
@danvy
danvy / WSL2-Net-Fix.ps1
Created September 5, 2020 21:04
Reset your WSL network connection trying to fix WSL2 media disconnected error
# Check these threads before proceeding:
# https://github.com/microsoft/WSL/discussions/5857
# https://github.com/microsoft/WSL/issues/5821
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
$CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine
Exit
}
# Restart the Host Network Service
Restart-Service -Force -Name hns