Skip to content

Instantly share code, notes, and snippets.

@hanskw4267
hanskw4267 / ssh_tunnelling.md
Last active September 4, 2023 07:58
ssh tunnel for ip forwarding

Sometimes we want to access a locally available device from a external facing ip address. (e.g. Like a computer on a local lan network with a separate wireguard interface.)

We can do this by using a SSH tunnel

ssh user@remotehost -L localport:host_reachable_from_remote_host:remoteport

e.g.

@hanskw4267
hanskw4267 / realtek_rtl88x1cu_setup.sh
Created March 15, 2023 09:24
Wifi adapter - Realtek RTL8811CU/RTL8821CU Setup
#! /usr/bin/env bash
echo "-------------------------------------------------"
echo "<-- REALTEK RTL88X1CU Driver setup - Hans -->"
echo "-------------------------------------------------"
echo " <-- Update and install pkgs --> "
sudo apt-get update
sudo apt-get install -y dkms git build-essential make bc
#! /usr/bin/env bash
echo "-------------------------------------------------"
echo "<-- REALTEK RTL8812AU Driver setup - Hans -->"
echo "-------------------------------------------------"
echo " <-- Update and install pkgs --> "
sudo apt-get update
sudo apt-get install -y dkms git build-essential
@hanskw4267
hanskw4267 / README.md
Created November 17, 2021 09:52 — forked from qdm12/README.md
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@hanskw4267
hanskw4267 / realtek_rtl8812bu_setup.sh
Last active January 18, 2022 08:41
Wifi adapter - REALTEK RTL8812BU setup
#! /usr/bin/env bash
echo "-------------------------------------------------"
echo "<-- REALTEK RTL8812BU Driver setup - Hans -->"
echo "-------------------------------------------------"
echo " <-- Update and install pkgs --> "
sudo apt-get update
sudo apt-get install -y dkms git build-essential

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@hanskw4267
hanskw4267 / ros_install.sh
Last active September 2, 2021 09:03
ROS ubuntu install
#! /usr/bin/env bash
# ROS install
onlyroot="Do not run this script as root!!!"
if [ $(whoami) == "root" ]; then #"guarding against root execution"
echo -e $COLOR$onlyroot$MONO
exit 0
fi
@hanskw4267
hanskw4267 / ros2_install.sh
Last active September 2, 2021 09:03
Ubuntu ROS2 install script
#! /usr/bin/env bash
# ROS install
onlyroot="Do not run this script as root!!!"
if [ $(whoami) == "root" ]; then #"guarding against root execution"
echo -e $COLOR$onlyroot$MONO
exit 0
fi
@hanskw4267
hanskw4267 / ubuntu_devel_setup.sh
Last active September 3, 2021 03:27
My personal linux setup scripts
#! /usr/bin/env bash
# Post install script to setup a linux development environment
onlyroot="Do not run this script as root!!!"
if [ $(whoami) == "root" ]; then #"guarding against root execution"
echo -e $COLOR$onlyroot$MONO
exit 0
fi