Skip to content

Commit

Permalink
feat: Adding things.
Browse files Browse the repository at this point in the history
Adam Blackwell committed Jan 9, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
mgorny Michał Górny
1 parent 9cfb544 commit 450b288
Showing 3 changed files with 56 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[user]

email = <fillmein>
name = <fillmein>
email = [email protected]
name = Adam Blackwell

[alias]

100 changes: 52 additions & 48 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -3,14 +3,50 @@
# Some functions taken from various web sites/mailing lists, others written
# myself.
#
# Last updated February 2018
# Last updated Sept 2023

git config --global user.email "[email protected]"
git config --global user.email "[email protected]"
git config --global user.name "Adam Blackwell"

export ZSH=$HOME/.oh-my-zsh
export CODE=$HOME/code
source ~/.zsh_profile
source ~/.profile
autoload -Uz compinit && compinit
autoload bashcompinit && bashcompinit

# AWS
export ONELOGIN_EMAIL="[email protected]"
export UPDATE_PS1_ASSUME_ROLE=false
source $CODE/edx/edx-internal/scripts/assume-role-onelogin.sh
alias assume=assume_role













ad-get-users-groups ()
{
local user=${1:?"No Username Provided/"};
dscl '/Active Directory/2TOR/All Domains' read "/Users/${user}" dsAttrTypeNative:memberOf | ( read -r;
printf "%s\n" "$REPLY";
sort -f )
}

ad-get-group-members ()
{
local group=${1:?"No Group Provided/"};
dscl '/Active Directory/2TOR/All Domains' read "/Groups/${group}" GroupMembership | ( read -r;
printf "%s\n" "$REPLY";
sort -f )
}

ulimit -n 4096

@@ -20,30 +56,30 @@ ulimit -n 4096
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"

plugins=(vagrant fasd git ruby sublime docker tmuxinator)
plugins=(vagrant fasd git ruby sublime docker)
alias cal=gcal
alias bfg="java -jar $HOME/bin/bfg.jar"

# Code
autoload bashcompinit
bashcompinit

# Python
export VIRTUALENVWRAPPER_PYTHON=/usr/local/opt/python/libexec/bin/python
#export VIRTUALENVWRAPPER_PYTHON=/usr/local/opt/python/libexec/bin/python

# Ruby
eval "$(rbenv init -)"

# Kubernetes
[ -f $HOME/bin/fubectl.source ] && source $HOME/bin/fubectl.source

# Work stuff
source $CODE/edx/edx-iam/util/assume-role.sh
alias k=kubectl
k8sstatus() {
if [[ $POWERLINE_K8SSTATUS = "0" ]]; then
unset POWERLINE_K8SSTATUS
else
export POWERLINE_K8SSTATUS=0
fi
}

# Shell

source $ZSH/oh-my-zsh.sh
source $ZSH/tmuxinator.zsh

# Aliases
# alias ag='allgit'
@@ -68,9 +104,6 @@ antigen bundle python
antigen bundle history
antigen bundle command-not-found

# Third Party
antigen bundle kennethreitz/autoenv

# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-completions src
antigen bundle zsh-users/zsh-syntax-highlighting
@@ -100,7 +133,7 @@ syspip(){
PIP_REQUIRE_VIRTUALENV="" pip "$@"
}

source /usr/local/bin/virtualenvwrapper.sh
source /opt/homebrew/bin/virtualenvwrapper.sh
alias v='workon'
alias v.deactivate='deactivate'
alias v.mk='mkvirtualenv'
@@ -126,6 +159,7 @@ alias rc='vi ~/.zshrc'

# Set prompt (white and purple, nothing too fancy)
PS1=$'%{\e[0;37m%}%B%*%b %{\e[0;35m%}%m:%{\e[0;37m%}%~ %(!.#.>) %{\e[00m%}'
XDG_CONFIG_DIRS=$HOME/.config

# Set less options
if [[ -x $(which less) ]]
@@ -222,7 +256,6 @@ alias 'vnc=ssh -f -L 9999:localhost:5901 [email protected] \ vncviewer
alias 'vncs=vncserver -nolisten tcp -localhost -nevershared -geometry 1278x945'

# Useful KDE integration (see later for definition of z)
alias 'k=z kate -u' # -u is reuse existing session if possible
alias 'q=z kfmclient openURL' # Opens (or executes a .desktop) arg1 in Konqueror

# These are useful with the Dvorak keyboard layout
@@ -362,35 +395,6 @@ chpwd() {
esac
}

# For changing the umask automatically
# Maybe I should be using chpwd for this.
umask 0077
cd() {
builtin cd $*

# Private folders
if [[ -z ${~PWD:#${HOME}/documents*} ||
-z ${~PWD:#${HOME}/imperial*} ||
-z ${~PWD:#${HOME}} ||
-z ${~PWD:#$/tmp/Adam/*} ]] then
if [[ $(umask) -ne 077 ]] then
umask 0077
echo -e "\033[01;32mUmask: private \033[m"
fi
fi
# Web permissions
if [[ -z ${~PWD:#/.www*} ||
# -z ${~PWD:#/matt/web*} ||
-z ${~PWD:#${HOME}/www*} ]] then
if [[ $(umask) -ne 072 ]] then
umask 0072
echo -e "\033[01;33mUmask: other readable \033[m"
fi
fi
}

cd . &> /dev/null

# For quickly plotting data with gnuplot. Arguments are files for 'plot "<file>" with lines'.
plot () {
echo -n '(echo set term png; '
@@ -585,5 +589,5 @@ function docker-stop {

antigen apply
export PATH="/usr/local/sbin:$PATH"
source <(awless completion zsh)

export CODE=~/code
2 changes: 2 additions & 0 deletions brew.sh
Original file line number Diff line number Diff line change
@@ -192,6 +192,8 @@ brew install gnupg

# Install more recent versions of some macOS tools.
brew install vim --with-override-system-vi
mkdir ~/.vim/backups
mkdir ~/.vim/swap
brew install grep
brew install openssh
brew install screen

0 comments on commit 450b288

Please sign in to comment.