Skip to content

Instantly share code, notes, and snippets.

View caljess599's full-sized avatar

Platform Jess caljess599

  • School of Data Science, University of Virginia
  • Charlottesville, VA
View GitHub Profile
@caljess599
caljess599 / logstash.txt
Created April 23, 2018 21:42
Logstash dump of FATAL event
2018-04-23T21:17:00.423Z [welld-ls-web 24cbe615b2ff]: [2018-04-23T21:17:00,422][DEBUG][logstash.pipeline ] filter received {"event"=>{"app"=>"welld-demo", "container"=>"353bd1f36a1b9a459a605cc9faa58b0335140485734d085d38b3fab9a753d14e", "headers"=>{"http_x_forwarded_port"=>"443", "http_version"=>"HTTP/1.1", "http_connection"=>"upgrade", "request_method"=>"POST", "http_x_forwarded_proto"=>"https", "http_host"=>"app-9093.on-aptible.com", "request_uri"=>"/", "http_x_request_start"=>"t=1524518220.410", "http_x_amzn_trace_id"=>"Root=1-5ade4d4c-885ddcb54af208eef5336d89", "http_user_agent"=>"Manticore 0.4.1", "content_type"=>"application/json", "http_accept_encoding"=>"gzip,deflate", "http_x_forwarded_for"=>"10.134.0.48, 10.134.6.105", "request_path"=>"/", "content_length"=>"564"}, "offset"=>"32627", "log"=>"F, [2018-04-23T21:16:58.210343 #18212] FATAL -- : \n", "source"=>"app", "type"=>"json", "layer"=>"app", "@timestamp"=>2018-04-23T21:16:58.210Z, "file"=>"/tmp/dockerlogs/353bd1f36a1b9a459a605cc9faa58b033514
@caljess599
caljess599 / timestamp.sh
Created October 4, 2017 17:18
shell script to timestamp input piped to it, if output is not empty
#!/bin/bash
while read x; do
if [ -n "$x" ]; then
echo -n `date +%Y-%m-%dT%H:%M:%S`
echo -n " "
echo $x
fi
done
#!/bin/bash
# name.sh
# description
# date
# # # # # # # # # # # OLD-TIMEY CHANGELOG # # # # # # # # # # #
# ---- when ---- | -- who -- | -- what -- |
# ----------------------------------------------------------------------------
# 0 Mon 2017 | |
#!/bin/bash
# name: whonode
# location: /bin/whonode
# # FUNCTIONS # #
usage () {
printf "usage: %s [-c] [-h] [-n cvpost<num> ] [-j JobID]* [-u user]* [-r] [-s]\n*flag can be passed multiple times\nFor complete documentation, go to https://staff.nrao.edu/wiki/bin/view/CIS/ClusterKnowHowVisible\n" $0 >&2
exit 2
@caljess599
caljess599 / lctl-2.sh
Last active August 10, 2017 19:47
completion file for lctl (Lustre Control)
# file: lctl-2
# lctl parameter-completion
# The main menu is created by hand; I excluded deprecated/"dangerous" functions and some only relevant to interactive mode
# The submenu for the get_param and set_param is auto-generated and replaces the actual device numbers (e.g., OST0030)
# with * so that the list becomes manageable.
LIST_PARAM=$(lctl list_param -R | grep -v '[0-9]$' | sed s/OST[0-f][0-f][0-f][0-f]/OST*/g)
CONTROL_PARAM="--net network net list_nids which_nid replace_nids interface_list peer_list conn_list active_tx route_list show_route ping help lustre_build_version device
device_list dl activate deactivate abort_recovery set_timeout conf_param local_param get_param set_param list_param debug_daemon debug_kernel dk debug_file df clear mark filter show debug_list modules blockdev_attach blockdev_detach blockdev_info pool_new pool_add pool_remove pool_destroy pool_list changelog_register changelog_deregister lfsck_start lfsck_stop set_route"
@caljess599
caljess599 / hash.py
Created March 4, 2015 18:27
Hash filter for ansible 1.8.x
# Hash filter for ansible 1.8.x
# Note: Ansible 1.9 includes this filter, but since there is no rpm
# for 1.9, this saves the trouble of upgrading by hand.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@caljess599
caljess599 / initial_data.json
Created November 20, 2014 17:23
initial_data.json modification for sentry
[{
"pk": 1,
"model": "sentry.user", #CHANGED MODEL NAME
"fields": {
"username": "admin",
"first_name": "",
"last_name": "",
"is_active": true,
"is_superuser": true,
"is_staff": true,