Skip to content

Instantly share code, notes, and snippets.

@bashenk
bashenk / fix-grub.sh
Created August 6, 2020 18:18 — forked from lovromazgon/fix-grub.sh
This script fixes GRUB for systems, that were installed according to the Manual Full System Encryption guide (https://help.ubuntu.com/community/ManualFullSystemEncryption). It is inspired by the original script used in the guide and reuses a lot of parts from it. Use an Ubuntu Live CD / USB to get to a terminal and run the script from there.
#!/usr/bin/env bash
####################################################################################################
#
# FIX GRUB FOR ENCRYPTED INSTALLATION
#
# This script is based on the Troubleshooting part of the Manual Full System Encryption for Ubuntu.
# See https://help.ubuntu.com/community/ManualFullSystemEncryption/Troubleshooting
#
# This is NOT AN OFFICIAL Ubuntu script, it can and will break your system. Use at own risk.
@bashenk
bashenk / get_android_service_call_numbers.sh
Last active January 25, 2023 19:49 — forked from ktnr74/get_android_service_call_numbers.sh
POSIX compliant and portable fork. Now has been updated with more optional parameters, more optimizations, and better error handling. If -t or -v are specified, an android device is not required.
#!/usr/bin/env sh
set -u
# https://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced#28776166
sourced=0
if [ -n "${ZSH_EVAL_CONTEXT-}" ]; then
case $ZSH_EVAL_CONTEXT in *:file) sourced=1;; esac;
elif [ -n "${KSH_VERSION-}" ]; then
if [ "$(cd "$(dirname -- "$0")" && pwd -P)/$(basename -- "$0")" != "$(cd "$(dirname -- "${.sh.file}")" && pwd -P)/$(basename -- "${.sh.file}")" ]; then
sourced=1