Added Dotfiles
This commit is contained in:
parent
9cd2220adb
commit
9ea4faff29
17 changed files with 622 additions and 0 deletions
28
zsh/aliases.d/cd.zsh
Normal file
28
zsh/aliases.d/cd.zsh
Normal file
|
@ -0,0 +1,28 @@
|
|||
# CD
|
||||
alias ..='cd ../'
|
||||
alias ...='cd ../../'
|
||||
alias ....='cd ../../../'
|
||||
alias .....='cd ../../../../'
|
||||
|
||||
# Go up [n] directories
|
||||
function up()
|
||||
{
|
||||
local cdir="$(pwd)"
|
||||
if [[ "${1}" == "" ]]; then
|
||||
cdir="$(dirname "${cdir}")"
|
||||
elif ! [[ "${1}" =~ ^[0-9]+$ ]]; then
|
||||
echo "Error: argument must be a number"
|
||||
elif ! [[ "${1}" -gt "0" ]]; then
|
||||
echo "Error: argument must be positive"
|
||||
else
|
||||
for i in {1..${1}}; do
|
||||
local ncdir="$(dirname "${cdir}")"
|
||||
if [[ "${cdir}" == "${ncdir}" ]]; then
|
||||
break
|
||||
else
|
||||
cdir="${ncdir}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
cd "${cdir}"
|
||||
}
|
5
zsh/aliases.d/find.zsh
Normal file
5
zsh/aliases.d/find.zsh
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Du/Find
|
||||
alias dud='du -d 1 -h'
|
||||
alias duf='du -sh *'
|
||||
alias fd='find . -type d -name'
|
||||
alias ff='find . -type f -name'
|
4
zsh/aliases.d/grep.zsh
Normal file
4
zsh/aliases.d/grep.zsh
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Grep
|
||||
alias grep='grep --color'
|
||||
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}'
|
||||
alias psg='ps aux | grep -v grep | grep'
|
5
zsh/aliases.d/interactive.zsh
Normal file
5
zsh/aliases.d/interactive.zsh
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Interactive
|
||||
alias rm='rm -i'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
|
10
zsh/aliases.d/list.zsh
Normal file
10
zsh/aliases.d/list.zsh
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Listing
|
||||
alias l='ls -lFh' #size,show type,human readable
|
||||
alias la='ls -lAFh' #long list,show almost all,show type,human readable
|
||||
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
|
||||
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
|
||||
alias ll='ls -l' #long list
|
||||
alias ldot='ls -ld .*'
|
||||
alias lS='ls -1FSsh'
|
||||
alias lart='ls -1Fcart'
|
||||
alias lrt='ls -1Fcrt'
|
20
zsh/aliases.d/own.zsh
Normal file
20
zsh/aliases.d/own.zsh
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Own Aliases
|
||||
alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
|
||||
alias clf='clf --color'
|
||||
|
||||
# The Fuck
|
||||
alias fuck='eval $(thefuck $(fc -ln -1))'
|
||||
|
||||
# PClear
|
||||
pclear () {
|
||||
clear
|
||||
printf '\033[3J'
|
||||
}
|
||||
|
||||
# Create SSL One Line
|
||||
sslcreate() {
|
||||
openssl genrsa -out private/$1.key 2048
|
||||
openssl req -new -key private/$1.key -out csr/$1.csr -sha256
|
||||
openssl x509 -req -days 365 -in csr/$1.csr -signkey private/$1.key -out certs/$1.crt
|
||||
}
|
||||
|
7
zsh/aliases.d/stuff.zsh
Normal file
7
zsh/aliases.d/stuff.zsh
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Stuff
|
||||
alias h='history'
|
||||
alias hgrep="fc -El 0 | grep"
|
||||
alias j='jobs'
|
||||
alias p='ps -f'
|
||||
alias sortnr='sort -n -r'
|
||||
|
2
zsh/aliases.d/tail.zsh
Normal file
2
zsh/aliases.d/tail.zsh
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Tail
|
||||
alias t='tail -f'
|
54
zsh/aliases.d/transfer.zsh
Normal file
54
zsh/aliases.d/transfer.zsh
Normal file
|
@ -0,0 +1,54 @@
|
|||
#
|
||||
# Defines transfer alias and provides easy command line file and folder sharing.
|
||||
#
|
||||
# Authors:
|
||||
# Remco Verhoef <remco@dutchcoders.io>
|
||||
#
|
||||
|
||||
transfer() {
|
||||
# check arguments
|
||||
if [ $# -eq 0 ];
|
||||
then
|
||||
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# get temporarily filename, output is written to this file show progress can be showed
|
||||
tmpfile=$( mktemp -t transferXXX )
|
||||
|
||||
# upload stdin or file
|
||||
file=$1
|
||||
|
||||
if tty -s;
|
||||
then
|
||||
basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
|
||||
|
||||
if [ ! -e $file ];
|
||||
then
|
||||
echo "File $file doesn't exists."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -d $file ];
|
||||
then
|
||||
# zip directory and transfer
|
||||
zipfile=$( mktemp -t transferXXX.zip )
|
||||
cd $(dirname $file) && zip -r -q - $(basename $file) >> $zipfile
|
||||
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
|
||||
rm -f $zipfile
|
||||
else
|
||||
# transfer file
|
||||
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
|
||||
fi
|
||||
else
|
||||
# transfer pipe
|
||||
curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
|
||||
fi
|
||||
|
||||
# cat output link
|
||||
cat $tmpfile
|
||||
|
||||
# cleanup
|
||||
rm -f $tmpfile
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue