Skip to content

Instantly share code, notes, and snippets.

@kyxap1
Last active April 30, 2021 21:57
Show Gist options
  • Save kyxap1/f180d6046083b09bbdbf4d93bcec6532 to your computer and use it in GitHub Desktop.
Save kyxap1/f180d6046083b09bbdbf4d93bcec6532 to your computer and use it in GitHub Desktop.
Brume (GL-MV1000) Edge Computing Gateway
# sync history
history -a
history -w
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
#!/bin/bash
if test -d $BASH_VERSION; then return; fi
complete -d cd
shopt -s cdspell
shopt -q -s cdspell
shopt -q -s checkwinsize
shopt -q -s extglob
shopt -s histappend
shopt -q -s cmdhist
set -o notify
ulimit -S -c 0 > /dev/null 2>&1
export HISTCONTROL="ignoreboth"
export HISTTIMEFORMAT="%Y %h %d %H:%M:%S "
export HISTFILESIZE=
export HISTSIZE=
# locale fix
export LC_MESSAGES=POSIX
export LC_ALL=en_US.UTF-8
export COLORTERM=truecolor
export CLICOLOR=1
export VISUAL=vim
export EDITOR=vim
export PAGER='less -F'
# man coloring
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;38;5;208m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[04;38;5;111m'
# /usr/share/source-highlight/src-hilite-lesspipe.sh
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -RSFXin'
# bash prompt
PS1='\[\033[01;93m\]\u@\h\[\033[00m\]'
PS1+=':\[\033[01;34m\]\w\[\033[00m\]\$ '
export PS1
# easier bash scripts debug
export PS2='continue> '
export PS3='choose: '
export PS4='|${BASH_SOURCE} ${LINENO}${FUNCNAME[0]:+ ${FUNCNAME[0]}()}| '
#dircolors database => https://gist.github.com/kyxap1/5bb34a24f5eb5412347d9ed571c2fade
eval "$(dircolors -b ~/.dircolors)"
alias diff='diff --color=tty'
alias grep='grep --color=tty'
alias grpe='grep --color=tty'
alias ip='ip --color=tty'
alias ls='ls --color=tty'
alias ls-='ls'
alias xargs='xargs '
alias dig='dig +vc'
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gd='git diff'
alias gs='git status'
alias gp='git pull'
alias gl='git lds'
alias gcm='git checkout master'
alias gpurge='git master-cleanse-local'
# Written by Gordio <[email protected]>
# Licence: MIT
# Need escape. I don't know why. (for ash)
opkg () {
BOLD=$(echo -e '\033[01;32m');
NORM=$(echo -e '\033[0m');
COL="no";
for arg in $*; do
if [ $arg == "whatdepends" -o $arg == "list" \
-o $arg == "list-installed" -o $arg == "list-upgradable" \
-o $arg == "list-changed-conffiles" -o $arg == "status" \
-o $arg == "info" -o $arg == "find" ]; then
COL="yes";
break;
fi
done
if [ $COL == "yes" ]; then
# (|\t*) added for 'whatdepends'
/bin/opkg $* | sed -re "s/^(|\t*)[a-z0-9-]*/$BOLD&$NORM/g";
else
/bin/opkg $*;
fi
}
# vim: set fdm=marker ts=4 sw=4 tw=80 fo-=t ff=unix:
bash bind-host bind-dig binutils block-mount bsdtar btrfs-progs bzip2 cfdisk coreutils coreutils-dircolors coreutils-tail curl ddns-scripts ddns-scripts_cloudflare.com-v4 diffutils dmesg e2fsprogs ebtables file findutils fstrim getopt git gl-crond gl-ddns gnupg grep gzip htop iftop kmod-fs-btrfs kmod-usb-ohci kmod-usb-storage kmod-usb-storage-extras kmod-usb-uhci less lftp lsblk luci-app-acme luci-app-attendedsysupgrade luci-app-ddns luci-app-opkg luci-app-statistics luci-app-wireguard luci-app-uhttpd luci-proto-hnet luci-proto-wireguard mac-telnet-client make mii-tool moreutils mount-utils mtr ncdu netcat nmap pciutils procps-ng-free procps-ng-ps procps-ng-uptime procps-ng-vmstat procps-ng-w procps-ng-watch procps-ng-watch pv rsync screen serialconsole smartmontools strace swap-utils tcpdump terminfo unzip usbutils vim-full vim-runtime vpnc-scripts wget wireguard-tools xz-utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment