Skip to content

Instantly share code, notes, and snippets.

@kai11
kai11 / .spacemacs
Last active Mar 26, 2019
Spacemacs on Ubuntu 16.04 - automatically switch between English and Russian layouts on entering and exiting insert state
View .spacemacs
;; 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))
@kai11
kai11 / unit.sh
Created May 21, 2019 — forked from tvlooy/unit.sh
Bash test: get the directory of a script
View unit.sh
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
@kai11
kai11 / README.md
Created Oct 25, 2020
Running Archivebox through SOCKS5 proxy
View README.md

Corresponding Archivebox issue https://github.com/pirate/ArchiveBox/issues/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