Skip to content

Instantly share code, notes, and snippets.

View Schemiii's full-sized avatar

Schemiii Schemiii

  • Germany, Laubach
  • 09:07 (UTC +01:00)
View GitHub Profile
#####################################################
# git
#####################################################
_fzf_complete_git() {
ARGS="$@"
local branches
branches=$(git branch -vv --all)
if [[ $ARGS == 'git co'* ]]; then
_fzf_complete "--reverse --multi" "$@" < <(
@Schemiii
Schemiii / .common.gitconfig
Created March 2, 2022 05:35
common gitconfig
[core]
autocrlf = false
editor = 'vim'
pager = bat --paging=always
[diff]
tool = vimdiff
[merge]
tool = vimdiff
@Schemiii
Schemiii / .zshrc
Created March 2, 2022 05:34
Zshrc
# zsh settings: some colors
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b"
# zsh auto-completion
if type brew &>/dev/null;then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH # add brews autocomplete to the list of complete functions
fi
@Schemiii
Schemiii / .vimrc
Created March 2, 2022 05:34
Vimrc
" polyglot
" csv adds lots of remaps, so its disabled for the moment..
let g:polyglot_disabled = ['csv']
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugins
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.vim/plugged')
" robust syntax
@Schemiii
Schemiii / remap_login_keys.sh
Last active January 15, 2020 20:18
OSX Remap z to y and y to z
# When your a programmer and you want to use US Layout but cannot stand that z and y are switched
# create e.g. ~/.login_hook.sh and, in there use hdiutil to remap y to z and vice versa
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x70000001C,"HIDKeyboardModifierMappingDst":0x70000001D},{"HIDKeyboardModifierMappingSrc":0x70000001D,"HIDKe yboardModifierMappingDst":0x70000001C}]}'
# add it to as a login script ( done once )
sudo defaults write com.apple.loginwindow LoginHook /some/path/to/login_hook.sh
@Schemiii
Schemiii / bash.tool.mem-by-pid
Created March 27, 2019 14:24
List processes by RAM consumption
ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |cut -d "" -f2 | cut -d "-" -f1
@Schemiii
Schemiii / bash.tool.randomstring
Created March 27, 2019 14:22
create string of 16 alphanumeric random chars
cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16 ; echo ''
@Schemiii
Schemiii / tshark.capture
Last active March 27, 2019 14:19
Capture 100 Mb of HTTP/GET and HTTP/POST requests on interface eth1
tshark -i eth1 -f "port 8080 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354 or tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420" -a filesize:100000 -w - | gzip -9 -f > trace_100mb.gzip