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
def ignore_error_and_retry(times=3): | |
def real_decorator(fn): | |
def warpper(*args, **kwargs): | |
try: | |
fn(*args, **kwargs) | |
except Exception as e: | |
print(str(e)) | |
if not hasattr(warpper, "counter"): | |
warpper.counter = 1 | |
else: |
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
from contextlib import contextmanager | |
import signal | |
@contextmanager | |
def timeout(seconds=3): | |
class TimeoutError(Exception): | |
pass | |
def handler(*args,**kwargs): | |
print("[-] Timeout!") | |
raise TimeoutError |
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 -e | |
remote="$1@$2" | |
echo -ne '\e]0;wait... '"$remote"'\a' | |
eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME") | |
localdir="$(cygpath -u "$APPDATA")/gnupg" | |
extrasock="$localdir/S.gpg-agent.extra" # file containing "PORT\nNONCE" | |
rdir='$HOME/.gnupg' # remote prefix | |
rinsock="$rdir/S.gpg-agent" # listen on this socket on server |
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
router id 33.44.0.1; | |
protocol device { | |
scan time 10; | |
} | |
protocol kernel { | |
metric 64; # Use explicit kernel route metric to avoid collisions | |
# with non-BIRD routes in the kernel routing table | |
import none; |
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
SUBSYSTEM=="usb", ACTION=="remove", ENV{ID_VENDOR_ID}=="1050", ENV{ID_MODEL_ID}="0407", RUN+="/usr/local/bin/yubikeylocker.sh" | |
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_VENDOR_ID}=="1050", ENV{ID_MODEL_ID}=="0407", RUN+="/usr/local/bin/yubikeylocker.sh" |
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 python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
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
package main | |
import ( | |
"context" | |
"crypto/sha256" | |
"crypto/tls" | |
"crypto/x509" | |
"encoding/pem" | |
"errors" | |
"fmt" |
OlderNewer