Skip to content

Instantly share code, notes, and snippets.

View kmatt's full-sized avatar
😐

Matt Keranen kmatt

😐
  • SE US
View GitHub Profile
@kmatt
kmatt / ncspot_config.toml
Created August 27, 2026 06:31
ncspot macOS config
bitrate = 160
cover_max_scale = 2
flip_status_indicators = true
initial_screen = "library"
notify = true
use_nerdfont = true
library_tabs = ["tracks", "playlists", "albums", "artists", "browse"]
[keybindings]
@kmatt
kmatt / vd.py
Created November 9, 2020 18:31
Visidata as a terminal Pandas dataframe viewer
import pandas as pd
import visidata as vd
df=pd.read_csv('file.csv')
vd.view_pandas(df)
@kmatt
kmatt / void-wsl.txt
Last active July 25, 2026 09:16
Install Void Linux on WSL2
# Based on https://gist.github.com/kmatt/71603170556ef8ffd14984af77ff10c5
# prompt ">" indicates Powershell commands
# prompt "$" are Linux shell commands
# https://docs.microsoft.com/en-us/windows/wsl/install-win10
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
@kmatt
kmatt / vimrc
Last active June 2, 2026 02:30
MYVIMRC
" Linux / macOS: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" PowerShell: iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |` ni $HOME/vimfiles/autoload/plug.vim -Force
" `:!pip install setuptools` may be needed for python-mode
let g:go_version_warning = 0
let g:pymode_python = 'python3'
let g:python3_host_prog = expand('/usr/bin/python3')
call plug#begin()
@kmatt
kmatt / ijq.sh
Created May 19, 2026 04:16 — forked from Thomascountz/ijq.sh
(Yet another) interactive jq, but it's a bash script using fzf
#!/usr/bin/env bash
set -euo pipefail
if [ "${1:-}" = "--help" ]; then
cat << EOF
Usage: ijq [filename]
A wrapper around jq that uses fzf to interactively build jq filters.
@kmatt
kmatt / slugifile.sh
Last active April 22, 2026 17:42
Slug filenames in directory
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "Usage: $0 FILENAME | 'WILDCARD' (in single quotes)"
exit
fi
slug() {
# Replace non-alpha characters and rename file
f=$(basename "$1")
@kmatt
kmatt / DuckDB_in_Databricks.ipynb
Created April 2, 2026 16:38 — forked from mniehoff/DuckDB_in_Databricks.ipynb
How to use DuckDB in Databricks to process data stored in Databricks Unity Catalog. https://www.codecentric.de/wissens-hub/blog/access-databricks-unitycatalog-from-duckdb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmatt
kmatt / pv_dump.sh
Created May 24, 2012 20:07
Monitoring dump and restore with pv
# dump
pg_dump testdb | pv -c -s $(psql -tc "SELECT pg_database_size('testdb')") -N dump | gzip > testdb.sql.gz
# restore
pv testdb_20120501.sql.gz | zcat | psql testdb
" Based on https://thegreata.pe/articles/2020/07/11/vim-syntax-highlighting-for-sql-strings-inside-python-code/
if exists('g:enable_sql_python_string') && g:enable_sql_python_string
let s:bcs = b:current_syntax
unlet b:current_syntax
syn include @SQL syntax/sql.vim
syntax region sqlPythonString
\ matchgroup=SpecialComment
\ start=~\z('''\|"""\)\_s*\(ALTER\|BEGIN\|CALL\|COMMENT\|COMMIT\|CONNECT\|CREATE\|DELETE\|DROP\|END\|EXPLAIN\|EXPORT\|GRANT\|IMPORT\|INSERT\|LOAD\|LOCK\|MERGE\|REFRESH\|RENAME\|REPLACE\|REVOKE\|ROLLBACK\|SELECT\|SET\|TRUNCATE\|UNLOAD\|UNSET\|UPDATE\|UPSERT\|WITH\)~
@kmatt
kmatt / EnableRDP.ps1
Created August 21, 2025 21:43 — forked from asheroto/EnableRDP.ps1
Enable RDP on a computer with PowerShell.
# Warning
Clear-Host
Write-Output "Run this script on the computer you want to access via RDP"
Write-Output ""
# Ask
Write-Output "Remote address can be an IP address or network with CIDR"
Write-Output "Example: 192.168.0.5 or 192.168.0.0/24"
Write-Output ""
$RemoteAddress = Read-Host "Remote Address"