Skip to content

Instantly share code, notes, and snippets.

@magicstone1412
magicstone1412 / android_gateway.txt
Created September 8, 2024 10:24 — forked from gcleaves/android_gateway.txt
Wireguard peer as internet gateway, using Android USB tethering
# attempt 6, success
# relies on Magisk auto start script
# pause script to give wireguard time to autostart
bullhead:/ # cat /data/adb/service.d/prep_gateway.sh
#!/system/bin/sh
sleep 2m
su -c 'iptables -F tetherctrl_FORWARD'
su -c 'sysctl -w net.ipv4.ip_forward=1'
su -c 'iptables -A FORWARD -i tun0 -j ACCEPT'
su -c 'iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE'
  1. Install Notepad++ (check "set as default HTML editor" to replace Notepad in IE).

  2. Run Notepad++, update its plugins, and install "NppExec" via Plugins, Plugin Manager.

  3. Download DBGpPlugin . Place in C:\Program Files (x86)\Notepad++\plugins\DBGpPlugin

  4. Use this link to download a modified version of the Komodo Remote Debugging Package. Place in plugin directory. (Unmodified Komodo package does not work with DBGpPlugin) Also contains DBGpPlugin

  5. Enter these scripts for Python debugging:

    Press F6 to create a NppExec Execute script, save as "Run Python":

    cd "$(CURRENT_DIRECTORY)"
    
@magicstone1412
magicstone1412 / UFW_ban_country.md
Created June 2, 2021 15:19 — forked from jasonruyle/UFW_ban_country.md
UFW to block countries

Upgrade nodejs to v12.x.x

$ sudo npm install -g n
$ sudo n lts

Install hsd

@magicstone1412
magicstone1412 / README.md
Created March 4, 2019 15:49 — forked from lifehome/README.md
Cloudflare API v4 Dynamic DNS Update in Bash

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

How to use?

  1. Put the cfupdater files to /usr/local/bin
  • If you are using IPv4 for A record, append -v4 to cfupdater in the following systemd service unit.
  • If you are using IPv6 for AAAA record, append -v6 to cfupdater in the following systemd service unit.
  • If you prefer a dual-stack record, append -dualstack to cfupdater in the following systemd service unit.
  1. chmod +x /usr/local/bin/cfupdater
  2. Create a systemd service unit at /etc/systemd/system/, the cfupdate.service is shown as an example.

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream