Skip to content

Instantly share code, notes, and snippets.

View jgrevich's full-sized avatar

Justin Grevich jgrevich

View GitHub Profile
@jgrevich
jgrevich / purpleair.conf
Created May 24, 2020 02:32
PurpleAir Logstash Configs
input {
http_poller {
add_field => { "purpleair.location" => "indoor" }
codec => "json"
schedule => { every => "11s" }
urls => {
purpleair_1 => "http://192.168.1.2/json"
purpleair_2 => "http://192.168.1.3/json"
purpleair_3 => "http://192.168.1.4/json"
}
@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
@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 / 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 / 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

Verifying that +jgrevich is my blockchain ID. https://onename.com/jgrevich
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
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
@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
#!/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