Skip to content

Instantly share code, notes, and snippets.

View click0's full-sized avatar

Vladyslav V. Prodan click0

View GitHub Profile
@click0
click0 / script-SA-24:04-openssh-13.2.patch.sh
Last active July 5, 2024 15:43
Патчи в FreeBSD-SA-24:04.openssh для разных веток FreeBSD
#!/bin/sh
# License:
# Public Domain
# Author:
# Eugene Grosbein
# Description:
# Пользователям stable, чтобы не пересобирать мир для исправления FreeBSD-SA-24:04.openssh
@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 / 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 / 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 ))
@click0
click0 / cbsdd
Created May 7, 2019 21:35
fix log warning
--- cbsdd.orig 2019-05-07 01:58:50.410050000 +0300
+++ cbsdd 2019-05-07 02:01:56.420224000 +0300
@@ -6,6 +6,12 @@
CBSDMODULE="taskd"
EXTHELP="wf_taskd.html"
+file_log=/var/log/cbsd/cbsd.log
+
+log123() {
+ echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $@" >> ${file_log}
@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