Skip to content

Instantly share code, notes, and snippets.

Justin Grevich jgrevich

Block or report user

Report or block jgrevich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jgrevich
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
#!/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
Created Mar 5, 2019
Automate the upgrade of plugins for the ES cluster
View elasticsearch_plugin_upgrade.sh
/usr/share/elasticsearch/bin/elasticsearch-plugin remove ingest-geoip
/usr/share/elasticsearch/bin/elasticsearch-plugin remove ingest-user-agent
/usr/share/elasticsearch/bin/elasticsearch-plugin install -bv ingest-geoip
/usr/share/elasticsearch/bin/elasticsearch-plugin install -bv ingest-user-agent
systemctl restart elasticsearch.service
systemctl restart filebeat.service
systemctl restart packetbeat.service
systemctl restart metricbeat.service
@jgrevich
jgrevich / area_code.rb
Created Nov 15, 2017
Generate phone numbers based on area-codes.com data
View area_code.rb
#!/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 Mar 8, 2017
The Seven Norms of Collaboration
View seven_norms_of_collaboration.md

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

View gist:5d9bc534b301ce7fe06ed24eac2af9aa
Verifying that +jgrevich is my blockchain ID. https://onename.com/jgrevich
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
jgrevich / generate_new_key_and_certs.sh
Created Jun 2, 2016
Generate new SAML key and cert
View generate_new_key_and_certs.sh
#!/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 Mar 23, 2016
Logitech c910 AV capture with gstreamer
View c910.sh
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
View tap_an_hour.sh
#!/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 / handbrake.sh
Last active Oct 30, 2015
Handbrake command to crop and resize a 2560x1600 video down to 1920x1080, but it doesn't crop/scale
View handbrake.sh
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 \
You can’t perform that action at this time.