FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Original HTTPS Page]

prehensilecode’s gists · GitHub

Instantly share code, notes, and snippets.

prehensilecode / vimrc_airline.txt
Last active June 12, 2026 01:31
vimrc for vim-ariline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
" airline config
let g:airline_theme='powerlineish'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
prehensilecode / trumpet_visualizer.py
Created June 30, 2025 20:01
stand-up maths' trumpet visualizer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
import numpy as np
import plotly.graph_objects as go
from dash import Dash, dcc, html, Input, Output, State
import dash_bootstrap_components as dbc
from flask_caching import Cache
external_stylesheets = [dbc.themes.SOLAR]
app = Dash(__name__, external_stylesheets=external_stylesheets)
server = app.server
prehensilecode / apple_epub_to_std_epub.sh
Last active June 21, 2025 16:11
Convert single Apple epub to standard epub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
#!/bin/bash
# Based on: https://www.reddit.com/r/Calibre/comments/dza1zi/comment/lxz97q5/
# Except this just does a single Apple epub, which is a directory (folder);
# loop over it to do a directory.
# WARNING: DOES NOT HANDLE BOOKS WITH DRM
# Downloaded Apple Books books are in:
# ~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books
# Books in iCloud are in:
# ~/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents
prehensilecode / reinstall_pip_pkgs.sh
Last active April 18, 2025 00:54
Re-install all pip packages retaining the same version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
#!/bin/bash
# tested on pip 25.0.1
# XXX this is probably not a good idea
for pkg in $( python3 -m pip list | tail -n+3 | awk '{print $1 "==" $2}' )
do
python3 -m pip install -U --force-reinstall "${pkg}"
done
prehensilecode / kindle_bulk_download.js
Last active February 21, 2025 20:02 — forked from lfhbento/userscript.js
Download all your Kindle books before Feb 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
// ==UserScript==
// @name Kindle Download
// @namespace http://tampermonkey.net/
// @version 2025-02-20
// @description Download all your kindle books
// @author You
// @match https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.com
// @grant none
// ==/UserScript==
prehensilecode / fsl.def
Last active February 18, 2025 19:33
Apptainer def file for FSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Bootstrap: debootstrap
OSversion: focal
MirrorURL: https://us.archive.ubuntu.com/ubuntu/
%environment
export FSLDIR="/usr/local/fsl"
export DEBIAN_FRONTEND="noninteractive"
export LANG="en_US.UTF-8"
%post
prehensilecode / remove_nvidia_from_initramfs.sh
Created December 2, 2024 15:23
Remove Nvidia & Nouveau kernel modules from initramfs and make persistent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
#!/bin/bash
# Removes both nvidia and nouveau drivers from initramfs and rebuilds them.
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [[ $( id -u ) -ne 0 ]]
then
echo "This must be run as root"
exit 1
else
kernelversion=$(uname -r)
prehensilecode / snapshotter.py
Last active July 18, 2024 20:56
GPFS snapshotter script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.6
# Author: David Chin david.chin@pennmedicine.upenn.edu
import sys
import os
import shlex
import subprocess
import argparse
import datetime
import calendar
from pathlib import Path
prehensilecode / tunnel_to_cluster_node_mgmt_port.md
Last active March 6, 2024 16:32
Tunnel to cluster node XCC or DRAC

Set up tunnel:

 ssh -L 1443:clusternode-xcc:443 adminuser@adminhost

Then, run web browser on PC connecting to

https://localhost:1443

Back | FazBrowse Home | New Git URL