Skip to content

Instantly share code, notes, and snippets.

View hSATAC's full-sized avatar
🐈
Cataholic

Ash Wu hSATAC

🐈
Cataholic
View GitHub Profile
@jeduardo
jeduardo / nginx-mtls.md
Last active March 22, 2024 13:38
mTLS with self-signed certificates in nginx

mTLS with self-signed certificates in nginx

First step is to generate the certificate and keys:

mkdir nginx-certs
cd nginx-certs
# Using the -nodes flag here so it does not ask for any password when exporting the key
openssl req -subj '/CN=ssl.test.local' -x509 -new -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -addext "keyUsage = digitalSignature,keyAgreement" -addext "extendedKeyUsage = serverAuth, clientAuth" -addext "subjectAltName = DNS:ssl.test.local, DNS:localhost, IP:127.0.0.1"
# The PCKS12 export will ask for a password. I will use 'test' again and will refer it in the final curl test command
@rondhi
rondhi / README.md
Last active April 12, 2024 08:23
How to stream games from OBS directly from Steam Deck's Gaming Mode

How to stream games from OBS directly from Steam Deck's Gaming Mode (as of 2023-02-26)

DISCLAIMER: As with any guide, please make sure to read through and understand everything before following the steps in this guide. I'm not responsible for you breaking anything on your own device. This guide assumes you have a little background with the linux command line as well as the text editor nano. If not, please educate yourself


Description: It's possible to stream Vulkan and OpenGL games from Gaming Mode on your Steam Deck. This guide is heavily based on robertkirkman's guide, which is linked multiple times throughout this guide. Much thanks to them


@netj
netj / gcp-start-iap-tunnel-ssh-proxy-magic.sh
Last active April 15, 2024 19:42
a nifty script for accessing with native SSH your IAP allowed Compute Engine instances
#!/usr/bin/env bash
# ~/.ssh/gcp-start-iap-tunnel-ssh-proxy-magic.sh
# a script to be used as SSH ProxyCommand to allow fully functional SSH access to any Google Cloud Compute Engine VMs allowing IAP access
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2022-10-31
# See also:
# - https://gist.github.com/netj/df4f9de1fefd254ab11979be7035b5d0/#readme
# - https://cloud.google.com/iap/docs/using-tcp-forwarding
#

Electron is tricky to get set up on Windows Subsystem for Linux, but it can work!

Four things needed overall:

  1. you need WSL2, not WSL1
  2. you need node, of course, and that part isn't so bad
  3. you need to apt install several dependencies
  4. you need an X Server so it can display the electron GUI over in Windows-land

Setup instructions, in order:

@thiagoghisi
thiagoghisi / bluetooth-restart.sh
Created July 7, 2019 23:56
Script for Mac OSX to Restart Bluetooth service & Reconnect all recently paired devices
#!/bin/bash
echo "Restarting bluetooth service..."
blueutil -p 0 && sleep 1 && blueutil -p 1
echo "Waiting bluetooth service to be restored..."
until blueutil -p | grep "1" >/dev/null; do sleep 1; done
echo "Searching for devices not connected..."
devices=($(blueutil --paired | grep "not connected" | awk -F '[ ,]' '{print $2}'))
@emilianavt
emilianavt / VRM.md
Last active July 26, 2023 19:05
Converting an avatar to VRM format

Converting an avatar to VRM format

In this guide, I assume you already know the basics of Unity and probably have previously uploaded an avatar to VRChat. If you haven't, you can still try to follow along, but some descriptions might be a bit too brief.

A more in-depth guide with screenshots can be found here.


Setup

@xinzweb
xinzweb / tmate-slave-ubuntu-1604.md
Last active January 18, 2019 12:52 — forked from mego22/tmate-slave-ubuntu-1604.md
Tmate-slave on Ubuntu 16.04

Install dependincies

apt-get install  git-core build-essential pkg-config libtool libevent-dev libncurses-dev zlib1g-dev automake libssh-dev cmake ruby

Install msgpack >= 1.2.0

git clone https://github.com/msgpack/msgpack-c.git
cd msgpack-c
cmake .
@yuanying
yuanying / kubectl-run-with-pvc.sh
Last active January 26, 2024 13:58
kubectl run with PVCs
#!/bin/bash
IMAGE="gcr.io/google-containers/ubuntu-slim:0.14"
COMMAND="/bin/bash"
SUFFIX=$(date +%s | shasum | base64 | fold -w 10 | head -1 | tr '[:upper:]' '[:lower:]')
usage_exit() {
echo "Usage: $0 [-c command] [-i image] PVC ..." 1>&2
exit 1
}
@benjisg
benjisg / echo_server.go
Last active August 29, 2023 18:19
Simple GO HTTP server to pretty print the request body sent to it
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
@mdonkers
mdonkers / server.py
Last active April 19, 2024 08:10
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer