Skip to content

Instantly share code, notes, and snippets.

@erincerys
erincerys / migration-irssi-logs.sh
Created August 8, 2017 04:05
Merge irssi log directories, deleting small files
#!/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
@olih
olih / jq-cheetsheet.md
Last active September 21, 2024 00:05
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@ralavay
ralavay / vim-nginx-conf-highlight.sh
Last active June 17, 2024 12:27
Enable syntax highlight for Nginx conf file in Vim
#!/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
@kynan
kynan / irssi_log_merge.py
Created May 16, 2012 00:13
Irssi Log Merger is a small Python script that takes a set of Irssi irclogs/ directories and merges them chronologically into a single set of files.
#!/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>