Skip to content

Commit

Permalink
Update setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav-nath committed Sep 20, 2022
1 parent f0111c1 commit ee420dc
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 55 deletions.
53 changes: 53 additions & 0 deletions setup/.aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
alias al="alias"

alias l="ls -lrth"
alias ll="ls -lrth"
alias la="ls -lrtha"

# List only directories
alias ld="ls -lrth | grep '^d'"

# List hidden directories as well
alias lda="ls -lrtha | grep '^d'"

alias dt="date '+%d-%b-%y | %a | %H:%M:%S | %Z'"

alias utc="TZ=UTC dt"
alias cst="TZ=US/Central dt"
alias est="TZ=US/Eastern dt"
alias ist="TZ=Asia/Kolkata dt"

# alias chmod commands
alias 000='chmod 000'
alias 644='chmod 644'
alias 666='chmod 666'
alias 655='chmod 655'
alias 755='chmod 755'
alias 777='chmod 777'

alias cs="cheatsheet" # see functions
alias serve="python3 -m http.server 8080"

# Reload the shell (i.e. invoke as a login shell)
alias reload="exec $SHELL -l"

# Search command line history
alias h="history | grep"

# Search running processes
alias p="ps aux | grep"
alias topcpu="/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10"

# git aliases
alias gst="git status"

# docker ps -a
alias dps="docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Ports}}' -a"

# Copy to clipboard
alias c="pbcopy"

# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"

alias mate="/Applications/TextMate.app/Contents/Resources/mate"
6 changes: 0 additions & 6 deletions setup/.zsh_functions → setup/.functions
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/local/bin/zsh

function reload() {
source ~/.zshrc
. ~/.zsh_aliases
. ~/.zsh_functions
}

# mkdir + cd
function mkd() {
if [ $# -eq 1 ]; then
Expand Down
35 changes: 0 additions & 35 deletions setup/.zsh_aliases

This file was deleted.

16 changes: 7 additions & 9 deletions setup/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ export ZSH="/Users/<user>/.oh-my-zsh"

# Alias definitions
# You may want to put all your additions into a separate file like
# ~/.zsh_aliases, instead of adding them here directly
# ~/.aliases, instead of adding them here directly

if [ -f ~/.zsh_aliases ]; then
. ~/.zsh_aliases
if [ -f ~/.aliases ]; then
. ~/.aliases
fi

# Function definitions
# You may want to put all your additions into a separate file like
# ~/.zsh_functions, instead of adding them here directly
# ~/.functions, instead of adding them here directly

if [ -f ~/.zsh_functions ]; then
. ~/.zsh_functions
if [ -f ~/.functions ]; then
. ~/.functions
fi

cat ~/banners/dragon.txt

date # see aliases
dt # see aliases
curl 'wttr.in/Pune?format=%l+weather+:+%C+%c+|+Temperature+%t+|+Feels+like+%f+|+Humidity+%h+|+Moon+phase+%m+|+Sunrise+%S+|+Sunset+%s\n'

sshadd # see functions
Expand Down Expand Up @@ -56,5 +56,3 @@ ZSH_THEME="robbyrussell"
plugins=(git)

source $ZSH/oh-my-zsh.sh

alias mate="/Applications/TextMate.app/Contents/Resources/mate"
10 changes: 5 additions & 5 deletions setup/banners/dragon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
o o _// /-~_>---<__-~ /
(^(~ /~_>---<__- _-~
,/| /__>--<__/ _-~
,//('( |__>--<__| / .----_
( ( ')) |__>--<__| | /' _---_~\
`-)) )) ( |__>--<__| | /' / ~\`\
,/,'//( ( \__>--<__\ \ /' // ||
,( ( ((, )) ~-__>--<_~-_ ~--____---~' _/'/ /'
,//('( |__>--<__| / .-----_,
( ( ')) |__>--<__| | /' _---_~\
`-)) )) ( |__>--<__| | /' / ~\`\
,/,'//( ( \__>--<__\ \ /' / / ||
,( ( ((, )) ~-__>--<_~-_ ~--____---~' _/'/ /'
`~/ )` ) ,/| ~-_~>--<_/-__ __-~ _/
._-~//( )/ )) ` ~~-'_/_/ /~~~~~~~__--~
;'( ')/ ,)( ~~~~~~~~~~
Expand Down

0 comments on commit ee420dc

Please sign in to comment.