Skip to content

Instantly share code, notes, and snippets.

@yougg
yougg / proxy.md
Last active December 10, 2025 08:12
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@kouk
kouk / sshuttle-over-k8s.sh
Last active December 22, 2022 15:04
Route traffic via a k8s cluster, using sshuttle
#!/bin/sh
HOST_PORT=30022
DRYRUN=
if [ "$1" = "-n" ] ; then
DRYRUN=true
shift
fi
TARGET=$1
@saniales
saniales / README.md
Last active February 20, 2022 15:58
Unmarshal UUID in mongo in Go using Mongo Go Driver

Usage

Copy in a separated package called mongoutil the content of the .go file, then use it as follows

import (
  "path/of/mongoutil" 
)

type example struct {
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@truebit
truebit / init.lua
Last active September 1, 2025 05:23
Kitty Terminal: pull down from top like iTerm2
local spaces = require("hs.spaces") -- https://github.com/asmagill/hs._asm.spaces
-- Switch kitty
hs.hotkey.bind({'command'}, 'escape', function () -- change your own hotkey combo here, available keys could be found here:https://www.hammerspoon.org/docs/hs.hotkey.html#bind
local BUNDLE_ID = 'net.kovidgoyal.kitty' -- more accurate to avoid mismatching on browser titles
function getMainWindow(app)
-- get main window from app
local win = nil
while win == nil do