Skip to content

Instantly share code, notes, and snippets.

View tshipenchko's full-sized avatar
🎯
Focusing

Łukasz Tshipenchko tshipenchko

🎯
Focusing
View GitHub Profile
@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 / nginx.conf
Last active January 1, 2024 19:49
My common nginx configs
#- Default reverse proxy
location / {
proxy_pass http://127.0.0.1:3000;
include proxy_params;
}
#- Reverse proxy w/ path + path removal
location /api {
# Removes /api prefix
rewrite ^/api/(.*) /$1 break;
@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"
@tshipenchko
tshipenchko / telegram_bots_commands_regex
Last active February 19, 2021 06:13
Telegram bots commands regex handler (python)
##Regex
`regex_patern = r'^\/(command)+(\@username_of_bot\w*(_\w+)*)?([ \f\n\r\t\v\u00A0\u2028\u2029].*)?$'`
Commands like that will handle
/command
/command arg1 arg2 ...
/command@username_of_bot
/command@username_of_bot arg1 arg2 ...
but
/command@other_bot