Skip to content

Instantly share code, notes, and snippets.

@Caltrop256
Caltrop256 / discord-token-getter.js
Last active June 5, 2024 17:18
Gets your discord user token and stores it. Paste this code into the console, make sure you have cache disabled (network -> disable cache)
new Promise(function (resolve) {
const iframe = document.createElement('iframe');
window.document.head.append(iframe);
const pd = Object.getOwnPropertyDescriptor(iframe.contentWindow, 'localStorage');
Object.defineProperty(window, 'localStorage', pd);
iframe.remove();
if (window.localStorage.__token) {
resolve(window.localStorage.__token);
} else {
@arrogantrabbit
arrogantrabbit / vps.md
Last active March 15, 2024 23:59
Hosting services, like Storj, behind firewall/GNAT, using Wireguard on a VPS and DNAT (Port Forwarding) with iptables.

DNAT with iptables over wireguard hosted on a VPS to host services behind a firewall/GNAT.

This is a short description of how to host services, using STORJ node as an example, on a host behind GNAT, or otherwise restrictive firewall, by forwarding packets through WireGuard endpoint on a relatively fast nearby VPS. This is not specific to Storj, and can be adopted to hosting other services.

As an example we will use an Oracle Cloud instance. Free tier still provides 10TB of monthly traffic that is sufficient for most node operators. Just make sure to create an account in a closest datacenter to minimize extra latency.

Notes on configuring the cloud instance

  1. Create the oracle compute instance (ideally, Ampere, because they are awesome, but if that is not availabe, any other will do too).
  2. Pick any OS you prefer, here we'll describe Ubuntu, as a most popular one.