Skip to content

Instantly share code, notes, and snippets.

@kai11
kai11 / README.md
Created October 25, 2020 11:20
Running Archivebox through SOCKS5 proxy

Corresponding Archivebox issue ArchiveBox/ArchiveBox#249

I cannot use Wireguard because I cannot setup it on my VPS. i decided to use https://hub.docker.com/r/ncarlier/redsocks/ However, by default it generates redsocks config with unauthenticated http\https proxy, for SOCKS5 it must be modified.

Running Archivebox thorugh SOCKS5 proxy

1. Creating docker bridge with name "archivebox"

docker network create --opt com.docker.network.bridge.name=archivebox -d bridge archivebox
@kai11
kai11 / unit.sh
Created May 21, 2019 07:25 — forked from tvlooy/unit.sh
Bash test: get the directory of a script
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
@kai11
kai11 / .spacemacs
Last active September 7, 2022 12:47
Spacemacs on Ubuntu 16.04 - automatically switch between English and Russian layouts on entering and exiting insert state
;; Spacemacs on Ubuntu 16.04 - automatically switch between English and Russian layouts on entering and exiting insert state
;; "r" command will use English though
;; Idea from https://github.com/syl20bnr/spacemacs/issues/3225
;; exit hook below assumes your langunage #0 (first in Input Sources list) is English
;; if it's not, change 0 to index of English
(defun dotspacemacs/user-config ()
(setq prev_lang (substring (shell-command-to-string
"gsettings get org.gnome.desktop.input-sources current")
7 -1))