Skip to content

Instantly share code, notes, and snippets.

@justinhartman
Last active March 8, 2023 12:47
Show Gist options
  • Save justinhartman/7347de7127f8d0b00a444ae46e82a1d7 to your computer and use it in GitHub Desktop.
Save justinhartman/7347de7127f8d0b00a444ae46e82a1d7 to your computer and use it in GitHub Desktop.

Revisions

  1. justinhartman revised this gist Mar 8, 2023. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,8 @@ alias grep='grep -n --color=always'
    export GREP_COLOR='1;35;40'
    # Sudo
    alias sudo-www='sudo -u www-data'
    # Laravel
    alias artisan="php artisan"
    # Git commands
    ## General
    alias gcf='git config --list'
    @@ -37,4 +39,21 @@ alias glo='git pull origin master'
    alias gts='git tag -s'
    ## Stats/Status
    alias gsb='git status -sb'
    alias glol="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
    alias glol="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
    # Folder sizes.
    # Returns a recurring list of folders with the total folder size, sorted from
    # smallest to biggest in human readable format.
    dufs() {
    du -chd 1 "$1" | sort -h
    }
    ## To enable the two commands below read:
    ## https://justhart.com/extremely-fast-compression-with-lz4/
    ## This will install what you need for super fast archive creation/extraction.
    # Make an LZ4 archive
    #lz4make () {
    # tar -c - "${1}" | lz4 - "${1}.tar.lz4"
    #}
    # Extract an LZ4 archive
    #lz4extract () {
    # pv "${1}" | lz4 -dc - | tar -x
    #}
  2. justinhartman revised this gist Dec 7, 2020. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,7 @@
    # Fixes locale issues.
    export LANGUAGE=en_GB.UTF-8
    export LANG=en_GB.UTF-8
    export LC_ALL=en_GB.UTF-8
    export LC_TERMINAL=en_GB.UTF-8
    # Load bash which also gives us colours :-)
    exec bash
  3. justinhartman revised this gist Nov 19, 2020. 2 changed files with 10 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -11,10 +11,10 @@ alias apt-upgrade='sudo apt update && sudo apt upgrade'
    alias apt-install='sudo apt install'
    alias apt-remove='sudo apt remove'
    alias apt-search='sudo apt search'
    # Grep
    # Search
    alias grep='grep -n --color=always'
    export GREP_COLOR='1;35;40'
    ## Sudo
    # Sudo
    alias sudo-www='sudo -u www-data'
    # Git commands
    ## General
    8 changes: 8 additions & 0 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    ## Append this function to your ~/.bashrc file.

    # Folder sizes.
    # Returns a recurring list of folders with the total folder size, sorted from
    # smallest to biggest in human readable format.
    dufs() {
    du -chd 1 "$1" | sort -h
    }
  4. justinhartman revised this gist Nov 19, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,8 @@ alias apt-search='sudo apt search'
    # Grep
    alias grep='grep -n --color=always'
    export GREP_COLOR='1;35;40'
    ## Sudo
    alias sudo-www='sudo -u www-data'
    # Git commands
    ## General
    alias gcf='git config --list'
  5. justinhartman revised this gist Nov 19, 2020. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,11 @@ alias ..='cd ..'
    alias ...='cd ...'
    alias ....='cd ....'
    # Apt
    alias apt-update='sudo apt-get update'
    alias apt-upgrade='sudo apt-get update && sudo apt-get upgrade'
    alias apt-install='sudo apt-get install'
    alias apt-remove='sudo apt-get remove'
    alias apt-update='sudo apt update'
    alias apt-upgrade='sudo apt update && sudo apt upgrade'
    alias apt-install='sudo apt install'
    alias apt-remove='sudo apt remove'
    alias apt-search='sudo apt search'
    # Grep
    alias grep='grep -n --color=always'
    export GREP_COLOR='1;35;40'
  6. justinhartman revised this gist Nov 19, 2020. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -10,10 +10,6 @@ alias apt-update='sudo apt-get update'
    alias apt-upgrade='sudo apt-get update && sudo apt-get upgrade'
    alias apt-install='sudo apt-get install'
    alias apt-remove='sudo apt-get remove'
    # Aliases
    alias push='git pull origin master && git push origin master'
    alias pull='git pull origin master'
    alias clone='git clone $1'
    # Grep
    alias grep='grep -n --color=always'
    export GREP_COLOR='1;35;40'
    @@ -22,14 +18,16 @@ export GREP_COLOR='1;35;40'
    alias gcf='git config --list'
    alias gd='git diff'
    ## Clone/Checkout
    alias gcr='git clone $1'
    alias gcl='git clone --recurse-submodules'
    alias gcm='git checkout master'
    alias gcb='git checkout -b'
    ## Commit
    alias gcam='git commit -a -m'
    alias gcmsg='git commit -m'
    ## Push & Pull
    alias gp='git push'
    alias gpoat='git push origin --all && git push origin --tags'
    alias gpa='git push origin --all && git push origin --tags'
    alias gl='git pull'
    alias glo='git pull origin master'
    ## Tagging
  7. justinhartman renamed this gist Aug 24, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. justinhartman created this gist Aug 24, 2020.
    39 changes: 39 additions & 0 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # Bash
    alias ls='ls --color=always'
    alias ll='ls -lh --color=always'
    alias la='ls -lha --color=always'
    alias ..='cd ..'
    alias ...='cd ...'
    alias ....='cd ....'
    # Apt
    alias apt-update='sudo apt-get update'
    alias apt-upgrade='sudo apt-get update && sudo apt-get upgrade'
    alias apt-install='sudo apt-get install'
    alias apt-remove='sudo apt-get remove'
    # Aliases
    alias push='git pull origin master && git push origin master'
    alias pull='git pull origin master'
    alias clone='git clone $1'
    # Grep
    alias grep='grep -n --color=always'
    export GREP_COLOR='1;35;40'
    # Git commands
    ## General
    alias gcf='git config --list'
    alias gd='git diff'
    ## Clone/Checkout
    alias gcl='git clone --recurse-submodules'
    alias gcm='git checkout master'
    ## Commit
    alias gcam='git commit -a -m'
    alias gcmsg='git commit -m'
    ## Push & Pull
    alias gp='git push'
    alias gpoat='git push origin --all && git push origin --tags'
    alias gl='git pull'
    alias glo='git pull origin master'
    ## Tagging
    alias gts='git tag -s'
    ## Stats/Status
    alias gsb='git status -sb'
    alias glol="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
    2 changes: 2 additions & 0 deletions .bash_profile.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # Load bash which also gives us colours :-)
    exec bash