* .gitconfig
* .chezmoi.yaml.tmpl
* .tmux.conf
* .vim
* .ssh
* .p10k.zsh
This commit is contained in:
Oliver Weyhmüller 2022-01-30 17:51:08 +00:00
parent 908a23c7b5
commit 4ec771a1c7
Signed by: oliver
GPG key ID: 5286794099F934A3
34 changed files with 2281 additions and 5243 deletions

96
.chezmoi.yaml.tmpl Normal file
View file

@ -0,0 +1,96 @@
{{- $headless := false -}}{{/* true if this machine does not have a screen and keyboard */}}
{{- $ephemeral := false -}}{{/* true if this machine is ephemeral, e.g. a cloud or VM instance */}}
{{- $work := false -}}{{/* true if this machine should have work secrets */}}
{{- $personal := false -}}{{/* true if this machine should have personal secrets */}}
{{- "" -}}
{{ if eq .chezmoi.os "linux" }}
{{/* detect GitHub codespaces, VSCode remote containers, Docker containers, Multipass VMs, and Vagrant boxes */}}
{{- if or (env "CODESPACES") (env "REMOTE_CONTAINERS_IPC") (eq .chezmoi.username "ubuntu" "vagrant" "vscode") (output "cat" "/proc/1/cgroup" | contains "docker") -}}
{{- $headless = true -}}
{{- $ephemeral = true -}}
{{- end -}}
{{ end }}
{{- $install_more_packages := "false" -}}
{{- if (hasKey .packages "install_more_packages") -}}
{{- $install_more_packages = .packages.install_more_packages -}}
{{- else -}}
{{- $install_more_packages = promptBool "Install more packages" -}}
{{- end -}}
{{- $config_python_format_tools := "false" -}}
{{- if (hasKey .packages "config_python_format_tools") -}}
{{- $config_python_format_tools = .packages.config_python_format_tools -}}
{{- else -}}
{{- $config_python_format_tools = promptBool "Config python formatting tools" -}}
{{- end -}}
{{/* work around unreliable hostname on darwin */}}
{{- $hostname := .chezmoi.hostname -}}
{{- if eq .chezmoi.os "darwin" -}}
{{- $computerName := output "scutil" "--get" "ComputerName" | trim -}}
{{- if eq $computerName "greybook" -}}
{{- $hostname = "greybook" -}}
{{- else -}}
{{- $hostname = $computerName -}}
{{- end -}}
{{- end -}}
{{- if not $ephemeral -}}
{{- if eq $hostname "blofeld.nc.w9r.de" -}}
{{- $headless = true -}}
{{- $work = true -}}
{{- else if eq $hostname "greybook" -}}
{{- $personal = true -}}
{{- $work = true -}}
{{- else if eq $hostname "goldfinger.do.w9r.de" -}}
{{- $headless = true -}}
{{- $work = true -}}
{{- else if stdinIsATTY -}}
{{- if hasKey . "headless" -}}
{{- $headless = .headless -}}
{{- else -}}
{{- $headless = promptBool "headless" -}}
{{- end -}}
{{- if hasKey . "ephemeral" -}}
{{- $ephemeral = .ephemeral -}}
{{- else -}}
{{- $ephemeral = promptBool "ephemeral" -}}
{{- end -}}
{{- else -}}
{{- $headless = true -}}
{{- $ephemeral = true -}}
{{- end -}}
{{- end -}}
data:
headless: {{ $headless }}
hostname: {{ $hostname }}
ephemeral: {{ $ephemeral }}
personal: {{ $personal }}
work: {{ $work }}
op_server: my.1password.com
op_account: oliver@weyhmueller.de
packages:
config_python_format_tools: {{ $config_python_format_tools }}
install_more_packages: {{ $install_more_packages }}
{{- if $personal }}
personal_vault: apbf24n32olg6xpk7mwoaevghq
{{- end }}
{{- if $work }}
work_vault: cihqioiemrmjckioptz6l3mu3q
{{- end }}
color: true
encryption: age
format: yaml
verbose: true
age:
identity: ~/.age/key.txt
recipient: age1uzqxem4cweevwncmvyyq2lr7wgjfc70xzyevca0t0rtfcdw5xytsrr38f6
git:
autoAdd: true
autoCommit: false
autoPush: false

4
.chezmoiexternal.yaml Normal file
View file

@ -0,0 +1,4 @@
".vim/autoload/plug.vim":
type: file
url: "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
refreshPeriod: 168h

2
.chezmoiignore Normal file
View file

@ -0,0 +1,2 @@
.idea
chezmoi.iml

1
.chezmoiremove Normal file
View file

@ -0,0 +1 @@
.git-credentials

View file

@ -0,0 +1,45 @@
{{- if (eq .chezmoi.os "linux") -}}
#!/bin/bash
set -e
VERSION="1.12.4"
if command -v op >/dev/null 2>&1; then
if [ "$(op --version)" = "$VERSION" ]; then
exit
fi
fi
tmpdir="$(mktemp -d)"
cd "$tmpdir"
if uname | grep -q Linux; then
case "$(uname -m)" in
*arm*) fname="op_linux_arm_v${VERSION}.zip" ;;
*) fname="op_linux_amd64_v${VERSION}.zip" ;;
esac
curl --fail --silent --show-error --location \
"https://cache.agilebits.com/dist/1P/op/pkg/v${VERSION}/${fname}" \
-o "$fname"
unzip "$fname"
gpg \
--keyserver hkp://keyserver.ubuntu.com \
--recv-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22
gpg --verify op.sig op
sudo mv op /usr/local/bin
fi
op --version
if op signin -l | grep -q '1. my'; then
# account already registered
eval $(op signin)
else
eval $(op signin {{ .op_server }} {{ .op_account }})
fi
{{ end -}}

View file

@ -0,0 +1,83 @@
{{- if (eq .chezmoi.os "linux") -}}
#!/usr/bin/env bash
set -eufo pipefail
packages=(
curl
git
gnupg
zsh
)
pip_packages=()
{{ if .packages.config_python_format_tools }}
packages+=(python3-pip)
pip_packages+=(
black
flake8
isort
)
{{ end }}
{{ if .packages.install_more_packages }}
packages+=(
axel
bat
exa
htop
httpie
iproute2
neofetch
neovim
ripgrep
tig
tmux
trash-cli
vim
wget
xclip
yt-dlp
zoxide
)
pip_packages+=(
thefuck
tldr
pynvim
)
{{ end }}
get_package_manager() {
if grep -Eqi "debian|raspbian" /proc/version; then
PKG="apt"
INSTALL_PARAM='install -y'
elif grep -Eqi "archlinux" /proc/version; then
PKG="pacman"
INSTALL_PARAM="-Sy --noconfirm"
fi
}
get_current_user() {
if [ `whoami` == "root" ]; then
USER="root"
else
USER=`whoami`
fi
}
get_package_manager
get_current_user
[ $USER == "root" ] && {
$PKG $INSTALL_PARAM ${packages[@]}
} || {
sudo $PKG $INSTALL_PARAM ${packages[@]}
}
{{ if lookPath "pip3" }}
if (( ${#pip_packages[@]} > 0 )); then
pip3 install ${pip_packages[@]}
fi
{{ end }}
{{ end -}}

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.idea
chezmoi.iml

View file

@ -0,0 +1,8 @@
#!/usr/bin/env zsh
echo -n 'IPv4: '
curl -4 https://ip.w9r.de/getip.php
echo
echo -n 'IPv6: '
curl -6 https://ip.w9r.de/getip.php
echo

64
bin/executable_git-churn Normal file
View file

@ -0,0 +1,64 @@
#!/usr/bin/ruby
#
# Credits: Corey Haines, Gary Bernhardt, Dan Croak
#
# Put this on your $PATH (~/bin is recommended).
#
# Show churn for the files changed in the branch:
#
# $ git-churn
#
class GitChurn
attr_accessor :all_files_with_churn_count, :changed_files, :result
def calculate
get_all_files_with_churn_count
get_changed_files
filter_into_result
print_result
end
private
def get_all_files_with_churn_count
self.all_files_with_churn_count =
`git log --all #{format_logs} | #{remove_blank_lines} | #{sort_by_ascending_churn_count}`.split("\n")
end
def format_logs
"--name-only --format='format:'"
end
def remove_blank_lines
"grep -v '^$'"
end
def sort_by_ascending_churn_count
'sort | uniq -c | sort'
end
def get_changed_files
self.changed_files =
`git log origin/master..HEAD #{format_logs} | #{remove_blank_lines} | #{remove_duplicates}`.split("\n")
end
def remove_duplicates
'sort | uniq'
end
def filter_into_result
self.result = all_files_with_churn_count.select { |file| file_changed?(file) }.join("\n")
end
def file_changed?(file)
changed_files.any? { |changed_file| file.include?(changed_file) }
end
def print_result
puts result
end
end
git_churn = GitChurn.new
git_churn.calculate

View file

@ -0,0 +1,18 @@
#!/bin/sh
#
# Promotes a local topic branch to a remote tracking branch of the same name,
# by pushing and then setting up the git config
#
# Thanks to ENTP:
# http://hoth.entp.com/2008/11/10/improving-my-git-workflow
curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
remote_branch=$(git branch -r | grep "origin/${curr_branch}")
[ -z "${remote_branch}" ] && ( git push origin "${curr_branch}" )
origin=$(git config --get "branch.${curr_branch}.remote")
[ -z "${origin}" ] && ( git config --add "branch.${curr_branch}.remote" origin )
merge=$(git config --get "branch.${curr_branch}.merge")
[ -z "${merge}" ] && ( git config --add "branch.${curr_branch}.merge" "refs/heads/${curr_branch}" )

View file

@ -0,0 +1,60 @@
#!/usr/bin/env ruby
## git-rank-contributors: a simple script to trace through the logs and
## rank contributors by the total size of the diffs they're responsible for.
## A change counts twice as much as a plain addition or deletion.
##
## Output may or may not be suitable for inclusion in a CREDITS file.
## Probably not without some editing, because people often commit from more
## than one address.
##
## git-rank-contributors Copyright 2008 William Morgan <wmorgan-git-wt-add@masanjin.net>.
## 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 3 of the License, or (at
## your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You can find the GNU General Public License at:
## http://www.gnu.org/licenses/
class String
def obfuscate; gsub(/@/, " at the ").gsub(/\.(\w+)(>|$)/, ' dot \1s\2') end
def htmlize; gsub("&", "&amp;").gsub("<", "&lt;").gsub(">", "&gt;") end
end
lines = {}
verbose = ARGV.delete("-v")
obfuscate = ARGV.delete("-o")
htmlize = ARGV.delete("-h")
author = nil
state = :pre_author
`git log -M -C -C -p --no-color`.split("\n").each do |l|
case
when (state == :pre_author || state == :post_author) && l =~ /Author: (.*)$/
author = $1
state = :post_author
lines[author] ||= 0
when state == :post_author && l =~ /^\+\+\+/
state = :in_diff
when state == :in_diff && l =~ /^[\+\-]/
lines[author] += 1
when state == :in_diff && l =~ /^commit /
state = :pre_author
end
end
lines.sort_by { |a, c| -c }.each do |a, c|
a = a.obfuscate if obfuscate
a = a.htmlize if htmlize
if verbose
puts "#{a}: #{c} lines of diff"
else
puts a
end
end

36
bin/executable_git-up Normal file
View file

@ -0,0 +1,36 @@
#!/bin/sh
#
# Usage: git-up
# git-reup
#
# Like git-pull but show a short and sexy log of changes
# immediately after merging (git-up) or rebasing (git-reup).
#
# Inspired by Kyle Neath's `git up' alias:
# http://gist.github.com/249223
#
# Stolen from Ryan Tomayko
# http://github.com/rtomayko/dotfiles/blob/rtomayko/bin/git-up
set -e
PULL_ARGS="$@"
# when invoked as git-reup, run as `git pull --rebase'
test "$(basename $0)" = "git-reup" &&
PULL_ARGS="--rebase $PULL_ARGS"
git pull $PULL_ARGS
# show diffstat of all changes if we're pulling with --rebase. not
# sure why git-pull only does this when merging.
test "$(basename $0)" = "git-reup" && {
echo "Diff:"
git --no-pager diff --color --stat HEAD@{1}.. |
sed 's/^/ /'
}
# show an abbreviated commit log of stuff that was just merged.
echo "Log:"
git log --color --pretty=oneline --abbrev-commit HEAD@{1}.. |
sed 's/^/ /'

364
bin/executable_git-wtf Normal file
View file

@ -0,0 +1,364 @@
#!/usr/bin/env ruby
HELP = <<EOS
git-wtf displays the state of your repository in a readable, easy-to-scan
format. It's useful for getting a summary of how a branch relates to a remote
server, and for wrangling many topic branches.
git-wtf can show you:
- How a branch relates to the remote repo, if it's a tracking branch.
- How a branch relates to integration branches, if it's a feature branch.
- How a branch relates to the feature branches, if it's an integration
branch.
git-wtf is best used before a git push, or between a git fetch and a git
merge. Be sure to set color.ui to auto or yes for maximum viewing pleasure.
EOS
KEY = <<EOS
KEY:
() branch only exists locally
{} branch only exists on a remote repo
[] branch exists locally and remotely
x merge occurs both locally and remotely
~ merge occurs only locally
(space) branch isn't merged in
(It's possible for merges to occur remotely and not locally, of course, but
that's a less common case and git-wtf currently doesn't display anything
special for it.)
EOS
USAGE = <<EOS
Usage: git wtf [branch+] [options]
If [branch] is not specified, git-wtf will use the current branch. The possible
[options] are:
-l, --long include author info and date for each commit
-a, --all show all branches across all remote repos, not just
those from origin
-A, --all-commits show all commits, not just the first 5
-s, --short don't show commits
-k, --key show key
-r, --relations show relation to features / integration branches
--dump-config print out current configuration and exit
git-wtf uses some heuristics to determine which branches are integration
branches, and which are feature branches. (Specifically, it assumes the
integration branches are named "master", "next" and "edge".) If it guesses
incorrectly, you will have to create a .git-wtfrc file.
To start building a configuration file, run "git-wtf --dump-config >
.git-wtfrc" and edit it. The config file is a YAML file that specifies the
integration branches, any branches to ignore, and the max number of commits to
display when --all-commits isn't used. git-wtf will look for a .git-wtfrc file
starting in the current directory, and recursively up to the root.
IMPORTANT NOTE: all local branches referenced in .git-wtfrc must be prefixed
with heads/, e.g. "heads/master". Remote branches must be of the form
remotes/<remote>/<branch>.
EOS
COPYRIGHT = <<EOS
git-wtf Copyright 2008--2009 William Morgan <wmorgan at the masanjin dot nets>.
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 3 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You can find the GNU General Public License at: http://www.gnu.org/licenses/
EOS
require 'yaml'
CONFIG_FN = ".git-wtfrc"
class Numeric; def pluralize s; "#{to_s} #{s}" + (self != 1 ? "s" : "") end end
if ARGV.delete("--help") || ARGV.delete("-h")
puts USAGE
exit
end
## poor man's trollop
$long = ARGV.delete("--long") || ARGV.delete("-l")
$short = ARGV.delete("--short") || ARGV.delete("-s")
$all = ARGV.delete("--all") || ARGV.delete("-a")
$all_commits = ARGV.delete("--all-commits") || ARGV.delete("-A")
$dump_config = ARGV.delete("--dump-config")
$key = ARGV.delete("--key") || ARGV.delete("-k")
$show_relations = ARGV.delete("--relations") || ARGV.delete("-r")
ARGV.each { |a| abort "Error: unknown argument #{a}." if a =~ /^--/ }
## search up the path for a file
def find_file fn
while true
return fn if File.exist? fn
fn2 = File.join("..", fn)
return nil if File.expand_path(fn2) == File.expand_path(fn)
fn = fn2
end
end
want_color = `git config color.wtf`
want_color = `git config color.ui` if want_color.empty?
$color = case want_color.chomp
when "true"; true
when "auto"; $stdout.tty?
end
def red s; $color ? "\033[31m#{s}\033[0m" : s end
def green s; $color ? "\033[32m#{s}\033[0m" : s end
def yellow s; $color ? "\033[33m#{s}\033[0m" : s end
def cyan s; $color ? "\033[36m#{s}\033[0m" : s end
def grey s; $color ? "\033[1;30m#{s}\033[0m" : s end
def purple s; $color ? "\033[35m#{s}\033[0m" : s end
## the set of commits in 'to' that aren't in 'from'.
## if empty, 'to' has been merged into 'from'.
def commits_between from, to
if $long
`git log --pretty=format:"- %s [#{yellow "%h"}] (#{purple "%ae"}; %ar)" #{from}..#{to}`
else
`git log --pretty=format:"- %s [#{yellow "%h"}]" #{from}..#{to}`
end.split(/[\r\n]+/)
end
def show_commits commits, prefix=" "
if commits.empty?
puts "#{prefix} none"
else
max = $all_commits ? commits.size : $config["max_commits"]
max -= 1 if max == commits.size - 1 # never show "and 1 more"
commits[0 ... max].each { |c| puts "#{prefix}#{c}" }
puts grey("#{prefix}... and #{commits.size - max} more (use -A to see all).") if commits.size > max
end
end
def ahead_behind_string ahead, behind
[ahead.empty? ? nil : "#{ahead.size.pluralize 'commit'} ahead",
behind.empty? ? nil : "#{behind.size.pluralize 'commit'} behind"].
compact.join("; ")
end
def widget merged_in, remote_only=false, local_only=false, local_only_merge=false
left, right = case
when remote_only; %w({ })
when local_only; %w{( )}
else %w([ ])
end
middle = case
when merged_in && local_only_merge; green("~")
when merged_in; green("x")
else " "
end
print left, middle, right
end
def show b
have_both = b[:local_branch] && b[:remote_branch]
pushc, pullc, oosync = if have_both
[x = commits_between(b[:remote_branch], b[:local_branch]),
y = commits_between(b[:local_branch], b[:remote_branch]),
!x.empty? && !y.empty?]
end
if b[:local_branch]
puts "Local branch: " + green(b[:local_branch].sub(/^heads\//, ""))
if have_both
if pushc.empty?
puts "#{widget true} in sync with remote"
else
action = oosync ? "push after rebase / merge" : "push"
puts "#{widget false} NOT in sync with remote (you should #{action})"
show_commits pushc unless $short
end
end
end
if b[:remote_branch]
puts "Remote branch: #{cyan b[:remote_branch]} (#{b[:remote_url]})"
if have_both
if pullc.empty?
puts "#{widget true} in sync with local"
else
action = pushc.empty? ? "merge" : "rebase / merge"
puts "#{widget false} NOT in sync with local (you should #{action})"
show_commits pullc unless $short
end
end
end
puts "\n#{red "WARNING"}: local and remote branches have diverged. A merge will occur unless you rebase." if oosync
end
def show_relations b, all_branches
ibs, fbs = all_branches.partition { |name, br| $config["integration-branches"].include?(br[:local_branch]) || $config["integration-branches"].include?(br[:remote_branch]) }
if $config["integration-branches"].include? b[:local_branch]
puts "\nFeature branches:" unless fbs.empty?
fbs.each do |name, br|
next if $config["ignore"].member?(br[:local_branch]) || $config["ignore"].member?(br[:remote_branch])
next if br[:ignore]
local_only = br[:remote_branch].nil?
remote_only = br[:local_branch].nil?
name = if local_only
purple br[:name]
elsif remote_only
cyan br[:name]
else
green br[:name]
end
## for remote_only branches, we'll compute wrt the remote branch head. otherwise, we'll
## use the local branch head.
head = remote_only ? br[:remote_branch] : br[:local_branch]
remote_ahead = b[:remote_branch] ? commits_between(b[:remote_branch], head) : []
local_ahead = b[:local_branch] ? commits_between(b[:local_branch], head) : []
if local_ahead.empty? && remote_ahead.empty?
puts "#{widget true, remote_only, local_only} #{name} #{local_only ? "(local-only) " : ""}is merged in"
elsif local_ahead.empty?
puts "#{widget true, remote_only, local_only, true} #{name} merged in (only locally)"
else
behind = commits_between head, (br[:local_branch] || br[:remote_branch])
ahead = remote_only ? remote_ahead : local_ahead
puts "#{widget false, remote_only, local_only} #{name} #{local_only ? "(local-only) " : ""}is NOT merged in (#{ahead_behind_string ahead, behind})"
show_commits ahead unless $short
end
end
else
puts "\nIntegration branches:" unless ibs.empty? # unlikely
ibs.sort_by { |v, br| v }.each do |v, br|
next if $config["ignore"].member?(br[:local_branch]) || $config["ignore"].member?(br[:remote_branch])
next if br[:ignore]
local_only = br[:remote_branch].nil?
remote_only = br[:local_branch].nil?
name = remote_only ? cyan(br[:name]) : green(br[:name])
ahead = commits_between v, (b[:local_branch] || b[:remote_branch])
if ahead.empty?
puts "#{widget true, local_only} merged into #{name}"
else
#behind = commits_between b[:local_branch], v
puts "#{widget false, local_only} NOT merged into #{name} (#{ahead.size.pluralize 'commit'} ahead)"
show_commits ahead unless $short
end
end
end
end
#### EXECUTION STARTS HERE ####
## find config file and load it
$config = { "integration-branches" => %w(heads/master heads/next heads/edge), "ignore" => [], "max_commits" => 5 }.merge begin
fn = find_file CONFIG_FN
if fn && (h = YAML::load_file(fn)) # yaml turns empty files into false
h["integration-branches"] ||= h["versions"] # support old nomenclature
h
else
{}
end
end
if $dump_config
puts $config.to_yaml
exit
end
## first, index registered remotes
remotes = `git config --get-regexp ^remote\.\*\.url`.split(/[\r\n]+/).inject({}) do |hash, l|
l =~ /^remote\.(.+?)\.url (.+)$/ or next hash
hash[$1] ||= $2
hash
end
## next, index followed branches
branches = `git config --get-regexp ^branch\.`.split(/[\r\n]+/).inject({}) do |hash, l|
case l
when /branch\.(.*?)\.remote (.+)/
name, remote = $1, $2
hash[name] ||= {}
hash[name].merge! :remote => remote, :remote_url => remotes[remote]
when /branch\.(.*?)\.merge ((refs\/)?heads\/)?(.+)/
name, remote_branch = $1, $4
hash[name] ||= {}
hash[name].merge! :remote_mergepoint => remote_branch
end
hash
end
## finally, index all branches
remote_branches = {}
`git show-ref`.split(/[\r\n]+/).each do |l|
sha1, ref = l.chomp.split " refs/"
if ref =~ /^heads\/(.+)$/ # local branch
name = $1
next if name == "HEAD"
branches[name] ||= {}
branches[name].merge! :name => name, :local_branch => ref
elsif ref =~ /^remotes\/(.+?)\/(.+)$/ # remote branch
remote, name = $1, $2
remote_branches["#{remote}/#{name}"] = true
next if name == "HEAD"
ignore = !($all || remote == "origin")
branch = name
if branches[name] && branches[name][:remote] == remote
# nothing
else
name = "#{remote}/#{branch}"
end
branches[name] ||= {}
branches[name].merge! :name => name, :remote => remote, :remote_branch => "#{remote}/#{branch}", :remote_url => remotes[remote], :ignore => ignore
end
end
## assemble remotes
branches.each do |k, b|
next unless b[:remote] && b[:remote_mergepoint]
b[:remote_branch] = if b[:remote] == "."
b[:remote_mergepoint]
else
t = "#{b[:remote]}/#{b[:remote_mergepoint]}"
remote_branches[t] && t # only if it's still alive
end
end
show_dirty = ARGV.empty?
targets = if ARGV.empty?
[`git symbolic-ref HEAD`.chomp.sub(/^refs\/heads\//, "")]
else
ARGV.map { |x| x.sub(/^heads\//, "") }
end.map { |t| branches[t] or abort "Error: can't find branch #{t.inspect}." }
targets.each do |t|
show t
show_relations t, branches if $show_relations || t[:remote_branch].nil?
end
modified = show_dirty && `git ls-files -m` != ""
uncommitted = show_dirty && `git diff-index --cached HEAD` != ""
if $key
puts
puts KEY
end
puts if modified || uncommitted
puts "#{red "NOTE"}: working directory contains modified files." if modified
puts "#{red "NOTE"}: staging area contains staged but uncommitted files." if uncommitted
# the end!

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
keyid=YOUR_KEY_ID_GOES_HERE
gpgconf --kill gpg-agent
cd "$(gpgconf --list-dirs homedir)/private-keys-v1.d"
gpg -K --with-keygrip --with-colons "$keyid" | \
awk -F: '/^grp/ { print $10".key"; }' | \
xargs rm -vf
gpg-connect-agent "scd serialno" "learn --force" /bye

8
bin/executable_headers Normal file
View file

@ -0,0 +1,8 @@
#!/bin/sh
#
# https://github.com/rtomayko/dotfiles/blob/rtomayko/bin/headers
curl -sv "$@" 2>&1 >/dev/null |
grep -v "^\*" |
grep -v "^}" |
cut -c3-

440
bin/executable_osx Normal file
View file

@ -0,0 +1,440 @@
#!/usr/bin/env bash
# Mac OS X configuration
#
# This configuration applies to the latest version of Mac OS X (currently
# 10.10.1), and sets up preferences and configurations for all the built-in
# services and apps. Third-party app config should be done elsewhere.
#
# Options:
# --no-restart: Don't restart any apps or services after running the script.
#
# @see: http://secrets.blacktree.com/?showapp=com.apple.finder
#
# @author Jeff Geerling, 2014
# Warn that some commands will not be run if the script is not run as root.
if [[ $EUID -ne 0 ]]; then
RUN_AS_ROOT=false
printf "Certain commands will not be run without sudo privileges. To run as root, run the same command prepended with 'sudo', for example: $ sudo $0\n\n" | fold -s -w 80
else
RUN_AS_ROOT=true
# Update existing `sudo` timestamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
fi
###############################################################################
# General UI/UX #
###############################################################################
# Set standby delay to 24 hours (default is 1 hour)
# You can check current values with `pmset -g`.
#if [[ "$RUN_AS_ROOT" = true ]]; then
# sudo pmset -a standbydelay 86400
#fi
## Disable system sleep (helpful if you're usually plugged into mains power).
#if [[ "$RUN_AS_ROOT" = true ]]; then
# sudo pmset -a sleep 0
#fi
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Save to disk (not to iCloud) by default
#defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Reveal IP address, hostname, OS version, etc. when clicking the clock
# in the login window
if [[ "$RUN_AS_ROOT" = true ]]; then
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
fi
# Restart automatically if the computer freezes
if [[ "$RUN_AS_ROOT" = true ]]; then
systemsetup -setrestartfreeze on
fi
# Disable Notification Center
# launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
# To re-enable, run:
# launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist && open /System/Library/CoreServices/NotificationCenter.app/
# Disable game center. Who uses that thing?
launchctl unload /System/Library/LaunchAgents/com.apple.gamed.plist 2> /dev/null
# Disable smart quotes as theyre annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes as theyre annoying when typing code
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Set background to dark-grey color
#sqlite3 ~/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '/Library/Desktop Pictures/Solid Colors/Solid Gray Dark.png'"
###############################################################################
# SSD-specific tweaks #
###############################################################################
if [[ "$RUN_AS_ROOT" = true ]]; then
# Disable local Time Machine snapshots
# sudo tmutil disablelocal
# Disable hibernation (speeds up entering sleep mode)
sudo pmset -a hibernatemode 0
# Remove the sleep image file to save disk space
#sudo rm /Private/var/vm/sleepimage
# Create a zero-byte file instead...
#sudo touch /Private/var/vm/sleepimage
# ...and make sure it cant be rewritten
#sudo chflags uchg /Private/var/vm/sleepimage
# Disable the sudden motion sensor as its not useful for SSDs
sudo pmset -a sms 0
fi
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# Trackpad: map bottom right corner to right-click
#defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
#defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
#defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
#defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
# Increase sound quality for Bluetooth headphones/headsets
# defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs - 0 = text boxes and lists, 2/3 = all controls)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 0
# Use scroll gesture with the Ctrl (^) modifier key to zoom
#defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
#defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in
#defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate, and make it happen more quickly.
defaults write NSGlobalDomain InitialKeyRepeat -int 20
defaults write NSGlobalDomain KeyRepeat -int 1
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
###############################################################################
# Screen #
###############################################################################
# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Save screenshots to the desktop
#defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Enable subpixel font rendering on non-Apple LCDs
defaults write NSGlobalDomain AppleFontSmoothing -int 2
# Enable HiDPI display modes (requires restart)
# if [[ "$RUN_AS_ROOT" = true ]]; then
# sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
# fi
###############################################################################
# Finder #
###############################################################################
# Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
defaults write com.apple.finder NewWindowTarget -string "PfDe"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Finder: show path bar
# defaults write com.apple.finder ShowPathbar -bool true
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Enable spring loading for directories
defaults write NSGlobalDomain com.apple.springing.enabled -bool true
# Remove the spring loading delay for directories
defaults write NSGlobalDomain com.apple.springing.delay -float 0.1
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
# Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Set the size of icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
# Use column view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `Nlsv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "clmv"
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Empty Trash securely by default
# defaults write com.apple.finder EmptyTrashSecurely -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
# Remove Dropboxs green checkmark icons in Finder
# file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
# [ -e "${file}" ] && mv -f "${file}" "${file}.bak"
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Preview -bool false \
Privileges -bool true
###############################################################################
# Dock, Dashboard, and hot corners #
###############################################################################
# Set the icon size of Dock items
defaults write com.apple.dock tilesize -int 30
# Enable spring loading for all Dock items
# defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
# Dont animate opening applications from the Dock
# defaults write com.apple.dock launchanim -bool false
# Speed up Mission Control animations
defaults write com.apple.dock expose-animation-duration -float 0.15
# Dont group windows by application in Mission Control
# (i.e. switch to old Exposé behavior)
# defaults write com.apple.dock expose-group-by-app -bool false
# Remove the auto-hiding Dock delay
defaults write com.apple.dock autohide-delay -float 0
# Remove the animation when hiding/showing the Dock
# defaults write com.apple.dock autohide-time-modifier -float 0
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Enable the 'reduce transparency' option on Yosemite. Save GPU cycles.
defaults write com.apple.universalaccess reduceTransparency -bool true
# Add iOS Simulator to Applications folder.
if [[ "$RUN_AS_ROOT" = true ]]; then
sudo ln -sf /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app /Applications/Simulator.app
fi
# Hot corners
# Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
# Bottom right screen corner → Mission Control
#defaults write com.apple.dock wvous-br-corner -int 2
#defaults write com.apple.dock wvous-br-modifier -int 0
# Top right screen corner → Put display to sleep
#defaults write com.apple.dock wvous-tr-corner -int 10
#defaults write com.apple.dock wvous-tr-modifier -int 0
# Bottom left screen corner → Desktop
#defaults write com.apple.dock wvous-bl-corner -int 4
#defaults write com.apple.dock wvous-bl-modifier -int 0
###############################################################################
# Safari & WebKit #
###############################################################################
# Set Safaris home page to `about:blank` for faster loading
defaults write com.apple.Safari HomePage -string "about:blank"
# Prevent Safari from opening safe files automatically after downloading
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
# Disable Safaris thumbnail cache for History and Top Sites
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
# Enable Safaris debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
###############################################################################
# Mail #
###############################################################################
# Disable send and reply animations in Mail.app
defaults write com.apple.mail DisableReplyAnimations -bool true
defaults write com.apple.mail DisableSendAnimations -bool true
# Copy email addresses as `foo@example.com` instead of `Foo Bar <foo@example.com>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Add the keyboard shortcut ⌘ + Enter to send an email in Mail.app
# defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" -string "@\\U21a9"
# Display emails in threaded mode
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
# defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
# defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
# Disable inline attachments (just show the icons)
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
# Disable spell checking
defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled"
###############################################################################
# Spotlight #
###############################################################################
if [[ "$RUN_AS_ROOT" = true ]]; then
# Disable Spotlight indexing for any volume that gets mounted and has not yet
# been indexed before.
# Use `sudo mdutil -i off "/Volumes/foo"` to stop indexing any volume.
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
# Restart spotlight
killall mds > /dev/null 2>&1
fi
###############################################################################
# Terminal #
###############################################################################
# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4
# For Terminal theme, see: https://github.com/geerlingguy/mac-dev-playbook
###############################################################################
# Activity Monitor #
###############################################################################
# Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# Visualize CPU usage in the Activity Monitor Dock icon
defaults write com.apple.ActivityMonitor IconType -int 5
# Show all processes in Activity Monitor
defaults write com.apple.ActivityMonitor ShowCategory -int 0
###############################################################################
# TextEdit #
###############################################################################
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# Open and save files as UTF-8 in TextEdit
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
###############################################################################
# Messages #
###############################################################################
# Disable automatic emoji substitution (i.e. use plain text smileys)
# defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes as its annoying for messages that contain code
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
# Disable continuous spell checking
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
###############################################################################
# Google Chrome #
###############################################################################
# Enable sensitive and senseless swipe-based navigation
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool true
# Use the system print dialog
defaults write com.google.Chrome DisablePrintPreview -bool true
###############################################################################
# Kill/restart affected applications #
###############################################################################
# Restart affected applications if `--no-restart` flag is not present.
if [[ ! ($* == *--no-restart*) ]]; then
for app in "cfprefsd" "Dock" "Finder" "Mail" "SystemUIServer" "Terminal"; do
killall "${app}" > /dev/null 2>&1
done
fi
printf "Please log out and log back in to make all settings take effect.\n"

89
bin/executable_spark Normal file
View file

@ -0,0 +1,89 @@
#!/usr/bin/env bash
#
# spark
# https://github.com/holman/spark
#
# Generates sparklines for a set of data.
#
# Here's a a good web-based sparkline generator that was a bit of inspiration
# for spark:
#
# https://datacollective.org/sparkblocks
#
# spark takes a comma-separated list of data and then prints a sparkline out of
# it.
#
# Examples:
#
# spark 1 5 22 13 53
# # => ▁▁▃▂▇
#
# spark 0 30 55 80 33 150
# # => ▁▂▃▅▂▇
#
# spark -h
# # => Prints the spark help text.
# Generates sparklines.
#
# $1 - The data we'd like to graph.
spark()
{
local n numbers=
# find min/max values
local min=0xffffffff max=0
for n in ${@//,/ }
do
# on Linux (or with bash4) we could use `printf %.0f $n` here to
# round the number but that doesn't work on OS X (bash3) nor does
# `awk '{printf "%.0f",$1}' <<< $n` work, so just cut it off
n=${n%.*}
(( n < min )) && min=$n
(( n > max )) && max=$n
numbers=$numbers${numbers:+ }$n
done
# print ticks
local ticks=(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)
local f=$(( (($max-$min)<<8)/(${#ticks[@]}-1) ))
(( f < 1 )) && f=1
for n in $numbers
do
echo -n ${ticks[$(( ((($n-$min)<<8)/$f) ))]}
done
echo
}
# If we're being sourced, don't worry about such things
if [ "$BASH_SOURCE" == "$0" ]; then
# Prints the help text for spark.
help()
{
cat <<EOF
USAGE:
spark [-h] VALUE,...
EXAMPLES:
spark 1 5 22 13 53
▁▁▃▂█
spark 0,30,55,80,33,150
▁▂▃▄▂█
echo 9 13 5 17 1 | spark
▄▆▂█▁
EOF
}
# show help for no arguments if stdin is a terminal
if { [ -z "$1" ] && [ -t 0 ] ; } || [ "$1" == '-h' ]
then
help
exit 0
fi
spark ${@:-`cat`}
fi

311
bin/executable_st Normal file
View file

@ -0,0 +1,311 @@
#!perl -T
use strict;
use warnings;
use bignum;
use Getopt::Long;
use Pod::Usage;
my %opt;
GetOptions(
\%opt,
# functions
'N|n|count',
'max',
'mean|avg|m',
'median',
'min',
'mode',
'percentile=i',
'quartile=i',
'sd|stdev',
'sum|s',
'variance|var',
# predefined sets
'summary|five',
'complete|all',
'default|basic',
# output control
'delimiter|d=s',
'format|fmt|f=s',
'no-header|nh',
'transverse-output|to',
'quiet|q',
'help|h',
) or pod2usage(1);
my %predefined = (
complete => [ qw/N min q1 median q3 max sum mean sd var percentile quartile mode/ ],
summary => [ qw/min q1 median q3 max/ ],
default => [ qw/N min max sum mean sd/ ],
);
pod2usage(1) if $opt{help};
my ($min,$max);
my ($n, $sum, $sum_square, $mean) = (0, 0, 0, 0);
my (%count, $most_common);
# some functions require the full dataset
my @data;
my $keep_data = (
defined $opt{median}
|| defined $opt{percentile}
|| defined $opt{quartile}
|| defined $opt{summary}
|| defined $opt{complete}
);
# some functions require frequencies
my $keep_frequencies = (
defined $opt{mode}
);
my $M2 = 0;
# read data
while (my $num = <>) {
chomp $num;
if ($num !~ m{^
[+-]?
(?: \. ? [0-9]+
| [0-9]+ \. [0-9]*
| \. ? [0-9]+ E [+-]? [0-9]+
| [0-9]* \. [0-9]+ E [+-]? [0-9]+
)
$}x) {
warn "Invalid number '$num'\n" unless $opt{quiet};
next;
}
$n++;
my $delta = $num - $mean;
$mean += $delta / $n;
$M2 += $delta * ($num - $mean);
if ($keep_data) {
push @data, $num;
}
if ($keep_frequencies) {
$count{$num}++;
$most_common = $count{$num} if (!defined $most_common or $count{$num} > $most_common);
}
$min = $num if (!defined $min or $num < $min);
$max = $num if (!defined $max or $num > $max);
$sum += $num;
}
# silently exit if $n == 0
exit if (!$n);
my ( %summary, $percentile, $quartile, $median );
if ( $opt{summary} or $opt{complete} ) {
my ($q1, $q2, $q3) = percentiles(\@data, 25, 50, 75);
%summary = (
min => $min,
q1 => $q1,
median => $q2,
q3 => $q3,
max => $max,
);
} elsif (defined $opt{percentile}) {
($percentile) = percentiles( \@data, $opt{percentile} );
} elsif (defined $opt{quartile}) {
die "Invalid quartile\n" if $opt{quartile} < 0 or $opt{quartile} > 4;
($quartile) = percentiles( \@data, $opt{quartile} * 25 );
} elsif (defined $opt{median}) {
($median) = percentiles( \@data, 50 );
}
my $variance = $n > 1 ? $M2 / ($n - 1) : undef;
my $sd = defined $variance ? sqrt($variance) : undef;
my @mode = grep { $count{$_} == $most_common } keys %count;
my $mode = scalar @mode == 1 ? $mode[0] : undef; # don't deal with multimodes
my %st = (
N => $n,
max => $max,
mean => $mean,
median => $median,
min => $min,
mode => $mode,
percentile => $percentile,
quartile => $quartile,
sd => $sd,
sum => $sum,
variance => $variance,
%summary,
);
my $delimiter = delete $opt{'delimiter'} || "\t";
my $format = delete $opt{'format'} || '%.2f';
my $no_header = delete $opt{'no-header'};
my $transverse = delete $opt{'transverse-output'};
my $quiet = delete $opt{'quiet'};
if ($delimiter =~ /^\\[a-z]$/) {
$delimiter = $delimiter eq '\t' ? "\t"
: $delimiter eq '\n' ? "\n"
: die "Invalid delimiter: '$delimiter'\n";
}
if ($format =~ m{( \%[0-9]*\.?[0-9]* [deEfgGi] )}x) {
$format = $1;
} else {
die "Invalid format: '$format'\n";
}
my @opt = !%opt || $opt{default} ? @{ $predefined{default} }
: $opt{complete} ? @{ $predefined{complete} }
: $opt{summary} ? @{ $predefined{summary} }
: grep { defined $opt{$_} } @{ $predefined{complete} };
@opt = grep { defined $st{$_} } @opt;
if (scalar @opt == 1) {
print "$st{$opt[0]}\n";
exit;
}
if ($transverse) {
for my $opt (@opt) {
print "$opt$delimiter" unless $no_header;
print sprintf( $format, $st{$opt} ), "\n";
}
} else {
print join($delimiter, @opt), "\n" unless $no_header;
print join($delimiter, map { sprintf ($format, $st{$_}) } @opt), "\n";
}
exit;
###
sub percentiles {
my ($data, @p) = @_;
my @data = sort { $a <=> $b } @{$data};
my @percentiles = ();
for my $p (@p) {
if ($p < 0 or $p > 100) {
die "Invalid percentile ($p)\n";
}
my $index = $p * $#data / 100;
my $percentile = $index == int($index) ? $data[$index]
: ($data[$index] + $data[$index+1]) / 2;
push @percentiles, $percentile;
}
return @percentiles;
}
__END__
=head1 NAME
st - statistics from the command line interface (CLI)
=head1 DESCRIPTION
"st" is a command-line tool to calculate statistics from a file or
standard input.
=head1 USAGE
st <input_file>
st [options] <input_file>
=head2 OPTIONS
If no options are used, C<st> will print:
n min max sum mean sd
The following options are available:
=head2 OUTPUT
--N|n|count
--max
--mean|avg|m
--median
--min
--mode
--sd|stdev
--sum|s
--variance|var
--percentile=<0..100>
--quartile=<1..3>
--summary # five-number summary: min q1 median q3 max
--complete # everything
=head2 FORMAT
--delimiter|d=<value> # default: "\t"
--format|fmt|f=<value> # default: "%.2f"
--no-header|nh # don't display header
--transverse-output|to # output in multiple lines
--quiet|q # silently skip invalid input
=head2 EXAMPLES
st
st --summary
st --complete
st --complete --transverse-output
st --no-header --delimiter='\n' --format='%.1e'
=head1 AUTHOR
Nelson Ferraz L<<nferraz@gmail.com>>
=head1 CONTRIBUTORS
imurray, who suggested a different algorithm for calculating variance.
asgeirn, who suggested a input filter and helped to remove some
warnings.
gabeguz, who modified the script to make it more portable.
Send comments, suggestions and bug reports to:
https://github.com/nferraz/st/issues
Or fork the code on github:
https://github.com/nferraz/st
=head1 COPYRIGHT
Copyright (c) 2013 Nelson Ferraz.
This program is free software; you can redistribute it and/or modify
it under the MIT License (see LICENSE).

1
dot_age/key.txt.tmpl Normal file
View file

@ -0,0 +1 @@
{{- onepasswordDocument "bjcozi7gxox7m4feoul5wty4ua" -}}

0
dot_aws/.keep Normal file
View file

View file

@ -0,0 +1,7 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBVeW1lQW8rNFpMVWdZYlds
NTNMc3NKOVE2NERobjMxYmphTDFPeTIzUWdRClQxZFhJNFNvUVBobXU5cHNkdnMv
aWw5UjNRcU1aQ3pQTmYwR1haclNqcFUKLS0tIDR4YkRsemd0cTdpSG0rWnRSVkFv
b3J4ZEtjTXptMjBhVTVucFhiNW9BeXMK8upcO6jVUo18xpN0iQOo/Qpl1vxj54Zj
fzyKgUttG2tyAbcXSEH1+L3qlnzqXR2ThuYiw8ZK5egkLXZLoy0rCQ==
-----END AGE ENCRYPTED FILE-----

View file

@ -0,0 +1,9 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA2ckJpR21wcjhmV1VqYkxk
TTZHcEVzK0VucUdUeE1iNlR3K3NLY0dhOEJzCkFmc0JUcmpWbHB2TDVMWGo5RHpo
Wk02bkErbWQxcWNma3pkeExBalhaOHcKLS0tIG1rUWhXQWwxVDA2SVIyZ1V3YkRx
OFF6UHdtQ21IOVU3dDhQMUdOVmpaeEEK817/EyAoPv208K0jA+UzrySIrPlnV36H
edkavkJL3evQP/mD7f5TpSzQEXU7Hppv4UnHaPkgCFzlLbuhhwhTWkoba32RmZ3J
1Ao7HhZglUcCiGoIX7llKoEr1qNwgsopSSr0iz9DC1dd7rD+UnWiZKwkRS4FNJV3
WUteprvZlZ3ynAKqUjBbtA2Hapql11EhwkFyog==
-----END AGE ENCRYPTED FILE-----

146
dot_config/git/config.tmpl Normal file
View file

@ -0,0 +1,146 @@
[user]
name = Oliver Weyhmueller
email = {{ (onepasswordDetailsFields "5o2mjxzzjyullqhdjxjgua2jie" .work_vault).username.value }}
signingkey = 2ECE9419860C7C3CD1C65D2A5286794099F934A3
[core]
excludesfile = ~/.config/git/ignore
autocrlf = input
attributesfile = ~/config/git/attributes
whitespace = space-before-tab,tab-in-indent,trailing-space,tabwidth=2
pager =
mergeoptions = --no-edit
commitGraph = true
[credential]
[gpg "x509"]
program = smimesign
[diff]
algorithm = histogram
renames = copies
[difftool]
prompt = false
[merge]
log = true
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[init]
defaultBranch = main
[commit]
gpgsign = true
[fetch]
prune = true
[pull]
rebase = true
[push]
default = upstream
[rebase]
autoStash = true
[color]
branch = auto
diff = auto
status = auto
[format]
pretty = %Cblue%h%Creset %Cgreen[%ar]%Creset (%an) %s
[apply]
whitespace = fix
[help]
autocorrect = 20
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
ci = commit -v
create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' -
delete-branch = !sh -c 'git push origin :refs/heads/$1 && git remote prune origin && git branch -D $1' -
merge-branch = !git checkout master && git merge @{-1} --ff-only
rebase-origin = !git fetch origin && git rebase origin/master
show-graph = log --graph --abbrev-commit --pretty=oneline
all = add -A
amend = commit --amend -C HEAD
credit = commit --amend --author "$1 <$2>" -C HEAD
delete-local-merged = branch -d `git branch --merged | grep -v '^*' | grep -v 'master'| tr -d '\n'`
promote = !~/bin/git-promote
rank-contributers = !~/bin/git-rank-contributers
undo = reset --soft HEAD^
wtf = !~/bin/git-wtf
browse = !hub browse
w = !hub browse
compare = !hub compare
cia = !git add -A && git commit -av
s = status -s
p = !"git pull; git submodule foreach git pull origin master"
remotes = remote -v
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
le = log --oneline --decorate
filelog = log -u
fl = log -u
dl = "!git ll -1"
dlc = diff --cached HEAD^
dr = "!f() { git diff "$1"^.."$1"; }; f"
lc = "!f() { git ll "$1"^.."$1"; }; f"
diffr = "!f() { git diff "$1"^.."$1"; }; f"
f = "!git ls-files | grep -i"
grep = grep -Ii
gr = grep -Ii
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f"
la = "!git config -l | grep alias | cut -c 7-"
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
assumeall = "!git st -s | awk {'print $2'} | xargs git assume"
lasttag = describe --tags --abbrev=0
lt = describe --tags --abbrev=0
ours = "!f() { git co --ours $@ && git add $@; }; f"
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
diff = diff --word-diff
dc = diff --cached
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
svnr = svn rebase
svnd = svn dcommit
svnl = svn log --oneline --show-commit
sl = stash list
sa = stash apply
ss = stash save
# Operating System dependent settings
{{ if eq .chezmoi.os "darwin" }}
[core]
trustctime = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[merge]
tool = Kaleidoscope
[credential]
helper = osxkeychain
{{ end }}
{{ if eq .chezmoi.os "linux" }}
[credential]
helper = store
{{ end }}

View file

@ -0,0 +1 @@
# This file is not to be synced

352
dot_config/git/ignore Normal file
View file

@ -0,0 +1,352 @@
# Created by https://www.toptal.com/developers/gitignore/api/windows,macos,linux,vim,visualstudiocode,jetbrains+all,hugo,java,homebrew,git,gradle,maven,microsoftoffice,ssh,vagrant,certificates
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,macos,linux,vim,visualstudiocode,jetbrains+all,hugo,java,homebrew,git,gradle,maven,microsoftoffice,ssh,vagrant,certificates
### certificates ###
*.pem
*.key
*.crt
*.cer
*.der
*.priv
### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig
# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt
### Homebrew ###
Brewfile.lock.json
### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# Temporary lock file while building
/.hugo_build.lock
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### JetBrains+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
.idea/*
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
*.iml
modules.xml
.idea/misc.xml
*.ipr
# Sonarlint plugin
.idea/sonarlint
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
### MicrosoftOffice ###
*.tmp
# Word temporary
~$*.doc*
# Word Auto Backup File
Backup of *.doc*
# Excel temporary
~$*.xls*
# Excel Backup File
*.xlk
# PowerPoint temporary
~$*.ppt*
# Visio autosave temporary files
*.~vsd*
### SSH ###
**/.ssh/id_*
**/.ssh/*_id_*
**/.ssh/known_hosts
### Vagrant ###
# General
.vagrant/
# Log files (if you are creating logs in debug mode, uncomment this)
# *.log
### Vagrant Patch ###
*.box
### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
# Support for Project snippet scope
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
### Gradle ###
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### Gradle Patch ###
**/build/
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,vim,visualstudiocode,jetbrains+all,hugo,java,homebrew,git,gradle,maven,microsoftoffice,ssh,vagrant,certificates

View file

@ -1,111 +0,0 @@
[user]
name = Oliver Weyhmueller
email = oliver@weyhmueller.de
username = weyhmueller
signingkey = 2ECE9419860C7C3CD1C65D2A5286794099F934A3
[mergetool]
keepBackup = true
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[merge]
tool = Kaleidoscope
[init]
defaultBranch = main
[commit]
gpgsign = true
[push]
default = tracking
[color]
branch = auto
diff = auto
status = auto
[format]
pretty = %Cblue%h%Creset %Cgreen[%ar]%Creset (%an) %s
[merge]
log = true
[apply]
whitespace = fix
[alias]
ci = commit -v
create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' -
delete-branch = !sh -c 'git push origin :refs/heads/$1 && git remote prune origin && git branch -D $1' -
merge-branch = !git checkout master && git merge @{-1} --ff-only
rebase-origin = !git fetch origin && git rebase origin/master
show-graph = log --graph --abbrev-commit --pretty=oneline
all = add -A
amend = commit --amend -C HEAD
credit = commit --amend --author "$1 <$2>" -C HEAD
delete-local-merged = branch -d `git branch --merged | grep -v '^*' | grep -v 'master'| tr -d '\n'`
promote = !~/bin/git-promote
rank-contributers = !~/bin/git-rank-contributers
undo = reset --soft HEAD^
wtf = !~/bin/git-wtf
browse = !hub browse
w = !hub browse
compare = !hub compare
cia = !git add -A && git commit -av
s = status -s
p = !"git pull; git submodule foreach git pull origin master"
remotes = remote -v
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
le = log --oneline --decorate
filelog = log -u
fl = log -u
dl = "!git ll -1"
dlc = diff --cached HEAD^
dr = "!f() { git diff "$1"^.."$1"; }; f"
lc = "!f() { git ll "$1"^.."$1"; }; f"
diffr = "!f() { git diff "$1"^.."$1"; }; f"
f = "!git ls-files | grep -i"
grep = grep -Ii
gr = grep -Ii
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f"
la = "!git config -l | grep alias | cut -c 7-"
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
assumeall = "!git st -s | awk {'print $2'} | xargs git assume"
lasttag = describe --tags --abbrev=0
lt = describe --tags --abbrev=0
ours = "!f() { git co --ours $@ && git add $@; }; f"
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
diff = diff --word-diff
dc = diff --cached
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
svnr = svn rebase
svnd = svn dcommit
svnl = svn log --oneline --show-commit
sl = stash list
sa = stash apply
ss = stash save
[core]
excludesfile = ~/.gitignore
autocrlf = input
attributesfile = ~/.gitattributes
# Treat spaces before tabs, lines that are indented with 8 or more spaces, and all kinds of trailing whitespace as an error
whitespace = space-before-tab,indent-with-non-tab,trailing-space
pager =
[gpg "x509"]
program = smimesign
#[gpg]
# program = /usr/local/bin/gpg

View file

@ -1,13 +0,0 @@
*.DS_Store
*.sw[nop]
.bundle
.sass-cache/
db/*.sqlite3
log/*.log
rerun.txt
tags
tmp/**/*
!tmp/cache/.keep
vendor/bundler_gems
vim/.netrwhist
zeus.json

View file

@ -70,11 +70,13 @@
haskell_stack # haskell version from stack (https://haskellstack.org/) haskell_stack # haskell version from stack (https://haskellstack.org/)
kubecontext # current kubernetes context (https://kubernetes.io/) kubecontext # current kubernetes context (https://kubernetes.io/)
terraform # terraform workspace (https://www.terraform.io) terraform # terraform workspace (https://www.terraform.io)
# terraform_version # terraform version (https://www.terraform.io)
aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
gcloud # google cloud cli account and project (https://cloud.google.com/) gcloud # google cloud cli account and project (https://cloud.google.com/)
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
toolbox # toolbox name (https://github.com/containers/toolbox)
context # user@hostname context # user@hostname
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger) ranger # ranger shell (https://github.com/ranger/ranger)
@ -85,7 +87,7 @@
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
# vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vi_mode # vi mode (you don't need this if you've enabled prompt_char)
vpn_ip # virtual private network indicator vpn_ip # virtual private network indicator
# load # CPU load load # CPU load
disk_usage # disk usage disk_usage # disk usage
# ram # free RAM # ram # free RAM
# swap # used swap # swap # used swap
@ -357,7 +359,7 @@
# Formatter for Git status. # Formatter for Git status.
# #
# Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42. # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
# #
# You can edit the function to customize how Git status looks. # You can edit the function to customize how Git status looks.
# #
@ -1284,10 +1286,20 @@
typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=232 typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=232
# typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
#############[ terraform_version: terraform version (https://www.terraform.io) ]##############
# Terraform version color.
typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4
typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0
# Custom icon.
# typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]#################
typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf'
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
# Show kubecontext only when the the command you are typing invokes one of these tools. # Show kubecontext only when the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show kubecontext. # Tip: Remove the next line to always show kubecontext.
typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|fluxctl|stern' typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern'
# Kubernetes context classes for the purpose of using different colors, icons and expansions with # Kubernetes context classes for the purpose of using different colors, icons and expansions with
# different contexts. # different contexts.
@ -1374,7 +1386,7 @@
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at '
#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
# Show aws only when the the command you are typing invokes one of these tools. # Show aws only when the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show aws. # Tip: Remove the next line to always show aws.
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt'
@ -1423,7 +1435,7 @@
# typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
# Show azure only when the the command you are typing invokes one of these tools. # Show azure only when the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show azure. # Tip: Remove the next line to always show azure.
typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'
# Azure account name color. # Azure account name color.
@ -1433,9 +1445,9 @@
# typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐'
##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
# Show gcloud only when the the command you are typing invokes one of these tools. # Show gcloud only when the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show gcloud. # Tip: Remove the next line to always show gcloud.
typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil'
# Google cloud color. # Google cloud color.
typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7
typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4
@ -1475,7 +1487,7 @@
# typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
#[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
# Show google_app_cred only when the the command you are typing invokes one of these tools. # Show google_app_cred only when the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show google_app_cred. # Tip: Remove the next line to always show google_app_cred.
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'
@ -1529,6 +1541,17 @@
# Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'.
typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]###############
# Toolbox color.
typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0
typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3
# Don't display the name of the toolbox if it matches fedora-toolbox-*.
typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}'
# Custom icon.
# typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in '
###############################[ public_ip: public IP address ]############################### ###############################[ public_ip: public IP address ]###############################
# Public IP color. # Public IP color.
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7

View file

@ -1,3 +1,4 @@
{{ range (gitHubKeys "weyhmueller") -}} {{ range (gitHubKeys "weyhmueller") -}}
{{ .Key }} {{ .Key }}
{{ end -}} {{ end -}}
command="/usr/bin/check_mk_agent" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFgOgaCRLxAsxPkMK4lgQKSzyHZYKvAL0Yq6UHDCYaXw cmk@checkmk

View file

@ -1,2 +1,2 @@
set show-date = no set main-view-date-display = relative-compact
set author-width = 3 set main-view-author-width = 5

View file

@ -1,10 +1,3 @@
#
# tmux configuration
# Version: 1.0
# Date: 2021-02-21 19:32:35 +0100
#
# Copyright 2021, Oliver Weyhmueller <oliver@weyhmueller.de>
#new-session -A -t 0 #new-session -A -t 0
set -g prefix C-a set -g prefix C-a
unbind C-b unbind C-b

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

90
dot_zshsyntax Normal file
View file

@ -0,0 +1,90 @@
# Dracula Theme (for zsh-syntax-highlighting)
#
# https://github.com/zenorocha/dracula-theme
#
# Copyright 2021, All rights reserved
#
# Code licensed under the MIT license
# http://zenorocha.mit-license.org
#
# @author George Pickering <@bigpick>
# @author Zeno Rocha <hi@zenorocha.com>
# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor)
typeset -gA ZSH_HIGHLIGHT_STYLES
# Default groupings per, https://spec.draculatheme.com, try to logically separate
# possible ZSH_HIGHLIGHT_STYLES settings accordingly...?
#
# Italics not yet supported by zsh; potentially soon:
# https://github.com/zsh-users/zsh-syntax-highlighting/issues/432
# https://www.zsh.org/mla/workers/2021/msg00678.html
# ... in hopes that they will, labelling accordingly with ,italic where appropriate
#
# Main highlighter styling: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md
#
## General
### Diffs
### Markup
## Classes
## Comments
ZSH_HIGHLIGHT_STYLES[comment]='fg=#6272A4'
## Constants
## Entitites
## Functions/methods
ZSH_HIGHLIGHT_STYLES[alias]='fg=#50FA7B'
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=#50FA7B'
ZSH_HIGHLIGHT_STYLES[global-alias]='fg=#50FA7B'
ZSH_HIGHLIGHT_STYLES[function]='fg=#50FA7B'
ZSH_HIGHLIGHT_STYLES[command]='fg=#50FA7B'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=#50FA7B,underline'
ZSH_HIGHLIGHT_STYLES[autodirectory]='fg=#FFB86C,italic'
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=#FFB86C'
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=#FFB86C'
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=#BD93F9'
## Keywords
## Built ins
ZSH_HIGHLIGHT_STYLES[builtin]='fg=#8BE9FD'
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#8BE9FD'
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#8BE9FD'
## Punctuation
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#FF79C6'
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]='fg=#FF79C6'
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=#FF79C6'
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=#FF79C6'
## Serializable / Configuration Languages
## Storage
## Strings
ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]='fg=#F1FA8C'
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]='fg=#F1FA8C'
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#F1FA8C'
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]='fg=#FF5555'
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#F1FA8C'
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]='fg=#FF5555'
ZSH_HIGHLIGHT_STYLES[rc-quote]='fg=#F1FA8C'
## Variables
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]='fg=#FF5555'
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[assign]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[named-fd]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#F8F8F2'
## No category relevant in spec
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#FF5555'
ZSH_HIGHLIGHT_STYLES[path]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#FF79C6'
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#FF79C6'
ZSH_HIGHLIGHT_STYLES[globbing]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#BD93F9'
#ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?'
#ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]='fg=?'
#ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=?'
#ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]='fg=?'
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]='fg=#FF5555'
ZSH_HIGHLIGHT_STYLES[redirection]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[arg0]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[cursor]='standout'