Skip to content

Instantly share code, notes, and snippets.

View RhubarbSin's full-sized avatar

Rhubarb Sin RhubarbSin

View GitHub Profile
@giumas
giumas / Logging - SQLite handler
Last active February 15, 2023 02:23
A minimal SQLite handler for the python logging module
from __future__ import absolute_import, division, print_function, unicode_literals
import sqlite3
import logging
import time
__version__ = "0.1.0"
initial_sql = """CREATE TABLE IF NOT EXISTS log(
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@thomedes
thomedes / ini.sed
Last active August 17, 2023 20:41
sed one-liners to deal with .ini / .conf files
# List all [sections] of a .INI file
sed -n 's/^[ \t]*\[\(.*\)\].*/\1/p'
# Read KEY from [SECTION]
sed -n '/^[ \t]*\[SECTION\]/,/\[/s/^[ \t]*KEY[ \t]*=[ \t]*//p'
# Read all values from SECTION in a clean KEY=VALUE form