Convert JSON to CSV

To convert a json file to CSV you will need a linux program called jq. INPUTFILE=”inputfile-with-json” OUTPUTFILE=”outputfile-formatted.csv” jq -r ‘(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv’ ${INPUTFILE} > ${OUTPUTFILE}

Parallel Gzip

Lzop use to be my favorite fast compression program. That is until I learned about parallels gzip (pigz) Compress a Folder # compress a folder called “myfolder” at maximum compression using six threads tar cf – myfolder | pigz -9…

Graylog 2.4.6 manual index backup and restore

When you do not have enterprise support closing and opening elastic search indexes can break stuff in Graylog 2.4.6. Elastic Search Indexes Close/Open The official documentation for Elasticsearch 2.4.6 closing and opening an index can be found here: curl…

tmux horizontal window splitting

To split terminal in to four horizontal tmux windows you can run the following code: #!/bin/bash tmux new-window -a -n WinSplit tmux new-session -d -s WinSplit tmux selectp -t WinSplit tmux split-window -v tmux set-window-option -g window-status-current-bg blue tmux split-window…

Extracting IP Addresses in Bash

One very handy function to have in your .bash_profile is a function to extract IP addresses. ipextract function I frequently use this function during investigations and though I should share it with everyone. ipextract () { # example ipextract <…