I hereby claim:
- I am beyondthewall on github.
- I am beyond (https://keybase.io/beyond) on keybase.
- I have a public key ASBJopj94UXr8Xlg1Jfpg_Mr9byHFmv4cWdRLIwXMklfDAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#conditional dns forwarding | |
uci add_list dhcp.@dnsmasq[0].servers=/example.com/10.85.0.10 | |
uci commit dhcp | |
/etc/init.d/dnsmasq restart | |
#wpa2 | |
uci set wireless.@wifi-iface[0].encryption=psk2 | |
uci set wireless.@wifi-iface[0].key="your_password" | |
uci commit wireless | |
wifi |
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
installdeps() | |
{ | |
#checking for system | |
systems="ubuntu arch" | |
issue="$(cat /etc/issue)" | |
for item in $systems; do | |
echo $issue | grep -i $item | |
if [ $? -eq 0 ]; then | |
system=$item | |
fi |
modprobe nbd max_part=16 | |
qemu-nbd -c /dev/nbd0 image.qcow2 | |
partprobe /dev/nbd0 | |
mount /dev/nbd0p1 /mnt/image |
tty -s | |
echo $? |
wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant_socialnerds.conf | |
sleep 5 | |
dhcpcd wlan0 |
#enable IPv4 Forwarding | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
#Drop IMCP from broadcast multicast | |
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts | |
#Enable TCP SYN Cookie Protection from SYN Floods | |
echo 1 > /proc/sys/net/ipv4/tcp_syncookies | |
#Don't accept ICMP redirect messages |
i=1 | |
j=1 | |
threshold=850 | |
while [ 2 -gt 1 ]; do | |
echo "run count: $i" | |
sleep 30 | |
mem=$(free -m | grep + | awk '{print $3}') | |
echo " used memory: $mem" | |
echo " threshold: $threshold" | |
if [ $mem -gt $threshold ]; then |
def gcd(a, b): | |
a=int(a) | |
b=int(b) | |
if a <= 0 or b <= 0: | |
print "given values may not be less than 1" | |
exit() | |
elif a > b: | |
c = b | |
else: |