Skip to content

Instantly share code, notes, and snippets.

View satmandu's full-sized avatar

Satadru Pramanik, DO, MPH, MEng satmandu

View GitHub Profile
@satmandu
satmandu / gist:5042446
Created February 26, 2013 21:36
'brew install -v python --with-brewed-openssl' on OS X 10.8.2
server: satadru$ brew install -v python --with-brewed-openssl
==> Downloading http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
Already downloaded: /Library/Caches/Homebrew/python-2.7.3.tar.bz2
/usr/bin/tar xf /Library/Caches/Homebrew/python-2.7.3.tar.bz2
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.9.4 (Ruby 1.8.7-358; Mac OS X 10.8.2) https://gist.github.com/raw/4349132/25662c6b382315b5db67bf949773d76471bbcee7/python-nfs-shutil.diff -o 000-homebrew.diff
######################################################################## 100.0%
==> Patching
/usr/bin/patch -f -p1 -i 000-homebrew.diff
tynt.com
intellitxt.com
vibrantmedia.com
snap.com
intellitxt.com
snap.com
kontera.com
AdGardener.com
apture.com
wibiya.com
@satmandu
satmandu / voiceplus.patch
Created September 11, 2013 15:50
VoicePlus Patch to eliminate multipart text concatenation prior to sending to Google Voice
--- android_packages_apps_VoicePlus/cm-10.2/src/org/cyanogenmod/voiceplus/VoicePlusService.java 2013-09-11 11:44:42.000000000 -0400
+++ android_packages_apps_VoicePlus/cm-10.2/src/org/cyanogenmod/voiceplus/VoicePlusService.java.new 2013-09-11 11:45:50.000000000 -0400
@@ -297,12 +297,6 @@
return;
}
- // combine the multipart text into one string
- StringBuilder textBuilder = new StringBuilder();
- for (String text: texts) {
- textBuilder.append(text);

Keybase proof

I hereby claim:

  • I am satmandu on github.
  • I am satadru (https://keybase.io/satadru) on keybase.
  • I have a public key ASASlTfjTHvXY5GikRIg-lHdX-mNO3Xabn6EN7ESB6egggo

To claim this, I am signing this object:

@satmandu
satmandu / gist:8a19a4ffb60a96d14716defc535ae8bf
Created August 6, 2018 20:02
Barmani 64 bit kernel compile
sudo apt update
sudo apt-get install -y bc build-essential gcc-aarch64-linux-gnu git unzip subversion
mkdir rpi ; cd rpi
# to get head, aka most actively developed current rpi kernel tree
git clone --depth=1 https://github.com/raspberrypi/linux.git
# for specific version use: git clone --depth=1 -b rpi-4.14.y https://github.com/raspberrypi/linux.git
# Now we get updated rpi firmware
svn export https://github.com/raspberrypi/firmware/trunk/boot
rm boot/config.txt
rm boot/kernel*
#!/bin/bash
if [ "$1" != "" ]; then
nice -20 ocrmypdf --redo-ocr --pdfa-image-compression lossless --output-type pdfa-2 "$1" "$1"
else
echo "No filename given"
fi
@satmandu
satmandu / before-dkms-ubuntu-mainline
Last active July 10, 2019 14:59
Workaround for ubuntu mainline kernel cross-compile issues with module building files compiled in wrong architecture
#!/bin/bash
# This should go in /etc/kernel/header_postinst.d
kernelver=$1
files=("scripts/recordmcount" "scripts/mod/modpost" \
"scripts/basic/fixdep")
rebuild=0
@satmandu
satmandu / build-arm64-eoan-rpi4
Last active July 25, 2019 15:23
Building eoan image for Raspberry Pi 4B
-v /dev:/dev --privileged
wget http://cdimage.ubuntu.com/ubuntu-server/daily-preinstalled/current/eoan-preinstalled-server-arm64+raspi3.img.xz
xzcat eoan-preinstalled-server-arm64+raspi3.img.xz > eoan-preinstalled-server-arm64+raspi4.img
kpartx -av eoan-preinstalled-server-arm64+raspi4.img
mount /dev/mapper/loop0p2 /mnt
mount /dev/mapper/loop0p1 /mnt/boot/firmware
git clone --depth=1 https://github.com/Hexxeh/rpi-firmware
#!/bin/bash -ex
# Hack to add user USERDATA zpool to an Ubuntu 19.10 system.
# I have this at /usr/local/bin/zfsuseradd.sh
user="${1}"
[[ -n "$user" ]] || (echo "User not specified." && exit 1)
zfs_user_suffix=$(mount | grep rpool/USERDATA/root_ | awk '{print $1}' | sed 's/rpool\/USERDATA\/root_//')
[[ -n "$zfs_user_suffix" ]] || (echo "Can't get Ubuntu ZFS user suffix." && exit 1)
zfs_system_suffix=$(mount | grep rpool/ROOT/ubuntu_ | awk '{print $1}' | head -1 | sed 's/rpool\/ROOT\/ubuntu_//')
[[ -n "$zfs_system_suffix" ]] || (echo "Can't get Ubuntu ZFS system suffix." && exit 1)
@satmandu
satmandu / mount_zfs.sh
Last active November 20, 2019 09:01
Alternative non-bpool/rpool zpool mount service for ubuntu 19.10
#!/bin/bash -e
#export PS4='+(${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
# Place in /usr/local/sbin/mount_zfs.sh
USAGE="Usage: $0 zpool1 zpool2 zpool3 ... zpoolN"
MOUNTATTEMPTS=50
COUNTER=1
if [ "$#" == "0" ]; then
echo "$USAGE"
exit 0