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 | |
sudo ip netns add vpn | |
sudo ip netns exec vpn ip addr add 127.0.0.1/8 dev lo | |
sudo ip netns exec vpn ip link set lo up | |
sudo ip link add vpn0 type veth peer name vpn1 | |
sudo ip link set vpn0 up | |
sudo ip link set vpn1 netns vpn up | |
sudo ip addr add 10.10.10.1/24 dev vpn0 | |
sudo ip netns exec vpn ip addr add 10.10.10.2/24 dev vpn1 | |
sudo ip netns exec vpn ip route add 37.59.63.23 via 10.10.10.1 dev vpn1 |
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 | |
sudo ip netns pids vpn | xargs -rd'\n' sudo kill | |
sudo rm -rf /etc/netns/vpn | |
sudo sysctl -q net.ipv4.ip_forward=0 | |
sudo iptables -D INPUT ! -i vpn0 -s 10.10.10.0/24 -j DROP | |
sudo iptables -t nat -D POSTROUTING -s 10.10.10.0/24 -o en+ -j MASQUERADE | |
sudo ip link del vpn0 | |
sudo ip netns delete vpn |
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 | |
# Converts all InnoDB tables in all databases to ROCKSDB | |
#DATABASES="db1 db2" # Convert databases db1 and db2 only | |
DATABASES="ALL" # Convert all databases | |
MYSQL_USER=user | |
# Uncomment if you're not using ~/.my.cnf file (will receive "Warning: Using a password on the command line interface can be insecure" warnings) | |
#MYSQL_PASS='some-secret-password' |
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
# save it as /etc/profile.d/ssh-telegram.sh | |
# use sed to parse JSON from ipinfo.io | |
# you can get your user_id by writing to @get_id_bot | |
USERID="<target_user_id>" | |
KEY="<bot_private_key>" | |
TIMEOUT="10" | |
URL="https://api.telegram.org/bot$KEY/sendMessage" | |
DATE_EXEC="$(date "+%d %b %Y %H:%M")" | |
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt' | |
if [ -n "$SSH_CLIENT" ] && [ -z "$TMUX" ]; then |
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 ia-save() { | |
curl -s -I "https://web.archive.org/save/$1" | | |
grep Content-Location | | |
awk '{printf( "https://web.archive.org/%s\n",$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
[Unit] | |
Description=Monero Daemon | |
After=network.target | |
[Service] | |
Type=forking | |
GuessMainPID=no | |
ExecStart=/usr/local/src/monero/build/release/bin/monerod --rpc-bind-ip 127.0.0.1 --detach --restricted-rpc | |
Restart=always | |
User=monerodaemon |
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 | |
# Ergil Osin 2017 | |
# Donate XMR 4FRyuEftwbeGToYJY6hcmTeFCEQufop63QDLPpabYcx9Ju78jqKdNvS99QNmWryLdobo1o7XocACES84LHzN8Guj5M82kEK79jUK6HG2ax | |
sudo apt update | |
sudo apt -y install wget curl git build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libcurl4-openssl-dev libgtest-dev | |
cd /usr/src/gtest | |
sudo cmake . | |
sudo make | |
sudo mv libg* /usr/lib/ | |
cd /usr/local/src |
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
[Unit] | |
Description=XMRig Daemon | |
After=network.target | |
[Service] | |
Type=forking | |
GuessMainPID=no | |
ExecStart=/usr/local/bin/xmrig -c /home/miner/config/config.json -l /home/miner/xmrig.log -B | |
Restart=always | |
User=miner |