This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wrapper for windows subsystem for linux (Bash on Ubuntu on Windows) | |
// It allows running native ubuntu applications from Windows | |
// 1. Compile (on windows, the command below is for mingw-gcc): | |
// g++ -O3 -flto -fwhole-program -fvisibility=hidden -fno-exceptions -fno-rtti -s win2lin.cpp -o win2lin.exe | |
// 2. make a copy for each program | |
// for i in git python perl; do cp win2lin.exe ${i}.exe; done | |
// 3. put directory with exes in windows PATH | |
// 4. example (from cmd.exe): | |
// cat "c:\test 1.txt" | |
// will be translated to: bash -c "exec cat \"/mnt/c/test 1.txt\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS ?= -O3 -flto | |
simple_uinput: proto.h spnav_config.h spnav.h proto.c spnav.c simple.c | |
$(CC) $(CFLAGS) -o $@ $^ | |
spnav_config.h: | |
touch $@ | |
proto.h spnav.h proto.c spnav.c: | |
curl -L -O --compressed --url "https://github.com/FreeSpacenav/libspnav/raw/master/src/{proto.c,proto.h,spnav.c,spnav.h}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To generate mitm cert and key: | |
# openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -passout pass:"third-wheel" -subj "/C=US/ST=private/L=province/O=city/CN=hostname.example.com" | |
# see: https://github.com/campbellC/third-wheel | |
[package] | |
name = "http-ytproxy" | |
version = "0.1.0" | |
edition = "2021" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ==UserScript== | |
-- @name mpv-playlist-kdialog | |
-- @version 0.1 | |
-- @description Display mpv playlist and select playlist entry in KDE's kdialog or Gnome's zenity. | |
-- @author ftk | |
-- @license 0BSD | |
-- @downloadURL https://gist.githubusercontent.com/ftk/5e26656a2ec9a6cb0fef46918f741d0a/raw/mpv-playlist-kdialog.lua | |
-- ==/UserScript== | |
local options = { | |
-- window dimensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# check for one-time codes coming as notifications via KDE connect and copy them to clipboard | |
# requirements: qdbus(qt-tools), dbus-monitor, kde-connect, klipper | |
# the script must be run in user session | |
set -euo pipefail | |
shopt -s lastpipe | |
if [[ $# -eq 0 ]] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Simple config generator for AmneziaWG server and clients (1 client by default) with random headers. | |
## It will generate files wg0s.conf, wg0c2.conf, ... | |
## wg0s.conf must be placed in /etc/amnezia/amneziawg/ on the server, other files must be distributed to clients. | |
## Usage: ./awg-mkconfig.sh [remote ip] [remote wan iface] (remote ssh name - optional) | |
## To get remote interface run "ip address show" on the server. Usually it starts with "ens". | |
## Environment variables: | |
## num_peers=2 - increase to generate configs for more than 1 client | |
## port - defaults to random port from 1024 to 33792 | |
## subnet=10.100.0 - first 3 octets for awg interface |