Skip to content

Instantly share code, notes, and snippets.

View patrick330602's full-sized avatar

Patrick Wu patrick330602

View GitHub Profile
@patrick330602
patrick330602 / gpg-forward.sh
Created May 12, 2020 03:42
gpg-forward for wsl
#!/bin/bash
if [ ! -S "$HOME/.gnupg/S.gpg-agent" ]
then
GPG_AGENT="/mnt/c/Users/csl/AppData/Roaming/gnupg/S.gpg-agent.extra"
PREPEND_FILE="/tmp/gpg_agent_prepend"
WINDOWS_GPG_AGENT_PORT=$(head -n1 "$GPG_AGENT")
tail -n+2 "$GPG_AGENT" > "$PREPEND_FILE"
socat "UNIX-LISTEN:$HOME/.gnupg/S.gpg-agent,fork" \
"SYSTEM:cat \"$PREPEND_FILE\" - <&3 | socat STDIO \"TCP\:127.0.0.1\:$WINDOWS_GPG_AGENT_PORT\" >&4,fdin=3,fdout=4"
fi
@patrick330602
patrick330602 / profile.ps1
Created March 13, 2020 02:52
My Windows Terminal Profile used during WSLConf (last two in profiles are the profiles I used for demo videos and live demo)
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"disabledProfileSources": [
"Windows.Terminal.Wsl"
],
"profiles": {
"defaults": {
@patrick330602
patrick330602 / anbox-modules.sh
Last active May 8, 2022 18:04
Andbox on WSL related stuff
sudo apt install dkms linux-headers-generic
git clone https://github.com/anbox/anbox-modules
cd ./anbox-modules
sudo cp anbox.conf /etc/modules-load.d/
sudo cp 99-anbox.rules /lib/udev/rules.d/
sudo cp -rT ashmem /usr/src/anbox-ashmem-1
sudo cp -rT binder /usr/src/anbox-binder-1
sudo dkms install anbox-ashmem/1
sudo dkms install anbox-binder/1
sudo modprobe ashmem_linux
@patrick330602
patrick330602 / adduser
Created November 8, 2018 07:34
adduser script from slackware for using in a project for better connectivity
#!/bin/bash
#
# Copyright 1995 Hrvoje Dogan, Croatia.
# Copyright 2002-2004, 2008, 2009, 2010 Stuart Winter, Surrey, England, UK.
# Copyright 2004, 2008-2010 Slackware Linux, Inc., Concord, CA, USA
# Copyright 2012 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
@patrick330602
patrick330602 / install.sh
Last active September 3, 2018 16:05
My main Ubuntu WSL setup script
#!/usr/bin/env bash
# incomplete
# update everyting first
sudo apt update
sudo apt upgrade
# install core dependencies
sudo apt install git vim zsh bc