Skip to content

Instantly share code, notes, and snippets.

@Gram21
Last active November 6, 2023 17:00
Show Gist options
  • Save Gram21/35dc66c4673bb63fa8c1 to your computer and use it in GitHub Desktop.
Save Gram21/35dc66c4673bb63fa8c1 to your computer and use it in GitHub Desktop.

Revisions

  1. Gram21 revised this gist Nov 29, 2022. 2 changed files with 2 additions and 1 deletion.
    2 changes: 1 addition & 1 deletion base.zshrc
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ ZSH=$HOME/.oh-my-zsh
    # Look in ~/.oh-my-zsh/themes/
    # Optionally, if you set this to "random", it'll load a random theme each
    # time that oh-my-zsh is loaded.
    ZSH_THEME="gnzh"
    ZSH_THEME="kphoen"

    # Texteditor and zshconfig aliases
    alias zshconfig="nano ~/.zshrc"
    1 change: 1 addition & 0 deletions install_zsh.sh
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,5 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/mas

    # Automatically load the linux .zshrc from above
    curl https://gist.github.com/Gram21/35dc66c4673bb63fa8c1/raw/base.zshrc > ~/.zshrc
    # Install zsh syntax highlighting
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  2. Gram21 revised this gist Dec 29, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install_zsh.sh
    Original file line number Diff line number Diff line change
    @@ -4,3 +4,4 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/mas

    # Automatically load the linux .zshrc from above
    curl https://gist.github.com/Gram21/35dc66c4673bb63fa8c1/raw/base.zshrc > ~/.zshrc
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  3. Gram21 revised this gist Oct 12, 2019. 1 changed file with 7 additions and 9 deletions.
    16 changes: 7 additions & 9 deletions base.zshrc
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ COMPLETION_WAITING_DOTS="true"
    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(git repo python history-substring-search docker zsh-syntax-highlighting encode64 web-search colored-man-pages extract)
    plugins=(git repo history-substring-search docker zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    @@ -37,10 +37,10 @@ source $ZSH/oh-my-zsh.sh
    # Path for custom binaries, scripts, etc.

    # Set exa instead of ls
    alias ls="exa"
    alias l="exa -alh"
    #alias ls="exa"
    #alias l="exa -alh"
    # set ccat instead of cat
    alias cat="ccat"
    #alias cat="ccat"

    # Have no chaining duplicates (meaning only the latest command if same command executed multiple times) in hist
    export HISTCONTROL=ignoreboth:erasedups
    @@ -53,11 +53,11 @@ export TERM=xterm-256color
    #alias gdb='gdb -q'

    # Update pip packages
    alias pipupgrade="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"
    #alias pipupgrade="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    #alias pipupgrade_sudo="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"

    # we want to use ripgrep instead of grep.
    alias grep="echo Using rg instead of grep; rg"
    #alias grep="echo Using rg instead of grep; rg"


    #
    @@ -74,8 +74,6 @@ mkcd() {
    fi
    }



    fpath=(/usr/local/share/zsh-completions $fpath)
    fpath+=~/.zfunc
    compinit
  4. Gram21 revised this gist Feb 18, 2019. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -277,6 +277,16 @@ pdfbuild() {
    pdflatex $1 && biber ${1%.*} && pdflatex $1 && pdflatex $1
    }

    markdown2pdf() {
    if [ ! -n "$1" -o ! -f "$1" ]; then
    echo "Provide an existing input markdown file"
    elif [ ! "${1##*.}" = "md" ]; then
    echo "Provided file is no markdown file!"
    else
    pandoc $1 -f markdown -t latex -s -o ${1%.*}.pdf
    fi
    }

    fpath=(/usr/local/share/zsh-completions $fpath)
    fpath+=~/.zfunc
    compinit
  5. Gram21 revised this gist Jul 20, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_zsh.sh
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@ chsh -s $(which zsh)
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

    # Automatically load the linux .zshrc from above
    curl https://gist.github.com/Gram21/35dc66c4673bb63fa8c1/raw/.zshrc_lin > ~/.zshrc
    curl https://gist.github.com/Gram21/35dc66c4673bb63fa8c1/raw/base.zshrc > ~/.zshrc
  6. Gram21 revised this gist Jul 20, 2018. 1 changed file with 81 additions and 0 deletions.
    81 changes: 81 additions & 0 deletions base.zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,81 @@
    # Path to your oh-my-zsh configuration.
    ZSH=$HOME/.oh-my-zsh

    # Set name of the theme to load.
    # Look in ~/.oh-my-zsh/themes/
    # Optionally, if you set this to "random", it'll load a random theme each
    # time that oh-my-zsh is loaded.
    ZSH_THEME="gnzh"

    # Texteditor and zshconfig aliases
    alias zshconfig="nano ~/.zshrc"

    # Set to this to use case-sensitive completion
    # CASE_SENSITIVE="true"

    # Comment this out to disable weekly auto-update checks
    # DISABLE_AUTO_UPDATE="true"

    # Uncomment following line if you want to disable colors in ls
    # DISABLE_LS_COLORS="true"

    # Uncomment following line if you want to disable autosetting terminal title.
    # DISABLE_AUTO_TITLE="true"

    # Uncomment following line if you want red dots to be displayed while waiting for completion
    COMPLETION_WAITING_DOTS="true"

    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(git repo python history-substring-search docker zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    # Customize to your needs...

    # Path for custom binaries, scripts, etc.

    # Set exa instead of ls
    alias ls="exa"
    alias l="exa -alh"
    # set ccat instead of cat
    alias cat="ccat"

    # Have no chaining duplicates (meaning only the latest command if same command executed multiple times) in hist
    export HISTCONTROL=ignoreboth:erasedups


    # Announce 256 bit color support
    export TERM=xterm-256color

    # Less gdb output
    #alias gdb='gdb -q'

    # Update pip packages
    alias pipupgrade="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"

    # we want to use ripgrep instead of grep.
    alias grep="echo Using rg instead of grep; rg"


    #
    # Create a new directory and cd into it
    # Similar to "mkdir xxx && cd $_"
    #
    mkcd() {
    if [ ! -n "$1" ]; then
    echo "Enter a directory name"
    elif [ -d $1 ]; then
    echo "\`$1' already exists"
    else
    mkdir $1 && cd $1
    fi
    }



    fpath=(/usr/local/share/zsh-completions $fpath)
    fpath+=~/.zfunc
    compinit
  7. Gram21 revised this gist May 28, 2018. 2 changed files with 10 additions and 106 deletions.
    10 changes: 10 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -267,6 +267,16 @@ transfer() {
    rm -f $tmpfile
    }

    # uses pdflatex and biber to build a pdf out of a given tex file
    pdfbuild() {
    if [ $# -eq 0 ]
    then
    echo "No arguments supplied"
    return 1
    fi
    pdflatex $1 && biber ${1%.*} && pdflatex $1 && pdflatex $1
    }

    fpath=(/usr/local/share/zsh-completions $fpath)
    fpath+=~/.zfunc
    compinit
    106 changes: 0 additions & 106 deletions .zshrc_lin
    Original file line number Diff line number Diff line change
    @@ -1,106 +0,0 @@
    # Path to your oh-my-zsh configuration.
    ZSH=$HOME/.oh-my-zsh

    # Set name of the theme to load.
    # Look in ~/.oh-my-zsh/themes/
    # Optionally, if you set this to "random", it'll load a random theme each
    # time that oh-my-zsh is loaded.
    ZSH_THEME="gnzh"

    # Set to this to use case-sensitive completion
    # CASE_SENSITIVE="true"

    # Comment this out to disable weekly auto-update checks
    # DISABLE_AUTO_UPDATE="true"

    # Uncomment following line if you want to disable colors in ls
    # DISABLE_LS_COLORS="true"

    # Uncomment following line if you want to disable autosetting terminal title.
    # DISABLE_AUTO_TITLE="true"

    # Uncomment following line if you want red dots to be displayed while waiting for completion
    COMPLETION_WAITING_DOTS="true"

    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(git mercurial repo python cargo history-substring-search pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    # Customize to your needs...

    # Path for custom binaries, scripts, etc.
    export PATH=$PATH:$HOME/bin

    # Set up rvm if installed
    if [ -d $HOME/.rvm ]; then
    export PATH=$PATH:$HOME/.rvm/bin
    source $HOME/.rvm/scripts/rvm
    fi

    # Announce 256 bit color support
    export TERM=xterm-256color

    # alias so we can use pbcopy and pbpaste in linux
    alias pbcopy='xclip -selection clipboard'
    alias pbpaste='xclip -selection clipboard -o'

    # get public ip
    alias show_public_ip="curl -Ss icanhazip.com"
    alias public_ip="show_public_ip"
    alias copy_public_ip="show_public_ip | pbcopy"

    # encode currently copied as base64
    alias encode_clipboard_base64="pbpaste | base64 | pbcopy"
    alias encode_clipboard="encode_clipboard_base64"
    alias base64_clipboard="encode_clipboard_base64"

    # Less gdb output
    alias gdb='gdb -q'

    # Update pip packages
    alias pipupgrade="pip list --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"

    # Use C++11 standard by default
    alias g++='g++ --std=c++11'
    alias clang++='clang++ --std=c++11'

    # Clear pacman cache: Only keep the latest version of every installed package in the cache
    alias clearcache='sudo paccache -r -k 1; sudo paccache -r -u -k 0'

    #
    # Highlights every occurande of the search pattern while displaying the whole content
    #
    # usage: cmd | highlight search_pattern
    # highlight search_pattern file
    highlight() {
    grep -E "$|$1" --color $2
    }

    #
    # cat with syntax highlighting
    #
    # usage: scat file1 file2 ...
    #
    scat() {
    for arg in "$@"; do
    pygmentize -g "$arg" 2> /dev/null || cat "$arg"
    done
    }

    #
    # Create a new directory and cd into it
    # Similar to "mkdir xxx && cd $_"
    #
    mkcd() {
    if [ ! -n "$1" ]; then
    echo "Enter a directory name"
    elif [ -d $1 ]; then
    echo "\`$1' already exists"
    else
    mkdir $1 && cd $1
    fi
    }
  8. Gram21 revised this gist Apr 30, 2018. 1 changed file with 45 additions and 48 deletions.
    93 changes: 45 additions & 48 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@ ZSH_THEME="gnzh"
    alias sublime="subl"
    alias s="subl"
    alias zshconfig="subl ~/.zshrc"
    export SVN_EDITOR=subl

    # Set to this to use case-sensitive completion
    # CASE_SENSITIVE="true"
    @@ -30,7 +31,7 @@ COMPLETION_WAITING_DOTS="true"
    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(m cargo git mercurial repo python history-substring-search osx vagrant docker brew pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)
    plugins=(m cargo git mercurial repo python history-substring-search osx vagrant docker brew zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    @@ -48,40 +49,40 @@ alias l="exa -alh"
    # set ccat instead of cat
    alias cat="ccat"

    # set python2 as standard
    alias python="python2"
    alias pip="python2 /usr/local/lib/python2.7/site-packages/pip"

    # Rust path variables
    LD_LIBRARY_PATH=$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    export PATH=/usr/local/sbin:/usr/local/bin:$PATH:$HOME/bin:$HOME/.cargo/bin
    export RLS_ROOT=${HOME}/repos/rls
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib

    if [[ $(rustup show | sed '1,11d' | sed '2d') == nightly* ]]; then
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    elif [[ $(rustup show | sed '1,11d' | sed '2d') == stable* ]]; then
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    fi

    rustup_stable() {
    rustup default stable
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    }

    rustup_nightly() {
    rustup default nightly
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    # export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    }
    # Rust path variables
    # LD_LIBRARY_PATH=$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    # export PATH=/usr/local/sbin:/usr/local/bin:$PATH:$HOME/bin:$HOME/.cargo/bin
    # export RLS_ROOT=${HOME}/repos/rls
    # export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib

    # if [[ $(rustup show | sed '1,11d' | sed '2d') == nightly* ]]; then
    # export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    # #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    # elif [[ $(rustup show | sed '1,11d' | sed '2d') == stable* ]]; then
    # export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    # #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    # fi

    # rustup_stable() {
    # rustup default stable
    # export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    # #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    # }

    # rustup_nightly() {
    # rustup default nightly
    # export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    # # export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    # }

    # for thefuck
    eval "$(thefuck --alias)"

    # Force add of ssh key
    #ssh-add ~/.ssh/id_ed25519 &>/dev/null
    #ssh-add ~/.ssh/id_rsa &>/dev/null

    # Have no chaining duplicates (meaning only the latest command if same command executed multiple times) in hist
    export HISTCONTROL=ignoreboth:erasedups

    @@ -135,8 +136,8 @@ alias clang++='clang++ --std=c++11'
    alias pipupgrade="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"

    # Update osx software
    alias updateosx="sudo softwareupdate -ia"
    # # Update osx software
    # alias updateosx="sudo softwareupdate -ia"

    # osc show battery status
    alias battery='pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto'
    @@ -201,28 +202,24 @@ updateAndUpgrade() {
    rustup update
    echo "****************************************************************"
    echo "pip..."
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo -H pip install -U
    echo "****************************************************************"
    echo "radare2..."
    cd "$HOME/repos/radare2"
    sys/user.sh
    cd - > /dev/null;
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 python2 /usr/local/lib/python2.7/site-packages/pip install -U
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo -H python2 /usr/local/lib/python2.7/site-packages/pip install -U
    # echo "****************************************************************"
    # echo "radare2..."
    # cd "$HOME/repos/radare2"
    # sys/user.sh
    # cd - > /dev/null;
    }

    sshuttle_start() {
    ip="$1"
    if [ -z ${ip} ]; then
    ip=$(dig +short cloud.janke.im)
    host="deploy@${ip}:22"
    else
    host=ip
    fi

    sshuttle -D --dns --pidfile /tmp/.sshuttle.pid -r $host 0/0
    sshuttle_start_daemon() {
    sshuttle -D --dns --pidfile /tmp/.sshuttle.pid -r [email protected]:22 0/0
    echo "Started sshuttle with pid $(cat /tmp/.sshuttle.pid)"
    }

    sshuttle_start() {
    sshuttle --dns -r [email protected]:22 0/0
    }

    #
    # Share files using transfer.io
    #
  9. Gram21 revised this gist Mar 19, 2018. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,13 @@ export GOPATH="/usr/local/opt/go/libexec/bin"

    alias md5sum="md5"

    # Set exa instead of ls
    alias ls="exa"
    alias l="exa -alh"
    # set ccat instead of cat
    alias cat="ccat"


    # Rust path variables
    LD_LIBRARY_PATH=$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    export PATH=/usr/local/sbin:/usr/local/bin:$PATH:$HOME/bin:$HOME/.cargo/bin
    @@ -266,3 +273,5 @@ transfer() {
    fpath=(/usr/local/share/zsh-completions $fpath)
    fpath+=~/.zfunc
    compinit
    export PATH="/usr/local/opt/python/libexec/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/opt/sqlite/bin:$PATH"
    MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
  10. Gram21 revised this gist May 16, 2017. 1 changed file with 22 additions and 13 deletions.
    35 changes: 22 additions & 13 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -38,29 +38,34 @@ source $ZSH/oh-my-zsh.sh

    # Path for custom binaries, scripts, etc.
    # export PATH="/usr/local/sbin:$HOME/repos/go/bin:$PATH"
    # export GOPATH="$HOME/repos/go/"
    export GOPATH="/usr/local/opt/go/libexec/bin"

    alias md5sum="md5"

    # Rust path variables
    LD_LIBRARY_PATH=$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    export PATH=/usr/local/sbin:/usr/local/bin:$PATH:$HOME/bin:$HOME/.cargo/bin
    export RLS_ROOT=${HOME}/repos/rls
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib

    if [[ $(rustup show | sed '1,11d' | sed '2d') == nightly* ]]; then
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib;
    #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    elif [[ $(rustup show | sed '1,11d' | sed '2d') == stable* ]]; then
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    fi

    rustup_stable() {
    rustup default stable
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    #export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    }

    rustup_nightly() {
    rustup default nightly
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    # export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    }

    # for thefuck
    @@ -97,10 +102,10 @@ alias open_ports="show_open_ports"
    alias show_public_ip="curl -Ss icanhazip.com"
    alias public_ip="show_public_ip"
    alias copy_public_ip="show_public_ip | pbcopy"
    alias show_public_ip_v4="curl -Ss icanhazip.com/v4"
    alias show_public_ip_v4="curl -Ss4 icanhazip.com/v4"
    alias public_ip_v4="show_public_ip_v4"
    alias copy_public_ip_v4="show_public_ip_v4 | pbcopy"
    alias show_public_ip_v6="curl -Ss icanhazip.com/v6"
    alias show_public_ip_v6="curl -Ss6 icanhazip.com/v6"
    alias public_ip_v6="show_public_ip_v6"
    alias copy_public_ip_v6="show_public_ip_v6 | pbcopy"

    @@ -113,7 +118,7 @@ alias decode_clipboard="decode_clipboard_base64"
    alias base64_clipboard_decode="decode_clipboard_base64"

    # Less gdb output
    alias gdb='gdb -q'
    #alias gdb='gdb -q'

    # Use C++11 standard by default
    alias g++='g++ --std=c++11'
    @@ -180,10 +185,14 @@ mkcd() {
    #
    updateAndUpgrade() {
    echo "Start updating and upgrading. This may take a while"
    upgrade_oh_my_zsh
    echo "****************************************************************"
    echo "brew..."
    brew update --verbose && brew upgrade && brew cleanup
    echo "****************************************************************"
    echo "Updating rust"
    rustup update
    echo "****************************************************************"
    echo "pip..."
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo -H pip install -U
    @@ -195,12 +204,12 @@ updateAndUpgrade() {
    }

    sshuttle_start() {

    ip="$1"
    host="root@${ip}"
    if [ -z ${ip} ]; then
    ip=$(dig +short gramarye.ddns.net)
    host="pi@${ip}:2222"
    ip=$(dig +short cloud.janke.im)
    host="deploy@${ip}:22"
    else
    host=ip
    fi

    sshuttle -D --dns --pidfile /tmp/.sshuttle.pid -r $host 0/0
    @@ -254,6 +263,6 @@ transfer() {
    rm -f $tmpfile
    }


    fpath=(/usr/local/share/zsh-completions $fpath)
    fpath+=~/.zfunc
    compinit
  11. Gram21 revised this gist Mar 13, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .zshrc
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ source $ZSH/oh-my-zsh.sh
    # export GOPATH="$HOME/repos/go/"

    # Rust path variables
    export PATH=$PATH:$HOME/bin:$HOME/.cargo/bin
    export PATH=/usr/local/sbin:/usr/local/bin:$PATH:$HOME/bin:$HOME/.cargo/bin
    export RLS_ROOT=${HOME}/repos/rls
    if [[ $(rustup show | sed '1,11d' | sed '2d') == nightly* ]]; then
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
  12. Gram21 revised this gist Mar 11, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -191,6 +191,7 @@ updateAndUpgrade() {
    echo "radare2..."
    cd "$HOME/repos/radare2"
    sys/user.sh
    cd - > /dev/null;
    }

    sshuttle_start() {
  13. Gram21 revised this gist Mar 10, 2017. 1 changed file with 10 additions and 7 deletions.
    17 changes: 10 additions & 7 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -37,32 +37,35 @@ source $ZSH/oh-my-zsh.sh
    # Customize to your needs...

    # Path for custom binaries, scripts, etc.
    # export PATH="/usr/local/sbin:/Users/JanKeim/repos/go/bin:$PATH"
    # export GOPATH="/Users/JanKeim/repos/go/"
    # export PATH="/usr/local/sbin:$HOME/repos/go/bin:$PATH"
    # export GOPATH="$HOME/repos/go/"

    # Rust path variables
    export PATH=$PATH:$HOME/bin:/Users/JanKeim/.cargo/bin
    export PATH=$PATH:$HOME/bin:$HOME/.cargo/bin
    export RLS_ROOT=${HOME}/repos/rls
    if [[ $(rustup show | sed '1,11d' | sed '2d') == nightly* ]]; then
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib;
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    elif [[ $(rustup show | sed '1,11d' | sed '2d') == stable* ]]; then
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    fi

    rustup_stable() {
    rustup default stable
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    }

    rustup_nightly() {
    rustup default nightly
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export RUST_SRC_PATH="${HOME}/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    }

    # for thefuck
    eval "$(thefuck --alias)"

    # Force add of ssh key
    #ssh-add ~/.ssh/id_ed25519 &>/dev/null
    #ssh-add ~/.ssh/id_rsa &>/dev/null
  14. Gram21 revised this gist Mar 8, 2017. 1 changed file with 23 additions and 5 deletions.
    28 changes: 23 additions & 5 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -39,13 +39,29 @@ source $ZSH/oh-my-zsh.sh
    # Path for custom binaries, scripts, etc.
    # export PATH="/usr/local/sbin:/Users/JanKeim/repos/go/bin:$PATH"
    # export GOPATH="/Users/JanKeim/repos/go/"

    # Rust path variables
    export PATH=$PATH:$HOME/bin:/Users/JanKeim/.cargo/bin
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    export RLS_ROOT=${HOME}/repos/rls
    if [[ $(rustup show | sed '1,11d' | sed '2d') == nightly* ]]; then
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib;
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    elif [[ $(rustup show | sed '1,11d' | sed '2d') == stable* ]]; then
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    fi

    fpath+=~/.zfunc
    compinit
    rustup_stable() {
    rustup default stable
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    }

    rustup_nightly() {
    rustup default nightly
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-apple-darwin/lib
    }

    # Force add of ssh key
    #ssh-add ~/.ssh/id_ed25519 &>/dev/null
    @@ -234,4 +250,6 @@ transfer() {
    rm -f $tmpfile
    }

    # test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh

    fpath+=~/.zfunc
    compinit
  15. Gram21 revised this gist Mar 8, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -45,6 +45,7 @@ export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/l
    export RLS_ROOT=${HOME}/repos/rls

    fpath+=~/.zfunc
    compinit

    # Force add of ssh key
    #ssh-add ~/.ssh/id_ed25519 &>/dev/null
    @@ -159,7 +160,6 @@ mkcd() {
    # Upgrade brew stuff, pip stuff and radare
    #
    updateAndUpgrade() {
    r2repo="$HOME/repos/radare2"
    echo "Start updating and upgrading. This may take a while"
    echo "****************************************************************"
    echo "brew..."
    @@ -170,7 +170,8 @@ updateAndUpgrade() {
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo -H pip install -U
    echo "****************************************************************"
    echo "radare2..."
    ${r2repo}/sys/user.sh
    cd "$HOME/repos/radare2"
    sys/user.sh
    }

    sshuttle_start() {
  16. Gram21 revised this gist Mar 7, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .zshrc
    Original file line number Diff line number Diff line change
    @@ -159,7 +159,7 @@ mkcd() {
    # Upgrade brew stuff, pip stuff and radare
    #
    updateAndUpgrade() {
    r2repo="~/rand/radare2"
    r2repo="$HOME/repos/radare2"
    echo "Start updating and upgrading. This may take a while"
    echo "****************************************************************"
    echo "brew..."
  17. Gram21 revised this gist Mar 7, 2017. 1 changed file with 24 additions and 33 deletions.
    57 changes: 24 additions & 33 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,9 @@ ZSH=$HOME/.oh-my-zsh
    ZSH_THEME="gnzh"

    # Texteditor and zshconfig aliases
    alias sublime="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
    alias s="sublime"
    alias zshconfig="sublime ~/.zshrc"
    alias sublime="subl"
    alias s="subl"
    alias zshconfig="subl ~/.zshrc"

    # Set to this to use case-sensitive completion
    # CASE_SENSITIVE="true"
    @@ -37,10 +37,13 @@ source $ZSH/oh-my-zsh.sh
    # Customize to your needs...

    # Path for custom binaries, scripts, etc.
    # export PATH="/usr/local/sbin:/Users/JanKeim/repos/go/bin:$PATH"
    # export GOPATH="/Users/JanKeim/repos/go/"
    export PATH=$PATH:$HOME/bin:/Users/JanKeim/.cargo/bin
    export PATH="/usr/local/sbin:/Users/JanKeim/repos/go/bin:$PATH"
    export GOPATH="/Users/JanKeim/repos/go/"
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    export DYLD_LIBRARY_PATH=${HOME}/.rustup/toolchains/stable-x86_64-apple-darwin/lib
    export RLS_ROOT=${HOME}/repos/rls

    fpath+=~/.zfunc

    # Force add of ssh key
    @@ -112,36 +115,11 @@ alias \?="ddg"
    # we want to use ripgrep instead of grep.
    alias grep="echo Using rg instead of grep; rg"

    # starting "idiot" as daemon
    alias idiot='idiot &'

    # Start Radare2 with -A flag.
    alias r2='r2 -AA'

    # Start ROPgadget automatically with a binary as first argument
    alias ROPgadget='ROPgadget --binary'

    # Alias for quick asking questions with the help of howdoi
    alias how='howdoi '

    # burp
    alias burp='open ~/vagrant/boxes/ctfbox/Burp/burpsuite_free_v1.6.32.jar'

    # Launch sqlmap * Change directory if necessary *
    alias sqlmap='python ~/rand/sqlmap-dev/sqlmap.py'

    # Launch Linux_Exploit_Suggester * Change directory if necessary *
    alias Linux_Exploit_Suggester='perl ~/rand/Linux_Exploit_Suggester/Linux_Exploit_Suggester.pl'

    # Launch The Backdoor Factory * Change directory if necessary *
    alias backdoor='~/rand/the-backdoor-factory/backdoor.py'

    # Launch Metasploit and Armitage with root
    alias msfconsole='sudo -E msfconsole'
    alias armitage='sudo -E armitage'

    # adb
    #alias adb="~/Library/Android/sdk/platform-tools/adb"
    # alias ROPgadget='ROPgadget --binary'

    #
    # Highlights every occurande of the search pattern while displaying the whole content
    @@ -195,6 +173,19 @@ updateAndUpgrade() {
    ${r2repo}/sys/user.sh
    }

    sshuttle_start() {

    ip="$1"
    host="root@${ip}"
    if [ -z ${ip} ]; then
    ip=$(dig +short gramarye.ddns.net)
    host="pi@${ip}:2222"
    fi

    sshuttle -D --dns --pidfile /tmp/.sshuttle.pid -r $host 0/0
    echo "Started sshuttle with pid $(cat /tmp/.sshuttle.pid)"
    }

    #
    # Share files using transfer.io
    #
    @@ -242,4 +233,4 @@ transfer() {
    rm -f $tmpfile
    }

    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
    # test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
  18. Gram21 revised this gist Mar 5, 2017. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -177,6 +177,24 @@ mkcd() {
    fi
    }

    #
    # Upgrade brew stuff, pip stuff and radare
    #
    updateAndUpgrade() {
    r2repo="~/rand/radare2"
    echo "Start updating and upgrading. This may take a while"
    echo "****************************************************************"
    echo "brew..."
    brew update --verbose && brew upgrade && brew cleanup
    echo "****************************************************************"
    echo "pip..."
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U
    pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo -H pip install -U
    echo "****************************************************************"
    echo "radare2..."
    ${r2repo}/sys/user.sh
    }

    #
    # Share files using transfer.io
    #
  19. Gram21 revised this gist Feb 6, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -109,6 +109,9 @@ alias battery='pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto'
    # shortcut for web_search
    alias \?="ddg"

    # we want to use ripgrep instead of grep.
    alias grep="echo Using rg instead of grep; rg"

    # starting "idiot" as daemon
    alias idiot='idiot &'

  20. Gram21 revised this gist Jan 26, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -106,6 +106,9 @@ alias updateosx="sudo softwareupdate -ia"
    # osc show battery status
    alias battery='pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto'

    # shortcut for web_search
    alias \?="ddg"

    # starting "idiot" as daemon
    alias idiot='idiot &'

  21. Gram21 revised this gist Jan 26, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -47,6 +47,9 @@ fpath+=~/.zfunc
    #ssh-add ~/.ssh/id_ed25519 &>/dev/null
    #ssh-add ~/.ssh/id_rsa &>/dev/null

    # Have no chaining duplicates (meaning only the latest command if same command executed multiple times) in hist
    export HISTCONTROL=ignoreboth:erasedups

    # Set up rvm if installed
    if [ -d $HOME/.rvm ]; then
    export PATH=$PATH:$HOME/.rvm/bin
  22. Gram21 revised this gist Jan 26, 2017. 1 changed file with 0 additions and 20 deletions.
    20 changes: 0 additions & 20 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -143,26 +143,6 @@ highlight() {
    grep -E "$|$1" --color $2
    }

    #
    # Interface to the OS clipboard
    #
    # usage: clip # show clipboard content
    # clip <file> # copy file content to clipboard
    # cmd | clip # copy output of cmd to clipboard
    clip() {
    if [[ -t 0 && -z "$1" ]]; then
    # output contents of clipboard
    xclip -out -selection clipboard
    elif [[ -n "$1" ]]; then
    # copy file contents to clipboard
    xclip -in -selection clipboard < "$1"
    else
    # read from stdin
    xclip -in -selection clipboard
    fi
    }


    #
    # cat with syntax highlighting
    #
  23. Gram21 revised this gist Jan 26, 2017. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -71,11 +71,20 @@ alias open_ports="show_open_ports"
    alias show_public_ip="curl -Ss icanhazip.com"
    alias public_ip="show_public_ip"
    alias copy_public_ip="show_public_ip | pbcopy"

    # encode currently copied as base64
    alias show_public_ip_v4="curl -Ss icanhazip.com/v4"
    alias public_ip_v4="show_public_ip_v4"
    alias copy_public_ip_v4="show_public_ip_v4 | pbcopy"
    alias show_public_ip_v6="curl -Ss icanhazip.com/v6"
    alias public_ip_v6="show_public_ip_v6"
    alias copy_public_ip_v6="show_public_ip_v6 | pbcopy"

    # encode/decode currently copied as base64
    alias encode_clipboard_base64="pbpaste | base64 | pbcopy"
    alias encode_clipboard="encode_clipboard_base64"
    alias base64_clipboard="encode_clipboard_base64"
    alias decode_clipboard_base64="pbpaste | base64 --decode | pbcopy"
    alias decode_clipboard="decode_clipboard_base64"
    alias base64_clipboard_decode="decode_clipboard_base64"

    # Less gdb output
    alias gdb='gdb -q'
  24. Gram21 revised this gist Jan 26, 2017. 2 changed files with 44 additions and 20 deletions.
    50 changes: 30 additions & 20 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -67,6 +67,36 @@ alias ctfboxup='ctfbox; vagrant up; vagrant ssh'
    alias show_open_ports="sudo lsof -i -n -P"
    alias open_ports="show_open_ports"

    # get public ip
    alias show_public_ip="curl -Ss icanhazip.com"
    alias public_ip="show_public_ip"
    alias copy_public_ip="show_public_ip | pbcopy"

    # encode currently copied as base64
    alias encode_clipboard_base64="pbpaste | base64 | pbcopy"
    alias encode_clipboard="encode_clipboard_base64"
    alias base64_clipboard="encode_clipboard_base64"

    # Less gdb output
    alias gdb='gdb -q'

    # Use C++11 standard by default
    alias g++='g++ --std=c++11'
    alias clang++='clang++ --std=c++11'

    # Update pip packages
    alias pipupgrade="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"

    # Update osx software
    alias updateosx="sudo softwareupdate -ia"

    # osc show battery status
    alias battery='pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto'

    # starting "idiot" as daemon
    alias idiot='idiot &'

    # Start Radare2 with -A flag.
    alias r2='r2 -AA'

    @@ -76,9 +106,6 @@ alias ROPgadget='ROPgadget --binary'
    # Alias for quick asking questions with the help of howdoi
    alias how='howdoi '

    # Less gdb output
    alias gdb='gdb -q'

    # burp
    alias burp='open ~/vagrant/boxes/ctfbox/Burp/burpsuite_free_v1.6.32.jar'

    @@ -95,23 +122,6 @@ alias backdoor='~/rand/the-backdoor-factory/backdoor.py'
    alias msfconsole='sudo -E msfconsole'
    alias armitage='sudo -E armitage'

    # Update pip packages
    alias pipupgrade="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"

    # Update osx software
    alias updateosx="sudo softwareupdate -ia"

    # osc show battery status
    alias battery='pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto'

    # Use C++11 standard by default
    alias g++='g++ --std=c++11'
    alias clang++='clang++ --std=c++11'

    # starting "idiot" as daemon
    alias idiot='idiot &'

    # adb
    #alias adb="~/Library/Android/sdk/platform-tools/adb"

    14 changes: 14 additions & 0 deletions .zshrc_lin
    Original file line number Diff line number Diff line change
    @@ -43,6 +43,20 @@ fi
    # Announce 256 bit color support
    export TERM=xterm-256color

    # alias so we can use pbcopy and pbpaste in linux
    alias pbcopy='xclip -selection clipboard'
    alias pbpaste='xclip -selection clipboard -o'

    # get public ip
    alias show_public_ip="curl -Ss icanhazip.com"
    alias public_ip="show_public_ip"
    alias copy_public_ip="show_public_ip | pbcopy"

    # encode currently copied as base64
    alias encode_clipboard_base64="pbpaste | base64 | pbcopy"
    alias encode_clipboard="encode_clipboard_base64"
    alias base64_clipboard="encode_clipboard_base64"

    # Less gdb output
    alias gdb='gdb -q'

  25. Gram21 revised this gist Jan 22, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -44,8 +44,8 @@ export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-
    fpath+=~/.zfunc

    # Force add of ssh key
    ssh-add ~/.ssh/id_ed25519 &>/dev/null
    ssh-add ~/.ssh/id_rsa &>/dev/null
    #ssh-add ~/.ssh/id_ed25519 &>/dev/null
    #ssh-add ~/.ssh/id_rsa &>/dev/null

    # Set up rvm if installed
    if [ -d $HOME/.rvm ]; then
  26. Gram21 revised this gist Jan 22, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion .zshrc
    Original file line number Diff line number Diff line change
    @@ -43,6 +43,10 @@ export GOPATH="/Users/JanKeim/repos/go/"
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    fpath+=~/.zfunc

    # Force add of ssh key
    ssh-add ~/.ssh/id_ed25519 &>/dev/null
    ssh-add ~/.ssh/id_rsa &>/dev/null

    # Set up rvm if installed
    if [ -d $HOME/.rvm ]; then
    export PATH=$PATH:$HOME/.rvm/bin
    @@ -212,4 +216,4 @@ transfer() {
    rm -f $tmpfile
    }

    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
  27. Gram21 revised this gist Jan 22, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ COMPLETION_WAITING_DOTS="true"
    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(m git mercurial repo python cargo history-substring-search osx vagrant docker brew pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)
    plugins=(m cargo git mercurial repo python history-substring-search osx vagrant docker brew pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    @@ -40,6 +40,7 @@ source $ZSH/oh-my-zsh.sh
    export PATH=$PATH:$HOME/bin:/Users/JanKeim/.cargo/bin
    export PATH="/usr/local/sbin:/Users/JanKeim/repos/go/bin:$PATH"
    export GOPATH="/Users/JanKeim/repos/go/"
    export RUST_SRC_PATH="/Users/JanKeim/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/"
    fpath+=~/.zfunc

    # Set up rvm if installed
    @@ -211,4 +212,4 @@ transfer() {
    rm -f $tmpfile
    }

    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
  28. Gram21 revised this gist Jan 12, 2017. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion .zshrc
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ COMPLETION_WAITING_DOTS="true"
    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(m git mercurial repo python history-substring-search osx vagrant docker brew pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)
    plugins=(m git mercurial repo python cargo history-substring-search osx vagrant docker brew pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    2 changes: 1 addition & 1 deletion .zshrc_lin
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ COMPLETION_WAITING_DOTS="true"
    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(git mercurial repo python history-substring-search pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)
    plugins=(git mercurial repo python cargo history-substring-search pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

  29. Gram21 revised this gist Dec 25, 2016. 1 changed file with 12 additions and 8 deletions.
    20 changes: 12 additions & 8 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -30,14 +30,17 @@ COMPLETION_WAITING_DOTS="true"
    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(git mercurial repo python history-substring-search osx vagrant brew pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)
    plugins=(m git mercurial repo python history-substring-search osx vagrant docker brew pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    # Customize to your needs...

    # Path for custom binaries, scripts, etc.
    export PATH=$PATH:$HOME/bin
    export PATH=$PATH:$HOME/bin:/Users/JanKeim/.cargo/bin
    export PATH="/usr/local/sbin:/Users/JanKeim/repos/go/bin:$PATH"
    export GOPATH="/Users/JanKeim/repos/go/"
    fpath+=~/.zfunc

    # Set up rvm if installed
    if [ -d $HOME/.rvm ]; then
    @@ -55,6 +58,10 @@ alias ctfboxup='ctfbox; vagrant up; vagrant ssh'
    # Good old netcat
    # alias nc=ncat

    # Mac list open ports
    alias show_open_ports="sudo lsof -i -n -P"
    alias open_ports="show_open_ports"

    # Start Radare2 with -A flag.
    alias r2='r2 -AA'

    @@ -84,8 +91,8 @@ alias msfconsole='sudo -E msfconsole'
    alias armitage='sudo -E armitage'

    # Update pip packages
    alias pipupgrade="pip list --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"
    alias pipupgrade="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --format=legacy --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"

    # Update osx software
    alias updateosx="sudo softwareupdate -ia"
    @@ -103,9 +110,6 @@ alias idiot='idiot &'
    # adb
    #alias adb="~/Library/Android/sdk/platform-tools/adb"

    # Clear pacman cache: Only keep the latest version of every installed package in the cache
    alias clearcache='sudo paccache -r -k 1; sudo paccache -r -u -k 0'

    #
    # Highlights every occurande of the search pattern while displaying the whole content
    #
    @@ -207,4 +211,4 @@ transfer() {
    rm -f $tmpfile
    }

    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
  30. Gram21 revised this gist Dec 18, 2016. 2 changed files with 3 additions and 23 deletions.
    24 changes: 2 additions & 22 deletions .zshrc_lin
    Original file line number Diff line number Diff line change
    @@ -7,11 +7,6 @@ ZSH=$HOME/.oh-my-zsh
    # time that oh-my-zsh is loaded.
    ZSH_THEME="gnzh"

    # Texteditor and zshconfig aliases
    #alias sublime="subl" # TODO
    #alias s="sublime"
    #alias zshconfig="sublime ~/.zshrc"

    # Set to this to use case-sensitive completion
    # CASE_SENSITIVE="true"

    @@ -30,7 +25,7 @@ COMPLETION_WAITING_DOTS="true"
    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(git mercurial repo python history-substring-search vagrant pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)
    plugins=(git mercurial repo python history-substring-search pip zsh-syntax-highlighting encode64 web-search colored-man-pages extract)

    source $ZSH/oh-my-zsh.sh

    @@ -48,22 +43,9 @@ fi
    # Announce 256 bit color support
    export TERM=xterm-256color

    # Good old netcat
    # alias nc=ncat

    # Start Radare2 with -A flag.
    alias r2='r2 -AA'

    # Start ROPgadget automatically with a binary as first argument
    alias ROPgadget='ROPgadget --binary'

    # Less gdb output
    alias gdb='gdb -q'

    # Launch Metasploit and Armitage with root
    alias msfconsole='sudo -E msfconsole'
    alias armitage='sudo -E armitage'

    # Update pip packages
    alias pipupgrade="pip list --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U"
    alias pipupgrade_sudo="pip list --outdated | cut -d ' ' -f1 | xargs -n1 sudo pip install -U"
    @@ -107,6 +89,4 @@ mkcd() {
    else
    mkdir $1 && cd $1
    fi
    }

    test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
    }
    2 changes: 1 addition & 1 deletion install_zsh.sh
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@ chsh -s $(which zsh)
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

    # Automatically load the linux .zshrc from above
    # curl https://gist.github.com/Gram21/35dc66c4673bb63fa8c1/raw/.zshrc_lin > ~/.zshrc
    curl https://gist.github.com/Gram21/35dc66c4673bb63fa8c1/raw/.zshrc_lin > ~/.zshrc