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 / 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 / vimrc
Created March 24, 2026 22:45
MYVIMRC
" Linux: 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 / 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"
@kmatt
kmatt / zeddiff.md
Created July 10, 2025 17:11
Side-by-side diff in Zed
@kmatt
kmatt / slugifile.sh
Last active July 1, 2025 19:49
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 / gistbackup.sh
Created January 10, 2025 05:30
Download all Gists using Github CLI
# Download all Gists
for i in $(gh gist list -L 1000 | cut -f1); do echo "ID: $i"; gh gist view $i > $i; done
# Rename each file with a slug of the first line / description
for f in *; do mv -v $f $(gawk 'NR==1{gsub(/[^[:alnum:]]/, "-"); gsub(/-+/, "-"); print $0 "_" FILENAME}' $f); done
#
# This shell prompt config file was created by promptline.vim
#
function __promptline_host {
local only_if_ssh="0"
if [ $only_if_ssh -eq 0 -o -n "${SSH_CLIENT}" ]; then
if [[ -n ${ZSH_VERSION-} ]]; then print %m; elif [[ -n ${FISH_VERSION-} ]]; then hostname -s; else printf "%s" \\h; fi
fi
}
@kmatt
kmatt / wef.ps1
Created December 20, 2024 21:42
Select and browse Windows event logs with FZF
(Get-EventLog *).Log | fzf | % { Get-EventLog -LogName $_.Trim() -after (Get-Date).AddDays(-7) } | fzf
@kmatt
kmatt / SMOScripter.ps1
Last active November 20, 2024 02:13
Script SQL Server database to individual files for schema history
param ([string]$s, [string[]] $d, [switch]$commit, [switch]$verbose, [string]$path=(Get-Location))
# Install-Module -Name SqlServer -Scope CurrentUser
# Systemd service unit:
# ExecStart=/usr/bin/pwsh /localdata/SMOSchema/scripter.ps1 -s ALL -commit
#
# Add to $SERVICENAME.service.d/override.conf
# [Service]
# Environment=SQLCMDUSER=