This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
# Install Docker CLI and Docker Compose, etc. | |
brew install docker docker-compose docker-credential-helper | |
# Configure Docker CLI. | |
mkdir -p "$HOME/.docker/cli-plugins" | |
ln -sfn '/opt/homebrew/opt/docker-compose/bin/docker-compose' "$HOME/.docker/cli-plugins/docker-compose" | |
echo '{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Stash the staged files if any. | |
NEEDS_UNSTASH=0 | |
if ! git diff --staged --exit-code >/dev/null; then | |
echo -ne '\033[1;32m' | |
echo -n 'Stashing the staged files' | |
echo -e '\033[0m' | |
git stash | |
NEEDS_UNSTASH=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
echo_and_run() { | |
echo "> $*" | |
"$@" | |
} | |
setup_sudo() { | |
# Ask for the administrator password upfront |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /etc/logid.cfg | |
devices: ({ | |
name: "MX Anywhere 3"; | |
hiresscroll: { | |
hires: true; | |
invert: false; | |
target: true; | |
up: { | |
mode: "Axis"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
if [[ $# -lt 2 ]]; then | |
echo "Usage: $(basename "$0") <preset or jq condition> <files or directories...>" | |
echo 'Presets: subrip_only, anime' | |
exit 1 | |
fi | |
JQ_COND="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
log() { | |
echo -en '\033[1;32m' | |
echo -n "$@" | |
echo -e '\033[0m' | |
} | |
choice() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: UTF-8 -*- | |
# Note: A newer version of this script is located at https://github.com/trustin/smi2ass | |
# | |
# Copyright (C) 2018 Trustin Heuiseung Lee and other contributors | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Put this file to /etc/pf.conf | |
# 2. Install init boot scripts using IceFloor then - http://www.hanynet.com/icefloor/ | |
# I tried to use IceFloor to configure everything but it didn't work very well. | |
# 3. Once done, you can confirm the rules were loaded with 'sudo pfctl -sr' | |
# 4. At System Preferences -> Security -> Firewall -> Firewall Options, | |
# check 'Block all incoming connections' to prevent annoying per-app dialogs. | |
set skip on lo0 | |
set block-policy drop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Git-aware bash command prompt | |
# | |
# Put this script at $HOME/.bash_prompt and add the following to your .bashrc: | |
# | |
# if [ "$PS1" ]; then | |
# if [ -f "$HOME/.bash_prompt" ]; then | |
# PROMPT_COMMAND="$HOME/.bash_prompt" | |
# if [ "$EUID" == "0" ]; then | |
# PS1="\n# " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
if [[ -z "${JAVA_HOME:-}" ]]; then | |
JAVA='java' | |
else | |
JAVA="$JAVA_HOME/bin/java" | |
fi | |
SJK_VERSION='0.20' | |
SJK_PATH="$HOME/.local/opt/sjk/sjk-plus-$SJK_VERSION.jar" |
NewerOlder