Skip to content

Instantly share code, notes, and snippets.

View click0's full-sized avatar

Vladyslav V. Prodan click0

View GitHub Profile
@click0
click0 / random-ipv6-address-generator.sh
Created April 24, 2011 17:48
Random generator ipv6 addresses within your ipv6 network prefix.
#Random generator ipv6 addresses within your ipv6 network prefix.
#!/usr/local/bin/bash
# Copyright
# Vladislav V. Prodan
# universite@ukr.net
# 2011
array=( 1 2 3 4 5 6 7 8 9 0 a b c d e f )
@click0
click0 / Example_microsocks_stunnel_freebsd_config.md
Last active August 12, 2023 00:34 — forked from daemonhorn/Example_microsocks_stunnel_freebsd_config.md
Socks5 using Microsocks and Stunnel on FreeBSD

Socks5 proxy using Microsocks and Stunnel on FreeBSD

Configuration information for the Microsocks package on FreeBSD as the existing documentation does not give sufficient details to create a secure configuration flexible enough to use for various use cases. See https://github.com/rofl0r/microsocks for the latest source code and wiki documentation. Note: The user authentication method supported by Microsocks is only plaintext, and is not protected by any layer of encryption. Please be hyper aware and use other layers of protection to secure your socks5 endpoint. (Firewall + TLS encryption with client authentication using something like stunnel).

  • If you want an easy way of doing this, just look at ssh -D localhost:1080 <user@host> instead since SSH provides a native Socks5 tunnel with encryption.
  • You can also use stunnel in socks5 protocol mode without Microsocks since it has native support for protocol = socks. See stunnel documentation here: https://www.stunnel.org/static/stunnel
@click0
click0 / image-build.sh
Created August 1, 2023 13:25 — forked from HackingGate/image-build.sh
upgrade ipk on OpenWrt
VERSION=19.07.7
# Download imagebuilder for R7800.
aria2c -c -x4 -s4 https://downloads.openwrt.org/releases/${VERSION}/targets/ipq806x/generic/openwrt-imagebuilder-${VERSION}-ipq806x-generic.Linux-x86_64.tar.xz
# Extract & remove used file & cd to the directory
tar -xvf openwrt-imagebuilder-${VERSION}-ipq806x-generic.Linux-x86_64.tar.xz
rm openwrt-imagebuilder-${VERSION}-ipq806x-generic.Linux-x86_64.tar.xz
cd openwrt-imagebuilder-${VERSION}-ipq806x-generic.Linux-x86_64/
@click0
click0 / wipe_disk_linux.sh
Created November 19, 2022 10:19
HDD or SSD Disk Cleanup
#!/bin/sh
# HDD or SSD Disk Cleanup
# Debian
disk_list=sda100
disk_list=$(grep -E "nvme[0-9]+n[0-9]$|[hsv]d[a-z]$" /proc/partitions | awk '{print $4;}' | sed ':a;N;$!ba;s/\n/ /g')
for disk in ${disk_list}; do
@click0
click0 / nginx.conf
Created March 9, 2022 23:09 — forked from mikoim/nginx.conf
Split RTMP Stream with nginx-rtmp-module
worker_processes 1;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
chunk_size 8192;
@click0
click0 / gateway.nanobsd
Created April 28, 2019 21:45 — forked from blacklion/gateway.nanobsd
my NanoBSD router config
#! /bin/sh
NANO_NAME=gateway-j3160
NANO_SRC=/data/src
NANO_OBJ=/usr/obj/nanobsd/gateway.v3
NANO_ROOT_DIR=/usr/home/lev/nanobsd
NANO_CONFROOT=${NANO_ROOT_DIR}/gateway.v3
NANO_TOOLS=${NANO_ROOT_DIR}/scripts
@click0
click0 / factorio_blueprint_string_edit.py
Created February 10, 2021 04:23 — forked from Bilka2/factorio_blueprint_string_edit.py
Decode a Factorio blueprint string, change some of it and reencode it
import json
import zlib
import base64
original_bp_string = '0eNp9j80OgjAQhN9lzq0RFNC+ijGGnw1uQhdCi5GQvrstXjx5m9mfb2c3NMNC08ziYTZwO4qDuW1w3Es9pJpfJ4IBe7JQkNomVztHthlYem3r9slCOkdQYOnoDZOFuwKJZ8/05e1mfchiG5rjwH+SwjS6uDxKShCB+nQoFNYoskOR7sQ0LvWmeeyW1vMr0rWNeiB9gslDSrBnNj8vKrxodjs2v2Tn6nytyio7lkUZwgd0Blhx'
bp_json = json.loads(zlib.decompress(base64.b64decode(original_bp_string[1:])).decode('utf8'))
# there is one entity in the blueprint, it's an assembler with a item request for 2 prod-3 modules and no recipe set
# for the fields of the blueprint json see https://wiki.factorio.com/Blueprint_string_format
bp_json['blueprint']['entities'][0]['items'] = {'copper-plate': 200} # overwrites existing item request
@click0
click0 / zfs-backup-mysql.sh
Created April 24, 2011 17:39
Just a small script I wrote to backup mysql via ZFS snapshots
#Just a small script I wrote to backup mysql via ZFS snapshots
#!/bin/sh
# Copyright (c) 2011 Vladislav V. Prodan <universite at ukr.net>
# My MySQL server uses the directory:
# tank/mysql # main directory MySQL
# tank/mysql/ibdata # data of InnoDB tables
# tank/mysql/iblogs # InnoDB transaction logs
@click0
click0 / repairsqlite.sh
Created August 2, 2020 00:10 — forked from sarim/repairsqlite.sh
Sqlite db repair script
#!/bin/bash
DBSTATUS=$(sqlite3 "$1" "PRAGMA integrity_check")
if [ "$DBSTATUS" == "ok" ] ; then
echo DB ALREADY OK
else
echo FIXING CORRUPT DB
TMPDB=$(mktemp -t sarim)
echo ".mode insert
.dump" | sqlite3 "$1" > $TMPDB
#!/bin/bash
zfs_arc_min=4 #G
zfs_arc_max=8 #G
cat << EOF >> /etc/modprobe.d/zfs.conf
# ZFS tuning for a proxmox machine that reserves 64GB for ZFS
#
# Don't let ZFS use less than 4GB and more than 64GB
options zfs zfs_arc_min=$(( ${zfs_arc_min} * 1024 * 1024 * 1024 ))