diff options
author | Silvino Silva <silvino@bk.ru> | 2021-02-12 03:59:34 +0000 |
---|---|---|
committer | Silvino Silva <silvino@bk.ru> | 2021-02-12 03:59:34 +0000 |
commit | a3628fc49db4d88ff3e4067268650710d1da3f6f (patch) | |
tree | 8fdac6dfc8cabb9f85a2db3a3bd628cfe44438cd /linux/conf/skel | |
parent | 0a6b0fc9769daf0932cb207c3285baa31547b489 (diff) | |
download | doc-a3628fc49db4d88ff3e4067268650710d1da3f6f.tar.gz |
initial openbsd support
Diffstat (limited to 'linux/conf/skel')
-rw-r--r-- | linux/conf/skel/.bash_profile | 8 | ||||
-rw-r--r-- | linux/conf/skel/.bashrc | 73 | ||||
-rw-r--r-- | linux/conf/skel/.profile | 36 | ||||
-rw-r--r-- | linux/conf/skel/.tmux.conf | 27 |
4 files changed, 144 insertions, 0 deletions
diff --git a/linux/conf/skel/.bash_profile b/linux/conf/skel/.bash_profile new file mode 100644 index 0000000..9ea6954 --- /dev/null +++ b/linux/conf/skel/.bash_profile @@ -0,0 +1,8 @@ +#!/bin/bash +if [ -f ~/.profile ]; then + source ~/.profile +fi + +if [ -f ~/.bashrc ]; then + source ~/.bashrc +fi diff --git a/linux/conf/skel/.bashrc b/linux/conf/skel/.bashrc new file mode 100644 index 0000000..f562e3c --- /dev/null +++ b/linux/conf/skel/.bashrc @@ -0,0 +1,73 @@ +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + + +alias diff='diff --color=auto' +alias grep='grep --color=auto' +alias ls='ls -ph --color=auto' +alias rm='rm -i' +#alias cp='cp -i' +alias mv='mv -i' +# Prevents accidentally clobbering files. +alias mkdir='mkdir -p' +alias h='history' +alias hg='history | grep' +alias j='jobs -l' +alias which='type -a' +alias ..='cd ..' + +# Generate a password +genpasswd () { + local l=$1 + [ "$l" == "" ] && l=20 + tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs +} + +# Git log +glog () { + git log --stat --decorate +} +# Git graph log +gloga () { + git log --graph --abbrev-commit --decorate --date=relative --all +} + +alias tmux="tmux -2" + +# Virtual Crux machine +alias c1.ank="ssh c1 -t tmux a" +alias c2.ank="ssh c2 -t tmux a" +alias c9.ank="ssh c9 -t tmux a" + +alias pkg_mirror="pkg_bin -f /usr/ports/mirror_bin_db" +alias pkg_update="pkg_bin -r /usr/ports/mirror_bin_db" + +#if [[ -z "$TMUX" ]] ;then +# ID="`tmux ls | grep -vm1 attached | cut -d: -f1`" # get the id of a deattached session +# if [[ -z "$ID" ]] ;then # if not available create a new one +# tmux new-session +# else +# tmux attach-session -t "$ID" # if available attach to it +# fi +#fi +MAIL=/home/silvino/.mail/ diff --git a/linux/conf/skel/.profile b/linux/conf/skel/.profile new file mode 100644 index 0000000..7e15d10 --- /dev/null +++ b/linux/conf/skel/.profile @@ -0,0 +1,36 @@ +export GPG_AGENT_INFO # the env file does not contain the export statement +export SSH_AUTH_SOCK # enable gpg-agent for ssh + +export GPGKEY=XXXXXXXX + +# ssh-agent to ask only ounce for password +SSH_ENV="$HOME/.ssh/environment" +function start_agent { + echo "Initialising new SSH agent..." + /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" + echo succeeded + chmod 600 "${SSH_ENV}" + . "${SSH_ENV}" > /dev/null + # KEY_NAME with default key to load + /usr/bin/ssh-add ~/.ssh/KEY_NAME; +} + +# Source SSH settings, if applicable +if [ -f "${SSH_ENV}" ]; then + . "${SSH_ENV}" > /dev/null + #ps ${SSH_AGENT_PID} doesn't work under cywgin + ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { + start_agent; + } +else + start_agent; +fi + +# Weston +if test -z "${XDG_RUNTIME_DIR}"; then + export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir + if ! test -d "${XDG_RUNTIME_DIR}"; then + mkdir "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" + fi +fi diff --git a/linux/conf/skel/.tmux.conf b/linux/conf/skel/.tmux.conf new file mode 100644 index 0000000..ee127e8 --- /dev/null +++ b/linux/conf/skel/.tmux.conf @@ -0,0 +1,27 @@ +set -g default-terminal "screen-256color" + +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi 'v' send-keys -X begin-selection +bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel + + +# Vim style +# copy tmux's selection buffer into the primary X selection with PREFIX+CTRL+Y +bind-key u run "tmux save-buffer - | xsel -ib" +# copy primary X selection into tmux's selection buffer with PREFIX+CTRL+P +bind-key e run "xsel -ob | tmux load-buffer -" + +set-option -g set-titles on +set-option -g set-titles-string '#S> #I.#P #W' + +set -g visual-activity on +set -g monitor-activity on +set -g visual-bell on +set -g bell-action any + +## Join windows: <prefix> s, <prefix> j +bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" +bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" + +# Torn on mouse +set -g mouse on |