Skip to content

Instantly share code, notes, and snippets.

@jclosure
jclosure / irs-get-human.md
Created April 2, 2024 06:29 — forked from getaaron/irs-get-human.md
Get a person at the IRS
  • Call 1-800-829-1040
  • Press 1 for English (or other language as desired)
  • Press 2 for personal tax
  • Press 1 for form / tax history
  • Press 3 for other
  • Press 2 for other
  • Ignore 2 SSN prompts till you get secret other menu
  • Press 2 for personal tax
  • Press 3 for other
  • Wait for agent!
@jclosure
jclosure / file_client.js
Created January 25, 2024 19:07
Just a simple ES6 uploader/downloader for S3 objects
var ACCESS_KEY_ID = "mykey_id";
var SECRET_ACCESS_KEY = "mykey_secret";
var REGION = 'us-east-1';
var ENDPOINT = 'http://127.0.0.1:9000';
import { S3 } from '@aws-sdk/client-s3';
import * as fs from 'fs';
class FileClient {
constructor(bucket) {
@jclosure
jclosure / curl_object_downloader.sh
Created January 25, 2024 19:04
Download S3 objects with only curl
#!/bin/bash
# Example:
# for minio: in k9s, forward ports 9000 and 9001 to localhost
# ./curl_object_downloader.sh localhost:9000 mykey_id mykey_secret \
# mybucket mypath/myobj.bin ./myobj.bin
# User Minio Vars
URL=$1
USERNAME=$2
@jclosure
jclosure / gist:1dd4c94b4a6ce0738bee8b7ffc6194ee
Last active August 11, 2023 14:06
OBJ to GLTF quick conversion
# install converter
npm install -g obj2gltf
# convert .obj to .gltf
obj2gltf -i mesh.obj --separate
# install web gltf viewer
git clone https://github.com/donmccurdy/three-gltf-viewer.git
cd three-gltf-viewer
npm install
@jclosure
jclosure / omegaconf_mixin_unobtrusive.py
Last active April 25, 2023 21:53
Omegaconf: Unobtrusive way to mix env vars over plan data yaml config
import os
from omegaconf import OmegaConf
os.environ.pop("PASSWORD", None)
os.environ.pop("PORT", None)
os.environ["PASSWORD"] = "foo"
os.environ["PORT"] = '666'
file_cfg = OmegaConf.create("inference_worker: {user: Ohad, password: secret, port: 123}")
@jclosure
jclosure / back_prop_grads.ipynb
Last active February 28, 2023 16:18
Back propagation for gradient descent
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jclosure
jclosure / see_all_git_changes_by_user.sh
Created February 27, 2023 21:46
For all files in a repo, see who has been making all the changes in the project.
# cd <repo_dir>
git ls-tree -r master --name-only | xargs -I {} git --no-pager blame master -- {} | awk '{print $1, $2, $3, $4}' | sed 's/(//g'
@jclosure
jclosure / PC_setup.md
Last active January 30, 2023 16:58
Notes: Windows Setup recipe for Linux Cloud Development

PC Setup notes

Enable CPU virtualization in the BIOS

After reboot continue

Turn off firewall

Install wsl

Open a CMD session as Administrator

@jclosure
jclosure / count_commits.sh
Last active January 19, 2023 17:56
Count the commits and lines modified by a user, from a start date, across a bunch of projects.
#!/bin/bash
## usage: just run script (relative file paths to project adjusted)
# $ count_commits.sh
## array of project dirs
declare -a project_dirs=("./foo" "./bar" "./qux")
# ignore files with these extensions
excludes="':!*.ipynb' ':!*.json' ':!*.log' ':!*.pb' ':!*.fb' ':!*.bin'"
@jclosure
jclosure / gorm_cascading.go
Created August 17, 2022 05:24
Cascade UPDATES and DELETES from parent to child table relations. Golang - Gorm
// HOW TO EXPRESSS CASCADING RELATIONS BETWEEN RELATED GORM MODELS
// if you update the server_id, it updates the server_id on sessions with old server_id
// if you delete the server, it deletes all sessions with same server_id
type Server struct {
Model
ServerID uuid.UUID `gorm:"type:uuid; primaryKey"`
# ...
Sessions []Session `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}