Skip to content

Commit

Permalink
update with latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom committed Nov 4, 2023
1 parent 1dd2532 commit d05d247
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 37 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
SHELL := /bin/bash

DOTFILES=$(shell find "$(CURDIR)/dots" -name "*" -type f -printf "$(HOME)/.%P\n")
BINSCRIPTS=$(shell find $(CURDIR)/bin -type f -printf "/usr/local/bin/%P\n")
SYSTEMDUNITS=$(shell find $(CURDIR)/systemd -type f -printf "$(HOME)/.config/systemd/user/%P\n")
APPCONFIG=$(shell find $(CURDIR)/appconfig -name "*" -type f | sed -e "s|$(CURDIR)\/app|$(HOME)/.|")
ETCFILES=$(shell find $(CURDIR)/etc -type f | sed -e 's|$(CURDIR)||')
DOTFILES=$(shell gfind "$(CURDIR)/dots" -name "*" -type f -printf "$(HOME)/.%P\n")
BINSCRIPTS=$(shell gfind $(CURDIR)/bin -type f -printf "/usr/local/bin/%P\n")
SYSTEMDUNITS=$(shell gfind $(CURDIR)/systemd -type f -printf "$(HOME)/.config/systemd/user/%P\n")
APPCONFIG=$(shell gfind $(CURDIR)/appconfig -name "*" -type f | sed -e "s|$(CURDIR)\/app|$(HOME)/.|")
ETCFILES=$(shell gfind $(CURDIR)/etc -type f | sed -e 's|$(CURDIR)||')

.PHONY: all
all: bin install dotfiles zsh gpg appconfig vim etc tools ## Installs the bin and etc directory files and the dotfiles.
Expand Down Expand Up @@ -48,8 +48,8 @@ gpg: ## Reconfiugure gpg agent
vim: ## Install and configure VIM
ln -snf $(CURDIR)/vim $(HOME)/.vim;
ln -snf $(CURDIR)/vim/vimrc $(HOME)/.vimrc;
sudo ln -snf $(CURDIR)/vim /root/.vim;
sudo ln -snf $(CURDIR)/vim/vimrc /root/.vimrc;
-sudo ln -snf $(CURDIR)/vim /root/.vim;
-sudo ln -snf $(CURDIR)/vim/vimrc /root/.vimrc;
git submodule update --init --recursive
git submodule foreach git pull --recurse-submodules origin master

Expand Down Expand Up @@ -110,7 +110,7 @@ fonts: /usr/share/fonts/comicmono
test: shellcheck ## Run all the tests on the files in the repository.

.PHONY: shellcheck
shellcheck: $(shell find $(CURDIR) -type f -not -iwholename '*.git*' -not -iwholename '*/.vim/pack/default/start/*' | while read in ; do if file -i "$${in}" | grep -q x-shell ; then echo "$${in}" ; fi ; done) ## Runs shellcheck tests on the scripts.
shellcheck: $(shell gfind $(CURDIR) -type f -not -iwholename '*.git*' -not -iwholename '*/.vim/pack/default/start/*' | while read in ; do if file -i "$${in}" | grep -q x-shell ; then echo "$${in}" ; fi ; done) ## Runs shellcheck tests on the scripts.
shellcheck --format=gcc $^

.PHONY: help
Expand Down
4 changes: 3 additions & 1 deletion dots/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

alias vi="vim"
alias mtr='mtr -o "LRDS N BAW" '
alias diff="colordiff"
#alias diff="colordiff"
alias lsd='ls --group-directories-first'
alias nmon='NMON="cmtu" nmon'
alias lock="qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock"
Expand All @@ -22,3 +22,5 @@ alias aduspc="wol d0:50:99:9a:f5:8c"
# AWS
alias aws-reset="unset AWS_ACCESS_KEY_ID AWS_SESSION_TOKEN AWS_SECRET_ACCESS_KEY"

# AVS
alias avs-proxy="ssh -D 8080 avs-bastion"
13 changes: 2 additions & 11 deletions dots/functions
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ function secrets-load() {
local secrets_file="$HOME/.secrets/shell_vars"
local staleness_period=3888000 # 45 days
if [ -f "$secrets_file" ]; then
last_mod=$(date +%s -r "$secrets_file")
#last_mod=$(date +%s -r "$secrets_file")
last_mod=$(stat -f %m "$secrets_file")
if [ "$((last_mod + staleness_period))" -gt "$(date +%s)" ]; then
# shellcheck source=/dev/null
source "$secrets_file"
Expand Down Expand Up @@ -232,16 +233,6 @@ function drain-reboot() {
kubectl uncordon "${host}"
}

function htop() {
echo "Did you mean to use 'below'? [y/n]"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]; then
/usr/bin/below
else
/usr/bin/htop
fi
}

function speakers() {
source "${HOME}/.secrets/homeassistant"
HOMEASSISTANT_SPEAKERS="input_select.speakers"
Expand Down
7 changes: 2 additions & 5 deletions dots/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,8 @@
name = paulfantom
signingkey = 0x12AE0185401674E7

[includeIf "gitdir:~/Projects/redhat/"]
path = .gitconfig-work

[includeIf "gitdir:~/Projects/go/src/github.com/openshift"]
path = .gitconfig-work
[includeIf "gitdir:~/Projects/src/avsystem.gitlab.com/"]
path = ~/.gitconfig-work

[commit]
gpgsign = false
Expand Down
5 changes: 2 additions & 3 deletions dots/gitconfig-work
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[user]
email = [email protected]
name = Pawel Krupa
signingkey = 0x12AE0185401674E7
email = [email protected]
name = Paweł Krupa
7 changes: 1 addition & 6 deletions dots/golang
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
export GO111MODULE=on
export GOROOT=/usr/local/go
export PATH=${PATH}:/usr/local/go/bin:${HOME}/.local/bin

# go path
export GOPATH="${HOME}/Projects"

# update path
export PATH=/usr/local/bin:/usr/local/go/bin:${PATH}:${GOPATH}/bin:/sbin
export PATH=${HOME}/.local/bin:${GOPATH}/bin:${PATH}

export CDPATH=${CDPATH}:$GOPATH/src/github.com:$GOPATH/src/golang.org:$GOPATH/src

Expand Down
23 changes: 20 additions & 3 deletions dots/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ plugins=(
github
helm
kube-ps1
ssh-agent
kubectl
systemadmin
terraform
zsh-interactive-cd
Expand All @@ -111,12 +111,29 @@ zstyle ':completion:*:ssh:*' hosts on
secrets-load

# check if there is newer kernel installed
checkkernel
#checkkernel

# ensure proper xmodmap mapping
(xmodmap | grep locka &>/dev/null) || xmodmap "$HOME/.Xmodmap"
#(xmodmap | grep locka &>/dev/null) || xmodmap "$HOME/.Xmodmap"

# Show what I need to do next
#todo


export PATH="/usr/local/opt/libpq/bin:$PATH"

if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"

autoload -Uz compinit
compinit
fi

source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc"
source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc"

export PATH=$PATH:/Users/paulfantom/.kubescape/bin:/Users/paulfantom/Library/Python/3.11/bin

kubectx -u &>/dev/null
# kubens default
56 changes: 56 additions & 0 deletions osx/brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/sh

# Install software using brew

# GUI software
brew install --cask rectangle arc MonitorControl steam signal

# Basic software
brew install \
strace \
convert \
wakeonlan \
yq \
git-lfs \
golang

# Infra-as-code
brew install \
terraform \
terragrunt \
ansible \
molecule

# Monitoring tools
brew install \
prometheus \
alertmanager \
pint \
jsonnet \
jsonnet-bundler \
thanos

# Kubernetes
brew install \
istioctl \
cilium-cli \
pluto \
fleet-cli \
argocd \
derailed/popeye/popeye \
kind \
chart-testing

# Cloud tools
brew install \
aksctl \
awscli \
azure-cli \
gcloud \
gke-gcloud-auth-plugin \
gkectl

# Others
brew install \
cloudflare/cloudflare/cloudflared \
minio-mc

0 comments on commit d05d247

Please sign in to comment.