Commit a26c17a2 authored by Ashwin Vishnu's avatar Ashwin Vishnu
Browse files

Merge remote-tracking branch 'origin/yunohost' into precis

parents 64cb4e15 231551da
......@@ -10,9 +10,49 @@ case $- in
esac
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] '
#PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] '
# 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|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
if [ -f ~/.profile ]; then
. ~/.profile
......@@ -27,14 +67,54 @@ xhost +local:root > /dev/null 2>&1
complete -cf sudo
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s cdspell
shopt -s checkwinsize
shopt -s cmdhist
shopt -s dotglob
shopt -s expand_aliases
shopt -s extglob
# append to the history file, don't overwrite it
shopt -s histappend
shopt -s hostcomplete
# 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
# 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
# some more ls aliases
alias ls='ls --color=auto'
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
# 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
# System specific
_BASHRC_LOCAL="$HOME/.bashrc-$HOST"
......@@ -48,3 +128,4 @@ fi
[ -f /home/avmo/.travis/travis.sh ] && source /home/avmo/.travis/travis.sh
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
#!/usr/bin/env zsh
set -e
which yadm || alias yadm="./yadm"
declare -r YADM_WORK=$(yadm rev-parse --show-toplevel)
# Because Git submodule commands cannot operate without a work tree, they must
# be run from within $YADM_WORK (assuming this is the root of your dotfiles)
......
#!/bin/bash
sudo runuser -u nextcloud -- /usr/bin/php /var/www/nextcloud/occ $@
#!/bin/bash
awk 'BEGIN {
t[1]="sd->processed"
t[2]="sd->dropped"
t[3]="sd->time_squeeze"
t[9]="sd->cpu_collision"
t[10]="sd->received_rps"
printf "%s %s %s %s %s\n",t[1],t[2],t[3],t[9],t[10];
}
{
printf "%d %d %d %d %d\n", strtonum( "0x"$1 ),strtonum( "0x"$2 ),strtonum( "0x"$3 ),strtonum( "0x"$9 ),strtonum( "0x"$10 )
}' /proc/net/softnet_stat | column -t
......@@ -18,16 +18,35 @@ if [ -d "$HOME/bin" ] ; then
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
if [ -d "$HOME/.local/bin" ] ; then
export PATH="$PATH:$HOME/.local/bin"
fi
# Return the first pathname in $PATH for name in $1
cmd_exists() {
if [ "$BASH_VERSION" ]; then
type -P "$1" # No output if not in $PATH
else
type "$1" 2> /dev/null | grep -v "not found"
fi
}
export HISTSIZE=10000
export HISTFILESIZE=${HISTSIZE}
export HISTCONTROL=ignoreboth
#Env Variables
export EDITOR="nvim"
if [ -x /usr/bin/nvim ]; then
export EDITOR="nvim"
elif [ -x /usr/bin/vim ]; then
export EDITOR="vim"
elif [ -x "$(cmd_exists nvim)" ]; then
# user installed nvim (AppImage)
export EDITOR="nvim"
else
export EDITOR="vim.tiny"
fi
export VIM_COLOR="material"
export LESS='-R'
LESSOPEN="|bat --color always %s"
......@@ -67,19 +86,22 @@ alias wanip='dig +short myip.opendns.com @resolver1.opendns.com'
alias dnsip='nmcli --fields ip4.dns,ip6.dns con show $(nmcli -t --fields NAME con show --active)'
# ArchLinux
alias fixpacdb='sudo rm -f /var/lib/pacman/db.lck'
alias pacdiffloc='locate --existing --regex "\.pac(new|save)$"'
alias aurvote='ssh aur@aur.archlinux.org vote'
alias checkupdates='checkupdates | column -t'
alias mksrcinfo='makepkg --printsrcinfo >! .SRCINFO'
alias pacman-update-mirrors='sudo reflector -c SE -c NO -c DK -c NL -f 8 --save /etc/pacman.d/mirrorlist'
alias pacman-recent="expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | less"
if [ -x /usr/bin/pacman ]; then
alias fixpacdb='sudo rm -f /var/lib/pacman/db.lck'
alias pacdiffloc='locate --existing --regex "\.pac(new|save)$"'
alias aurvote='ssh aur@aur.archlinux.org vote'
alias checkupdates='checkupdates | column -t'
alias mksrcinfo='makepkg --printsrcinfo >! .SRCINFO'
alias pacman-update-mirrors='sudo reflector -c SE -c NO -c NL -f 6 --save /etc/pacman.d/mirrorlist'
alias pacman-recent="expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | less"
fi
# Python
## Uncomment if pip cache takes up too much space
# alias pip="python -m pip --no-cache-dir"
## or even better simply symlink ~/.cache/pip
[ -x /usr/bin/spyder ] && alias spyder='env python /usr/bin/spyder'
[ -x /usr/bin/spyder3 ] && alias spyder3='env python3 /usr/bin/spyder3'
alias jupyter-clean-checkpoints='find -name ".ipynb_checkpoints" -type d | xargs rm -rf'
alias ipcluster-mpi='ipcluster start -n 2 --engines=MPIEngineSetLauncher'
......@@ -131,12 +153,13 @@ export WORKON_HOME='/scratch/avmo/opt'
SDL_VIDEO_FULLSCREEN_HEAD=0
# Dircolors
eval $(dircolors $HOME/.dir_colors)
eval "$(dircolors $HOME/.dir_colors)"
# Firefox
export MOZ_USE_XINPUT2=1
# Alacritty
# FIXME: needed for HIDPI
# export WINIT_HIDPI_FACTOR=2
# Python startup
......@@ -148,18 +171,9 @@ export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
# Bemenu
export BEMENU_BACKEND='wayland'
# Return the first pathname in $PATH for name in $1
function cmd_exists() {
if [[ $ZSH_VERSION ]]; then
whence -cp "$1" 2> /dev/null
else # bash
type -P "$1" # No output if not in $PATH
fi
}
# Programming Languages
# Perl
if [[ -x $(cmd_exists perl) ]]; then
if [ "$(cmd_exists perl)" ]; then
PERL5DIR="$HOME/.local/share/perl5"
PATH="${PERL5DIR}/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="${PERL5DIR}/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
......@@ -169,7 +183,7 @@ if [[ -x $(cmd_exists perl) ]]; then
fi
# Node.js
if [[ -x $(cmd_exists npm) ]]; then
if [ "$(cmd_exists npm)" ]; then
export NPM_PACKAGES=$HOME/.npm-packages
export PATH="$NPM_PACKAGES/bin:$PATH:$HOME/.yarn/global/node_modules/.bin:"
# export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
......@@ -178,13 +192,13 @@ if [[ -x $(cmd_exists npm) ]]; then
fi
# Java
if [[ -x $(cmd_exists archlinux-java) ]]; then
export JAVA_HOME=/usr/lib/jvm/$(archlinux-java get)
if [ "$(cmd_exists archlinux-java)" ]; then
export JAVA_HOME="/usr/lib/jvm/$(archlinux-java get)"
fi
export JAVA_FONTS=/usr/share/fonts/TTF
# Go lang
if [[ -x $(cmd_exists go) ]]; then
if [ "$(cmd_exists go)" ]; then
export GOPATH=$HOME/.go
export GOBIN=$GOPATH/bin
export PATH="$GOBIN:$PATH"
......@@ -193,12 +207,12 @@ if [[ -x $(cmd_exists go) ]]; then
fi
# Rust
if [[ -x $(cmd_exists cargo) ]]; then
if [ "$(cmd_exists cargo)" ]; then
export PATH="$HOME/.cargo/bin:$PATH"
fi
# Lua
if [[ -x $(cmd_exists luarocks) ]]; then
if [ "$(cmd_exists luarocks)" ]; then
eval $(luarocks path --bin --append)
fi
......
#!/bin/bash
declare -r SSH_KEY=~/.ssh/coderef
declare -r SSH_CONFIG=~/.ssh_config
declare -r SSH_KEY=$HOME/.ssh/coderef
declare -r SSH_CONFIG=$HOME/.ssh/config
function yes_or_no {
while true; do
......@@ -13,7 +13,7 @@ function yes_or_no {
}
# Command yadm does not exists
if [[ -z $(type -P "yaadm") ]]; then
if [[ -z $(type -P "yadm") ]]; then
if yes_or_no 'Command yadm not found. Try installing using system package manager?'; then
if [ -x /usr/bin/apt ]; then
# Debian / Ubuntu
......
# ~/.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
# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# 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
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment