Skip to content

Instantly share code, notes, and snippets.

Avatar
🥁
🎵 🎵 🎵 🎶

bookgin BookGin

🥁
🎵 🎵 🎵 🎶
View GitHub Profile
View NAT.iptables
WAN="eno1"
LAN="eno2"
sysctl net.ipv4.ip_forward=1
# make sure the default FORWARD policy is DROP
iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
iptables -A FORWARD -i $WAN -o $LAN -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# NAT
View ipv4_negate.py
#!/usr/bin/env python3
import ipaddress
ips = [ipaddress.ip_network('0.0.0.0/0')]
exts = map(ipaddress.ip_network
'''
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
127.0.0.0/8
@BookGin
BookGin / solve.sh
Last active Dec 2, 2020
Ubuntu 18.04 Bionic Netplan Wifi Not Working
View solve.sh
# https://gist.github.com/austinjp/9b968c75c3e54004be7cd7a134881d85
# make sure your wifi SSID and password are correct again
vim /etc/netplan/01-netcfg.yaml
# this package should solve all the problem
apt install wpasupplicant
# generate and apply the config file
netplan apply
# remember to enable the device
ip link set wlp2s0 up
@BookGin
BookGin / segfault.py
Last active Dec 29, 2019
Python Segfault
View segfault.py
#!/usr/bin/env python3
# https://bugs.python.org/issue22911
[[a.extend([__import__('itertools').chain.from_iterable(a)]),next(*a)]for(a)in[[]]]
@BookGin
BookGin / 臺灣學術倫理教育資源中心 台灣學術倫理教育資訊中心 題庫 答案 解答 .txt
Last active May 6, 2021
學術倫理 解答,臺灣學術倫理教育資源中心 台灣學術倫理教育資訊中心 題庫 答案 解答 ,請大家留言補充更多解答 或是修正答案 感謝!
View 臺灣學術倫理教育資源中心 台灣學術倫理教育資訊中心 題庫 答案 解答 .txt
使用方法:Ctrl + F 直接搜尋題目關鍵字即可
請大家留言補充更多解答 或是修正答案,感謝各位的貢獻!
臺灣學術倫理教育資源中心
https://ethics.moe.edu.tw/exam/
其他資源:
@BookGin
BookGin / tty.sh
Created Jun 5, 2019
Spawn a tty shell
View tty.sh
python -c 'import pty;pty.spawn("sh")'
@BookGin
BookGin / firefox-unregister-all-service-workers.js
Last active Apr 19, 2021
Unregister all service workers in Firefox.
View firefox-unregister-all-service-workers.js
# navigate to about:debugging#workers first
for (let k of document.getElementsByClassName("unregister-link")) k.click()
for (let k of document.getElementsByClassName("qa-unregister-button")) k.click()
View pdf2img.sh
#!/usr/bin/env bash
if [ $# != 1 ]; then
echo "Usage: $0 [filename]"
exit 1
fi
lastdir=`pwd`
tmpdir=`mktemp -d --suffix=-pdf2img`
echo "temp dir: $tmpdir"
@BookGin
BookGin / IceCTF2016-l33tcrypt-server.py
Created Aug 29, 2016
IceCTF 2016 Stage3 l33tcrypt: server.py
View IceCTF2016-l33tcrypt-server.py
#!/usr/bin/python
# IceCTF 2016 - Stage3 - l33tcrypt
# finalC · 182 solves / 1660· Cryptography · 90 pt
#
# l33tcrypt is a new and fresh encryption service.
# For added security it pads all information with the flag!
# Can you get it? nc l33tcrypt.vuln.icec.tf 6001 server.py
# [server.py]: