/
^(?:([^:\/?#]+):\/\/)?
(?:([a-zA-Z0-9\-_.+]+)(?:\:([a-zA-Z0-9\-_.+]+))?@)?
((?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)(?:\.(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*\.?)
(?:\:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]))?
(\/[^?#]*)?
(?:\?([^#]*))?
(?:#(.*))?$
/
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 java.io.IOException; | |
import java.net.URLClassLoader; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.nio.file.Path; | |
/** | |
* Example demonstrating a ClassLoader leak. | |
* | |
* <p>To see it in action, copy this file to a temp directory somewhere, |
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 bash | |
elevate() { | |
powershell -Command "Start-Process cmd -ArgumentList \"/c\",\"$1 2>&1 | clip\" -Verb RunAs" | |
powershell -sta "add-type -as System.Windows.Forms; [windows.forms.clipboard]::GetText()" | |
} |
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 scala.collection.{AbstractIterator, Iterator} | |
import scala.collection.Iterator.empty | |
object ImplicitIteratorExtensions{ | |
implicit final class InclusiveIterator[A](it: Iterator[A]){ | |
/** | |
* The actual function to act upon the iterator. Emuluates a "do-while" loop. In other words, it will stop iterating on | |
* predicte failure, but will include that last result as a part of the iterator. | |
* @param predicate {A => Boolean} - A function that is evaluated on each result from the parent iterator. | |
* @return |
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
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2' | |
} | |
} | |
apply plugin: com.github.jengelman.gradle.plugins.shadow.ShadowPlugin |
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 | |
# Use socat to proxy any protocol through an HTTP CONNECT firewall. | |
# Useful if you are trying to SSH into a remote server or clone git:// from inside a company. | |
# | |
# Requires that the proxy allows CONNECT to the port specified | |
# in this scripts arguments (e.g. git: 9418, SSH: 22, etc). | |
# | |
# Save this file as connectproxy somewhere in your path (e.g., ~/bin) and then run | |
# chmod +x connectproxy | |
# git config --global core.gitproxy connectproxy |
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 | |
python3 -c ' | |
import sys, yaml, json | |
try: json.dump(yaml.load(sys.stdin), sys.stdout, indent=4) | |
except KeyboardInterrupt as e: print("Interrupted. Quitting..."); sys.exit(130) | |
' |
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 bash | |
# List files that exist only in dir1. https://stackoverflow.com/a/24695424/1902896 | |
comm -23 <(ls dir1 | sort) <(ls dir2 | sort) | |
# Find files with a certain name located in the specified directory | |
find <directory> -name "<file_name>" 2>/dev/null | |
# Find files with a certain name located in the specified directory, then loop over each file name, printing each one. |
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 bash | |
sudo apt-get install -y ocserv software-properties-common | |
sudo add-apt-repository -y ppa:certbot/certbot | |
sudo apt-get update && sudo apt-get install -y certbot | |
sudo certbot certonly --standalone --preferred-challenges http -n --agree-tos --email [email protected] -d vpn.steele.co | |
(crontab -l 2>/dev/null; echo "@daily certbot renew --quiet && systemctl restart ocserv") | crontab - | |
sudo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE |
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 bash | |
find / -type f -name "libnssckbi.so" 2>/dev/null | while read line; do | |
sudo mv $line ${line}.bak | |
sudo ln -s /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so $line | |
done | |
sudo mount --bind -o nodev,ro /etc/ssl/certs /snap/core/current/etc/ssl/certs/ | |
sudo mount --bind -o nodev,ro /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so /snap/firefox/85/libnssckbi.so |
OlderNewer