Skip to content

Instantly share code, notes, and snippets.

View hex128's full-sized avatar
👾

Hex hex128

👾
View GitHub Profile
type: custom:yasno-card
city: "Київ"
dso: "ПРАТ «ДТЕК КИЇВСЬКІ ЕЛЕКТРОМЕРЕЖІ»"
group: "1.1"
@hex128
hex128 / buildroot-docker-compose.yml
Created January 10, 2024 02:32
Docker Compose File for Buildroot
services:
set-permissions:
image: alpine
user: root
volumes:
- buildroot:/mnt/buildroot
command: chown -R 1000:1000 /mnt/buildroot
build:
image: buildroot/base:20211120.1925
volumes:
@hex128
hex128 / wg-apply
Last active October 13, 2021 11:11
Apply Wireguard configuration without restart
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <WG_IFACE>" > /dev/stderr
exit 1
fi
wg addconf wg0 <(wg-quick strip wg0)
#!/usr/bin/env python3
import datetime
import fcntl
import glob
import html.parser
import logging
import os
import re
import shutil
import socket
/*
* gcc -fPIC -Wall -ldl -shared -o pwd_override.so -Wl,-soname,pwd_override.so pwd_override.c
*/
#define _GNU_SOURCE
#include <pwd.h>
#include <stdio.h>
#include <dlfcn.h>
@hex128
hex128 / bspatch.patch
Last active December 24, 2018 21:29
KingstVIS 3.1.1 dark theme fix
@start /b cmd /c mpv --no-border --loop=force --no-osc --ontop --demuxer-lavf-analyzeduration=0 --demuxer-lavf-probesize=32 --no-audio --framedrop=decoder --force-seekable=no --no-cache --cache-secs=0 --no-cache-pause --rtsp-transport=tcp --geometry=432x768+0+0 rtsp://192.0.2.10/
@start /b cmd /c mpv --no-border --loop=force --no-osc --ontop --geometry=934x768+432+0 video.mp4
@echo off
net session >nul 2>&1
if %errorLevel% == 0 (
sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi
sc.exe config mrxsmb10 start= disabled
) else (
echo Please run with Administrator rights.>&2
)
pause
ffmpeg -f lavfi -i anullsrc -re -rtsp_transport tcp -analyzeduration 0 -i rtsp://admin:[email protected]/h264/ch${channel}/main/av_stream -c:v libx264 -c:a libfaac -ar 44100 -ac 2 -preset ultrafast -tune zerolatency -crf 30 -g 20 -f flv rtmp://127.0.0.1/live/ch${channel}
@hex128
hex128 / remainingTime.js
Last active October 25, 2016 01:14
Human readable remaining time till timestamp (Russian)
/**
* @description Get a human readable remaining time till timestamp
* @param till {Number} Timestamp of the moment in the future
* @return {String} Human readable remaining time string
*/
remainingTime = function (till) {
var delta = till - this.timestamp,
string;
if (delta < -60) { // In the past
string = 'Далее';