This file contains 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
import sys, tty, termios | |
def getch(): | |
fd = sys.stdin.fileno() | |
old_settings = termios.tcgetattr(fd) | |
try: | |
tty.setraw(sys.stdin.fileno()) | |
ch = sys.stdin.read(1) | |
if ch == '\x1b': | |
ch += sys.stdin.read(2) |
This file contains 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
{ | |
"log": { | |
"loglevel": "info" | |
}, | |
"outboundDetour": [ | |
{ | |
"tag": "direct", | |
"protocol": "freedom", | |
"settings": {} | |
} |
This file contains 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
function clone::do_clone() { | |
local script="url='$1' | |
print('github' in url or 'bitbucket' in url)" | |
local need_proxy=$(python -c "$script") | |
local proxy="socks5://localhost:1080" | |
if [ "$need_proxy" = "True" ]; then | |
export {https,http,all}_proxy=$proxy | |
git clone "$1" "$2" | |
unset {https,http,all}_proxy |
This file contains 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
# based on the original config | |
from libqtile.config import Key, Screen, Group, Drag, Click | |
from libqtile.command import lazy | |
from libqtile import layout, bar, widget | |
from libqtile import hook | |
from libqtile.log_utils import logger | |
import os | |
import subprocess |
This file contains 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
sed -i "s/jessie/stretch/g" /etc/apt/sources.list && apt update -y && apt dist-upgrade -y && printf "net.ipv4.tcp_congestion_control=bbr\nnet.core.default_qdisc=fq" >> /etc/sysctl.conf |
This file contains 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
sed -i "s/jessie/stretch/g" /etc/apt/sources.list && apt update -y && apt dist-upgrade -y && printf "net.ipv4.tcp_congestion_control=bbr\nnet.core.default_qdisc=fq" >> /etc/sysctl.conf |
This file contains 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
import subprocess | |
import glob | |
import json | |
import os | |
p = {} | |
os.chdir(os.path.expanduser("~/.password-store")) | |
for f in glob.glob("**/*.gpg", recursive=True): | |
name = os.path.splitext(f)[0] | |
print(name) | |
e = subprocess.check_output(["pass", name]) |
This file contains 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
sudo apt install automake libssl-dev |
This file contains 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
import os | |
from distutils.version import LooseVersion | |
import shutil | |
path = os.path.expanduser('~/.meteor/packages') | |
for root, dirs, files in os.walk(path): | |
if root == path: | |
continue | |
version = sorted([i for i in dirs if i[0] != '.'], key=LooseVersion) | |
if len(version) > 1: |
This file contains 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
APP_NAME = panda | |
RUN_USER = git | |
RUN_MODE = prod | |
[attachment] | |
ENABLED = true | |
PATH = /home/pan/app/git-attachment | |
[session] | |
PROVIDER = file |