Skip to content

Instantly share code, notes, and snippets.

View docker-compose.yml
version: '3'
services:
plex:
image: plexinc/pms-docker:beta
container_name: plex
restart: always
network_mode: host
volumes:
- $PWD/plex/config:/config
View docker-compose.yml
---
version: "2"
services:
vpn:
image: bubuntux/nordvpn
container_name: vpn
cap_add:
- net_admin
devices:
- /dev/net/tun
@jlyman
jlyman / electron-codesigner.sh
Created Oct 21, 2015
Current version of codesigner script I'm trying to use to sign Electron apps for use on OS X (not MAS).
View electron-codesigner.sh
# Invoke this script with a relative `.app` path
# EX:
# codesign.sh "dist/osx/MyApp-darwin-x64/MyApp.app"
# I had better luck using the iPhoneOS codesign_allocate
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"
#export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate"
# Next two are specified in Apple docs:
# export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
@tywkeene
tywkeene / crypto.sh
Last active Apr 27, 2020
Encrypt files and directories securely with pgp/tar/gzip/shred all in a small shell script
View crypto.sh
#!/usr/bin/env bash
set -e
function yesno() {
read -p "$1 Continue? (y/n): "
case $(echo -e "$REPLY" | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac
@mrkgnao
mrkgnao / ghostscript-pdf-crop.sh
Created Oct 8, 2018
Crop pdfs with GhostScript
View ghostscript-pdf-crop.sh
#!/usr/bin/env bash
set -euo pipefail
origdir=$(pwd)
tmpdir=$(mktemp -d)
echo "tmpdir: $tmpdir"
read -r width height < <(pdfinfo $1 | grep "Page size:" | sed 's/[a-zA-Z: ]*\([0-9]\+\)[x ]*\([0-9]\+\).*/\1 \2/')
npages=$(pdfinfo $1 | grep "Pages:" | sed 's/Pages: \+\([0-9]\+\).*/\1/')
echo "page count: $npages"
echo "(width, height) = ($width, $height)"
@drmikecrowe
drmikecrowe / docker-compose.yml
Created Sep 2, 2019
Ultimate docker-compose setup for home media center
View docker-compose.yml
#Reference: https://www.smarthomebeginner.com/docker-home-media-server-2018-basic
version: "3.6"
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx
ports:
- "80:80"
volumes:
View pdfcrop.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pdfcrop
=======
Based on pdfcrop.pl_. Uses the BoundingBox [#]_
Dependencies:
- PyPDF2_
@99darwin
99darwin / mup_migrate.md
Created Jan 11, 2019
Deploy Meteor App with MUP and Migrate Local MongoDB to Remote Server
View mup_migrate.md

Deploy Meteor app and migrate the built-in, local MongoDB to a remote server where the app is hosted.

It took me days to actually get this working, so I figured I would write out the steps I took to finally resolve the issue for my own assistance in the future and, hopefully, to help others who encounter this problem.

Create .deploy folder in your app's directory

cd .deploy
mup init

Configure the mup.js file to match your configuration. Here's an extremely basic example:

View Handy one-liners for SED.markdown
@Neil-Smithline
Neil-Smithline / idletime.sh
Created Mar 18, 2012
Mac OS X Idle Time Shell Script
View idletime.sh
#!/bin/sh
# Get MacOSX idletime. Shamelessly stolen from http://bit.ly/yVhc5H
/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}'