Skip to content

Instantly share code, notes, and snippets.

View jonlabelle's full-sized avatar

Jon LaBelle jonlabelle

View GitHub Profile
@jonlabelle
jonlabelle / nginx-combine-access-logs.sh
Last active June 5, 2022 22:33
Combine Nginx Access Log files into one file.
#!/usr/bin/env bash
set -e
##
# Combine all Nginx Access Log files, into one log file. Starting with the
# oldest log file(s) at the bottom, with the newest log file(s) on top.
#
# Useful for exporting into log analyzers, or bulk importing into tools like
# Splunk.
@jonlabelle
jonlabelle / dotnetcheatsheet.md
Created July 23, 2018 19:50 — forked from nth-block/dotnetcheatsheet.md
Dotnet core Cheat Sheet
@jonlabelle
jonlabelle / relative_time.py
Last active November 23, 2019 17:45 — forked from zhangsen/relative_time.py
python-relative-time
from datetime import datetime, timedelta
def relative_time(date):
"""Take a datetime and return its "age" as a string.
The age can be in second, minute, hour, day, month or year. Only the
biggest unit is considered, e.g. if it's 2 days and 3 hours, "2 days" will
be returned.
@jonlabelle
jonlabelle / Settings.StyleCop
Last active February 26, 2021 10:46 — forked from sneal/Settings.StyleCop
StyleCop settings
<StyleCopSettings Version="105">
<GlobalSettings>
<CollectionProperty Name="RecognizedWords">
<Value>upsert</Value>
<Value>api</Value>
<Value>deserializer</Value>
<Value>deserializing</Value>
<Value>json</Value>
<Value>json:api</Value>
</CollectionProperty>
@jonlabelle
jonlabelle / clean_dotnet_build_files.sh
Last active October 14, 2023 22:02
Delete dotnet build dirs and files ('bin', 'obj', etc) recursively, starting from the current working directory.
#!/usr/bin/env bash
#
# Delete dotnet build dirs and files (e.g. 'bin', 'obj', etc...)
# recursively, starting from the current working directory (PWD).
#
# TODO:
# - Handle unknown options passed in as arguments
#
# Author: Jon LaBelle
@jonlabelle
jonlabelle / search.sh
Last active March 5, 2021 05:59
Bash script to search file contents (by file extension) for the specified search term. Uses grep under the hood.
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2086,SC2155,SC2001,SC2048
#
# Search file contents (by file extension) for the specified search term.
#
# grep options:
#
# -i Perform case insensitive matching.
# −r Recursively search subdirectories listed.
@jonlabelle
jonlabelle / exec_with_retry.sh
Created January 27, 2019 00:01
Bash script to execute a command and (exponentially) retry if it fails.
#!/usr/bin/env bash
set -e
#
# Executes a command and (exponentially) retries if it fails.
#
# Usage:
#
# exec_with_retry <command>
@jonlabelle
jonlabelle / iis_config_file_paths.md
Created March 21, 2019 15:49
IIS Config File Paths

IIS Config File Paths

Internet Information Services (IIS) 7 and later use an XML-based configuration system for storing IIS settings which replaces the metabase that was used in IIS 6.0 and earlier. This new configuration system was introduced with ASP.NET and is based on a hierarchical system of management system that uses *.config files. The configuration files for IIS 7 and later are located in the %windir%\System32\inetsrv\config folder.

applicationHost.config

@jonlabelle
jonlabelle / sublime-merge-command-line-usage.md
Created March 27, 2019 16:19
Sublime Merge Command Line Usage

Sublime Merge Command Line Usage

Sublime Merge includes a command line tool, smerge, to work with repositories on the command line. This can be used to open repositories, search, and merge files.

Setup

Windows

@jonlabelle
jonlabelle / docker_compose_cheatsheet.md
Last active March 27, 2026 06:39
Docker Compose Cheatsheet