diff options
author | terminaldweller <thabogre@gmail.com> | 2022-04-17 15:53:44 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-04-17 15:53:44 +0000 |
commit | c94222d3c29789909f761aff31777bdc5b036c9c (patch) | |
tree | d1749737e9209556493a61e435dbae3371dba407 | |
parent | update (diff) | |
download | scripts-c94222d3c29789909f761aff31777bdc5b036c9c.tar.gz scripts-c94222d3c29789909f761aff31777bdc5b036c9c.zip |
bunch of stuff
-rw-r--r-- | .bashrc | 38 | ||||
-rw-r--r-- | .mutt/.muttrc | 42 | ||||
-rw-r--r-- | .tmux.conf | 2 | ||||
-rw-r--r-- | .vimrc | 2 | ||||
-rw-r--r-- | .zshrc | 8 | ||||
-rw-r--r-- | init.vim | 1 | ||||
-rw-r--r-- | irssi/config | 34 | ||||
-rwxr-xr-x | irssi/irssi.sh | 3 | ||||
-rw-r--r-- | irssi/solarized-powerline.theme | 10 | ||||
-rwxr-xr-x | lesscolor.sh | 15 | ||||
-rw-r--r-- | root/.bashrc | 10 | ||||
-rwxr-xr-x | services/docker/run | 9 |
12 files changed, 110 insertions, 64 deletions
@@ -1,6 +1,6 @@ case $- in - *i*) ;; - *) return;; +*i*) ;; +*) return ;; esac HISTCONTROL=ignoreboth @@ -11,13 +11,13 @@ shopt -s histappend shopt -s checkwinsize if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) + debian_chroot=$(cat /etc/debian_chroot) fi export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases + . ~/.bash_aliases fi if ! shopt -oq posix; then @@ -30,7 +30,6 @@ fi set -o vi export VAGRANT_DEFAULT_PROVIDER=libvirt -export PATH=$PATH:/home/farzad/.local/bin export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking export LESS_TERMCAP_md=$'\e[01;38;5;74m' # begin bold export LESS_TERMCAP_me=$'\e[0m' # end mode @@ -56,25 +55,24 @@ export PATH=$PATH:/usr/sbin disk_usage=$(df | grep /dev/sdb3 | awk '{print $5}') # https://www.askapache.com/linux/bash-power-prompt/ -function aa_prompt_defaults () -{ - local colors=`tput colors 2>/dev/null||echo -n 1` C=; +function aa_prompt_defaults() { + local colors=$(tput colors 2>/dev/null || echo -n 1) C= - if [[ $colors -ge 256 ]]; then - C="`tput setaf 33 2>/dev/null`"; - AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; export AA_PP="\033[38;5;2m"$((mf/1024))/"\033[38;5;89m"$((mt/1024))MB--$disk_usage; unset -v mf mt n a'; - else - C="`tput setaf 4 2>/dev/null`"; - AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; export AA_PP="\033[92m"$((mf/1024))/"\033[32m"$((mt/1024))MB--$disk_usage; unset -v mf mt n a'; - fi; + if [[ $colors -ge 256 ]]; then + C="$(tput setaf 33 2>/dev/null)" + AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; export AA_PP="\033[38;5;2m"$((mf/1024))/"\033[38;5;89m"$((mt/1024))MB--$disk_usage; unset -v mf mt n a' + else + C="$(tput setaf 4 2>/dev/null)" + AA_P='mf=x mt=x n=0; while [[ $n < 1 ]];do read a mt a; read a mf a; (( n++ )); done</proc/meminfo; export AA_PP="\033[92m"$((mf/1024))/"\033[32m"$((mt/1024))MB--$disk_usage; unset -v mf mt n a' + fi - eval $AA_P; + eval $AA_P - PROMPT_COMMAND='stty echo; history -a; echo -en "\e[34h\e[?25h"; (($SECONDS % 2==0 )) && eval $AA_P; echo -en "$AA_PP";'; - SSH_TTY=${SSH_TTY:-`tty 2>/dev/null||readlink /proc/$$/fd/0 2>/dev/null`} + PROMPT_COMMAND='stty echo; history -a; echo -en "\e[34h\e[?25h"; (($SECONDS % 2==0 )) && eval $AA_P; echo -en "$AA_PP";' + SSH_TTY=${SSH_TTY:-$(tty 2>/dev/null || readlink /proc/$$/fd/0 2>/dev/null)} - PS1="\[\e[m\n\e[1;38m\][\$\$:\$PPID \j:\!\[\e[1;38m\]]\[\e[0;36m\] \T \d \[\e[1;34m\][${C}\u@\H\[\e[1;34m\]:\[\e[0;37m\]${SSH_TTY/\/dev\/} \[\e[0;37m\]+${SHLVL}\[\e[1;34m\]] \[\e[1;37m\]\w\[\e[0;37m\]\n\\$ "; + PS1="\[\e[m\n\e[1;38m\][\$\$:\$PPID \j:\!\[\e[1;38m\]]\[\e[0;36m\] \T \d \[\e[1;34m\][${C}\u@\H\[\e[1;34m\]:\[\e[0;37m\]${SSH_TTY/\/dev\//} \[\e[0;37m\]+${SHLVL}\[\e[1;34m\]] \[\e[1;37m\]\w\[\e[0;37m\]\n\\$ " - export PS1 AA_P PROMPT_COMMAND SSH_TTY + export PS1 AA_P PROMPT_COMMAND SSH_TTY } aa_prompt_defaults diff --git a/.mutt/.muttrc b/.mutt/.muttrc index d899ce1..9875438 100644 --- a/.mutt/.muttrc +++ b/.mutt/.muttrc @@ -285,28 +285,28 @@ bind index M middle-page bind index L bottom-page # color body brightwhite default "^[[:space:]].*" -color body yellow default "^(diff).*" -color body white default "^[\-\-\-].*" -color body white default "^[\+\+\+].*" +# color body yellow default "^(diff).*" +color body red default "^[\-\-\-].*" +color body green default "^[\+\+\+].*" color body green default "^[\+].*" color body red default "^[\-].*" -color body brightblue default "[@@].*" -color body brightwhite default "^(\s).*" -color body cyan default "^(Signed-off-by).*" -color body cyan default "^(Docker-DCO-1.1-Signed-off-by).*" -color body brightwhite default "^(Cc)" -color body yellow default "^diff \-.*" -color body brightwhite default "^index [a-f0-9].*" -color body brightblue default "^---$" -color body white default "^\-\-\- .*" -color body white default "^[\+]{3} .*" +color body blue default "[@@].*" +# color body brightwhite default "^(\s).*" +# color body cyan default "^(Signed-off-by).*" +# color body cyan default "^(Docker-DCO-1.1-Signed-off-by).*" +# color body brightwhite default "^(Cc)" +# color body yellow default "^diff \-.*" +# color body brightwhite default "^index [a-f0-9].*" +# color body brightblue default "^---$" +color body red default "^\-\-\- .*" +color body green default "^[\+]{3} .*" color body green default "^[\+][^\+]+.*" color body red default "^\-[^\-]+.*" -color body brightblue default "^@@ .*" -color body green default "LGTM" -color body brightmagenta default "-- Commit Summary --" -color body brightmagenta default "-- File Changes --" -color body brightmagenta default "-- Patch Links --" -color body green default "^Merged #.*" -color body red default "^Closed #.*" -color body brightblue default "^Reply to this email.*" +color body blue default "^@@ .*" +# color body green default "LGTM" +# color body brightmagenta default "-- Commit Summary --" +# color body brightmagenta default "-- File Changes --" +# color body brightmagenta default "-- Patch Links --" +# color body green default "^Merged #.*" +# color body red default "^Closed #.*" +# color body brightblue default "^Reply to this email.*" @@ -34,7 +34,7 @@ set -sg escape-time 0 set -g default-command /usr/bin/zsh set -g default-shell /usr/bin/zsh -set -g default-terminal "screen-256color" +set -g default-terminal "st-256color" set -s set-clipboard external set-option -g prefix C-a @@ -1065,7 +1065,7 @@ let g:ctrlp_root_markers = ['.root'] let g:ctrlp_custom_ignore = '\v[\/](node_modules|target|dist)|(\.(swp|ico|git|svn))$' if executable('rg') set grepprg=rg\ --color=never - let g:ctrlp_user_command = 'rg %s --files --hidden --color=never --glob "!node_modules,!*.swp,!*.swo"' + let g:ctrlp_user_command = 'rg %s --files --hidden --color=never --glob "!node_modules"' let g:ctrlp_use_caching = 0 endif @@ -218,6 +218,8 @@ alias dud="du -hcD --max-depth=1 | sort -hr | colcol | column -t" alias bbox="busybox" alias gitconfigrc="vim ~/scripts/.gitconfig" alias fixgitconfigrc="cp ~/scripts/.gitconfig ~/.gitconfig" +alias nviminit="vim ~/scripts/init.vim" +alias fixnviminit="cp ~/scripts/init.vim ~/.config/nvim/init.vim" #autosuggest ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#5f5fff,bg=#000000,bold,underline" @@ -379,9 +381,9 @@ export PATH=$PATH:/home/devi/vagrant # export PATH=$PATH:/home/devi/devi/emsdk.git/main/upstream/emscripten export PATH=$PATH:/home/devi/google-java-format export PATH=$PATH:/home/devi/gradle/gradle-7.2/bin -export PATH=$PATH:/home/devi/devi/emsdk.git/3.1.0 -export PATH=$PATH:/home/devi/devi/emsdk.git/3.1.0/node/14.15.5_64bit/bin -export PATH=$PATH:/home/devi/devi/emsdk.git/3.1.0/upstream/emscripten +export PATH=$PATH:/home/devi/devi/emsdk.git/3.1.8 +export PATH=$PATH:/home/devi/devi/emsdk.git/3.1.8/node/14.18.2_64bit/bin +export PATH=$PATH:/home/devi/devi/emsdk.git/3.1.8/upstream/emscripten export PATH=$PATH:/home/devi/devi/git-scripts.git/master ks() { @@ -1,4 +1,3 @@ - let mapleader = " " call plug#begin('~/AppData/Local/nvim/plugged') Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } diff --git a/irssi/config b/irssi/config index bfb983e..7823a8d 100644 --- a/irssi/config +++ b/irssi/config @@ -70,6 +70,22 @@ servers = ( use_tls = "yes"; tls_verify = "no"; autoconnect = "yes"; + }, + { + address = "efnet.port80.se"; + chatnet = "EFnet"; + port = "6697"; + use_tls = "yes"; + tls_verify = "no"; + autoconnect = "yes"; + }, + { + address = "irc.dal.net"; + chatnet = "DALnet"; + port = "6697"; + use_tls = "yes"; + tls_verify = "yes"; + autoconnect = "yes"; } ); @@ -89,6 +105,8 @@ chatnets = { Rizon = { type = "IRC"; }; IRCNet = { type = "IRC"; }; "Undernet-ZNC" = { type = "IRC"; }; + EFnet = { type = "IRC"; }; + DALnet = { type = "IRC"; }; }; channels = ( @@ -283,7 +301,6 @@ statusbar = { time = "{sb $Z}"; user = "%z005fff{sb {sbnickmode $[-2]cumode}%k$N %Zeeeeee {sbumode %k$usermode} %Z005fff%0%z005f00{sbaway $A}}%N"; - # treated specially .. window is printed with non-empty windows, # window_empty is printed with empty windows window = " %Z00af00{sb $tag/{channel $itemname} %C {sbmode $M}} %C%n "; @@ -299,6 +316,10 @@ statusbar = { lag = "{sb %0%Zff8700%zff8700%k ⌚ $0 %Zff8700%0%N}"; act = "{sb %Zeeeeee%0%n%z005fff %F$0%F %N}"; more = "%c%0%n%z00af00 more ⬇ %c%0%N"; + + # vim_mode + vim_mode_1 = "%z005f5f%Zffffff%z005f5f%k%9 $vim_cmd_mode%N"; + vim_windows_1 = "%Z005f5f%0%z005f5f%k%9 $vim_wins%z005f5f"; }; # there's two type of statusbars. root statusbars are either at the top @@ -322,16 +343,20 @@ statusbar = { # list of items in statusbar in the display order items = { barstart = { priority = "100"; }; + user = { }; window = { }; window_empty = { }; mh_sbsplitmode = { }; lag = { priority = "-1"; }; more = { priority = "-1"; alignment = "right"; }; - barend = { priority = "100"; alignment = "right"; }; - otr = { }; + otr = { priority = "100"; alignment = "right"; }; usercount = { }; - rotator = { }; + rotator = { alignment = "right"; }; + vim_windows_1 = { alignment = "right"; }; + vim_mode_1 = { priority = "100"; alignment = "right"; }; + + barend = { priority = "100"; alignment = "right"; }; }; }; @@ -455,6 +480,7 @@ settings = { timezones = "GMT:GMT EST:EST CET:CET Tehran:Asia/Tehran Tokyo:Asia/Tokyo Montreal:America/Montreal Pacific:America/Los_Angeles Paris:Europe/Paris"; # hilite_url url_color = "38;5;6"; + hilite_url = "38;5;6"; # rotator rotator_chars = ". o 0 O"; rotator_speed = "1000"; diff --git a/irssi/irssi.sh b/irssi/irssi.sh index 33d348c..779c170 100755 --- a/irssi/irssi.sh +++ b/irssi/irssi.sh @@ -19,8 +19,9 @@ wget https://scripts.irssi.org/scripts/scriptassist.pl wget https://scripts.irssi.org/scripts/tordetect.pl wget https://scripts.irssi.org/scripts/usercount.pl # wget https://scripts.irssi.org/scripts/bitlbee_typing_notice.pl -# wget https://scripts.irssi.org/scripts/uberprompt.pl +wget https://scripts.irssi.org/scripts/uberprompt.pl wget https://scripts.irssi.org/scripts/bitlbee_tab_completion.pl +wget https://raw.githubusercontent.com/shabble/irssi-scripts/master/vim-mode/vim_mode.pl cd ~/scripts/irssi cp ./config ~/.irssi/config diff --git a/irssi/solarized-powerline.theme b/irssi/solarized-powerline.theme index 7bc04e4..c079bac 100644 --- a/irssi/solarized-powerline.theme +++ b/irssi/solarized-powerline.theme @@ -88,7 +88,7 @@ abstracts = { channel = "%Z00af00$*%n"; # nick is printed - nick = "%Zeeeeee{nickcolor $*}"; + nick = "%z005f87%Zeeeeee{nickcolor $*}"; mynick = "%Zeeeeee{nickcolor $*}"; inick = "%Zeeeeee{nickcolor $*}"; # Inverted @@ -322,7 +322,7 @@ abstracts = { topicsbstart = "{sbstart $*}"; topicsbend = "{sbend $*}"; - prompt = "%k%z005f87$c $* %N%Z005f87%n "; + prompt = "%k%z005f87%9$c $*%w%k$R%w%k$S%w%k$N%w%k$T %N%Z005f87%n "; # This controls each part of a statusbar, including the outer brackets of adv_windowlist sb = "$*"; @@ -447,9 +447,9 @@ formats = { topic_info = "%k%z00d700TOPIC %Z00d700%0%N {nick $0}%N {nickhost $2} $1"; unaway = "%k%z00d700AWAY %Z00d700%0%N END"; usermode_change = "%z008700%ZeeeeeeMODE %N%Z008700%N {mode $0}%N for %0{mynick $1}%N"; - who = "%z00d700%kWHO %z005f87%k {inick $[!9]1} %Z005f87 %k$0 %0%g Status: $[!3]2 $[-2]3 hops %N%k%N {nickhost $4@$5} {comment $6}"; - whois = "%z00d700%kWHOIS %Z00d700%0%n {nick $0} {nickhost $1@$2}%:{whois ircname $3}"; - whowas = "%z00d700%kWHOWAS %Z00d700%0%n {nick $0} {nickhost $1@$2}%:{whois was $3}"; + who = "%z00d700%kWHO %Z00d700%z005f87 %z005f87%k{inick $[!9]1} %Z005f87%2 %k$0 %0%g Status: $[!3]2 $[-2]3 hops %N%g%N {nickhost $4@$5} {comment $6}"; + whois = "%z00d700%kWHOIS %Z00d700%z005f87 {nick $0} %Z005f87%0 {nickhost $1@$2}%:{whois ircname $3}"; + whowas = "%z00d700%kWHOWAS %Z00d700%0%n {nick $0} {nickhost $1@$2}%:{whois was $3}"; own_action = "$nickalign{ownaction $0$nicktrunc}$1"; action_private = "$nickalign{pvtaction $0$nicktrunc}$2"; action_private_query = "$nickalign{pvtaction_query $0$nicktrunc}$2"; diff --git a/lesscolor.sh b/lesscolor.sh index 069126e..4a8dc93 100755 --- a/lesscolor.sh +++ b/lesscolor.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash get_interp() { - shebang=$(head -1 $1) + shebang=$(head -1 "$1") IFS='/' read -ra arr_slash <<< "$shebang" IFS=' ' read -ra arr_space <<< "${arr_slash[-1]}" - + if [[ ${arr_space[0]} == "env" ]];then - echo ${arr_space[1]} + echo "${arr_space[1]}" else - echo ${arr_space[0]} + echo "${arr_space[0]}" fi } @@ -62,10 +62,11 @@ case "$1" in *.feature|*.tap|*.awk|*.vim|*.pot|*.po|*.weechatlog|*.todotxt|*.thy|\ *.lean|*.rts|*.u|*.vcl|*.bpl|*.sil|*.vpr|*.cirru|*.duel|*.jbst|*.qml|\ *.qbs|*.slim|*.xqy|*.xquery|*.xq|*.xql|*.xqm|*.whiley|*.x10) - pygmentize -f 256 -O style=$PYGMENTIZE_STYLE "$1"|nl -b a;; + pygmentize -f 256 -O style="$PYGMENTIZE_STYLE" "$1" | nl -b a;; *) - interp=$(get_interp $1) - pygmentize -f 256 -O style=$PYGMENTIZE_STYLE -l $interp "$1"|nl -b a + # interp=$(get_interp "$1") + # pygmentize -f 256 -O style="$PYGMENTIZE_STYLE" -l "$interp" "$1" | nl -b a + pygmentize -f 256 -O style="$PYGMENTIZE_STYLE" -g "$1" | nl -b a esac exit 0 diff --git a/root/.bashrc b/root/.bashrc index ff70aa8..3be781e 100644 --- a/root/.bashrc +++ b/root/.bashrc @@ -11,4 +11,14 @@ alias ....="cd ../../.." alias .....="cd ../../../.." alias ......="cd ../../../../.." +export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking +export LESS_TERMCAP_md=$'\e[01;38;5;74m' # begin bold +export LESS_TERMCAP_me=$'\e[0m' # end mode +export LESS_TERMCAP_se=$'\e[0m' # end standout-mode +export LESS_TERMCAP_so=$'\e[38;5;246m' # begin standout-mode - info box +export LESS_TERMCAP_ue=$'\e[0m' # end underline +export LESS_TERMCAP_us=$'\e[04;38;5;146m' # begin underline + export PS1="\[$(tput bold)\]\[\033[38;5;9m\]\u\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;10m\]@\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;12m\]\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;170m\][\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;228m\]\w\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;211m\]]\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;171m\]\\$\[$(tput sgr0)\] " + +alias man="man -O width=210" diff --git a/services/docker/run b/services/docker/run new file mode 100755 index 0000000..77eff1a --- /dev/null +++ b/services/docker/run @@ -0,0 +1,9 @@ +#!/bin/sh +[ -r conf ] && . ./conf +modprobe -q loop || exit 1 +mountpoint -q /sys/fs/cgroup/systemd || { + mkdir -p /sys/fs/cgroup/systemd; + mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd; +} +#exec env HTTP_PROXY="http://127.0.0.1:9999" chpst -o 1048576 -p 1048576 dockerd $OPTS 2>&1 +exec env NO_PROXY="localhost,127.0.0.1,192.168.1/24" HTTPS_PROXY="socks5://127.0.0.1:9996" HTTP_PROXY="socks5://127.0.0.1:9996" chpst -o 1048576 -p 1048576 dockerd $OPTS 2>&1 |