Skip to content

Instantly share code, notes, and snippets.

@helix84
helix84 / Highlight non-matching anchor links (Bookmarklet)
Created January 2, 2020 07:26 — forked from jkphl/Highlight non-matching anchor links (Bookmarklet)
Use this JavaScript bookmarklet to find invalid anchor references within your HTML documents. The script searches the current document for links referring to named anchors on the same page that don't really exist and highlights them with a red background.
@helix84
helix84 / diff-configs.sh
Created February 12, 2020 10:06 — forked from matthewd/diff-configs.sh
Diff /etc files against the versions supplied in Debian packages
#!/bin/bash
# This script will make a best-effort attempt at showing modifications
# to package-provided config files on a Debian system.
#
# It's subject to some pretty significant limitations: most notably,
# there's no way to identify all such config files. We approximate the
# answer by looking first at dpkg-managed conffiles, and then hoping
# that most of the time, if maintainer scripts are managing files
# themselves, they're using ucf. So, DO NOT TRUST THIS SCRIPT to find
@helix84
helix84 / .screenrc
Created March 31, 2020 22:28 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@helix84
helix84 / python-zip.md
Last active April 5, 2020 22:40 — forked from asimjalis/python-zip.md
How to deploy a Python application as a zip file

How to deploy a Python application as a zip file

by Asim Jalis, MetaProse.com

Create a file __main__.py containing:

print "Hello world from Python"

Zip up the Python files (in this case just this one file) into app.zip by typing:

#! python2
"""
uTorrent resume.dat => qbittorrent
Author: robot
Largely based on resumedata_2015.rb, see https://github.com/qbittorrent/qBittorrent/issues/1826 for discussion.
Zero error tolerance is assumed. As well see error.log for warnings.
Feel free to change defaults in def mkfr().
@helix84
helix84 / access-log-to-parquet.sql
Created November 10, 2025 12:08 — forked from purcell/access-log-to-parquet.sql
Use DuckDB to convert a compressed web access log in Combined Log Format to Parquet
COPY (
WITH
-- Read the raw log line by line by abusing CSV parser
raw_log AS (
FROM read_csv_auto('/tmp/log/access.log-20230904.gz', header=false, delim='\0')
)
, combined_log AS (
SELECT regexp_extract(column0
, '^(\S+) (\S+) (\S+) \[(.*?)\] "([A-Z]+?) (.*?) HTTP/(.*?)" (\d+) (\d+) "(.*?)" "(.*?)"$'
, [ 'ip', 'identity', 'userid', 'timestamp', 'method'