Skip to content

Instantly share code, notes, and snippets.

View bennyfactor's full-sized avatar

Benjamin Lamb bennyfactor

  • Trabian Technology
  • INDPLS IN US NA
View GitHub Profile
@bennyfactor
bennyfactor / xterm-brew-unicode-build.sh
Last active March 9, 2023 16:04
Get an xterm in xquartz that actually supports unicode encodings, thank you homebrew
brew tap-new xquartz-unicode/libx11-unicode
# use a cdn to get a raw from github since occasionally downloading directly from raw.githubusercontent makes computers do a sad face
curl -L https://cdn.statically.io/gh/Homebrew/homebrew-core/HEAD/Formula/libx11.rb -o /usr/local/Homebrew/Library/Taps/xquartz-unicode/homebrew-libx11-unicode/Formula/libx11-unicode.rb
sed -i '' 's/class Libx11/class Libx11Unicode/g' /usr/local/Homebrew/Library/Taps/xquartz-unicode/homebrew-libx11-unicode/Formula/libx11-unicode.rb
sed -i '' 's/--enable-loadable-i18n//g' /usr/local/Homebrew/Library/Taps/xquartz-unicode/homebrew-libx11-unicode/Formula/libx11-unicode.rb
brew style --fix /usr/local/Homebrew/Library/Taps/xquartz-unicode/homebrew-libx11-unicode/Formula/libx11-unicode.rb
brew install --build-from-source libx11-unicode
brew tap-new xquartz-unicode/xterm-unicode
# use a cdn to get a raw from github since occasionally downloading directly from raw.githubusercontent makes computers do a sad face
@bennyfactor
bennyfactor / 0001-metal-radeon-macbook-pro-monterey.patch
Created March 8, 2023 14:20
Patches AUTOMATIC1111/stable-diffusion-webui at commit 0cc0ee1 to use gpu on 2019 macbook pro with amd radeon
From 345c4d6124b1a5802ddaafaf9f74d35a3da46758 Mon Sep 17 00:00:00 2001
From: Your Mom
Date: Sat, 4 Mar 2023 09:13:11 -0500
Subject: [PATCH] patch to run on metal for radeon macbook pro on monterey
---
macos-torch-patch.sh | 12 ++++++++++++
requirements.txt | 2 +-
webui-user.sh | 25 +++++++++++++++++++++----
3 files changed, 34 insertions(+), 5 deletions(-)
@bennyfactor
bennyfactor / tco.sh
Last active November 18, 2022 03:07
Get all those t.co links before they're gone forever
#!/bin/sh
# go to the base directory of your twitter archive, ie something like twitter-YYYY-MM-DD-deadbeefcafe42069
# run this for loop:
for i in `grep -oh "https://t.co/[[:alnum:]]*" data/*.js | sort | uniq`
do
echo $i $(curl -Is ${i} | grep location | sed -e 's/location./, /') | sed -e 's/ ,/,/' | tee -a tco.csv
done
diff --git source/distro/google-perftools-1.7/src/tcmalloc.cc source/distro/google-perftools-1.7/src/tcmalloc.cc
index 8d94d20..0769425 100644
--- source/distro/google-perftools-1.7/src/tcmalloc.cc
+++ source/distro/google-perftools-1.7/src/tcmalloc.cc
@@ -137,6 +137,13 @@
# define WIN32_DO_PATCHING 1
#endif
+// GLibc 2.14+ requires the hook functions be declared volatile, based on the value of the
+// define __MALLOC_HOOK_VOLATILE. For compatibility with older/non-GLibc implementations,
@bennyfactor
bennyfactor / mysql55.rb
Last active December 11, 2019 02:07
Homebrew Mysql 5.5.56 formula
class Mysql55 < Formula
desc "Open source relational database management system"
homepage "https://dev.mysql.com/doc/refman/5.5/en/"
url "https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56.tar.gz"
sha256 "3fd30a24267cef84ee8aeb327a5b08a669d3ab8c4d76d1b1b3b66d26cf777a0a"
bottle do
sha256 "57a68b94580d89ac07c633904da7218bb73092dcbc7d31071d96090a9b65c517" => :sierra
sha256 "867a059b4ea2769b2c54b6124f3c6d0558bdea87d5880043b084850d226d91f3" => :el_capitan
sha256 "477c1abafe1181b27fde3588725e475a0204159621214953deeaf3d4c4c21efa" => :yosemite
@bennyfactor
bennyfactor / libvips.spec
Last active June 25, 2019 17:07 — forked from mbklein/libvips.spec
libvips RPM spec for CentOS 6
Summary: A fast image processing library with low memory needs
Name: vips
Version: 8.7.4
Release: 1%{?dist}
License: LGPLv2.1+
Source0: https://github.com/jcupitt/libvips/releases/download/v8.7.4/%{name}-%{version}.tar.gz
URL: https://github.com/jcupitt/libvips
BuildRequires: chrpath, gtk-doc, libxml2-devel, libjpeg-turbo-devel, libpng-devel
BuildRequires: libtiff-devel, libexif-devel, libgsf-devel, lcms-devel
BuildRequires: ImageMagick-devel, gobject-introspection-devel, libwebp-devel
@bennyfactor
bennyfactor / dodge.md
Last active September 9, 2018 04:49
Download somebody's scan of the 1990 Dodge Pickup Truck Factory Service Manual, save files in proper page order

It's a lot better to do this in bash, zsh's expansion/glob facilities are too smart for their own good and mess up some of the commands.

wget --random-wait -e robots=off -U mozilla https://manuals.co/workshop/dodge/ram/dodge-ram-1990-workshop-manual-rear-wheel-drive-truck/5575968/{1..1134}
grep -o s3.eu.west.1.amazonaws.com.manuals.co.5575968.bg.\*.png * | sed -e "s/:/.png https:\/\//g" | sed -e "s/^/wget -e robots=off -U mozilla \-O /g" > wget.sh
bash wget.sh
ls | grep -v .png | xargs rm
rename 's/.png$//' *
for f in *; do mv $f `printf %04d ${f}`; done
rename 's/$/.png/' *
@bennyfactor
bennyfactor / a
Last active February 12, 2018 01:55
US Population by county, 1790-1990, from https://www.census.gov/population/www/censusdata/pop1790-1990.html
b
@bennyfactor
bennyfactor / Ruby 1.8.7 ree-187 macOS Catalina 10.15.7.sh
Last active February 23, 2023 05:18
How to rebuild old ruby on modern macos, because of course the headers moved and bundler suddenly can't build native extensions any more
# This is based on https://gist.github.com/whitehat101/87c06c29dabfe15f094ec331b77a7c6d and https://solitum.net/openssl-os-x-el-capitan-and-brew/
# I take no responsibility for the damage it may do to any other build system you run.
# Disable system integrity protection before this mess.
# Uninstall everything critical to get back to baseline
rbenv uninstall ree-1.8.7-2012.02
@bennyfactor
bennyfactor / keybase.md
Created August 13, 2014 20:23
Keybase authority for github

Keybase proof

I hereby claim:

  • I am bennyfactor on github.
  • I am bennyfactor (https://keybase.io/bennyfactor) on keybase.
  • I have a public key whose fingerprint is 6CA7 5D93 8C28 B486 82FB 9191 67A6 C881 5ABE B552

To claim this, I am signing this object: