Skip to content

Instantly share code, notes, and snippets.

satmandu

  • New York, NY
Block or report user

Report or block satmandu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@satmandu
satmandu / make_deb.sh
Last active May 28, 2020
Make arm64 deb packages for the offical Raspberry Pi Foundation arm64 kernels
View make_deb.sh
#!/bin/bash -ex
# Builds arm64 debian packages from the rpi firmware repository kernels.
# This runs on an arm64 host with arm64 compilation tools...
# or with some sort of cross-compilation setup.
# Debs are put in $workdir/build
#
# This will NOT work in Raspbian unless you have an arm64 compilation
# environment setup. Has not been tested yet on
# Raspberry Pi OS (64 bit) beta test version
#
@satmandu
satmandu / build_rstudio_focal.sh
Last active May 12, 2020
COMPLETELY UNSUPPORTED way to build rstudio from the v1.3-patches branch with QT 5.15 for ubuntu/20.04 focal & R 4.0. Put both files in the same directory. Note a docker install is needed for this to work.
View build_rstudio_focal.sh
#!/bin/bash -ex
git_branch="v1.3-patch"
git_base="https://github.com/rstudio/rstudio"
QT_VERSION=5.15.0
now=$(date +"%m%d%Y%H%M")
#docker build --pull --no-cache -f Dockerfile.focal-amd64 -t rstudio:focal-amd64 .
# following from https://stackoverflow.com/a/246128
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
@satmandu
satmandu / 70-gapps.sh
Created Apr 10, 2020
not working 70-gapps.sh
View 70-gapps.sh
#!/sbin/sh
#
# ADDOND_VERSION=2
#
# /system/addon.d/70-gapps.sh
#
. /tmp/backuptool.functions
if [ -z $backuptool_ab ]; then
SYS=$S
@satmandu
satmandu / k5.6.3.patch
Last active Feb 27, 2020
Patch for zfs-dkms_0.8.3-1ubuntu5 to fix compatibility with kernel 5.6rc3 as per zfs PR #9961 & PR #1064
View k5.6.3.patch
diff -Npaur a/config/kernel-inode-times.m4 b/config/kernel-inode-times.m4
--- a/config/kernel-inode-times.m4 2020-01-22 16:49:01.000000000 -0500
+++ b/config/kernel-inode-times.m4 2020-02-27 12:40:52.273139053 -0500
@@ -1,8 +1,22 @@
-dnl #
-dnl # 4.18 API change
-dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64.
-dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [
+
@satmandu
satmandu / build_arm64_rpi_userland.sh
Last active May 7, 2020
Generate an arm64 rpi userland for use on ubuntu/arm64.
View build_arm64_rpi_userland.sh
#!/bin/bash -x
workdir="${HOME}/workdir"
[[ ! -d "$workdir" ]] && ( mkdir -p "$workdir" || exit 1)
[[ ! -d "$workdir"/tmp ]] && ( mkdir -p "$workdir"/tmp || exit 1)
[[ ! -d "$workdir"/output ]] && ( mkdir -p "$workdir"/output || exit 1)
echo "workdir is ${workdir}"
tmpdir=$(mktemp -d deb_XXXX -p "$workdir"/tmp)
deb_temp=${tmpdir}/deb
extract_tmp=${tmpdir}/extract
@satmandu
satmandu / nighttime.py
Last active Feb 21, 2020
Sets volumes for all Google home device on the local network programmatically.
View nighttime.py
#!/usr/bin/python3
# Sets volumes for all Google home device on the local network programmatically.
# Adapted from script at https://pastebin.com/ke3Z65pm
# from this discussion by reddit user Mjjjjjjjjjjjjjjjj
# https://www.reddit.com/r/googlehome/comments/8b0b4o/python_script_to_manage_the_volume_of_multiple/
#
from __future__ import print_function
import time
import sys
View use_rpi_bootloader_on_ubuntu_rpi.sh
#!/bin/bash
echo "* Disabling any non-vmlinuz kernel lines"
echo " in /boot/firmware/config.txt ."
sed -i -E '/(^kernel=vmlinuz)/!s/^kernel=/#kernel=/g' /boot/firmware/config.txt
echo "* Adding line to use the rpi bootloader to load the kernel"
echo " in /boot/firmware/config.txt ."
if ! grep -qs '^kernel=vmlinuz' /boot/firmware/config.txt
then echo "kernel=vmlinuz" >> /boot/firmware/config.txt
fi
echo "* Adding line to use the rpi bootloader to load the initrd"
@satmandu
satmandu / overlayon.sh
Created Jan 9, 2020
set overlay on so that everything mounts at boot
View overlayon.sh
#!/bin/bash
for f in `sudo zfs list -H| awk '{print $1}'`; do sudo zfs set overlay=on "$f" ; done
@satmandu
satmandu / mount_zfs.sh
Last active Nov 20, 2019
Alternative non-bpool/rpool zpool mount service for ubuntu 19.10
View mount_zfs.sh
#!/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
View zfsuseradd.sh
#!/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)
You can’t perform that action at this time.