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
nc -l 8888 |
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 | |
mkdir ~/.ssh | |
touch ~/.ssh/authorized_keys | |
# vim ~/.ssh/authorized_keys | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/authorized_keys |
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 importlib | |
# @timer | |
def timer(fn): | |
time = importlib.import_module('time') # dynamic import | |
def wrapper(*args, **kw): | |
print('[{}]: Task starting...'.format(fn.__name__)) | |
START = time.time() | |
res = fn(*args, **kw) |
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
#!/usr/bin/env python3 | |
import sys | |
import zlib | |
# from binascii import crc32 | |
ans = int(sys.argv[1], 16) | |
for i in range(100000, 999999): | |
if i % 100000 == 0: | |
print('cracking',i) | |
if zlib.crc32(bytes(str(i), encoding='utf8')) == ans: |
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
#!/usr/bin/env python3 | |
import requests | |
TEST_URL = 'https://www.baidu.com/' | |
def check_proxy(proxyIp, proxyPort='8080', proxyType='https'): | |
if len(proxyIp) <= 0: | |
return False | |
proxy = "{proxyIp}:{proxyPort}".format(proxyIp=proxyIp, proxyPort=proxyPort) |
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
/* | |
enhance CapsLock | |
CapsLock -> Backspace | |
C - CapsLock -> Delete | |
A - CapsLock -> Enter | |
*/ | |
SetCapsLockState, AlwaysOff | |
CapsLock::SendInput {Backspace} | |
+CapsLock::SendInput {Delete} | |
^CapsLock::SendInput {Enter} |
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 | |
# set flag fast fail | |
set -e | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
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
#!/bin/bash | |
red='\e[91m' | |
green='\e[92m' | |
yellow='\e[93m' | |
magenta='\e[95m' | |
cyan='\e[96m' | |
none='\e[0m' | |
# Root |
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 | |
git filter-branch --commit-filter ' | |
OLD_EMAIL="your-old-email@example.com" | |
CORRECT_NAME="your-correct-name" | |
CORRECT_EMAIL="your-correct-email@example.com" | |
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]; | |
then | |
GIT_AUTHOR_NAME="$CORRECT_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
/** | |
* Highlights text within a dom element. | |
* | |
* Specifically this is designed to work with the output | |
* positions of terms returned from a lunr search. | |
* | |
* @param {HTMLElement} element - the element that contains text to highlight. | |
* @param {MatchLocation[]} matches - the list of matches to highlight. | |
*/ | |
module.exports = function (element, matches) { |