Skip to content

Instantly share code, notes, and snippets.

View cleverfox's full-sized avatar
🎯
Focusing

Vladimir Goncharov cleverfox

🎯
Focusing
  • Pattaya, Thailand
  • 11:30 (UTC +07:00)
View GitHub Profile
@cleverfox
cleverfox / hello.rs
Created March 25, 2026 07:46
My gist description
fn main() {
println!("Hello!");
}
@cleverfox
cleverfox / hello.rs
Created March 24, 2026 08:40
My gist description
fn main() {
println!("Hello!");
}
@cleverfox
cleverfox / set_shaper.sh
Created March 24, 2026 08:32
set local network shaper for test ton-node-rust
#!/usr/bin/env bash
# shapertest.sh — cross-platform network shaper for protocol testing
# Usage: ./shapertest.sh <set|reset|status> <node_count> <delay_ms> <loss_percent>
# Supports: Linux (tc/netem), FreeBSD (ipfw/dummynet), macOS (dnctl/pf)
# Ports per node: TCP 3000+N, UDP 3000+N, UDP 4000+N
set -euo pipefail
# ─── Argument parsing ────────────────────────────────────────────────────────
@cleverfox
cleverfox / ipsec.md
Created July 17, 2025 17:59
Static IPSec between Linux & FreeBSD

static ipsec between FreeBSD & Linux

  • Linux has IP address 9.9.223.245

  • FreeBSD has IP address 5.3.25.69

Linux shell script

ip xfrm policy del src 9.9.223.245 dst 5.3.25.69 dir out
@cleverfox
cleverfox / cmd to birman.json
Created December 2, 2023 08:42 — forked from piskov/cmd to birman.json
Command to birman layout switcher
{
"title": "Change keyboard layout on cmd press",
"rules": [
{
"description": "Change input source to En Birman by left_command; Ru Birman by right_command.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_command",
@cleverfox
cleverfox / convert.sh
Created June 5, 2021 07:14
Convert video to prores for shogun
ffmpeg -i logo.mp4 -r 25 -vcodec prores_ks -profile:v 1 -pix_fmt yuv422p10le -vf scale=1920:1080 -c:a pcm_s24le logo2.mov
@cleverfox
cleverfox / hls2YT.sh
Created March 6, 2021 16:20
FFMPEG h.265 hls to youtube
ffmpeg -i http://192.168.2.11:80/sdi_ext -c:v copy -f hls -method PUT -hls_time 1 -hls_playlist_type event -http_persistent 1 'https://a.upload.youtube.com/http_upload_hls?cid=KEY&copy=0&file=stream.m3u8'
ffmpeg -i http://192.168.2.11:80/sdi -c:v copy -af "pan=stereo|c0=c0|c1=c0" -f flv rtmp://a.rtmp.youtube.com/live2/key1 -c:v copy -af "pan=stereo|c0=c1|c1=c1" -f flv rtmp://a.rtmp.youtube.com/live2/key2
@cleverfox
cleverfox / tc.erl
Created April 28, 2019 15:07
SMPTE timecode view
fun(T) -> Ts=T div 25, {Ts div 3600 rem 24, Ts div 60 rem 60, Ts rem 60, T rem 25} end (16#14CEFE).
{15,9,8,10}
@cleverfox
cleverfox / hex.erl
Created April 9, 2018 20:45
hex.erl
-module(hex).
-export([encode/1, decode/1]).
-export([parse/1]).
parse(B) -> decode(B).
decode(B) when is_binary(B) ->
decode(binary_to_list(B));
decode([$0, $x|L]) ->