Skip to content

Instantly share code, notes, and snippets.

View johnpmitsch's full-sized avatar

John Mitsch johnpmitsch

View GitHub Profile
This is a basic example of using SOCKS.
From the computer you want to browse on you'll make an ssh connection to the computer you want to browse from.
In this example it'll be my laptop connecting to my desktop.
Run: ssh -D <port, I use 10000> <user>@<hostname of desktop>
Now, in a browser you don't normally use (I'm using firefox), go to network proxy.
Set Manual porxy configuration
@iNecas
iNecas / $*_vs_$@
Last active August 15, 2018 13:46
Difference between $* and "$@"
./test_args.sh "one two" three
with $*
["one", "two", "three"]
with "$@"
["one two", "three"]
pushd .
FILES=$(find test -type f -path "*$1*"|tr '\n' ' ')
echo $FILES
bundle exec ruby -Itest $FILES
popd
@jturel
jturel / gist:317e9f892fb19e84480880f1f674e74e
Last active February 11, 2022 16:21
SubscriptionFacetPools
# create a new organization $MYORG
org = Organization.find_by_name($MYORG)
hosts = []
50000.times { hosts << { name: SecureRandom.uuid, organization_id: org.id } }
host_ids = ::Host::Managed.import(hosts, validate: false).ids
facets = host_ids.map { |id| { host_id: id } }
facet_ids = Katello::Host::SubscriptionFacet.import(facets, validate: false).ids
@johnpmitsch
johnpmitsch / sdk.ts
Last active August 3, 2023 16:06
QuickNode SDK snippet: get NFTs for a wallet
// 1. Go to https://auth.quicknode.com/signup
// 2. Spin up ethereum, sepolia, or polygon endpoint and add Token/NFT RPC API v2 add-on
// 3. npm/yarn install @quicknode/sdk in typescript or javascript project
// 4. Copy and paste code in project and replace endpointUrl and wallet value below
// 5. profit!
import Core from "@quicknode/sdk/core";
(async () => {
const core = new Core({