Skip to content

Instantly share code, notes, and snippets.

View satmandu's full-sized avatar

Satadru Pramanik, DO, MPH, MEng satmandu

View GitHub Profile
#!/bin/bash
# ***Note*** You need machinectl installed.
# This can be found in the systemd-container package on Ubuntu!
#
# Place this nvidia-wallpaper-restore-on-resume.sh script in /lib/systemd/system-sleep/
# Then run: sudo chmod +x /lib/systemd/system-sleep/nvidia-wallpaper-restore-on-resume.sh
#
# This works around the wallpaper corruption on resume from suspend with Nvidia GPUs
# reported at https://gitlab.gnome.org/GNOME/gnome-shell/issues/1084
# and due to this feature of the Nvidia driver:
@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 / gist:3fd42c5a538bc34a1636950740838d3e
Created April 12, 2019 03:56
Waveshare35a config info for raspberry pi
From https://www.spotpear.com/learn/EN/raspberry-pi/Raspberry-Pi-LCD/Raspberry-Pi-_Rotate-the-screen-display.html
Raspberry Pi - Rotate the screen display
Raspberry Pi 2.4/3.2 inch LCD
Rotate display
sudo nano /boot/config.txt
#!/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 / 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*
@satmandu
satmandu / netflix-dns.sh
Last active January 10, 2021 13:12
PfSense script to keep HE tunnels from confusing netflix by blocking netflix IPV6 resolution.
#!/bin/sh
#make sure the directory for the python libraries is in the chroot
mkdir -p /var/unbound/usr/local/lib/python2.7
#link the actual python library directory to the chroot's directory
mount -t nullfs /usr/local/lib/python2.7 /var/unbound/usr/local/lib/python2.7
#copy the python script to the /var/unbound directory so
#unbound-checkconf can find it
@satmandu
satmandu / MacBookPro6,2-integrated-graphics-only.md
Created May 10, 2017 01:22
Getting a MacBookPro6,2 working with integrated graphics only with ubuntu.

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 / mavericks make iso v1
Last active March 24, 2020 18:36
Quick and Dirty make OS X Mavericks ISO on desktop. Note that you're going to have to enter your password for the sudo commands.
hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg
cd /tmp
hdiutil convert /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -format UDRW -o /tmp/RWBase
hdiutil convert -format UDSP -o /tmp/sparseRWBase RWBase.dmg
rm /tmp/RWBase.dmg
hdiutil resize -size 6g /tmp/sparseRWBase.sparseimage
hdiutil attach -owners on /tmp/sparseRWBase.sparseimage -shadow
sudo rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
sudo ditto /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/Packages
hdiutil eject /Volumes/OS\ X\ Install\ ESD/
@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);