Skip to content

Instantly share code, notes, and snippets.

View andrew-aladjev's full-sized avatar

andrew-aladjev

View GitHub Profile
@andrew-aladjev
andrew-aladjev / route-down.client.sh
Last active April 26, 2024 07:03
Route for multiple wireguard clients
#!/bin/bash
set -e
set -o pipefail
WG_ROUTING_TABLE="$1"
WG_INTERFACE="$2"
# Removing IPV4 routing table.
ip -4 route flush dev "$WG_INTERFACE" table "$WG_ROUTING_TABLE" || :
#!/bin/bash
set -e
WG_INTERFACE="$1"
WG_RUN_DIR_PATH="/tmp/run/wireguard"
CONTAINER_ID_PATH="${WG_RUN_DIR_PATH}/wstunnel-${WG_INTERFACE}.container-id"
CONTAINER_ID=$(cat "$CONTAINER_ID_PATH" || :)
@andrew-aladjev
andrew-aladjev / iptabled-down.server.sh
Last active April 22, 2024 09:09 — forked from insdavm/wireguard-over-tcp.md
WireGuard over TCP with udptunnel
#!/bin/bash
set -e
WG_INTERFACE="$1"
IPV4_NETWORK="$2"
IPV6_NETWORK="$3"
NET_INTERFACE="$4"
iptables -D FORWARD -i "$WG_INTERFACE" -j ACCEPT
ip6tables -D FORWARD -i "$WG_INTERFACE" -j ACCEPT
@andrew-aladjev
andrew-aladjev / eslint.config.mjs
Created April 8, 2024 10:39
eslint.config.mjs
import eslint from '@eslint/js';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import lodash from 'lodash';
import typescriptEslint from 'typescript-eslint';
// Merged typescript eslint config.
export const eslintConfigTypescript = typescriptEslint.configs.all.reduce(
(result, config) => lodash.merge(result, config),
{},