Skip to content

Instantly share code, notes, and snippets.

View tshipenchko's full-sized avatar
🎯
Focusing

Łukasz Tshipenchko tshipenchko

🎯
Focusing
View GitHub Profile
#!/usr/bin/env bash
sudo true
ACTIVE_CONNECTION=$(nmcli -t -f NAME,TYPE connection show --active | grep -E '(wifi|ethernet)' | head -n 1 | cut -d':' -f1)
CURRENT_DNS=$(nmcli connection show "$ACTIVE_CONNECTION" | grep ipv4.dns: | awk '{print $2}' | sed 's/--//g')
[ -z "$CURRENT_DNS" ] && trap "nmcli connection modify \"$ACTIVE_CONNECTION\" ipv4.dns '' && nmcli connection up \"$ACTIVE_CONNECTION\" && echo Resetup DNS" EXIT
setup_routes() {
if ip route show 10.10.10.0/24 | grep -v ppp0 >/dev/null 2>&1; then
@tshipenchko
tshipenchko / speed.py
Created November 24, 2024 22:38
DPDK telemetry interface RX/TX byte and packet rate per second
#!/usr/bin/env python3
import socket
import os
import sys
import glob
import json
import time
import argparse
from datetime import datetime
@tshipenchko
tshipenchko / index.md
Last active June 8, 2025 07:40
Windows WebDav Basic Auth (Apache + LDAP)
@tshipenchko
tshipenchko / compose.yaml
Created April 2, 2024 14:16
mtproto server using v2ray-core (ARM supported)
version: "3"
services:
v2ray:
image: v2fly/v2fly-core:v4.45.2
restart: always
command: v2ray -config /config.json
volumes:
- ./config.json:/config.json
ports:
@tshipenchko
tshipenchko / agent.sh
Created April 1, 2024 10:09
ssh-agent shell
#!/usr/bin/env bash
trap 'echo "Killing ssh-agent" && eval "$(ssh-agent -k)"' EXIT
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
echo "Shell activated"
bash
@tshipenchko
tshipenchko / Caddyfile
Created January 1, 2024 12:03
LFH caddy
*.8197cb8c.nip.io {
tls internal
@portNum header_regexp "Host" ([0-9]+)\.8197cb8c\.nip\.io
handle @portNum {
reverse_proxy localhost:{http.regexp.1}
}
handle {
respond "bad port"
}
@tshipenchko
tshipenchko / README.md
Last active May 19, 2024 11:09
My common nginx configs

TLS certificate

openssl req -x509 -nodes -days 36500 -newkey rsa:2048 \
  -keyout nginx.key -out nginx.crt -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost"
@tshipenchko
tshipenchko / nginx.conf
Created December 21, 2023 04:45
Minimal nginx SPA config
### SRC: https://github.com/steebchen/nginx-spa
server {
listen 80 default_server;
gzip on;
gzip_min_length 1000;
gzip_types text/plain text/xml application/javascript text/css;
root /app;
@tshipenchko
tshipenchko / default.nix
Created November 14, 2023 12:30
nix-shell + python w/ integrated dependencies
{ pkgs ? import <nixpkgs> { } }:
let
ld_library_path = pkgs.lib.makeLibraryPath (with pkgs; [
stdenv.cc.cc # for greenlet support
]);
in
pkgs.symlinkJoin {
name = "dev-env-python311-cc-libpq";
paths = with pkgs; [ python311 postgresql ];
nativeBuildInputs = [ pkgs.makeWrapper ];
@tshipenchko
tshipenchko / gist:0ab1d9ffd5ede65557caaa909f240ad3
Created August 29, 2021 11:07
Yatopia Pufferpanel template
{
"name": "minecraft-yatopia",
"display": "Yatopia - Minecraft",
"type": "minecraft-java",
"install": [
{
"files": [
"https://api.yatopiamc.org/v2/build/${build}/download?branch=ver/${version}"
],
"type": "download"