This file contains hidden or 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
apt update | |
apt install tinyproxy | |
echo 'BasicAuth myuser mypassword | |
Allow 0.0.0.0' >> /etc/tinyproxy/tinyproxy.conf | |
systemctl enable tinyproxy | |
systemctl restart tinyproxy | |
systemctl status tinyproxy | |
FILELIST=$(curl -sL https://github.com/shadowsocks/shadowsocks-rust/releases/download/v1.22.0/shadowsocks-v1.22.0.x86_64-unknown-linux-gnu.tar.xz | tar xvJ -C /tmp) | |
echo "To uninstall, remove these file under /usr/bin: |
This file contains hidden or 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
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo | |
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo | |
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo |
This file contains hidden or 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
# install dependencies | |
yum install epel-release -y | |
yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y | |
yum config-manager --set-enabled PowerTools | |
yum update | |
yum install tinyproxy -y | |
#vi /etc/tinyproxy/tinyproxy.conf | |
echo 'BasicAuth myuser mypassword | |
Allow 0.0.0.0' >> /etc/tinyproxy/tinyproxy.conf |
This file contains hidden or 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
## Netcat server command | |
nc -l -p <unused port # > /dev/null | |
eg: | |
nc -l -p 1122 > /dev/null | |
## Netcat Client command | |
dd if=/dev/zero bs=100M count=1 | nc <netcat server> <netcat port> | |
eg: | |
dd if=/dev/zero bs=100M count=1 | nc 10.0.1.251 1122 |
This file contains hidden or 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
awk 'NR==FNR{a[$0]=1;next}!a[$0]' B A | |
# or better memory usage: | |
awk 'NR==FNR{a[$0];next} !($0 in a)' B A | |
grep -Fvx -f B.txt A.txt |
This file contains hidden or 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
inside: | |
~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist |
This file contains hidden or 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
EXECFILE="$(readlink "$0" || echo "$0")" | |
EXECPATH="$( cd -- "$(dirname "$EXECFILE")" >/dev/null 2>&1 ; pwd -P )" | |
cd "$EXECPATH" |
This file contains hidden or 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
In /etc/ssh/sshd_config | |
IPQoS cs0 cs0 | |
In /etc/fstab | |
UUID=XXXX /media/pi/Data auto rw,user,auto 0 0 | |
``` | |
sudo setfacl -b /media/pi |
This file contains hidden or 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 | |
# Pump | |
sudo pmset -a disablesleep 1 | |
sudo pmset -a sleep 0 | |
caffeinate -di | |
#Sleep | |
kill `ps -ef | grep caffeinate | grep -v grep | awk '{print $3}'` | |
sudo pmset -a disablesleep 0 |
This file contains hidden or 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 permutationRecursion(a: List[Int]) = { | |
import scala.collection.mutable | |
val results = mutable.ListBuffer[List[Int]]() | |
def p(curr: List[Int], remaining: List[Int]): Unit = { | |
if (remaining.isEmpty) { | |
results += curr | |
} | |
else { | |
for (i <- remaining) { |
NewerOlder