Skip to content

Instantly share code, notes, and snippets.

View TitaniumHocker's full-sized avatar
🍺
forever young, forever drunk

Ivan Fedorov TitaniumHocker

🍺
forever young, forever drunk
View GitHub Profile
#!/usr/bin/env sh
# Simple script for creating local tcp proxy to actual destination via socat
set -e
USAGE=$(cat <<EOF
Usage: $0 [-h|--help] <host:port> [host:port] ...
Simple script for creating local tcp proxy to actual
@TitaniumHocker
TitaniumHocker / wg-easy-bootstrap.sh
Last active October 23, 2025 12:06
Simple wg-easy setup on Debian 12 with https
#!/usr/bin/env bash
set -e
if [ -z $1 ]; then
echo "Domain name wasn't provided!" 1>&2;
exit 1
fi
apt-get install --yes docker docker-compose nginx certbot python3-certbot-nginx dnsutils curl
@TitaniumHocker
TitaniumHocker / index.wsgi
Last active August 30, 2022 00:00
Simple entrypoint for Apache2 mod_wsgi
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Simple entrypoint for Apache2 mod_wsgi."""
import os
import sys
from itertools import chain
class WSGIEntrypoint(object):
def __call__(self, environ, start_response):
@TitaniumHocker
TitaniumHocker / hcmp.py
Last active December 9, 2021 21:18
Simple tool for hash compare
#!/usr/bin/env python3
# Simple program for compairing string with hash
# Author: Ivan Fedorov <inbox@titaniumhocker.ru>
# Licence: MIT
import sys
import hashlib
import typing as t
from argparse import ArgumentParser
@TitaniumHocker
TitaniumHocker / forked.pl
Created October 1, 2021 20:29
Simple utility for starting command in separate process.
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
my $stdin = "/dev/null";
my $stdout = "/dev/null";
my $stderr = "/dev/null";
@TitaniumHocker
TitaniumHocker / queue.c
Created July 13, 2021 20:15
Simple queue implementation in C via dual linked list
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
typedef struct node
{
char *data;
size_t size;
@TitaniumHocker
TitaniumHocker / stack.c
Last active July 12, 2021 21:37
Simple stack implementation in C via linked list
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <string.h>
typedef struct node
{
char *data;
size_t size;