Skip to content

Instantly share code, notes, and snippets.

@ffflorian
Last active November 27, 2017 09:12
Show Gist options
  • Save ffflorian/c4bba565728559d903dd to your computer and use it in GitHub Desktop.
Save ffflorian/c4bba565728559d903dd to your computer and use it in GitHub Desktop.
dotfiles
#!/bin/bash
alias close="wmctrl -c"
alias conn="sudo netstat -pan --inet"
alias duf="sudo du -sh * | sort -rh"
alias ga="git add -A"
alias gb="git checkout -b "
alias gbranch="git rev-parse --abbrev-ref HEAD"
alias gc="git commit -S -m"
alias gd="git diff --cached"
alias gdn="git diff --cached --name-only"
alias gl="git log"
alias gpg="gpg2"
alias gpull="git pull"
alias gpush="git push"
alias gt="git tag -a -s -m"
alias img="cacaview"
alias inst="sudo apt install"
alias l="ls -CFh"
alias la="ls -Ah"
alias ll="ls -AhlF"
alias myip="curl icanhazip.com"
alias n="nvm"
alias nano="vim"
alias open="xdg-open"
alias reboot="systemctl reboot"
alias reload="source ~/.bashrc && source ~/.bash_aliases"
alias shutdown="systemctl poweroff"
alias temp="watch -n 1 -d sensors"
alias upd="sudo apt update -qq"
alias upgr="sudo apt upgrade"
alias upgrd="sudo apt dist-upgrade"
alias wp="ps aux | grep -v grep | grep"
alias wttr="curl -4 -s http://wttr.in/Berlin | head -7 | tail -5"
alias xclip="xclip -selection c"
alias yt="youtube-dl --retries 1 --no-call-home --user-agent \"Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36\""
biggest () {
if [[ $# -eq 0 ]] ; then
du -hd1 | sort -rh | tail -n +2
else
du -hd1 | sort -rh | tail -n +2 | head -n${1}
fi
}
debchangelog () {
zless "/usr/share/doc/${1}/changelog.Debian.gz"
}
matrix () {
echo -e "\e[1;40m"
clear
while :;
do echo ${LINES} ${COLUMNS} $(( ${RANDOM} % ${COLUMNS})) $(( ${RANDOM} % 72 ));
sleep 0.05;
done | gawk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
}
nvm () {
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm "$@"
}
ytl () {
URL="$(yt --get-url ${1})"
if [ ! -z "${URL}" ]; then
vlc --quiet "${URL}" &
fi
}
= () {
calc="${@//p/+}"
calc="${calc//x/*}"
echo "$(($calc))"
}
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# If this is an xterm set the title to user@host:dir
case "$TERM" in
linux|xterm*|rxvt*)
#PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;34m\]\w \$ \[\033[00m\]'
PS1=' \[\033[01;34m\]\w \$ \[\033[00m\]'
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
## Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen
## if we're coming from a remote SSH connection, in an interactive session
## then automatically put us into a screen(1) session. Only try once
## -- if $STARTED_SCREEN is set, don't try it again, to avoid looping
## if screen fails for some reason.
#if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ]
#then
# STARTED_SCREEN=1 ; export STARTED_SCREEN
# [ -d $HOME/lib/screen-logs ] || mkdir -p $HOME/lib/screen-logs
# sleep 1
# screen -U -RR && exit 0
# # normally, execution of this rc script ends here...
# echo "Screen failed! continuing with normal bash startup"
#fi
## [end of auto-screen snippet]
export EDITOR="vim"
export NPM_PACKAGES="/home/florian/.npm-packages"
export NODE_PATH="$NPM_PACKAGES/lib/node_modules${NODE_PATH:+:$NODE_PATH}"
export PATH="$NPM_PACKAGES/bin:$PATH"
# Unset manpath so we can inherit from /etc/manpath via the `manpath`
# command
unset MANPATH # delete if you already modified MANPATH elsewhere in your config
export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
export _JAVA_AWT_WM_NONREPARENTING=1
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
{
"apiKey": "",
"dir": "/home/florian/git/exercism",
"api": "http://exercism.io",
"xapi": "http://x.exercism.io"
}
[user]
email = github@floriankeller.de
name = Florian Keller
au BufReadPost *.sublime-settings set syntax=json
set ruler " Show the line and column number in status line
set showcmd " Show (partial) command in status line
set laststatus=2 " Always show status line
set showmode " Display current editing mode
set title " Make the window title reflect the file being edited
"set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set history=2000 " Set history to 2000 entries
"set nu " Line numbers
set hlsearch " Highlight search results
"set cursorline " Highlight the current line
syntax on
:color slate
!! source: https://github.com/spazzpp2/dotfiles/blob/29819a5ac5e451bfa39bc324378aa508ef75cae8/Molokai.xrdb
! Molokai theme
URxvt*background: #101010
URxvt*foreground: #d0d0d0
URxvt*color0: #101010
URxvt*color1: #960050
URxvt*color2: #66aa11
URxvt*color3: #c47f2c
URxvt*color4: #30309b
URxvt*color5: #7e40a5
URxvt*color6: #3579a8
URxvt*color7: #9999aa
URxvt*color8: #303030
URxvt*color9: #ff0090
URxvt*color10: #80ff00
URxvt*color11: #ffba68
URxvt*color12: #5f5fee
URxvt*color13: #bb88dd
URxvt*color14: #4eb4fa
URxvt*color15: #d0d0d0
*xterm*background: #101010
*xterm*foreground: #d0d0d0
*xterm*cursorColor: #d0d0d0
*xterm*color0: #101010
*xterm*color1: #960050
*xterm*color2: #66aa11
*xterm*color3: #c47f2c
*xterm*color4: #30309b
*xterm*color5: #7e40a5
*xterm*color6: #3579a8
*xterm*color7: #9999aa
*xterm*color8: #303030
*xterm*color9: #ff0090
*xterm*color10: #80ff00
*xterm*color11: #ffba68
*xterm*color12: #5f5fee
*xterm*color13: #bb88dd
*xterm*color14: #4eb4fa
*xterm*color15: #d0d0d0
urxvt*depth: 32
urxvt*background: rgba:0000/0000/0000/dddd
URxvt.letterSpace: -1.5
!URxvt*font: xft:Monospace:pixelsize=12
URxvt*font: xft:Source Code Pro:pixelsize=13
URxvt.scrollBar: True
URxvt.scrollstyle: plain
URxvt.thickness: 12
URxvt.scrollBar_right: True
URxvt.secondaryScroll: False
URxvt*borderLess: False
URxvt*internalBorder: 0
URxvt.geometry: 140x50
!URxvt.perl-lib: ~/.urxvt/ext
!URxvt.perl-ext-common: keyboard-select
!URxvt.keysym.M-Escape: perl:keyboard-select:activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment