Skip to content

Instantly share code, notes, and snippets.

View Splat's full-sized avatar

Ryan Donahue Splat

  • Earth
View GitHub Profile
# Description goes here!
#
# * *Params* :
# - ++ ->
# * *Headers* :
# - ++ ->
# * *Body* :
# - ++ ->
# * *Args* :
# - ++ ->
@Splat
Splat / nodejs_fedora_install.md
Last active July 8, 2016 21:10
Nodejs install on Fedora

Installation of NodeJS in Fedora

I recently had a bit of trouble installing nodejs on my Fedora installation. RPM was having issues installing during the nodejs install process.

The error installing as root is as follows:

+ rpm -i --nosignature --force '/tmp/tmp.3BlR6h6inY'
*error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Inappropriate ioctl for device)*
Error executing command, exiting
@Splat
Splat / git_stats
Created September 22, 2016 23:48
Get some git stats on commiters
git ls-files -z | xargs -0n1 git blame -w | ruby -n -e '$_ =~ /^.*\((.*?)\s[\d]{4}/; puts $1.strip' | sort -f | uniq -c | sort -n
@Splat
Splat / git_branch_clutter
Created September 22, 2016 23:49
find old and dead branches within a Git repo for potential cleanup
for k in $(git branch -a --merged|grep -v "\->"|sed s/^..//);do echo -e $(git log -1 --pretty=format:"%Cgreen%ci %Cred%cr%Creset" "$k")\\t"$k";done|sort|more
@Splat
Splat / auth_log_failures
Created September 22, 2016 23:52
Getting some sorted and unique information from the auth log
egrep -i 'authentication failure;' FILENAME.txt | egrep 'root' | egrep -v ' more ' | awk '{print $14}' | tr '=' ' ' | awk '{print $2}' | sort | uniq -c | sort -nr | more
@Splat
Splat / tiger_output_diff
Created September 22, 2016 23:55
Working with the output of Tiger vulnerability reports to sanitized and diff from a prior
find security.report.safer.* -type f -printf "%C@ %p\n" | sort -rn | head -n 2
diff <(tail -n +4 file | head -n -1) <(tail -n +4 file2 | head -n -1)
@Splat
Splat / mongo_missing_indexes
Created September 22, 2016 23:59
Working with the mongodb oplog for non indexed queries
cd /var/log/mongodb/
grep '2015-07-10' mongodb.log| grep IXSCAN | sed -e s'/.*planSummary: IXSCAN//' | sed -e 's/ cursorid.*//; s/ keyUpdates.*//; s/ nto.*//; ' | perl -lne 'print join "\n", split /, IXSCAN/;' | perl -pne 's/(^\s+)//' | sort | uniq -c
@Splat
Splat / key_copy
Created September 23, 2016 00:01
copy your key
pbcopy < ~/.ssh/id_rsa.pub
@Splat
Splat / ruby_cert_chain_request.rb
Last active November 21, 2016 16:37
Loading certificate chain from a CA directory to use for validation to a certain depth.
require 'net/http'
require 'net/https'
require 'uri'
API_URI = 'some.site.com'
root_ca_path = '/etc/ssl/certs'
root_ca_depth = 5
api_user = 'username'
api_password = 'password'
@Splat
Splat / couch-install-centos7.
Created February 24, 2017 20:50 — forked from wmealing/couch-install-centos7.
centos7 / rhel7 install instructions for couchdb.
#!/bin/bash
# Move to a location where you don't mind storing the couchdb install files.
cd /tmp/
EPEL_FILE=epel-release-latest-7.noarch.rpm
COUCH=apache-couchdb-1.6.1.tar.gz
rm -rf epel-release-latest-7.noarch.rpm