Skip to content

Instantly share code, notes, and snippets.

View WesleyCh3n's full-sized avatar
😺

WesleyCh3n WesleyCh3n

😺
View GitHub Profile
git config --global credential.credentialStore dpapi
:: port forwarding
netsh interface portproxy add v4tov4 listenport=1234 listenaddress=111.222.333.444 connectport=4321 connectaddress=444.333.222.111
netsh interface portproxy delete v4tov4 listenport=1234 listenaddress=111.222.333.444
:: enable firewall
netsh advfirewall firewall add rule name="allow port 22" dir=in action=allow protocol=TCP localport=22
netsh advfirewall firewall delete rule name="allow port 22"
@WesleyCh3n
WesleyCh3n / vs_cpp_winget.md
Created January 17, 2025 15:34 — forked from robotdad/vs_cpp_winget.md
Installing VS C++ workloads with winget

This is a short outline of how to install the C++ workload with Visual Studio or the build tools using winget.

To find VS releases with winget use search. winget search buildtools

The install command will install the VS installer with the core of the selected product installed. That isn't much. So if you use either of these commands to insll VS or the build tools you will need to launch the VS installer afterwards and select the relevant C++ workloads you need.

winget install Microsoft.VisualStudio.2022.BuildTools

winget install Microsoft.VisualStudio.2022.Community
# Check ssh client/server availability
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
# Install Client if not present
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
# Install Server if not present
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
# Start ssh server
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@WesleyCh3n
WesleyCh3n / netplan.yaml
Created December 15, 2023 06:26
netplan ip client
network:
version: 2
renderer: NetworkManager
ethernets:
enp0s31f6:
addresses:
- 192.168.11.2/24
nameservers:
addresses:
- 8.8.8.8
@WesleyCh3n
WesleyCh3n / 01-network-manager-all.yaml
Created November 28, 2023 03:26
iptables forwarding (router setting)
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
enp4s0:
dhcp4: true
enp5s0:
addresses:
- 192.168.80.1/24
@WesleyCh3n
WesleyCh3n / tmuxv3.2a.sh
Created July 8, 2023 03:41
compile and install tmux v3.2a on ubuntu
#!/usr/bin/env bash
sudo apt install libevent-dev ncurses-dev build-essential bison pkg-config
wget https://github.com/tmux/tmux/releases/download/3.2a/tmux-3.2a.tar.gz
tar -zxf tmux-3.2a.tar.gz
cd tmux-3.2a
./configure
make && sudo make install
@font-face {
font-family: 'VictorMono NF';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Medium/VictorMonoNerdFont-Medium.ttf') format('truetype');
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: 'VictorMono NF';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Italic/VictorMonoNerdFont-Italic.ttf') format('truetype');
@font-face {
font-family: 'VictorMono Nerd Font Mono';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Regular/complete/Victor%20Mono%20Regular%20Nerd%20Font%20Complete%20Mono.ttf') format('truetype');
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: 'VictorMono Nerd Font Mono';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Bold/complete/Victor%20Mono%20Bold%20Nerd%20Font%20Complete%20Mono.ttf') format('truetype');