Skip to content

Instantly share code, notes, and snippets.

View raffleberry's full-sized avatar
🎯
Focusing

raffleberry raffleberry

🎯
Focusing
  • Monkaw
  • 01:01 (UTC +03:00)
View GitHub Profile
@raffleberry
raffleberry / Setup Multiple github accounts and ssh keys.md
Last active November 10, 2024 06:19
Setup Multiple github accounts and ssh keys

Context

You're Robin and you want to commit as Batman.

~/.gitconfig

[user]
	email = [email protected]
	name = robin
[core]
	sshCommand = ssh -i ~/.ssh/robin_pk
@raffleberry
raffleberry / update ddns noip.com.md
Last active April 13, 2024 03:37
update noip.com ddns manually or with ddns-updater

manually

IP=$(dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"' )

IP=$(curl https://checkip.amazonaws.com/)

#https://www.noip.com/integrate/request
curl https://<username>:<password>@dynupdate.no-ip.com/nic/update?hostname=all.ddnskey.com&$IP

ddns-updater

@raffleberry
raffleberry / Howto.md
Last active September 3, 2023 08:54 — forked from brentjanderson/Howto.md
SSH Tunneling with Firefox

Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).

  1. Open a terminal
@raffleberry
raffleberry / context.jsx
Last active April 26, 2021 19:45
React Context Template
// source: https://medium.com/swlh/this-is-how-to-use-the-react-context-api-with-hooks-for-a-clean-code-architecture-2019-e66662ec7ab8
const AppContext = createContext();
function AppContextProvider({ children }) {
const [amount, setAmount] = useState(0);
function deposit(value) {
setAmount(amount + value);
}