Skip to content

Instantly share code, notes, and snippets.

View Benargee's full-sized avatar

Benargee Benargee

  • Ontario, Canada
View GitHub Profile
@Jaykul
Jaykul / Agent Passthru.md
Last active November 30, 2025 22:11
SSH Agent passthru to WSL 2 (working, in Windows 11, in May 2023)

For awhile now, each time I got a new Windows laptop I would dig up strasis gist on how to set up agent forwarding for SSH in WSL2 -- but recently I tried to point someone else at it and they were very confused by it, so this is my attempt at simpler instructions.

Installation

With Chocolatey, you must use an elevated PowerShell session. If there's no choco command found, it will fall back to winget for the npiperelay install. To force using Winget even if you have choco installed, you need to download it, so you can pass parameters to it.

Easy mode: just run this in PowerShell:

@Alevsk
Alevsk / install-docker.yaml
Last active November 16, 2025 09:54
Ansible playbook to install docker
- hosts: "{{ HOSTS }}"
name: Install Docker
become: yes
vars:
docker_group: docker
tasks:
- name: Install apt-transport-https
ansible.builtin.apt:
name:
- apt-transport-https
@kgadek
kgadek / note.md
Last active November 8, 2025 07:05
Debian on ZFS root on Raspberry Pi 4

Note

I'm no longer be maintaining this, as I'm no longer using Raspberry Pi 4 + ZFS.

My case was:

  • Raspberry Pi 4 8GB
  • Debian 11 Bullseye
  • native ZFS encryption
@abbaspour
abbaspour / nginx.conf
Last active August 28, 2024 02:52
Guide how to enable JWT validation on open source nginx server using ngx-http-auth-jwt-module
daemon off;
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
@cedriczirtacic
cedriczirtacic / wol.py
Created February 12, 2019 16:11
wake-on-lan using scapy
from scapy.sendrecv import send
from scapy.layers.inet import *
from binascii import unhexlify
import sys
magic = ''
for h in sys.argv[1].split(':'): magic += unhexlify(h);
send(IP(dst="255.255.255.255")/UDP(dport=9)/Raw(load=(chr(0xff)*6 + magic*16)))
@strarsis
strarsis / howto.md
Last active November 16, 2025 06:16
KeeAgent (for KeePass) on Bash on Windows / WSL (2) - KeePass as an SSH agent

Update (March 2023) (Last checked: Oktober 2024)

Side note: The latest edge build of KeeAgent plugin offers an option for creating a WSL compatible socket. This would be very handy. I already tried to use that socket, but the socket file is currently empty and ssh inside WSL 2 is unable to use it. This appears to be a very new, unreleased and unstable feature. I will follow the development of it and when it finally works (well, for me) I will update this HOWTO. But until then, please use the proven wsl-ssh-agent/npiperelay.exe approach below.

Thanks to the instructions for WSL 2 of the wsl-ssh-agent project, KeeAgent works great in WSL 2 now: https://github.com/rupor-github/wsl-ssh-agent#wsl-2-compatibility The approach uses minimal and well-maintained tools.

Mini-changelog

  • 14.08.2025: Improve: Improve title of this gist.
@hhromic
hhromic / raspbian-stretch-lite-slimdown.md
Last active August 14, 2025 14:29
Slimming Down Raspbian Stretch Lite

Slimming Down Raspbian Stretch Lite

Notes for slimming down a fresh installation of Raspbian Stretch Lite. This guide does not strip Raspbian of basic functionality such as Bluetooth and mDNS.

Instructions

Install a fresh Raspbian Stretch Lite image into the SD card ([source][1]).

$ unzip -p 2018-04-18-raspbian-stretch-lite.zip | dd bs=4M of=/dev/sdX conv=fsync

@ellerbrock
ellerbrock / Free O'Reilly Books.md
Last active November 14, 2025 22:21 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@A412
A412 / stripe_api
Last active January 6, 2019 03:40
geeni stripe api
base url is www.geeni.org
first two indentations are paths
CAPITALS are request methods
last identation is queries
return is in {}
state is 1 for success 0 for anything else
message is "success" or failure message
stripeid/chargeid is stripe internal id for object, already written to firebase so no need to
site will use HTTPS/SSL in future but currently does not so stick to test ccs / bank accounts
@varemenos
varemenos / 1.README.md
Last active October 9, 2025 17:15
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit