jq is useful to slice, filter, map and transform structured json data.
brew install jq
| #!/bin/bash | |
| # migrate.sh | |
| # DESCRIPTION: Parse two directories of logfiles. | |
| # FUNCTION: Append new files with old ones, delete files that are small, and move new files that aren't present to the old directory. | |
| # USAGE: bash migrate.sh /path/to/old_logdir /path/to/new_logdir | |
| # ELABORATION: | |
| # Settings | |
| minlines=15 # Threshhold number of lines to delete a logfile |
| #!/bin/bash | |
| # | |
| # Highligh Nginx config file in Vim | |
| # Download syntax highlight | |
| mkdir -p ~/.vim/syntax/ | |
| wget http://www.vim.org/scripts/download_script.php?src_id=19394 -O ~/.vim/syntax/nginx.vim | |
| # Set location of Nginx config file | |
| cat > ~/.vim/filetype.vim <<EOF |
| #!/usr/bin/python | |
| # .- coding: utf-8 -. | |
| # | |
| # irssi_log_merge.py. | |
| # Written by Lasse Karstensen <lasse.karstensen@gmail.com>, 2008. | |
| # Released under GPLv2. | |
| # | |
| # Newest version available on http://hyse.org/irssi-log-merge/ . | |
| # | |
| # Modified by Florian Rathgeber <florian.rathgeber@gmail.com> |