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 / setup.url
Last active March 29, 2018 07:01
Mac OSX set stuff
https://apple.stackexchange.com/questions/12161/os-x-terminal-must-have-utilities
https://github.com/walles/px
https://bjango.com/mac/istatmenus/
@Gabelbombe
Gabelbombe / getops.md
Last active September 14, 2017 04:42

getopts with short/long options AND short/long arguments

Works with all combinations, e.G.:

  • foobar -f --bar
  • foobar --foo -b
  • foobar -bf --bar --foobar
  • foobar -fbFBAshorty --bar -FB --arguments=longhorn
  • foobar -fA "text shorty" -B --arguments="text longhorn"
  • bash foobar -F --barfoo
@Gabelbombe
Gabelbombe / seems-legit.sh
Last active August 15, 2017 21:37
Manually upgrading AMZ Linuz requires /boot/grub/menu.lst to be manually updated ~Le Sigh
#!/bin/bash
## Run our update
yum update -y \
--disablerepo='*' \
--enablerepo='amzn-updates' \
--exclude='docker'
## Cleanup old kernel versions
package-cleanup --count=2 --oldkernels
@Gabelbombe
Gabelbombe / README.md
Last active August 10, 2017 19:31
Multiple Github ssh keys for multiple users

Background

So let's say that you started a new company. New companies mean new gear, new tools... and GASP a new GIT account. Okay, so that's super spiffy and stuff but begs the question. What if you aren't bringing your OWN Github account (GH was just my scenario and is most likely not yours, I'm staring at YOU Bitbucket...).

So the issue that you'll immediately find out (if you're me that is), is that you can't really use two accounts with two individual keys and expect to actually accomplish... well... shit... Hence this mini-paper thing.

The Issue

The issue is is that GH (as Github will be referred to from now on) runs over ssh during snazzy stuff such as the clone, commit as well as the pull processes. So there are a few things we can do here. One of them, is hijack the GIT_SSH or GIT_SSH_COMMAND global variables. This comes with the downfall that you'll be required to use some silly wrapper script to be able to continually issues authority or users in orde to get anything acco

#!/usr/bin/env bash -xu
echo -e 'Modifying Apples Bitpool'
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
echo -e 'Modifying Negotiable Bitpool'
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 58
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 58
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
[user]
email = [email protected]
name = ehime
[hub]
protocol = https
[core]
excludesfile = /opt/boxen/config/git/gitignore
whitespace = fix,-indent-with-non-tab,-indent-with-tab,trailing-space,cr-at-eol

Commands that are required to be ran in order to set up a Mac

Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Get generator
if ! hash pwgen 2>/dev/null ; then
#!/bin/bash
# bash support for Terminal.
# Working Directory
#
# Tell the terminal about the current working directory at each prompt.
if [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL, including
#!/bin/bash
cd /tmp ; git clone https://github.com/jenkinsci/docker.git jenkinsci-docker
cd jenkinsci-docker
docker build -t jenkins-test .
docker rm -f base-jenkins > /dev/null 2>&1
docker run -it \
--env JAVA_OPTS="${JAVA_OPTS}" \
--env JENKINS_SLAVE_AGENT_PORT=50001 \
--name base-jenkins \