Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
07d68ce
Update git info
knub Feb 1, 2017
b3021a6
Update tilda position
knub Feb 1, 2017
d6de381
Setup merantix specific stuff
knub Feb 1, 2017
df051c6
Update installs
knub Feb 2, 2017
7b8acc6
Update zsh
knub Feb 2, 2017
956a7c6
Update paths
knub Feb 2, 2017
c56dddc
Add cdedison
knub Feb 6, 2017
4486c7e
Git: push new branch via gpt
knub Feb 6, 2017
eda9d9b
gpd deletes remote branches
knub Feb 6, 2017
e32b217
Update tilda
knub Feb 7, 2017
b02a27b
Remove merantix from pythonpath
knub Feb 7, 2017
2826639
Add more helper functions.
knub Mar 31, 2017
fa759f2
More merantix specific stuff.
knub Mar 31, 2017
487ab7d
Add new git aliases.
knub Nov 6, 2017
2fd26f3
Add new Moscow TB alias.
knub Nov 6, 2017
71cc213
Fix ls colors.
knub Jan 16, 2018
c0b6cc1
Fix gpm command.
knub Jan 16, 2018
79b7bac
Add new merantix commands.
knub Jan 16, 2018
17790fe
Update tilda.
knub Jan 16, 2018
5ceaeab
Turn off vim's Python mode.
knub Jan 16, 2018
f0776bd
TBs to function.
knub Jan 24, 2018
8a17901
More and updated aliases.
knub Mar 23, 2018
2548af6
Useful git aliases.
knub Mar 23, 2018
be9de1e
Fix tbs function.
knub May 23, 2018
5c851c6
New aliases managing download directory.
knub May 24, 2018
9594e03
Move to ubuntu again.
knub Dec 24, 2018
d36b243
Adapt media file path.
knub Dec 26, 2018
e296aeb
Start commit editor always on first line.
knub Dec 26, 2018
25034df
New alias for deleting branches.
knub Dec 27, 2018
7a35bdd
Remove old paths.
knub Jan 2, 2019
ed1958d
Adapt stuff.
knub Apr 26, 2019
15b936d
Update Merantix scripts.
knub May 22, 2019
1e384b2
Merantix updates.
knub May 29, 2019
a5059e3
Extend gpm to handle arbitrary 'master' branches.
knub Jun 3, 2019
d47233d
Add guasetup.
knub Jun 11, 2019
d1a4dff
Update what to install.
knub Jul 27, 2019
03a6fa9
Update antigen.
knub Jul 27, 2019
c8711c4
Fix git alias.
knub Nov 25, 2020
9cdedf8
Add kitty.
knub Nov 25, 2020
f0e4fb0
Fix delete branches.
knub Nov 25, 2020
f4a526d
Guake setup.
knub Nov 25, 2020
043d0a7
Local setup.
knub Nov 25, 2020
8e249e3
Remove guasetup.
knub Dec 26, 2021
cabd154
Improve ff.
knub Dec 26, 2021
e539ab7
Remove meld.
knub Jan 5, 2022
98cd0a8
Add exif helpers.
knub Jan 5, 2022
d48e708
Add mediainfo.
knub Feb 12, 2022
5b8b59e
Sync with master.
knub Feb 16, 2022
775d460
Lynx setup.
knub Feb 17, 2022
8523c2a
Lynx settings.
knub Mar 3, 2023
bf891c2
smarter git checkout
knub Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bin/exif_rename
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

exiftool \
-P \
-d '%Y-%m-%d-%H-%M' \
'-filename<$DateTimeOriginal%-03c.%e' \
'-filename<$DateTimeOriginal $Title%-03c.%e' \
"$@"
21 changes: 21 additions & 0 deletions bin/exif_set_title
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

for VIDEO_FNAME in "$@"
do
TITLE=$(exiftool -s -s -s -XMP:Title "$VIDEO_FNAME")

echo "$VIDEO_FNAME"

# Play video
totem "$VIDEO_FNAME" 2> /dev/null

# Ask user for new values
read -e -p "Title [$TITLE]: " TITLE

# Update EXIF if result wasn't blank
if [ -n "${TITLE}" ]; then
exiftool -overwrite_original \
-XMP:Title="$TITLE" \
"$VIDEO_FNAME"
fi
done
2 changes: 1 addition & 1 deletion bin/git-amend
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Use the last commit message and amend your stuffs.

git commit --amend -C HEAD
git commit --amend --no-verify -C HEAD
1 change: 0 additions & 1 deletion bin/meld

This file was deleted.

1 change: 1 addition & 0 deletions bin/run.zsh-run
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export PATH="$PATH:$DOTFILES/bin"
export PATH="$PATH:/home/knub/.local/bin"
1 change: 1 addition & 0 deletions dircolors/dircolors.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ EIGHTBIT 1

### By file type

OTHER_WRITABLE 00
# global default
NORMAL 00
# normal file
Expand Down
47 changes: 43 additions & 4 deletions git/aliases.zsh-run
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,63 @@ alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C
alias ga="git add"
alias ga.="git add ."
alias gam='git commit --amend'
alias gp='git push origin HEAD -q'
alias gp='git push -u origin HEAD -q'
alias gpf='gp -f'
alias gpt='git push -u -q origin $(git rev-parse --abbrev-ref HEAD)'
alias gpd='git push origin --delete'
alias gl='git --no-pager log --decorate=short --pretty="format:HEAD %C(yellow)%H%n%CresetAuthor: %an <%ae>%nDate: %ai, %ar%nCommit: %ci %cr%n%n%s%n" -n1'
alias glr='git pull --rebase --quiet && gl'
alias grc='git rebase --continue'
alias gfro='git fetch -q && git reset --hard origin/$(git name-rev --name-only HEAD) && gl'
alias gfro='git fetch -q && git reset --hard origin/$(git branch --show-current) && gl'
alias gd='git diff'
alias gds='git diff --staged'
alias gc='git commit'
alias gcempty='git commit -m "" --allow-empty-message'
alias gca='git commit -a'
alias gco='git checkout'
alias gco.='git checkout .'
alias gcom='git checkout master'

git_checkout_main_or_master() {
if git rev-parse --verify master &>/dev/null; then
git checkout master
else
git checkout main
fi
}
alias gcom='git_checkout_main_or_master'
alias gcod='git checkout develop'
alias gb='git branch'
alias gs='git status -sb'
alias grpo='git remote prune origin'
alias grh='git reset HEAD'
alias gt='git stash'
alias gtl='git stash list'
alias gtd='git stash drop'
alias gbd='git branch -D'
alias gtlrt='git stash -q && git pull --rebase --quiet && gl && git stash pop -q'
alias gcaap='git add . && git-amend && gp -f' # git commit all amend push
alias gcaapf='git add . && git-amend && gp -f' # git commit all amend push force
alias gassumeunchanged='git ls-files -v | grep "^[[:lower:]]"'

function gpm() {
# git post merge cleanup
BRANCH=$(git rev-parse --abbrev-ref HEAD)

if [[ $# -ne 0 ]]
then
gco $1
else
gcom
fi
glr
gbd $BRANCH
grpo
}
function gbackup() {
# creates backup branch
BRANCH=$(git rev-parse --abbrev-ref HEAD)
git checkout -b $BRANCH-backup
git checkout $BRANCH
}
function gri() {
git rebase -i "HEAD~$1"
}
Expand All @@ -33,3 +69,6 @@ function vimgitexclude() {
function vimgitignore() {
vim + $(git rev-parse --show-toplevel)/.gitignore
}
function vimgitconfig() {
vim + $(git rev-parse --show-toplevel)/.git/config
}
2 changes: 1 addition & 1 deletion git/gitconfig.symlink
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[user]
name = Stefan Bunk
email = stefan.bunk@googlemail.com
email = stefan@merantix.com
[alias]
count = !git shortlog -sn
[color]
Expand Down
2 changes: 2 additions & 0 deletions installs
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ Unison

# Fedora font rendering
infinality

mediainfo
30 changes: 30 additions & 0 deletions machine-based/merantix/aliases.zsh-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

alias cil="gcloud compute instances list"
alias cid="gcloud compute instances delete"
alias cista="gcloud compute instances start"
alias cisto="gcloud compute instances stop"

function cid() {
gcloud compute instances list | grep $1 | awk '{print $1}' | xargs -I {} -P 100 gcloud compute instances delete {} --quiet
}

alias dipython="drun ipython -i /merantix_core/developer_env/ipython_setup.py"

function vimgithook() {
vim + $(git rev-parse --show-toplevel)/.git/hooks/pre-commit
}

function delete_branches() {
git branch --list 'benjamin-*' | xargs -r git branch -D
git branch --list 'christian-*' | xargs -r git branch -D
git branch --list 'dominik_*' | xargs -r git branch -D
git branch --list 'filippo-*' | xargs -r git branch -D
git branch --list 'gunnar-*' | xargs -r git branch -D
git branch --list 'john-*' | xargs -r git branch -D
git branch --list 'john_*' | xargs -r git branch -D
git branch --list 'jack-*' | xargs -r git branch -D
git branch --list 'jacek-*' | xargs -r git branch -D
git branch --list 'markus-*' | xargs -r git branch -D
git branch --list 'robert-*' | xargs -r git branch -D
git branch --list 'thijs-*' | xargs -r git branch -D
}
4 changes: 4 additions & 0 deletions machine-based/merantix/helper.zsh-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function merantix_data_sync_with_nautilus() {
merantix_data_sync $1
nautilus ~/merantix/core/data/$1
}
9 changes: 8 additions & 1 deletion machine-based/merantix/homes-and-paths.zsh-run
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
export PYTHONPATH="/home/knub/Repositories/merantix:"
export CLOUDSDK_PYTHON=python3

LYNX_DB_URL=postgresql://read_only:UO%EH^P%t4nkRd%W@cloudproxy:5433/lynx
LYNX_DB_ENV="local"

LYNX_DB_HOST="10.0.0.251"
LYNX_DB_PROXY_USER="ml_access"
LYNX_DB_PROXY_HOST="80.158.3.226"
13 changes: 12 additions & 1 deletion machine-based/merantix/navigation.zsh-run
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
alias cdmerantix="cd ~/Repositories/merantix"
alias cdcore="cd ~/merantix/core"
alias cdpp="cd /merantix_core/data/mx-healthcare-derived/preprocessed"
alias cdexperiments="cd /merantix_core/data/mx-healthcare-derived/experiments"

function cddata() {
if [ "$#" -eq 0 ]
then
cd ~/merantix/core/data
else
cd ~/merantix/core/data/$1
fi
}
17 changes: 0 additions & 17 deletions machine-based/thinkpad/homes-and-paths.zsh-run
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
## PATH
# export PATH="$PATH:/opt/scala-2.11.5/bin"
# export PATH="$PATH:/opt/idea-IU-143.1184.17/bin"
# export PATH="$PATH:/home/knub/.cargo/bin"
#export PATH="/opt/anaconda3/bin:$PATH"

## JAVA HOME
#export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
#export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_31
export JAVA_HOME=/etc/alternatives/java_sdk

## HADOOP_HOME
export HADOOP_HOME="/home/knub/Programme/hadoop-2.5.1"
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native

## ANDROID
export ANDROID_HOME="/opt/android-sdk"
14 changes: 0 additions & 14 deletions machine-based/thinkpad/navigation.zsh-run
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
alias cdonehundredandeighty="cd ~/Repositories/onehundredandeighty"
alias cdthesis='cd ~/Repositories/master-thesis/thesis'
alias cddata='cd ~/Repositories/master-thesis/data'
alias cdmodels='cd ~/Repositories/master-thesis/models'
alias cdresults='cd ~/Repositories/master-thesis/results'
alias cdmaster='cd ~/Repositories/master-thesis'
alias cdscala='cd ~/Repositories/master-thesis/code/scala'
alias cdpython='cd ~/Repositories/master-thesis/code/python/knub/thesis'
alias cdword2vec='cd ~/Repositories/word2vec/trunk'
alias cdlftm='cd ~/Repositories/LFTM'
alias cdgaussian='cd ~/Repositories/Gaussian_LDA'
alias cdtopicvec='cd ~/Repositories/topicvec'
alias cdshdp='cd ~/Repositories/sHDP'
alias vimthesis='vim /home/knub/Repositories/master-thesis/thesis/thesis.tex'
12 changes: 0 additions & 12 deletions machine-based/thinkpad/project/coheel.zsh-run

This file was deleted.

31 changes: 11 additions & 20 deletions setup_machine.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

PACKAGE_MANAGER=dnf
PACKAGE_MANAGER=apt

set -o xtrace

Expand All @@ -9,49 +9,40 @@ if ! test -f zsh/antigen/Makefile ; then
git submodule update
fi

if ! grep -q "defaultyes" /etc/dnf/dnf.conf ; then
echo "defaultyes=True" | sudo tee -a /etc/dnf/dnf.conf
fi

sudo $PACKAGE_MANAGER upgrade
sudo $PACKAGE_MANAGER install \
alacarte \
autokey-gtk \
curl \
dconf-editor \
htop \
powertop \
gimp \
gitg \
gnome-tweak-tool \
gnome-tweaks \
gparted \
gvim \
vim-gtk3 \
iotop \
ImageMagick \
imagemagick \
inkscape \
meld \
ncdu \
nethogs \
rubygem-rake \
sl \
the_silver_searcher \
rake \
silversearcher-ag \
tree \
texlive \
tilda \
tlp \
tlp-rdw \
unison \
ubuntu-restricted-extras \
ubuntu-restricted-addons \
unison-gtk \
vim \
xclip \
zsh


if ! grep -q "knub:/bin/zsh" /etc/passwd ; then
chsh -s /bin/zsh
fi

if ! dnf repolist | grep -q "home_snwh_paper" ; then
sudo dnf config-manager --add-repo http://download.opensuse.org/repositories/home:snwh:paper/Fedora_25/home:snwh:paper.repo
sudo dnf install paper-gtk-theme paper-icon-theme
fi

if ! test -L ~/.zshrc ; then
rake install
Expand Down
14 changes: 14 additions & 0 deletions system/kitty.zsh-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
alias icat="kitty +kitten icat --align left"

function show_rocs() {
for d in $(gsutil ls "gs://mx-healthcare-derived/experiments/smart_elimination/image/$1/**/roc_curve_screen_detected_cancers.png"); do
dataset=${d/*$1\//};
dataset=${dataset/\/cancer_detection_task*/};
dataset=${dataset:19}
echo $dataset | tr a-z A-Z;
gsutil cp $d . 2> /dev/null
icat roc_curve_screen_detected_cancers.png
rm roc_curve_screen_detected_cancers.png
done;
}

9 changes: 8 additions & 1 deletion system/util.zsh-run
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function watchdir() {

# find file, ignore gitignored files
function ff() {
ag -l --nocolor --hidden -g "$1"
ag --skip-vcs-ignores -l --nocolor --hidden -g "$1"
}
# find file, do not ignore gitignored files
function ffa() {
Expand Down Expand Up @@ -46,3 +46,10 @@ function byobustart() {
}

alias sum='awk "{ sum += \$1 } END { print sum }"'

function lsdownloads() {
ls ~/Downloads
}
function rmdownloads() {
rm ~/Downloads/*
}
Loading