Skip to content

Instantly share code, notes, and snippets.

View ross-spencer's full-sized avatar
💭
🖖

Ross Spencer ross-spencer

💭
🖖
View GitHub Profile
@ross-spencer
ross-spencer / robust.md
Created February 11, 2025 14:01
Example robust link
@ross-spencer
ross-spencer / asciihist.py
Created January 16, 2025 17:42 — forked from bgbg/asciihist.py
ASCII histograms
from __future__ import print_function
import numpy as np
def asciihist(it, bins=10, minmax=None, str_tag='',
scale_output=30, generate_only=False, print_function=print):
"""Create an ASCII histogram from an interable of numbers.
Author: Boris Gorelik [email protected]. based on http://econpy.googlecode.com/svn/trunk/pytrix/pytrix.py
License: MIT
"""
ret = []
@ross-spencer
ross-spencer / query.sparql
Created December 30, 2024 09:07
Non-alphanumerical (Latin English) File Format Extensions in Wikidata (Regex)
SELECT DISTINCT ?idExtension ?extension ?mediaType ?idExtensionLabel
WHERE
{
?idExtension wdt:P31 wd:Q235557 ;
wdt:P1195 ?extension .
FILTER (!regex(?extension, "[0-9a-zA-Z]", "i")) .
OPTIONAL { ?idExtension wdt:P1163 ?mediaType }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY ?extension ?mediaType
@ross-spencer
ross-spencer / sqlbuddy.py
Created December 30, 2024 07:41 — forked from angea/sqlbuddy.py
Scans SQLite files for known features (UserVersion, AppId, Schema...)
#!/usr/bin/env python3
# Scans SQLite files for known features (UserVersion, AppId, Schema...)
# Ange Albertini 2024
import argparse
import hashlib
import sqlite3
import sys
user_versions = {
@ross-spencer
ross-spencer / imagetest.sh
Created November 22, 2024 20:19 — forked from kumbasar/imagetest.sh
How To Create a NTFS Image File in Linux
#!/bin/bash
set -x
image="test.img"
label="test"
mntdir=`mktemp -d`
sudo dd status=progress if=/dev/zero of=$image bs=6M count=1000 && sync
echo 'type=7' | sudo sfdisk $image
@ross-spencer
ross-spencer / cknow.txt
Last active November 25, 2024 14:01
Copyright © 2002 Computer Knowledge
Copyright © 2002 Computer Knowledge
All Rights Reserved
This download for personal use only. Do NOT distribute
it to others either alone or incorporated into any
software without prior permission from Computer Knowledge.
Developers who wish to incorporate portions of the list
please see the comments at the end of this file.
.??_ Files ending in "_" are often compressed install files of the same
name (e.g., .EX_ expands to .EXE, .DL_ expands to .DLL, etc.)

Note

Going to move development to this repo to make PRs easier to manage: https://github.com/brianckeegan/Post_2024_News

Post-2024 news

Mainstream media failed to hold Trump to account over the course of the 2024 presidential campaign through "view from nowhere" centrism and false equivalencies between both campaigns.

Here is a list of news organizations, newsletters, and writers that are audience-funded and/or non-profits committed to independent and investigative journalism.

Rules

  • No centrist contrarians or right-wing authors
@ross-spencer
ross-spencer / logger-rsyslog.py
Created July 12, 2024 08:48 — forked from danielkraic/logger-rsyslog.py
python app with loggin to rsyslog
"""
rsyslog config: /etc/rsyslog.d/my-sample.conf:
$template AppLogFormat, "%TIMESTAMP:::date-pgsql%%TIMESTAMP:27:32:date-rfc3339%(%syslogseverity-text%)%msg%\n"
if $app-name == 'my-sample-app' then -/var/log/my-sample-app/app.log;AppLogFormat
& ~
"""
from __future__ import print_function

top (the UNIX process inspector) cheat sheet

This is a list of the most helpful keyboard commands I use within top.

The basics

h shows help on interactive commands. Also see the top manual page

q to quit the program.

@ross-spencer
ross-spencer / bash_strict_mode.md
Created February 10, 2024 04:31 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation