Skip to content

Instantly share code, notes, and snippets.

View mcrosson's full-sized avatar

KemoNine mcrosson

View GitHub Profile
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active March 15, 2024 15:56
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@adam-p
adam-p / Local PR test and merge.md
Last active February 5, 2024 19:39
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@nickbalch
nickbalch / Picture Frame photo slideshow Raspberry Pi Framebuffer working code
Last active August 7, 2020 18:54
Incomplete Picture Frame / Photo Slideshow Python code for Raspberry Pi and Touchscreen Display using Framebuffer.
import os
import stat
import pygame
import time
import random
# https://learn.adafruit.com/pi-video-output-using-pygame/pointing-pygame-to-the-framebuffer
drivers = ['directfb', 'fbcon', 'svgalib']
background = (255,255,0)