Last active
June 26, 2020 16:16
-
-
Save nehaljwani/007f0eaebb814a9556fa03c24098c8c3 to your computer and use it in GitHub Desktop.
NJW's dotrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias urldecode='python2.7 -c "import sys, urllib as ul; \ | |
print ul.unquote_plus(sys.argv[1])"' | |
aria2c_ka() { | |
aria2c $(urldecode $1 | grep -wo 'magnet.*') | |
} | |
cfget () { | |
git clone https://github.com/conda-forge/$(pwd | awk -F'/' '{print $NF}')-feedstock | |
} | |
cfrebase() { | |
git pull --rebase https://github.com/conda-forge/$(pwd | tr '/' '\n' | grep feedstock) $@ | |
} | |
git-add-nwani() { | |
git remote add nwani $(git config --get remote.origin.url | awk -F'/' '{$4="nehaljwani"}1' OFS='/') | |
} | |
github-fetch-pr() { | |
github_username=${1%:*} | |
github_branch=${1#*:} | |
git fetch $(git remote get-url origin | sed "s,\(github.com[:/]\)\([^/]\)*,\1${github_username},g") ${github_branch} | |
} | |
gotoscratch() { | |
mkdir -p /tmp/scratch.nwani/$(date +%s) | |
cd $_ | |
} | |
regro-push () { | |
git push https://github.com/regro-cf-autotick-bot/$(pwd | tr '/' '\n' | grep feedstock) HEAD:"$(echo $1 | awk -F: '{print $NF}')" | |
} | |
regro-rebase() { | |
git pull --rebase https://github.com/regro-cf-autotick-bot/$(pwd | tr '/' '\n' | grep feedstock) "$(echo $1 | awk -F: '{print $NF}')" | |
} | |
random-string() { | |
LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | fold -w ${1:-12} | head -1 | |
} | |
regro-push () { | |
git push https://github.com/regro-cf-autotick-bot/$(pwd | tr '/' '\n' | grep feedstock) HEAD:"$@" | |
} | |
# Concat PDFs | |
# gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=out.pdf in1.pdf in2.pdf | |
transfer() { | |
curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename $1) | tee /dev/null; | |
} | |
tscp() { | |
scp -v -o ProxyCommand='/usr/local/bin/ncat --proxy 127.0.0.1:9890 --proxy-type socks5 %h %p' $@ | |
} | |
tssh() { | |
ssh -o ProxyCommand='/usr/local/bin/ncat --proxy 127.0.0.1:9890 --proxy-type socks5 %h %p' $@ | |
} | |
steal_ssh_agent() { | |
export SSH_AUTH_SOCK=$(find /tmp/ssh-*/ 2>/dev/null | grep agent | head -1) | |
} | |
# Remove the -u option if you want to convert it to your local timezone instead of UTC. | |
function nanots { | |
date -d "@0$(echo "$1 / 10^9" | bc -l)" -u "+%D %T.%N %Z" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In prezto zsh shell,
find
has been aliased tonoglob find
, maybe changing to$(/usr/bin/find ..)
makes sense