Compare commits

...

17 Commits

Author SHA1 Message Date
Ismo Vuorinen
0f87411f65 install.sh chmod 2022-12-06 15:42:24 +02:00
Ismo Vuorinen
af461e7234 rcrc, conditional zshrc, allowed_signers 2022-12-06 15:39:59 +02:00
Ismo Vuorinen
5af773f931 SSH signing, wtf config, editorconfig, updates 2022-12-05 10:15:37 +02:00
Ismo Vuorinen
976c0580f0 Removed keybase 2022-12-05 08:29:47 +02:00
Ismo Vuorinen
0fd327ab9e Update install.sh 2022-12-04 20:15:24 +02:00
Ismo Vuorinen
221777dde0 Brewfile update, add .gitignore
`brew bundle dump -f ~/.dotfiles/Brewfile --describe`
2022-12-04 20:12:48 +02:00
Ismo Vuorinen
1dc430850d Indent with spaces 2022-11-22 13:05:37 +02:00
Ismo Vuorinen
209b54e15b Moved git config to .config/git 2022-11-22 13:02:56 +02:00
Ismo Vuorinen
b15f412107 Added Ruby Gems bin to path 2022-11-22 12:46:06 +02:00
Ismo Vuorinen
28ecb02549 Added command for updating Brewfile 2022-11-21 16:37:07 +02:00
Ismo Vuorinen
e18785eaa7 Add README.md 2022-11-21 16:33:37 +02:00
Ismo Vuorinen
ef6d004f71 gitconfig, zshrc, install.sh, git_profiles 2022-11-16 15:34:44 +02:00
50cd1d17e6 Update Brewfile
removed openfortivpn, terraform@0.12, reviewdog, codeclimate, midnight-commander, qcachegrind
2022-11-14 15:32:54 +02:00
Ismo Vuorinen
b139ff6136 Added brew to path 2022-11-11 05:05:42 +02:00
Ismo Vuorinen
fd6f59706b x-open-ports helper script 2022-09-21 15:28:10 +03:00
4edca57eea rcm install script
env RCRC=/dev/null rcup -B 0 -g > install.sh
2022-09-21 01:42:45 +03:00
26dbcedf1b Updated Brewfile 2022-09-21 01:32:11 +03:00
17 changed files with 713 additions and 151 deletions

27
.editorconfig Normal file
View File

@@ -0,0 +1,27 @@
root = true
[*]
charset = utf-8
end_of_line = lf
# indent_size = 4
indent_style = space
insert_final_newline = true
# max_line_length = 160
# tab_width = 4
trim_trailing_whitespace = true
[{*.yaml,*.yml}]
indent_size = 2
[*.sh]
indent_style = space
indent_size = 2
tab_width = 2
shell_variant = posix # like -ln=posix
binary_next_line = true # like -bn
switch_case_indent = true # like -ci
space_redirects = true # like -sr
keep_padding = false # like -kp
function_next_line = false # like -fn
never_split = true # like -ns

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
Brewfile.lock.json

226
Brewfile
View File

@@ -1,6 +1,7 @@
tap "1password/tap"
tap "anchore/grype"
tap "codeclimate/formulae"
tap "ddosify/tap"
tap "dm3ch/tap"
tap "gesquive/tap"
tap "github/gh"
tap "homebrew/autoupdate"
@@ -8,109 +9,218 @@ tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/services"
tap "reviewdog/tap"
tap "shivammathur/extensions"
tap "shivammathur/php"
tap "wpscanteam/tap"
brew "act"
# Interpreted, interactive, object-oriented programming language
brew "python@3.10"
# Automate deployment, configuration, and upgrading
brew "ansible"
brew "aspell"
brew "autoconf"
brew "bandwhich"
brew "brew-php-switcher"
brew "glib"
brew "coreutils"
brew "openldap"
# Zstandard is a real-time compression algorithm
brew "zstd"
brew "dive"
brew "dog"
brew "eg-examples"
brew "faas-cli"
# Spell checker with better logic than ispell
brew "aspell"
# Automatic configure script builder
brew "autoconf"
# Official Amazon AWS command-line interface
brew "awscli"
# Terminal bandwidth utilization tool
brew "bandwhich"
# Switch Apache / Valet / CLI configs between PHP versions
brew "brew-php-switcher"
# Core application library for C
brew "glib"
# Manage compile and link flags for libraries
brew "pkg-config"
# Open source suite of directory software
brew "openldap"
# Libraries to talk to Microsoft SQL Server and Sybase databases
brew "freetds"
brew "fswatch"
brew "gh"
brew "git"
brew "git-extras"
brew "git-flow-avh"
brew "git-recent"
brew "git-standup", link: false
brew "gnu-sed"
brew "p11-kit"
brew "unbound"
brew "gnutls"
brew "gnupg"
brew "goaccess"
brew "netpbm"
# C/C++ and Java libraries for Unicode and globalization
brew "icu4c"
brew "harfbuzz"
brew "librsvg"
brew "graphviz"
brew "grep"
brew "gzip"
brew "hadolint"
brew "htop"
brew "httrack"
brew "imagemagick"
brew "jq"
brew "lastpass-cli"
brew "lazydocker"
# Postgres C API library
brew "libpq"
brew "libvoikko"
brew "m-cli"
brew "midnight-commander"
brew "nmap"
brew "nvm"
brew "openjdk"
brew "openapi-generator"
brew "openfortivpn"
# General-purpose scripting language
brew "php"
brew "php-cs-fixer"
brew "phpmd"
brew "phpstan"
# Dependency Manager for PHP
brew "composer"
# GNU File, Shell, and Text utilities
brew "coreutils"
# Diff that understands syntax
brew "difftastic"
# Tool for exploring each layer in a docker image
brew "dive"
# Command-line DNS client
brew "dog"
# Useful examples at the command-line
brew "eg-examples"
# CLI for templating and/or deploying FaaS functions
brew "faas-cli"
# Monitor a directory for changes and run a shell command
brew "fswatch"
# GitHub command-line tool
brew "gh"
# Distributed revision control system
brew "git"
# Small git utilities
brew "git-extras"
# AVH edition of git-flow
brew "git-flow-avh"
# See your latest local git branches, formatted real fancy
brew "git-recent"
# GNU implementation of the famous stream editor
brew "gnu-sed"
# Validating, recursive, caching DNS resolver
brew "unbound"
# GNU Transport Layer Security (TLS) Library
brew "gnutls"
# GNU Pretty Good Privacy (PGP) package
brew "gnupg"
# Image manipulation
brew "netpbm"
# OpenType text shaping engine
brew "harfbuzz"
# Library to render SVG files using Cairo
brew "librsvg"
# Graph visualization software from AT&T and Bell Labs
brew "graphviz"
# GNU grep, egrep and fgrep
brew "grep"
# Popular GNU data compression program
brew "gzip"
# Smarter Dockerfile linter to validate best practices
brew "hadolint"
# Improved top (interactive process viewer)
brew "htop"
# Website copier/offline browser
brew "httrack"
# Tools and libraries to manipulate images in many formats
brew "imagemagick"
# Lightweight and flexible command-line JSON processor
brew "jq"
# Lazier way to manage everything docker
brew "lazydocker"
# Linguistic software and Finnish dictionary
brew "libvoikko"
# Swiss Army Knife for macOS
brew "m-cli"
# Mac App Store command-line interface
brew "mas"
# Terminal-based visual file manager
brew "midnight-commander"
# Port scanning utility for large networks
brew "nmap"
# Manage multiple Node.js versions
brew "nvm"
# Development kit for the Java programming language
brew "openjdk"
# Generate clients, server & docs from an OpenAPI spec (v2, v3)
brew "openapi-generator"
# Interpreted, interactive, object-oriented programming language
brew "python@3.8"
brew "qcachegrind"
brew "qt"
# RC file (dotfile) management
brew "rcm"
# Search tool like grep and The Silver Searcher
brew "ripgrep"
# Powerful, clean, object-oriented scripting language
brew "ruby"
# Static analysis and lint tool, for (ba)sh scripts
brew "shellcheck"
brew "skopeo"
# Autoformat shell script source code
brew "shfmt"
# Send macOS User Notifications from the command-line
brew "terminal-notifier", link: false
brew "terraform@0.12"
# Tool to build, change, and version infrastructure
brew "terraform", link: false
# Thin wrapper for Terraform e.g. for locking state
brew "terragrunt"
# Tool which checks for the support of TLS/SSL ciphers and flaws
brew "testssl"
# Terraform version manager inspired by rbenv
brew "tfenv"
# Programmatically correct mistyped console commands
brew "thefuck"
# Simplified and community-driven man pages
brew "tldr"
# Terminal multiplexer
brew "tmux"
# Display directories as trees (with optional color/HTML output)
brew "tree"
# Modern watch command
brew "viddy"
# Executes a program periodically, showing output fullscreen
brew "watch"
# Internet file retriever
brew "wget"
# Personal information dashboard for your terminal
brew "wtfutil"
# Tracks most-used directories to make cd smarter
brew "z"
# A vulnerability scanner for container images and filesystems
brew "anchore/grype/grype"
# High-performance load testing tool, written in Golang.
brew "ddosify/tap/ddosify"
# lets you quickly switch between multiple git user profiles
brew "gesquive/tap/git-user"
brew "reviewdog/tap/reviewdog"
# Xdebug PHP extension
brew "shivammathur/extensions/xdebug@7.4"
# Xdebug PHP extension
brew "shivammathur/extensions/xdebug@8.0"
# Xdebug PHP extension
brew "shivammathur/extensions/xdebug@8.1"
# General-purpose scripting language
brew "shivammathur/php/php"
# General-purpose scripting language
brew "shivammathur/php/php@7.4"
# General-purpose scripting language
brew "shivammathur/php/php@8.0"
brew "wpscanteam/tap/wpscan"
# Command-line helper for the 1Password password manager
cask "1password-cli"
# App to build and share containerized applications and microservices
cask "docker"
# Reimagine your terminal
cask "fig"
# Unofficial overcast.fm podcast app
cask "fog"
# Open Source Webfont Converter
cask "fontplop"
# GIT client
cask "fork"
# Set of tools to manage resources and applications hosted on Google Cloud
cask "google-cloud-sdk"
# HTTP and GraphQL Client
cask "insomnia"
# Kubernetes IDE
cask "lens"
# Reverse proxy, secure introspectable tunnels to localhost
cask "ngrok"
# Display image info and preview unsupported formats in QuickLook
cask "qlimagesize"
# QuickLook generator for Markdown files
cask "qlmarkdown"
# QuickLook plugin for plaintext files without an extension
cask "qlstephen"
# QuickLook plugin for JSON files
cask "quicklook-json"
# QuickLook generator for Adobe Swatch Exchange files
cask "quicklookase"
# MySQL/MariaDB database management
cask "sequel-ace"
# Collection of apps available by subscription
cask "setapp"
# Application for inspecting installer packages
cask "suspicious-package"
# Quicklook extension for source files
cask "syntax-highlight"
# Open-source code editor
cask "visual-studio-code"
# Multimedia player
cask "vlc"
# Rust-based terminal
cask "warp"
mas "1Password for Safari", id: 1569813296
mas "GarageBand", id: 682658836
mas "iMovie", id: 408981434
mas "Keynote", id: 409183694
mas "Numbers", id: 409203825
mas "Pages", id: 409201541
mas "Tailscale", id: 1475387142

56
README.md Normal file
View File

@@ -0,0 +1,56 @@
# .dotfiles
The folder structure follows [XDG Base Directory Specification][xdg] where possible.
## Setup
## rcrc
Update install script
```bash
rcup -B 0 -g > ~/.dotfiles/install.sh | shfmt -w -l ~/.dotfiles/install.sh
```
## brew
Install everything described in `Brewfile`
```bash
brew bundle install --force --file=~/.dotfiles/Brewfile
```
Update `Brewfile`
```bash
brew bundle dump --force --file=~/.dotfiles/Brewfile --describe
```
Enable automatic brew updates and upgrades.
```bash
brew autoupdate start 43200 --upgrade --cleanup --immediate
```
## XDG Variables
| Var | Default |
|--------------------|----------------------|
| Executables | `$HOME/.local/bin` |
| `$XDG_DATA_HOME` | `$HOME/.local/share` |
| `$XDG_STATE_HOME` | `$HOME/.local/state` |
| `$XDG_CONFIG_HOME` | `$HOME/.config` |
- `$XDG_DATA_HOME` defines the base directory relative to which user-specific data files should be stored. If `$XDG_DATA_HOME` is either not set or empty, a default equal to ` $HOME/.local/share` should be used.
- `$XDG_CONFIG_HOME` defines the base directory relative to which user-specific configuration files should be stored. If `$XDG_CONFIG_HOME` is either not set or empty, a default equal to `$HOME/.config` should be used.
- `$XDG_STATE_HOME` defines the base directory relative to which user-specific state files should be stored. If `$XDG_STATE_HOME` is either not set or empty, a default equal to `$HOME/.local/state` should be used.
- The `$XDG_STATE_HOME` contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in `$XDG_DATA_HOME`. It may contain:
- actions history (logs, history, recently used files, …)
- current state of the application that can be reused on a restart (view, layout, open files, undo history, …)
- User-specific executable files may be stored in `$HOME/.local/bin`. Distributions should ensure this directory shows up in the UNIX `$PATH` environment variable, at an appropriate place.
- `$XDG_DATA_DIRS` defines the preference-ordered set of base directories to search for data files in addition to the `$XDG_DATA_HOME` base directory. The directories in `$XDG_DATA_DIRS` should be seperated with a colon ':'.
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

View File

@@ -19,9 +19,6 @@ if [[ $(uname) == 'Darwin' ]]; then
alias p8a='$(brew --prefix php)/bin/php artisan'
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
# work related
alias geniemvpn='sudo openfortivpn -c ~/.local/openfortivpn.conf'
fi
alias watchx='watch -dpbc'

60
config/git/config Normal file
View File

@@ -0,0 +1,60 @@
[user]
name = Ismo Vuorinen
email = ismo.vuorinen@vincit.fi
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDLyOvkr1nRqMVv3UAizmk6C+q40H4khvw7qIXXXyOyFmzjwYx/Cuxoi4uZVjX+q4qFYJ+c312uu6YXiEtfyoCao3wub8r1cLBQ3eIvuyWp2K8Ixcd9JmFmLmoeiENpJxqyr0WPZLDkrCWUZCsQQh8zzGFnfciUdUdTiZ7s21AEhhmFRSdFlVfQSlGMFxU321psg1YilcP80bDwFd1FsL4TssSkwlbgP/twqnpZ4436TTo7kp0UnH/RZkfRdDWScKHaWgncBG0CZeQxGWnRp8fvZn/7gDnthcZhvnDALVBE7QFuZ90GxqVw3IGpHryV0mFO6EGQ9Ke9YX7pKVZPUXZjeCN4SVKsqFdVJ6AjaSJ9K7nL98rYK7qNzndT3cKqPNgPteyXWRulH68A51ecQqHrjTttZcdN9hKt9uBHpzuXsby2QObT+VB4MNjZapa+YYF/WgwJCml4lzn2xMFg1vYZD78pfoJ9e5f2cL1MMlUSDb0TNxmEXfDQ77H/pRpKDz0=
[core]
excludesfile = ~/.config/git/gitignore
[alias]
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
nah = !git reset --hard && git clean -df
undo-commit = reset HEAD~ --soft
llog = log --pretty=fuller
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
[diff]
tool = difftastic
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[init]
defaultBranch = master
[pull]
rebase = false
[color]
ui = true
diff = auto
branch = auto
status = auto
[color "status"]
added = green bold
changed = yellow
deleted = red bold strike
untracked = cyan
branch = yellow black bold ul
[gpg]
format = ssh
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
allowedSignersFile = ~/.ssh/allowed_signers
[commit]
gpgsign = true

180
config/wtf/config.yml Normal file
View File

@@ -0,0 +1,180 @@
wtf:
colors:
background: black
border:
focusable: darkslateblue
focused: orange
normal: gray
checked: yellow
highlight:
fore: black
back: gray
rows:
even: yellow
odd: white
grid:
# How _wide_ the columns are, in terminal characters. In this case we have
# four columns, each of which are 35 characters wide.
columns: [35, 35, 30, 20]
# How _high_ the rows are, in terminal lines. In this case we have four rows
# that support ten line of text and one of four.
rows: [10, 10, 10, 20, 10, 4]
refreshInterval: 1
openFileUtil: "open"
mods:
# You can have multiple widgets of the same type.
# The "key" is the name of the widget and the type is the actual
# widget you want to implement.
europe_time:
title: "Europe"
type: clocks
colors:
rows:
even: "lightblue"
odd: "white"
enabled: true
locations:
GMT: "Etc/GMT"
Amsterdam: "Europe/Amsterdam"
Berlin: "Europe/Berlin"
Barcelona: "Europe/Madrid"
Copenhagen: "Europe/Copenhagen"
London: "Europe/London"
Rome: "Europe/Rome"
Stockholm: "Europe/Stockholm"
position:
top: 0
left: 0
height: 1
width: 1
refreshInterval: 15
sort: "alphabetical"
americas_time:
title: "Americas"
type: clocks
colors:
rows:
even: "lightblue"
odd: "white"
enabled: true
locations:
UTC: "Etc/UTC"
Vancouver: "America/Vancouver"
New_York: "America/New_York"
Sao_Paulo: "America/Sao_Paulo"
Denver: "America/Denver"
Iqaluit: "America/Iqaluit"
Bahamas: "America/Nassau"
Chicago: "America/Chicago"
position:
top: 0
left: 1
height: 1
width: 1
refreshInterval: 15
sort: "alphabetical"
battery:
type: power
title: "⚡️"
enabled: true
position:
top: 1
left: 2
height: 1
width: 2
refreshInterval: 15
todolist:
type: todo
checkedIcon: "X"
colors:
checked: gray
highlight:
fore: "black"
back: "orange"
enabled: true
filename: "todo.yml"
position:
top: 1
left: 0
height: 2
width: 1
refreshInterval: 3600
ip:
type: ipinfo
title: "My IP"
colors:
name: "lightblue"
value: "white"
enabled: true
position:
top: 0
left: 2
height: 1
width: 2
refreshInterval: 150
security_info:
type: security
title: "Staying safe"
enabled: true
position:
top: 1
left: 1
height: 1
width: 1
refreshInterval: 3600
readme:
type: textfile
enabled: true
filePaths:
- "~/.config/wtf/config.yml"
format: true
formatStyle: "monokai"
position:
top: 3
left: 0
height: 1
width: 1
refreshInterval: 15
news:
type: hackernews
title: "HackerNews"
enabled: true
numberOfStories: 10
position:
top: 3
left: 1
height: 1
width: 3
storyType: top
refreshInterval: 900
resources:
type: resourceusage
enabled: true
position:
top: 4
left: 0
height: 2
width: 1
refreshInterval: 1
uptime:
type: cmdrunner
args: []
cmd: "uptime"
enabled: true
position:
top: 5
left: 1
height: 1
width: 3
refreshInterval: 30
disks:
type: cmdrunner
cmd: "df"
args: ["-h"]
enabled: true
position:
top: 4
left: 1
height: 1
width: 3
refreshInterval: 3600

8
git_profiles Normal file
View File

@@ -0,0 +1,8 @@
[work]
name = Ismo Vuorinen
email = ismo.vuorinen@vincit.fi
[home]
name = Ismo Vuorinen
email = ismo@vuorinen.net

View File

@@ -1,45 +0,0 @@
[user]
name = Ismo Vuorinen
email = ismo.vuorinen@geniem.com
signingkey = 027A74A88B2CC570
[core]
excludesfile = ~/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[commit]
template = ~/.stCommitMsg
[alias]
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
nah = !git reset --hard && git clean -df
undo-commit = reset HEAD~ --soft
llog = log --pretty=fuller
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[init]
defaultBranch = master
[pull]
rebase = false
[color]
ui = true
[color "status"]
added = green bold
changed = yellow
deleted = red bold strike
untracked = cyan
branch = yellow black bold ul

38
helper.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
#
# Dotfiles and install helper
#
# Helper variables, override with ENVs like `VERBOSE=1 helpers.sh help`
: ${VERBOSE:=0}
: ${CP:=/bin/cp}
: ${LN:=/bin/ln}
: ${MKDIR:=/bin/mkdir}
: ${RM:=/bin/rm}
: ${DIRNAME:=/usr/bin/dirname}
case "$1" in
install)
echo "install stuff"
case "$2" in
*)
echo "-> $0 install [brew]"
esac
;;
brew)
echo "brew commands"
;;
dotfiles)
echo "dotfiles manager"
;;
other)
echo "Other commands"
;;
*)
echo $"Usage: $0 [install | brew | dotfiles | other]"
echo $" All commands have their own subcommands."
echo $" When in doubt run the subcommand to show list."
echo ""
exit 1
;;
esac

81
install.sh Executable file
View File

@@ -0,0 +1,81 @@
#!/bin/sh
#
# Usage:
#
# sh install.sh
#
# Environment variables: VERBOSE, CP, LN, MKDIR, RM, DIRNAME.
#
# env VERBOSE=1 sh install.sh
#
# DO NOT EDIT THIS FILE
#
# This file is generated by rcm(7) as:
#
# rcup -B 0 -g
#
# To update it, re-run the above command.
#
: ${VERBOSE:=0}
: ${CP:=/bin/cp}
: ${LN:=/bin/ln}
: ${MKDIR:=/bin/mkdir}
: ${RM:=/bin/rm}
: ${DIRNAME:=/usr/bin/dirname}
verbose() {
if [ "$VERBOSE" -gt 0 ]; then
echo "$@"
fi
}
handle_file_cp() {
if [ -e "$2" ]; then
printf "%s " "overwrite $2? [yN]"
read overwrite
case "$overwrite" in
y)
$RM -rf "$2"
;;
*)
echo "skipping $2"
return
;;
esac
fi
verbose "'$1' -> '$2'"
$MKDIR -p "$($DIRNAME "$2")"
$CP -R "$1" "$2"
}
handle_file_ln() {
if [ -e "$2" ]; then
printf "%s " "overwrite $2? [yN]"
read overwrite
case "$overwrite" in
y)
$RM -rf "$2"
;;
*)
echo "skipping $2"
return
;;
esac
fi
verbose "'$1' -> '$2'"
$MKDIR -p "$($DIRNAME "$2")"
$LN -sf "$1" "$2"
}
handle_file_ln "/Users/ivuorinen/.dotfiles/bash_profile" "/Users/ivuorinen/.bash_profile"
handle_file_ln "/Users/ivuorinen/.dotfiles/bashrc" "/Users/ivuorinen/.bashrc"
handle_file_ln "/Users/ivuorinen/.dotfiles/config/alias" "/Users/ivuorinen/.config/alias"
handle_file_ln "/Users/ivuorinen/.dotfiles/config/antigen.zsh" "/Users/ivuorinen/.config/antigen.zsh"
handle_file_ln "/Users/ivuorinen/.dotfiles/config/gh/config.yml" "/Users/ivuorinen/.config/gh/config.yml"
handle_file_ln "/Users/ivuorinen/.dotfiles/config/git/config" "/Users/ivuorinen/.config/git/config"
handle_file_ln "/Users/ivuorinen/.dotfiles/config/git/gitignore" "/Users/ivuorinen/.config/git/gitignore"
handle_file_ln "/Users/ivuorinen/.dotfiles/config/wtf/config.yml" "/Users/ivuorinen/.config/wtf/config.yml"
handle_file_ln "/Users/ivuorinen/.dotfiles/git_profiles" "/Users/ivuorinen/.git_profiles"
handle_file_ln "/Users/ivuorinen/.dotfiles/huskyrc" "/Users/ivuorinen/.huskyrc"
handle_file_ln "/Users/ivuorinen/.dotfiles/local/bin/x-open-ports" "/Users/ivuorinen/.local/bin/x-open-ports"
handle_file_ln "/Users/ivuorinen/.dotfiles/rcrc" "/Users/ivuorinen/.rcrc"
handle_file_ln "/Users/ivuorinen/.dotfiles/ssh/allowed_signers" "/Users/ivuorinen/.ssh/allowed_signers"
handle_file_ln "/Users/ivuorinen/.dotfiles/ssh/config" "/Users/ivuorinen/.ssh/config"
handle_file_ln "/Users/ivuorinen/.dotfiles/vuerc" "/Users/ivuorinen/.vuerc"
handle_file_ln "/Users/ivuorinen/.dotfiles/zshrc" "/Users/ivuorinen/.zshrc"

20
local/bin/x-open-ports Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# List open (listened) ports, without the crud that
# usually comes with `lsof -i`
#
# Originally from: https://www.commandlinefu.com/commands/view/8951
# Original author: https://www.commandlinefu.com/commands/by/wickedcpj
#
echo 'User: Command: Port:';
echo '=====================================================';
lsof -i 4 -P -n +c 0 | \
grep -i 'listen' | \
awk '{print $3, $1, $9}' | \
sed 's/ [a-z0-9\.\*]*:/ /' | \
sort -k 3 -n | \
xargs printf '%-20s %-25s %-5s\n' | uniq
echo "";

2
rcrc Normal file
View File

@@ -0,0 +1,2 @@
EXCLUDES="README.md install.sh Brewfile.lock.json Brewfile"
HOSTNAME=$(hostname -s)

0
ssh/allowed_signers Normal file
View File

2
ssh/config Normal file
View File

@@ -0,0 +1,2 @@
Host *
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"

115
zshrc
View File

@@ -3,69 +3,94 @@
# shellcheck shell=bash
LOCAL_BIN="$HOME/.local/bin"
OPT_FOLDER="/usr/local/opt"
PHP_74=$(brew --prefix php@7.4)/bin
PHP_80=$(brew --prefix php@8.0)/bin
PHP_CUR=$(brew --prefix php)/bin
PYTHON_38="$HOME/Library/Python/3.8/bin"
COMPOSER_DIR="$HOME/.composer/vendor/bin"
BREW_PYTHON=$(brew --prefix python@3.8)/bin
GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin
BREW_RUBY=$(brew --prefix ruby)/bin
USR_SBIN=/usr/local/sbin
export PATH="$LOCAL_BIN:$PYTHON_38:$COMPOSER_DIR:$BREW_PYTHON:$GNUBIN_DIR:$BREW_RUBY:$USR_SBIN:$PATH"
source "$HOME/.config/antigen.zsh"
export PATH="/opt/homebrew/bin:$USR_SBIN:$PATH"
if [ command -v brew &> /dev/null ]; then
BREW_BIN=$(brew --prefix)/bin
BREW_SBIN=$(brew --prefix)/sbin
# PHP_74=$(brew --prefix php@7.4)/bin
# PHP_80=$(brew --prefix php@8.0)/bin
# PHP_CUR=$(brew --prefix php)/bin
BREW_PYTHON=$(brew --prefix python@3.8)/bin
GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin
BREW_RUBY=$(brew --prefix ruby)/bin
BREW_GEMS=$(gem environment gemdir)/bin
export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$BREW_BIN:$BREW_SBIN:$PATH"
fi
export PATH="$LOCAL_BIN:$PYTHON_38:$COMPOSER_DIR:$PATH"
export HIST_STAMPS="yyyy-mm-dd"
export NVM_DIR="$HOME/.nvm"
export NVM_LAZY_LOAD=true
export NVM_COMPLETION=true
export NVM_AUTO_USE=true
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
antigen use oh-my-zsh
[[ -f "$HOME/.dotfiles/alias" ]] && source "$HOME/.dotfiles/alias"
antigen bundle php
antigen bundle nvm
# antigen bundle ruby
antigen bundle docker
antigen bundle ssh-agent
# antigen bundle git-auto-fetch
# Try to load antigen, if present
[[ -f "$HOME/.config/antigen.zsh" ]] && source "$HOME/.config/antigen.zsh"
antigen bundle colored-man-pages
antigen bundle jreese/zsh-titles
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
# antigen is present
if command -v antigen &> /dev/null; then
antigen use oh-my-zsh
antigen bundle Sparragus/zsh-auto-nvm-use
antigen bundle reegnz/jq-zsh-plugin
antigen bundle MichaelAquilina/zsh-you-should-use
antigen bundle sroze/docker-compose-zsh-plugin
# antigen bundle voronkovich/phpcs.plugin.zsh
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen bundle ssh-agent
antigen bundle colored-man-pages
antigen bundle jreese/zsh-titles
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle MichaelAquilina/zsh-you-should-use
antigen bundle unixorn/autoupdate-antigen.zshplugin
# antigen bundle git-auto-fetch
# Platform dependant bundles
if [[ $(uname) == 'Linux' ]]
then
antigen bundle command-not-found
elif [[ $(uname) == 'Darwin' ]]
then
# Only enable brew plugin if brew exists
hash brew 2>/dev/null && antigen bundle brew
hash php 2>/dev/null && antigen bundle php
hash nvm 2>/dev/null && antigen bundle nvm
hash docker 2>/dev/null && antigen bundle docker
hash nvm 2>/dev/null && antigen bundle Sparragus/zsh-auto-nvm-use
hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin
hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin
# antigen bundle voronkovich/phpcs.plugin.zsh
# Platform dependant bundles
if [[ $(uname) == 'Linux' ]]; then
antigen bundle command-not-found
elif [[ $(uname) == 'Darwin' ]]; then
# If we have brew installed
if command -v brew &> /dev/null; then
# Only enable brew plugin if brew exists
antigen bundle brew
# load Z
[[ -f "$(brew --prefix z)/etc/profile.d/z.sh" ]] && source "$(brew --prefix z)/etc/profile.d/z.sh"
fi
fi
antigen apply
fi
antigen apply
# op (1Password cli) is present
if hash op 2>/dev/null; then
eval "$(op completion zsh)"; compdef _op op
fi
export HIST_STAMPS="yyyy-mm-dd"
source "$HOME/.alias"
GCLOUD_INSTALL_LOCATION=$(gcloud info --format="value(installation.sdk_root)" --quiet)
source "$GCLOUD_INSTALL_LOCATION/path.zsh.inc"
source "$GCLOUD_INSTALL_LOCATION/completion.zsh.inc"
source "$(brew --prefix z)/etc/profile.d/z.sh"
# gcloud is present
if hash gcloud 2>/dev/null; then
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
fi
# Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"