Skip to content

Instantly share code, notes, and snippets.

View jgrevich's full-sized avatar

Justin Grevich jgrevich

View GitHub Profile
@jgrevich
jgrevich / handbrake.sh
Last active October 30, 2015 01:47
Handbrake command to crop and resize a 2560x1600 video down to 1920x1080, but it doesn't crop/scale
HandBrakeCLI -vv \
--main-feature \
-m \
-e x264 \
--x264-preset veryslow \
--x264-tune film \
--x264-profile high \
--h264-level 4.1 \
-x "ref=4;threads=12:lookahead_threads=2:no-fast-pskip" \
-2 \
#!/bin/bash
FILENAME="/home/pi/.tap/`/bin/date +\%Y.\%m.\%d.\%H00.\%Z`"
/bin/echo 'Recording at: ' $FILENAME &>> $FILENAME.log
/usr/bin/arecord -Dhw:1 -vvvv -f dat -d 3597 -R 2000 2>> $FILENAME.log | lame --verbose --preset extreme -r -s 48 - $FILENAME.mp3 &>> $FILENAME.log
@jgrevich
jgrevich / c910.sh
Created March 23, 2016 06:18
Logitech c910 AV capture with gstreamer
gst-launch-1.0 -vvv \
v4l2src device=/dev/video0 ! videorate ! \
'image/jpeg,framerate=30/1,width=1920,height=1080' ! queue ! mux. \
pulsesrc device='alsa_input.usb-046d_0821_9E3A69E0-00-U0x46d0x821.analog-stereo' ! \
'audio/x-raw,rate=32000,channels=1,depth=24' ! \
audioconvert ! lamemp3enc quality=2 ! queue ! mux. \
matroskamux name="mux" ! filesink location=capture.mkv
@jgrevich
jgrevich / generate_new_key_and_certs.sh
Created June 2, 2016 21:24
Generate new SAML key and cert
#!/bin/sh
openssl genrsa -des3 -out keys/saml.key.enc 2048
openssl rsa -key keys/saml.key.enc -out keys/saml.key
openssl req -new -key keys/saml.key -out certs/saml.csr -config config/openssl.conf
openssl x509 -req -days 365 -in certs/saml.csr -signkey keys/saml.key -out certs/saml.crt
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: value)'
terminating with uncaught exception of type NSException
abort() called
Verifying that +jgrevich is my blockchain ID. https://onename.com/jgrevich
@jgrevich
jgrevich / seven_norms_of_collaboration.md
Last active March 8, 2017 22:35
The Seven Norms of Collaboration

The Seven Norms of Collaboration

Pausing

Pausing slows down the “to and fro” of discussion. It provides for “wait time,” which has been shown to dramatically improve thinking. It signals to others that their ideas and comments are worth thinking about, dignifies their contributions, and implicitly encourages future participation. Pausing enhances discussion and greatly increases the quality of decision making.

Paraphrasing

To paraphrase is to recast into one’s own words, to summarize or to provide an example of what has just been said. It helps members of a team hear and understand each other as they evaluate data and formulate decisions, and it helps to reduce group tension by communicating the attempt to understand. Signal your intention to paraphrase (“So, you’re suggesting . . .”), and choose a level for the paraphrase: (1) acknowledge and clarify; (2) summarize and organize; or (3) shift the focus to a higher or lower level.

Probing for specificity

Probing seeks to clarify something

@jgrevich
jgrevich / area_code.rb
Created November 15, 2017 23:09
Generate phone numbers based on area-codes.com data
#!/usr/bin/env ruby
# area_coder 0.0.1
#
# area code list generator via areacodes.com
#
# USAGE:
# specify criteria for phone number list
# restrict to area code (with smart prefix lookup), city, state, or regex
# http://www.area-codes.com/state/state-CA.asp
@jgrevich
jgrevich / elasticsearch_plugin_upgrade.sh
Last active February 11, 2021 07:42
Automate the upgrade of plugins for the ES cluster
systemctl restart elasticsearch.service
systemctl restart filebeat.service
systemctl restart packetbeat.service
systemctl restart metricbeat.service
systemctl restart kibana.service
@jgrevich
jgrevich / lba.rb
Created April 9, 2019 06:28
Automate process of running bad blocks based on LBA number of errors found in smartctl
#!/usr/local/rvm/rubies/ruby-2.6.2/bin/ruby
# b = (int)((L-S)*512/B)
# where:
# b = File System block number
# B = File system block size in bytes
# L = LBA of bad sector
# S = Starting sector of partition as shown by fdisk -lu and (int) denotes the integer part.
lba = ARGV[0].to_i