Skip to content

Instantly share code, notes, and snippets.

View Gabelbombe's full-sized avatar

Till Eulenspiegel Gabelbombe

  • The Deep Darkness, WA
View GitHub Profile
@Gabelbombe
Gabelbombe / ungtar.sh
Created March 21, 2017 08:58
Better UnTar/GunZipper
#!/usr/bin/env bash -xe
if ! hash pigz 2>/dev/null ; then echo -e 'PigZ required..' ; return 3 ; fi
if ! hash pv 2>/dev/null ; then echo -e 'PV required..' ; return 3 ; fi
[ -f "${1}" ] && {
pigz -dc "${1}" |pv |tar -xf -
} || {
echo -e "${1} does not exist.." ; return 4
}
@Gabelbombe
Gabelbombe / README.md
Last active May 8, 2018 23:10
Bypass EFI / NVRAM lock settings in OSX 10.12~

OSX 10.12~ NVRAM Manipulation

Begining with OS X 10.11 El Capitan, a set of security mechanism, System Integrity Protection(SIP), has been enforced and it can only be configured or turned off in the recovery environment like Recovery HD. In the normal environment, SIP configuration will not be permitted even with root privilege. If so, the SIP would be useless since it can be easily turned off.

As many people may already noticed, the configuration of SIP status is stored in the NVRAM with a property called csr-active-config. Of course users wouldn’t be

#!/bin/bash
# Generating eBooks and PDFs
# GitBook can generates a website, but can also output content as ebook (ePub, Mobi, PDF).
# From http://toolchain.gitbook.com/ebook.html
if ! hash
# Serve website at http://localhost:4000/
gitbook serve
@Gabelbombe
Gabelbombe / .bash_profile
Created February 25, 2017 17:09
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#!/usr/bin/env bash -ex
##better root check
[ -w / ] || {
echo -e "This script must be run as su" ; exit 1
}
defaults write /Library/Preferences/com.apple.desktopservices DSDontWriteNetworkStores -string true
@Gabelbombe
Gabelbombe / README.md
Last active February 14, 2017 07:11
Attempt to install "damaged" pkgs/apps workaround

To resolve the Gatekeeper (damaged app message nag) issue on macOS Sierra for unlocked images/programs (pretending you cannot open apps, poss unsigned/bad signing issue). You try completely disabling Gatekeeper checks. To try, open a terminal and enter:

sudo spctl --master-disable

Your sudo password will evidently be required.

Button clicks:

  • LMB: Open menu
  • MMB: Mute all tabs in all windows
  • MMB + CTRL: Unmute all tabs in all windows
  • RMB: Toggle sound for active tab
  • RMB + Key Modifiers: Open default CB menu
  • Mouse Scroll: Change volume level for all tabs
  • Mouse Scroll + Ctrl (FF49+): Set default volume level for media

Browser Hot Keys:

bytesToHuman() {
b=${1:-0}; d=''; s=0; S=(Bytes {K,M,G,T,E,P,Y,Z}iB)
while ((b > 1024)); do
d="$(printf ".%02d" $((b % 1024 * 100 / 1024)))"
b=$((b / 1024))
let s++
done
echo "$b$d ${S[$s]}"
}
@Gabelbombe
Gabelbombe / console-image.js
Created January 16, 2017 02:25
Add a image to the web browsers console
(function(url) {
// Create a new `Image` instance
var image = new Image();
image.onload = function() {
// Inside here we already have the dimensions of the loaded image
var style = [
// Hacky way of forcing image's viewport using `font-size` and `line-height`
'font-size: 1px;',
'line-height: ' + this.height + 'px;',
@Gabelbombe
Gabelbombe / upgrader.sh
Created January 15, 2017 03:20
protcoded idea upgrader (brew cask) tasks
#!/usr/bin/env bash
function upgrade ()
{
binary="${1}"
command="${2}"
case $binary in
brew)