Skip to content

Instantly share code, notes, and snippets.

View mshuler's full-sized avatar
💭
ヽ(´ー`)ノ

Michael Shuler mshuler

💭
ヽ(´ー`)ノ
View GitHub Profile
@mshuler
mshuler / split-page.py
Created October 19, 2024 18:18 — forked from tshrinivasan/split-page.py
Split a PDF vertically, used for scanned double sided PDF pages
# Source http://stackoverflow.com/a/15741856/1301753
import copy
import sys
import math
import pyPdf
def split_pages(src, dst):
src_f = file(src, 'r+b')
dst_f = file(dst, 'w+b')
@mshuler
mshuler / lrsync.lua
Created December 3, 2020 16:41 — forked from kashyapp/lrsync.lua
lsyncd and configuration
local hostname = os.getenv("HOSTNAME")
local package = os.getenv("PACKAGE")
assert(hostname, "HOSTNAME env variable is not set")
assert(package, "PACKAGE env variable is not set")
local privateKey = "/usr/share/" .. package .. "/etc/id_rsa"
settings {
statusFile = "/var/run/" .. package .. "/lsyncd.stat",
statusInterval = 60,

Warm Butter Cake or 1000 Calories of Bliss

A toasty butter cake, topped with a thin layer of vanilla cheesecake, and that topped with a sweet crunchy sugar crust. It is warmed, and served with a scoop of vanilla bean ice cream.

Prep Time: 20 minutes
Cook Time: 1 hour
Total Time: 1 hour 20 minutes\

@mshuler
mshuler / randpw
Created March 15, 2020 00:02
Generate random password string on the CLI
#!/bin/bash
# Generate random password string from all printable, non-space
# characters, using passed argument for number of characters,
# defaulting to a 16-character string. For example:
# $ randpw
# XC6Jo]2fj&f4E45n
# $ randpw 24
# :U)#J]b5[0mg)Wp@M\)l`$\y
(cassandra-3.0)mshuler@hana:~/git/cassandra$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.19-SNAPSHOT | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh> DESC CLUSTER ;
Cluster: Test Cluster
Partitioner: Murmur3Partitioner
cqlsh> CREATE KEYSPACE foo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
This worked out pretty well for high quality 1080p 60fps video from the 4:3 3264x2448 JPG timelapse images,
cropping the top and bottom of the original images to 16:9 widescreen:
ffmpeg -framerate 60 -pattern_type glob -i '*/*.JPG' -vf crop=in_w:in_w*9/16,scale=1920:1080 -c:v libx264 -r 60 -pix_fmt yuv420p timelapse-60fps.mp4
@mshuler
mshuler / github-mirror.sh
Created November 23, 2010 01:33
example github mirror from launchpad
#!/bin/sh
# OpenStack bzr to github mirror
#
# Requirements:
# git >= 1.7.0, bzr >= 2.0.0,
# git-bzr-ng, python-fastimport, patched bzr-fastimport
#####
# Set up unpackaged source:
# mkdir ~/src
### BEGIN INIT INFO
# Provides: zram-disk
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop: 0 1 6
# Short-Description: Use compressed RAM as in-memory filesystem
# Description: Use compressed RAM as in-memory filesystem
### END INIT INFO
./app/src/antlr/ExtendedCommonASTWithHiddenTokens.java: *No copyright* UNKNOWN
./app/src/antlr/TokenStreamCopyingHiddenTokenFilter.java: *No copyright* UNKNOWN
./app/src/processing/app/About.java: *No copyright* UNKNOWN
./app/src/processing/app/Base.java: GPL (v2) (with incorrect FSF address)
./app/src/processing/app/Editor.java: GPL (v2) (with incorrect FSF address)
./app/src/processing/app/EditorConsole.java: GPL (v2 or later) (with incorrect FSF address)
./app/src/processing/app/EditorHeader.java: GPL (v2 or later) (with incorrect FSF address)
./app/src/processing/app/EditorLineStatus.java: GPL (v2 or later) (with incorrect FSF address)
./app/src/processing/app/EditorState.java: GPL (v2) (with incorrect FSF address)
./app/src/processing/app/EditorStatus.java: GPL (v2 or later) (with incorrect FSF address)
@mshuler
mshuler / etc-grub.d-40_custom
Created September 10, 2013 00:31
ThinkPad BIOS Update CD via GRUB2
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
##
menuentry "ThinkPad BIOS Update CD" {
set root='(hd0,msdos1)'
echo 'Loading memdisk ...'
linux16 /boot/memdisk iso