Skip to content

Instantly share code, notes, and snippets.


Justin Grevich jgrevich

View GitHub Profile
jgrevich / purpleair.conf
Created May 24, 2020
PurpleAir Logstash Configs
View purpleair.conf
input {
http_poller {
add_field => { "purpleair.location" => "indoor" }
codec => "json"
schedule => { every => "11s" }
urls => {
purpleair_1 => ""
purpleair_2 => ""
purpleair_3 => ""
jgrevich / lba.rb
Created Apr 9, 2019
Automate process of running bad blocks based on LBA number of errors found in smartctl
View lba.rb
# 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
jgrevich /
Last active Feb 11, 2021
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 / area_code.rb
Created Nov 15, 2017
Generate phone numbers based on data
View area_code.rb
#!/usr/bin/env ruby
# area_coder 0.0.1
# area code list generator via
# specify criteria for phone number list
# restrict to area code (with smart prefix lookup), city, state, or regex
jgrevich /
Last active Mar 8, 2017
The Seven Norms of Collaboration

The Seven Norms of Collaboration


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.


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

View gist:5d9bc534b301ce7fe06ed24eac2af9aa
Verifying that +jgrevich is my blockchain ID.
View gist:114448d0c63c91c13625b27816554fd0
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
jgrevich /
Created Jun 2, 2016
Generate new SAML key and cert
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
jgrevich /
Created Mar 23, 2016
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
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