Instantly share code, notes, and snippets.

# Darkify Slack on Mac OS:
# curl | sh
# Thanks to:
if [ -z "`grep tt__customCss ${SLACK_INTEROP_JS}`" ]; then
# Backup original CSS for reverts:

Jellyfin setup on Raspberry Pi 3 Debian 9(stretch)

Jellyfin is the open source version of Emby.

install docker

wget -nv -O- | sh

I created a bootable usb drive in disk utility

then ran diskutil list to find the identifier

/dev/disk2s1 in my case

make sure to unmount the drive

then dd


raspberry pi auto mount usb drive

my drive is hfsplus usb 2TB

get the usb UUID from blkid

pretty print drive locations lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

followed this, with special attention to the order. Drive must be unmounted before running fsck.


Foward requests to one port to another on the same server

I wanted to forward requests comming to a server on port 2222 to the same server port 22.

I'm using ufw for the firewall on the server.

  1. allow port 22 and 2222 on the server.
$ sudo ufw allow 22

Local DNS dnsmasq

Use case

I wanted to have an outside domain name resolve to a computer inside my local private network. I am tyring out to handle the resolution. The DNS resolves fine outside of my local network, yet locally the fqdn will not resolve. To enable this, a local dns needs to handle the request, routing to the local server.

This is where the raspberry pi dns comes in. I'm running Raspbian GNU/Linux 9 (stretch), a Debian variant.


I have been unable to get dnsmasq to start correctly on reboot. Nothing stands out in daemon.log. sudo service dnsmasq status shows one particular line that is different from the status of a reboot vs a manual service restart:

# modified version of:
# wget -O
# GUI-related packages
# none right now...
# Edu-related packages
View index.js
var Aws = require('aws-sdk');
var sinon = require('sinon');
// Only works for 'createBucket', 'update' and a few others since most API methods are generated dynamically
// upon instantiation. Very counterintuitive, thanks Amazon!
var createBucket = sinon.stub(Aws.S3.prototype, 'createBucket');
createBucket.yields(null, 'Me create bucket');
// For other methods, we can 'assign' the stubs to the proto, already defined function won't be overridden
var listBuckets = Aws.S3.prototype.listBuckets = sinon.stub();