Skip to content

Instantly share code, notes, and snippets.

@jclosure
jclosure / play_spotify_via_winamp.md
Last active September 24, 2024 16:17
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 / logging_to_syslog.md
Last active August 23, 2024 22:25
Logging to syslog from bash and using dedicated custom log files that get rotated automatically

demo by creating a script called run.sh

#!/bin/bash

# https://urbanautomaton.com/blog/2014/09/09/redirecting-bash-script-output-to-syslog/
exec 1> >(logger -s -t $(basename $0) 2>&1)

for i in 1 2 3 4 5
do
@jclosure
jclosure / contains_key_or_empty.txt
Created July 3, 2017 05:33
Kibana Painless scripted field checks if field exists or is empty and returns default, otherwise value
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value }
@jclosure
jclosure / flatbuffers_helpers.sh
Created January 17, 2019 21:26
Flatbuffers shell encode/decode helpers using flatc for dynamic conversion
# Usage: source ./flatbuffers_helpers.sh
# Source this file into your environment and use the flatbuffer-related
# helper functions to convert:
#
# json -> flatbuffers
# flatbuffers -> json
#
# Add new type-specific functions as needed.
@jclosure
jclosure / concave_hulls.ipynb
Created January 27, 2020 00:11 — forked from dwyerk/concave_hulls.ipynb
concave hulls using shapely and scipy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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 / 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) {