Skip to content

Instantly share code, notes, and snippets.

@jclosure
jclosure / play_spotify_via_winamp.md
Last active May 5, 2024 01:39
How to play your Spotify music in Winamp and get Visualizatons

Spotiamp features a builtin Shoutcast® server, so you can easily stream the music to any device supporting Shoutcast, such as Sonos.

Download and install Winamp

I've installed version 5.8

https://www.winamp.com/

@jclosure
jclosure / docker_reverting
Created June 5, 2015 08:07
How to revert a docker container to a previous commit
$ docker history imagename
IMAGE CREATED CREATED BY SIZE
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB
8dbd9e392a96 7 months ago 131.5 MB
$ docker tag 2844 imagename # <-- that's the secret right there
$ docker history imagename
IMAGE CREATED CREATED BY SIZE
@jclosure
jclosure / osx_hardening
Created May 10, 2016 14:59
The Ultimate OS X Hardening Guide Collection
Apple: http://www.apple.com/support/security/guides/
NSA Guide: http://www.nsa.gov/ia/_files/factsheets/macosx_hardening_tips.pdf
Mac Shadows: http://www.macshadows.com/kb/index.php?title=Hardening_Mac_OS_X
Univ. Texas: https://wikis.utexas.edu/display/ISO/Mac+OS+X+Server+Hardening+Checklist
Center for Internet Security: http://benchmarks.cisecurity.org/en-us/?route=downloads.browse.category.benchmarks.os.unix.osx
@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 / install_dia_osx.md
Created August 6, 2017 00:20
How to install Dia on OSX (and have it run)
brew cask install dia

After his it won't run because DISPLAY=:0 env var is not set

vim /Applications/Dia.app/Contents/Resources/bin/dia
@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 / history_tracking.sql
Created January 31, 2022 08:57
Automatic history tracking in postgres.
-- create a separate schema to hold our history table
CREATE SCHEMA IF NOT EXISTS logging;
CREATE TABLE IF NOT EXISTS logging.t_history (
id serial,
tstamp timestamp DEFAULT now(),
schemaname text,
tabname text,
operation text,
who text DEFAULT current_user,
new_val json,
@jclosure
jclosure / python_inotify_fs_watcher.py
Last active January 23, 2024 11:16
Using watchdog to inspect all changes for a dir + pattern. Useful for seeing all activity during debugging inotify handlers.
import logging
import os
import time
import traceback
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
MAP_DATA_DIR = "/tmp/foo"
@jclosure
jclosure / concave_hulls.ipynb
Created January 27, 2020 00:11 — forked from dwyerk/concave_hulls.ipynb
concave hulls using shapely and scipy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.