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
#!/bin/env python | |
import os | |
import subprocess | |
from sys import stderr | |
FORCED_GIT_GUI_PATH=None | |
# Do NOT modify anything below. | |
UNPATCHED_NEEDLE = 'pave_toplevel .' |
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
#!/bin/bash | |
PREVIOUS="(@@.*function|class)" NEEDLE="getTraced" \ | |
bash -c 'git diff | awk "(/$PREVIOUS/ && !/$NEEDLE/) {capture=1; buffer = \$0; next} capture==1 {buffer = buffer \$0 \"\n\"} (\$capture && /$NEEDLE/) {printf(\"%s\", buffer); capture=0}"' |
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 random | |
import logging | |
import re as module_re | |
import re2 as module_re2 | |
USAGE_PROBABILITY = 0.5 | |
USE_ONLY_PYRE2 = True | |
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
{ | |
// PHP highlights for https://github.com/fabiospampinato/vscode-highlight | |
"highlight.regexes": { | |
"(NOTE:)\s": { | |
"regexFlags": "g", | |
"filterLanguageRegex": "php", | |
"decorations": [ | |
{ | |
"color": "#CFC8A6", | |
"backgroundColor": "#CFC8A40", |
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
#!/bin/bash | |
function psleep { | |
S="$1" | |
O="$S" | |
while [ $S -gt 0 ]; do | |
echo -ne "\r$S s (from $O) " | |
sleep 1 | |
((S--)) | |
done |
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
#!/bin/bash | |
# Put this into your .bashrc, or whatever. | |
function git-add-regex { | |
git diff -U0 | grepdiff -E "$1" --output-matching=hunk | git apply --cached --unidiff-zero | |
} |
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
#!/bin/sh | |
# Usage: | |
# ./a2manage.sh a2dismod proxy.* | |
# ./a2manage.sh a2enmod proxy proxy_fcgi ssl | |
MODS_A_CONF_PATH="/etc/apache2/*.conf" | |
MODS_B_CONF_PATH="/etc/apache2/conf.d/*.conf" | |
function a2enmod { |
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
# After installing MariaDB via apt, run this: | |
## Fix MySQL (MariaDB) | |
if [ ! -f "/etc/init.d/mysql" ]; then | |
sudo cp /usr/share/mysql/mysql.init /etc/init.d/mysql | |
sudo chmod a+x /etc/init.d/mysql | |
sudo service mysql restart | |
sudo mysql_secure_installation | |
sudo service mysql restart | |
fi |
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
# This is the name of archive taken from https://downloads.python.org/pypy/ | |
PYPY_VER="pypy3.9-v7.3.11-linux64" | |
PYPY_VER_NUM=`echo ${PYPY_VER} | grep -oP "v(\d\.?)+" | sed -r 's/[v.]//g'` | |
cd ~ | |
mkdir pypy | |
wget https://downloads.python.org/pypy/$PYPY_VER.tar.bz2 && tar -xvjf $PYPY_VER.tar.bz2 | |
rm $PYPY_VER.tar.bz2 | |
mv $PYPY_VER pypy/ | |
sudo ln -s ~/pypy/$PYPY_VER/bin/pypy3 /usr/bin/pypy3-$PYPY_VER_NUM; chmod +x /usr/bin/pypy3-$PYPY_VER_NUM |
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
#!/bin/bash | |
# Have this in your client WSL1 ".bashrc" file. | |
WSL_DAEMON_DIST_NAME="Alpine" # WSL distribution name which has Docker daemon running in it. | |
export DOCKER_HOST=`wsl.exe -d $WSL_DAEMON_DIST_NAME eval ifconfig | grep -A 1 eth0 | grep -Po "\d+\.\d+\.\d+\.\d+" | head -n1` |
NewerOlder