From 9d11dea48729e867b77495ad1a40f879c2c2cecf Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 11 May 2021 14:43:14 +0200 Subject: [PATCH] add parts --- bash_profile.d/00_base.sh | 42 ++++++++++++++++++++++++++ bash_profile.d/convenience.sh | 20 +++++++++++++ bash_profile.d/git.sh | 55 +++++++++++++++++++++++++++++++++++ bash_profile.d/java.sh | 1 + bash_profile.d/pEp.sh | 46 +++++++++++++++++++++++++++++ 5 files changed, 164 insertions(+) create mode 100644 bash_profile.d/00_base.sh create mode 100644 bash_profile.d/convenience.sh create mode 100644 bash_profile.d/git.sh create mode 100644 bash_profile.d/java.sh create mode 100644 bash_profile.d/pEp.sh diff --git a/bash_profile.d/00_base.sh b/bash_profile.d/00_base.sh new file mode 100644 index 0000000..9650c98 --- /dev/null +++ b/bash_profile.d/00_base.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#export PATH=$PATH:/opt/local/bin:/opt/local/sbin +export PATH=/opt/local/bin:/opt/local/sbin:$PATH +export PATH="$HOME/.cargo/bin:$PATH" +export LANG=en_US.UTF-8 + +TERM=xterm +EDITOR=vim +LESS='-RS -i -X' + +HISTFILESIZE= +HISTSIZE=100000 + +alias sp='source $HOME/.bash_profile' + +alias m='make' +alias mc='m clean' +alias mi='m install' +alias md='m develop' + + +# ls +if [ $(uname) == "Linux" ]; then { + alias l='ls -l --color=always --time-style=+%F%t%T' + alias ll='l -a' + alias lt='l -at' + alias ltr='l -art' +} fi + +if [ $(uname) == "Darwin" ]; then { + alias l='ls -GlT' + alias ll='l -a' + alias lt='l -at' + alias ltr='l -art' +} fi + + +# grep +alias grep='grep --color=auto' + + diff --git a/bash_profile.d/convenience.sh b/bash_profile.d/convenience.sh new file mode 100644 index 0000000..8737ce2 --- /dev/null +++ b/bash_profile.d/convenience.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +rmclassesrecursively() { + rm -vf $(find . | grep -E '\.class$') +} + +rmdotoanddotdrecursively() { + rm -v $(find . | grep -E '\.o$|\.d$') +} + +function realpath() { + python3 -c 'import sys, os; print(os.path.realpath(sys.argv[1]))' $1 +} + +# Print filenames matching grep $1 +function fmatch() { + grep -ri $1 * | perl -pe 's/\:.*?\n/\n/g' | sort -u +} + + diff --git a/bash_profile.d/git.sh b/bash_profile.d/git.sh new file mode 100644 index 0000000..754fbe7 --- /dev/null +++ b/bash_profile.d/git.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# git +alias gf='git fetch --all --tags' +alias gp='git pull' + +# git push +alias gpush='git push' +alias gpushf='git push --force' +alias gpusht='gpush; gpush --tags' +alias gpushtf='gpushf;gpushf --tags' +# --all / -u +alias gpau='gpush --all -u' +alias gpu='gpush -u' +alias gpauf='gpushf --all -u' +alias gpuf='gpushf -u' +# with tags +alias gpaut='gpush --all -u;gpusht' +alias gput='gpush -u;gpusht' +alias gpauft='gpushf --all -u;gpushtf' +alias gpuft='gpushf -u;gpushtf' + +alias gs='git status --long' +alias gd='git diff' +alias gt='git tag' +alias gst='git for-each-ref --sort=creatordate --format "%(objectname) %(refname)" refs/tags' +alias gb='git branch' +alias gsb='git branch -vv --all' +alias gl='git log --graph --date=iso --topo-order --source --oneline' +alias gla='gl --all' +alias gll='git log --graph --date=iso --stat --topo-order --source' +alias glla='gll --all' +alias gm='git merge --no-ff' +alias grb='git rebase' +alias gco='git checkout' +alias gc='git commit' +alias gup='git pull --rebase --autostash -v' +alias gcp='git cherry-pick' + +# stats +alias gstats='git shortlog -sne' +function gstatslines() { + echo -e "this usually takes a while.\nSo, go grab a coffee... or two... or three..."; + git ls-files | while read f; do { + git blame -wMCC --line-porcelain $f | grep -I '^author '; + } done | sort -f | uniq -ic | sort -n --reverse +} + +function gstats_libpEpAdapter_heck() { + echo "libpEpAdapter: corrected lines of code for author heck, because he commited the sqlite3 amalgamation..." + echo "$(gstatslines | grep 'author heck' | cut -f1 -d' ') - $(cat src/sqlite3.c src/internal/sqlite3.h | wc -l)" | bc +} + + +alias gstatsall='gstats;gstatslines' diff --git a/bash_profile.d/java.sh b/bash_profile.d/java.sh new file mode 100644 index 0000000..2dc9946 --- /dev/null +++ b/bash_profile.d/java.sh @@ -0,0 +1 @@ +export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home diff --git a/bash_profile.d/pEp.sh b/bash_profile.d/pEp.sh new file mode 100644 index 0000000..31de7e2 --- /dev/null +++ b/bash_profile.d/pEp.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Delete symlinks in the pEpPythonAdapter (to allow "project search") +function pEpPythonAdapterRmSymlinks() { + for i in $(find . -type l | grep -i lib); do { rm -v $i; }; done +} + +# pEp Fresh Repo Clones +export PEP_LOCAL_CONF_DIR=$HOME/src/adapter/conf/ + +function clone_pEpEngine() { + git clone https://gitea.pep.foundation/pEp.foundation/pEpEngine.git . + cp $PEP_LOCAL_CONF_DIR/local.conf.pEpEngine local.conf + cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpEngine .idea +} + +function clone_pEpEngineHeck() { + git clone https://gitea.pep.foundation/heck/pEpEngine . + cp $PEP_LOCAL_CONF_DIR/local.conf.pEpEngine local.conf + cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpEngine .idea +} + +function clone_pEpPythonAdapter() { + git clone https://gitea.pep.foundation/pEp.foundation/pEpPythonAdapter.git . + cp $PEP_LOCAL_CONF_DIR/local.conf.pEpPythonAdapter local.conf + cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpPythonAdapter .idea +} + +function clone_pEpJNIAdapter() { + git clone https://gitea.pep.foundation/pEp.foundation/pEpJNIAdapter.git . + cp $PEP_LOCAL_CONF_DIR/local.conf.pEpJNIAdapter local.conf + cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpJNIAdapter .idea + cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpJNIAdapter .idea +} + +function clone_libpEpAdapter() { + git clone https://gitea.pep.foundation/pEp.foundation/libpEpAdapter.git . + cp $PEP_LOCAL_CONF_DIR/local.conf.libpEpAdapter local.conf + cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.libpEpAdapter .idea +} + +function clone_devWiki() { + git clone ssh://wiki/var/lib/gitit/wikidata . +} + +alias test_pEpPythonAdapter='python3 -c "import pEp;"'