Skip to content

Instantly share code, notes, and snippets.

@gcleaves
gcleaves / android_gateway.txt
Last active September 14, 2024 09:07
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'
@lifehome
lifehome / README.md
Last active February 25, 2024 06:34 — forked from benkulbertis/cloudflare-update-record.sh
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.

Look out!

A newer version is available!

This gist will no longer update, instead please go to https://github.com/lifehome/systemd-cfddns for more updated versions.

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.
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

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