Compare commits
43 Commits
Author | SHA1 | Date | |
---|---|---|---|
38461006cf | |||
ecd49cdfdf | |||
4d48f02553 | |||
e54bebad64 | |||
ca2981a954 | |||
b3761b361f | |||
4510552267 | |||
5fd630c948 | |||
0ba4593214 | |||
ef0e3c01c7 | |||
521cbd0c2d | |||
3b1c3037f3 | |||
0af1e2d9d1 | |||
8a26df4c74 | |||
75a18fd7c6 | |||
65252ffe9f | |||
ce711ca6d5 | |||
925065127f | |||
a456bf734c | |||
0e928f9f34 | |||
7dd3ac24fc | |||
e0d6ead5f5 | |||
e1d80ce73f | |||
f1d3ef2616 | |||
1c0cd58364 | |||
7f7a2c7725 | |||
73808aad2a | |||
5433ec428d | |||
06814fbb4a | |||
5829a06604 | |||
2cab93bad9 | |||
29d1870eb3 | |||
60930b0206 | |||
51db0dbd95 | |||
337228c244 | |||
8bf03bbed6 | |||
1369ee6d15 | |||
02aa2898a5 | |||
bbc5f85972 | |||
cc9072dbc5 | |||
72412817c7 | |||
c678ce8f14 | |||
0440bdc0dd |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,4 @@
|
||||
.stfolder
|
||||
main.retry
|
||||
/private
|
||||
.env
|
||||
|
66
README.md
66
README.md
@ -1,38 +1,50 @@
|
||||
Sync
|
||||
=========
|
||||
# Sync
|
||||
Syncs austenwares.com offical bash/zsh/tmux/vim/... config files
|
||||
|
||||
Sync syncs tmux/vim/bash config files with one command
|
||||
### Installation
|
||||
- Using Ansible (more setup, easier syncing)
|
||||
|
||||
Usage:
|
||||
git clone https://gitea.austenwares.com/stonewareslord/sync
|
||||
cd sync
|
||||
virtualenv .env
|
||||
. .env/bin/activate
|
||||
pip install -r requirements.txt
|
||||
./sync.sh TAG[,TAG2...] [ANSIBLE-OPTS]
|
||||
|
||||
```sh
|
||||
usage: sync.sh [-h] [-t] [-c] [-b] [-s] [-d]
|
||||
- Using stow (quicker, easier, less features)
|
||||
|
||||
optional arguements:
|
||||
-h Show this help message and exit
|
||||
-t Syncs tmux configuration file
|
||||
-c Syncs other configuration files
|
||||
-b Syncs Vim bundles
|
||||
-s Syncs computer with server applications in server.txt
|
||||
-d Syncs computer with desktop applications in desktop.txt
|
||||
```
|
||||
git clone https://gitea.austenwares.com/stonewareslord/sync ~/sync
|
||||
cd ~/sync
|
||||
stow skel
|
||||
# For private
|
||||
git clone https://gitea.austenwares.com/stonewareslord/private
|
||||
stow private/skel
|
||||
|
||||
Or, install vim bundles and vimrc, customizing which bundles you use first (requires `curl` and `vim` packages):
|
||||
- Stow oneliner
|
||||
|
||||
```sh
|
||||
mkdir -p ~/.vim/plugin/ ~/.vim/backup/ ~/.vim/undo/ ~/.vim/tmp/ ~/.vim/bundle/ ~/.vim/bundle/ ; if [ ! -f ~/.vim/plugin/sessionman.vim ] ; then curl -o ~/.vim/plugin/sessionman.vim http://www.vim.org/scripts/download_script.php?src_id=15599 ; fi ; if [ ! -d ~/.vim/bundle/vundle/ ] ; then git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle ; fi ; curl -o ~/.vimrc -k https://austenwares.com/gitlab/stonewareslord/Sync/raw/master/vimrc ; vim ~/.vimrc +"execute \"normal /Bundle 'gmarik\/vundle'\<CR>\"" +"execute \"normal :nohlsearch\<CR>:function Save()\<CR>w\<CR>BundleInstall\<CR>qa\<CR>endfunction\<CR>\"" +"nnoremap <F2> :call Save()<CR>:so ~/.vimrc<CR>:BundleInstall<CR>" ; echo "Installation should be complete. Run \"vim\" to check"
|
||||
```
|
||||
command -v stow >/dev/null && git clone https://gitea.austenwares.com/stonewareslord/sync ~/sync && cd ~/sync && stow skel && git checkout develop && git clone git@gitea.austenwares.com:stonewareslord/private && stow private/skel
|
||||
|
||||
Usage: run this command and it will automatically load the bundle list with descriptions of each. Delete the ones you don't want to install and press `F2` in normal mode to install al at once.
|
||||
- Installing vim
|
||||
|
||||
Or, temporarily load the bashrc (requires `curl` package):
|
||||
vim +'call Initialize()'
|
||||
|
||||
```sh
|
||||
curl -k -o /tmp/tmprc https://98.26.78.121/gitlab/stonewareslord/Sync/raw/master/tmprc && . /tmp/tmprc ; rm /tmp/tmprc
|
||||
```
|
||||
### Examples
|
||||
#### Sync all config and remove existing files
|
||||
|
||||
Or, clone the sync project and add all origins automatically:
|
||||
./sync.sh clean --extra-vars 'overwrite_existing=yes'
|
||||
|
||||
```sh
|
||||
mkdir sync&&cd sync&&git init&&git remote add testorigin https://98.26.78.121/gitlab/stonewareslord/Sync.git&&git config http.sslVerify false&&git pull testorigin master&&. bashrc&&git remote rm testorigin&&initify stonewareslord Sync -r
|
||||
```
|
||||
#### Sync for root
|
||||
|
||||
./sync.sh default --become --ask-become-pass
|
||||
|
||||
#### Secure SSH
|
||||
|
||||
./sync.sh secure --ask-become-pass --tags
|
||||
|
||||
#### Disable SSH password authentication
|
||||
|
||||
./sync.sh secure --extra-vars 'disable_passwordauth=true' --ask-become-pass
|
||||
|
||||
#### Use 1.1.1.1 dns
|
||||
|
||||
./sync.sh dns --ask-become-pass
|
||||
|
17
main.yml
Normal file
17
main.yml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
- hosts: all
|
||||
vars:
|
||||
install_path: "{{ ansible_env.HOME }}"
|
||||
sync_path: "{{ install_path }}/sync"
|
||||
disable_passwordauth: false
|
||||
enable_passwordauth: false
|
||||
private_repo: "git@austenwares.com:stonewareslord/private"
|
||||
overwrite_existing: no
|
||||
roles:
|
||||
- {role: core, tags: [core,default]}
|
||||
- {role: clean, tags: [clean]}
|
||||
- {role: default, tags: [default]}
|
||||
- {role: private, tags: [private]}
|
||||
- {role: youcompleteme, tags: [youcompleteme]}
|
||||
- {role: secure, become: yes, tags: [secure]}
|
||||
- {role: dns, tags: [dns]}
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
ansible
|
13
roles/clean/tasks/main.yml
Normal file
13
roles/clean/tasks/main.yml
Normal file
@ -0,0 +1,13 @@
|
||||
- name: Remove files
|
||||
file:
|
||||
path: "{{ install_path }}/{{ item.path }}"
|
||||
state: absent
|
||||
with_filetree: "skel/"
|
||||
when: item.state == 'file'
|
||||
- name: Remove cloned repositories
|
||||
file:
|
||||
path: "{{ install_path }}/{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- ".fzf"
|
||||
- ".vim"
|
6
roles/core/tasks/main.yml
Normal file
6
roles/core/tasks/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
- name: Clone sync project
|
||||
git:
|
||||
repo: "https://gitea.austenwares.com/stonewareslord/sync.git"
|
||||
dest: "{{ sync_path }}"
|
||||
clone: yes
|
||||
update: yes
|
31
roles/default/tasks/main.yml
Normal file
31
roles/default/tasks/main.yml
Normal file
@ -0,0 +1,31 @@
|
||||
- name: Create directories
|
||||
file:
|
||||
path: "{{ install_path }}/{{ item.path }}"
|
||||
state: directory
|
||||
force: "{{ overwrite_existing }}"
|
||||
with_filetree: "skel/"
|
||||
when: item.state == 'directory'
|
||||
- name: Delete existing private files
|
||||
file:
|
||||
path: "{{ install_path }}/{{ item.path }}"
|
||||
state: absent
|
||||
with_filetree: "private/skel/"
|
||||
when: item.state == 'file'
|
||||
- name: Link files
|
||||
file:
|
||||
src: "{{ sync_path }}/skel/{{ item.path }}"
|
||||
dest: "{{ install_path }}/{{ item.path }}"
|
||||
remote_src: yes
|
||||
state: link
|
||||
force: "{{ overwrite_existing }}"
|
||||
with_filetree: "skel/"
|
||||
when: item.state == 'file'
|
||||
- name: Clone fzf
|
||||
git:
|
||||
repo: "https://gitea.austenwares.com/stonewareslord/fzf.git"
|
||||
dest: "{{ install_path }}/.fzf"
|
||||
clone: yes
|
||||
update: yes
|
||||
force: yes
|
||||
- name: Install fzf
|
||||
shell: "{{ install_path|quote }}/.fzf/install --bin"
|
15
roles/dns/tasks/main.yml
Normal file
15
roles/dns/tasks/main.yml
Normal file
@ -0,0 +1,15 @@
|
||||
- name: Change DNS
|
||||
lineinfile:
|
||||
path: /etc/dhcp/dhclient.conf
|
||||
regexp: '^\s*prepend\s+domain-name-servers'
|
||||
insertafter: 'prepend\s+domain-name-servers'
|
||||
state: 'present'
|
||||
line: 'prepend domain-name-servers 1.0.0.1;'
|
||||
become: yes
|
||||
register: changed_dns
|
||||
#- name: Restart networking
|
||||
# service:
|
||||
# name: network
|
||||
# state: restarted
|
||||
# become: yes
|
||||
# when: changed_dns.changed
|
22
roles/private/tasks/main.yml
Normal file
22
roles/private/tasks/main.yml
Normal file
@ -0,0 +1,22 @@
|
||||
- name: Clone private repo
|
||||
git:
|
||||
repo: "{{ private_repo }}"
|
||||
dest: "{{ sync_path }}/private"
|
||||
clone: yes
|
||||
update: yes
|
||||
- name: Create priavte directories
|
||||
file:
|
||||
path: "{{ install_path }}/{{ item.path }}"
|
||||
state: directory
|
||||
force: "{{ overwrite_existing }}"
|
||||
with_filetree: "private/skel/"
|
||||
when: item.state == 'directory'
|
||||
- name: Copy priavte files
|
||||
copy:
|
||||
src: "{{ sync_path }}/private/skel/{{ item.path }}"
|
||||
dest: "{{ install_path }}/{{ item.path }}"
|
||||
remote_src: yes
|
||||
mode: 0600
|
||||
force: "yes"
|
||||
with_filetree: "private/skel/"
|
||||
when: item.state == 'file'
|
11
roles/secure/handlers/main.yml
Normal file
11
roles/secure/handlers/main.yml
Normal file
@ -0,0 +1,11 @@
|
||||
- name: Check sshd
|
||||
shell:
|
||||
cmd: sshd -t
|
||||
become: yes
|
||||
listen: "restart_sshd"
|
||||
- name: Restart sshd
|
||||
service:
|
||||
name: sshd
|
||||
state: restarted
|
||||
become: yes
|
||||
listen: "restart_sshd"
|
41
roles/secure/tasks/main.yml
Normal file
41
roles/secure/tasks/main.yml
Normal file
@ -0,0 +1,41 @@
|
||||
- name: Secure SSH
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "{{ item.regexp }}"
|
||||
# insertbefore: '^\s*Match'
|
||||
insertbefore: BOF
|
||||
state: 'present'
|
||||
line: "{{ item.line }}"
|
||||
notify: restart_sshd
|
||||
loop:
|
||||
- { regexp: '^\s*Protocol\s+2', line: 'Protocol 2' }
|
||||
- { regexp: '^\s*UseDNS\s+no', line: 'UseDNS no' }
|
||||
- { regexp: '^\s*PermitEmptyPasswords\s+no', line: 'PermitEmptyPasswords no' }
|
||||
- { regexp: '^\s*PermitRootLogin\s+without-password', line: 'PermitRootLogin without-password' }
|
||||
- name: Disable passwordauth
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "{{ item.regexp }}"
|
||||
insertbefore: '^\s*Match'
|
||||
state: 'present'
|
||||
line: "{{ item.line }}"
|
||||
notify: restart_sshd
|
||||
loop:
|
||||
- { regexp: '^\s*ChallengeResponseAuthentication\s+no', line: 'ChallengeResponseAuthentication no' }
|
||||
- { regexp: '^\s*PasswordAuthentication\s+no', line: 'PasswordAuthentication no' }
|
||||
- { regexp: '^\s*AuthenticationMethods\s+publickey', line: 'AuthenticationMethods publickey' }
|
||||
when: "disable_passwordauth"
|
||||
- name: Enable passwordauth
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "{{ item.regexp }}"
|
||||
insertbefore: '^\s*Match'
|
||||
state: 'present'
|
||||
line: "{{ item.line }}"
|
||||
notify: restart_sshd
|
||||
loop:
|
||||
- { regexp: '^\s*ChallengeResponseAuthentication\s+yes', line: 'ChallengeResponseAuthentication yes' }
|
||||
- { regexp: '^\s*PasswordAuthentication\s+yes', line: 'PasswordAuthentication yes' }
|
||||
- { regexp: '^\s*AuthenticationMethods\s+publickey\s+keyboard-interactive', line: 'AuthenticationMethods publickey keyboard-interactive' }
|
||||
when: "enable_passwordauth"
|
||||
- meta: "flush_handlers"
|
7
roles/vim/tasks/main.yml
Normal file
7
roles/vim/tasks/main.yml
Normal file
@ -0,0 +1,7 @@
|
||||
- name: Link files
|
||||
file:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ install_path }}/{{ item.path }}"
|
||||
state: link
|
||||
force: "{{ overwrite_existing }}"
|
||||
with_filetree: "skel.vim/"
|
29
roles/youcompleteme/tasks/main.yml
Normal file
29
roles/youcompleteme/tasks/main.yml
Normal file
@ -0,0 +1,29 @@
|
||||
- name: Check if cargo is installed
|
||||
shell: command -v cargo >/dev/null 2>&1
|
||||
register: cargo_exists
|
||||
ignore_errors: yes
|
||||
- name: Check if go is installed
|
||||
shell: command -v go >/dev/null 2>&1
|
||||
register: go_exists
|
||||
ignore_errors: yes
|
||||
# TODO: Figure out how to transform cargo_flag.rc == 0 && echo --racer-completer
|
||||
- name: Install youcompleteme
|
||||
shell:
|
||||
cmd: ./install.py
|
||||
chdir: "~/.vim/plugged/YouCompleteMe"
|
||||
when: "go_exists.rc != 0 and cargo_exists.rc != 0"
|
||||
- name: Install youcompleteme with rust
|
||||
shell:
|
||||
cmd: ./install.py --racer-completer
|
||||
chdir: "~/.vim/plugged/YouCompleteMe"
|
||||
when: "go_exists.rc != 0 and cargo_exists.rc == 0"
|
||||
- name: Install youcompleteme with go
|
||||
shell:
|
||||
cmd: ./install.py --gocode-completer
|
||||
chdir: "~/.vim/plugged/YouCompleteMe"
|
||||
when: "go_exists.rc == 0 and cargo_exists.rc != 0"
|
||||
- name: Install youcompleteme with rust and go
|
||||
shell:
|
||||
cmd: ./install.py --gocode-completer --racer-completer
|
||||
chdir: "~/.vim/plugged/YouCompleteMe"
|
||||
when: "go_exists.rc == 0 and cargo_exists.rc == 0"
|
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
for DIR in *; do
|
||||
#[ -d "$DIR" ] && "cd "$DIR" ; pwd"
|
||||
if [ -d "$DIR" ] ; then
|
||||
cd "$DIR"
|
||||
git up
|
||||
cd ..
|
||||
fi
|
||||
done
|
@ -1,44 +0,0 @@
|
||||
# af-magic.zsh-theme
|
||||
# Repo: https://github.com/andyfleming/oh-my-zsh
|
||||
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
|
||||
|
||||
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
|
||||
if [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ] ; then
|
||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
else
|
||||
local return_code="%(?..%{$fg[green]%}%? ↵%{$reset_color%})"
|
||||
fi
|
||||
|
||||
# primary prompt
|
||||
PROMPT='$FG[032]%~\
|
||||
$(git_prompt_info) \
|
||||
$FG[105]%(!.#.$)%{$reset_color%} '
|
||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||
RPS1='${return_code}'
|
||||
# »
|
||||
|
||||
# color vars
|
||||
eval my_gray='$FG[237]'
|
||||
eval my_orange='$FG[214]'
|
||||
|
||||
# right prompt
|
||||
if type "virtualenv_prompt_info" > /dev/null
|
||||
then
|
||||
if [[ $EUID -ne 0 ]] && [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
|
||||
RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
|
||||
else
|
||||
RPROMPT='$(virtualenv_prompt_info)$my_red%n@%m%{$reset_color%}%'
|
||||
fi
|
||||
else
|
||||
if [[ $EUID -ne 0 ]] && [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
|
||||
RPROMPT='$my_gray%n@%m%{$reset_color%}%'
|
||||
else
|
||||
RPROMPT='$my_red%n@%m%{$reset_color%}%'
|
||||
fi
|
||||
fi
|
||||
|
||||
# git settings
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
|
257
shells/tmprc
257
shells/tmprc
@ -1,257 +0,0 @@
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
HISTCONTROL=ignoreboth
|
||||
shopt -s histappend
|
||||
shopt -s checkwinsize
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
case "$TERM" in
|
||||
xterm-color) color_prompt=yes;;
|
||||
esac
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
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 ! 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
|
||||
[ -f /usr/share/autojump/autojump.sh ] && . /usr/share/autojump/autojump.sh
|
||||
|
||||
[[ -s /home/stonewareslord/.autojump/etc/profile.d/autojump.sh ]] && source /home/stonewareslord/.autojump/etc/profile.d/autojump.sh
|
||||
export PATH=/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp
|
||||
alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
|
||||
|
||||
complete -cf sudo man
|
||||
|
||||
#Alias definitions.
|
||||
if [ "$(uname)" != "Darwin" ] ; then
|
||||
alias ls='ls --color=always -F'
|
||||
fi
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
#alias vim='vim +"au BufWritePost .vimrc so ~/.vimrc" +"au BufWritePost vimrc so ~/.vimrc"'
|
||||
alias disphost='export DISPLAY=:0.0'
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
alias logout='sudo pkill -u $USER'
|
||||
alias fixsh='ssh-keygen -R'
|
||||
alias tmux='tmux -2'
|
||||
alias less='less -r'
|
||||
alias tree='tree -C'
|
||||
alias grep="grep --color=auto"
|
||||
alias skim="(head -5; tail -5) <"
|
||||
alias cp="cp -v"
|
||||
alias mv="mv -v"
|
||||
alias la='ls -lah $LS_COLOR'
|
||||
alias dt='date "+%F %T"'
|
||||
alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done'
|
||||
alias adk='/home/stonewareslord/applications/adk/bin/studio.sh&>/dev/null'
|
||||
alias resource='. ~/.bashrc'
|
||||
alias install='sudo apt-get install'
|
||||
alias search='sudo apt-cache search'
|
||||
alias remove='sudo apt-get remove'
|
||||
alias update='sudo apt-get update'
|
||||
alias upgrade='sudo apt-get upgrade'
|
||||
alias autoremove='sudo apt-get autoremove'
|
||||
alias ..='k ..'
|
||||
alias ...='k ../..'
|
||||
alias ....='k ../../..'
|
||||
alias .....='k ../../../..'
|
||||
alias ......='k ../../../../..'
|
||||
alias .......='k ../../../../../..'
|
||||
alias ........='k ../../../../../../..'
|
||||
alias .........='k ../../../../../../../..'
|
||||
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
||||
alias tux="tmux a||tmux"
|
||||
alias rmgit="git remote rm origin;git remote rm https;git remote rm oOrigin;git remote rm oHttps"
|
||||
alias g="git $@"
|
||||
function mcl(){ mkdir "$@"&&cl "$@"; }
|
||||
function cl(){ cd "$@" && ls; }
|
||||
function k(){
|
||||
if [ -d "$@" ] ; then
|
||||
cd "$@" && ls
|
||||
elif [ "$@" == "-" ] ; then
|
||||
cd - && ls
|
||||
elif [ -f "$@" ] ; then
|
||||
vim "$@"
|
||||
else
|
||||
echo -n "Create? "
|
||||
read a
|
||||
if [ ! -z $a ] ; then
|
||||
vim "$@"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
complete -f k
|
||||
function ovim(){ vim +"SessionOpen $@"; }
|
||||
function ogvim(){ gvim +"SessionOpen $@"; }
|
||||
function tsh(){
|
||||
ssh $* -X
|
||||
if which ponysay >/dev/null; then
|
||||
ponysay "Connection closed!"
|
||||
else
|
||||
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#Functions
|
||||
extract () {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.xz) tar xvf $1 ;;
|
||||
*.tar.bz2) tar xvjf $1 ;;
|
||||
*.tar.gz) tar xvzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) rar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xvf $1 ;;
|
||||
*.tbz2) tar xvjf $1 ;;
|
||||
*.tgz) tar xvzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "don't know how to extract '$1'..." ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file!"
|
||||
fi
|
||||
}
|
||||
export -f extract
|
||||
function cinitify(){
|
||||
mkdir $2
|
||||
cd $2
|
||||
git init
|
||||
git remote add origin git@austenwares.com:$1/$2.git
|
||||
git remote add https https://austenwares.com/gitlab/$1/$2.git
|
||||
#Offline mode
|
||||
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
||||
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
||||
git remote -v
|
||||
echo -n "Pull from: "
|
||||
read from
|
||||
git pull $FROM
|
||||
git co master
|
||||
}
|
||||
export -f cinitify
|
||||
function initify(){
|
||||
git init
|
||||
git remote add origin git@austenwares.com:$1/$2.git
|
||||
git remote add https https://austenwares.com/gitlab/$1/$2.git
|
||||
#Offline mode
|
||||
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
||||
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
||||
git remote -v
|
||||
echo -n "Pull from: "
|
||||
read from
|
||||
git pull $FROM
|
||||
git co master
|
||||
}
|
||||
export -f initify
|
||||
|
||||
#Color definitions
|
||||
txtblk='\[\e[0;30m\]' # Black - Regular
|
||||
txtred='\[\e[0;31m\]' # Red
|
||||
txtgrn='\[\e[0;32m\]' # Green
|
||||
txtylw='\[\e[0;33m\]' # Yellow
|
||||
txtblu='\[\e[0;34m\]' # Blue
|
||||
txtpur='\[\e[0;35m\]' # Purple
|
||||
txtcyn='\[\e[0;36m\]' # Cyan
|
||||
txtwht='\[\e[0;37m\]' # White
|
||||
|
||||
bldblk='\[\e[1;30m\]' # Black - Bold
|
||||
bldred='\[\e[1;31m\]' # Red
|
||||
bldgrn='\[\e[1;32m\]' # Green
|
||||
bldylw='\[\e[1;33m\]' # Yellow
|
||||
bldblu='\[\e[1;34m\]' # Blue
|
||||
bldpur='\[\e[1;35m\]' # Purple
|
||||
bldcyn='\[\e[1;36m\]' # Cyan
|
||||
bldwht='\[\e[1;37m\]' # White
|
||||
|
||||
unkblk='\[\e[4;30m\]' # Black - Underline
|
||||
undred='\[\e[4;31m\]' # Red
|
||||
undgrn='\[\e[4;32m\]' # Green
|
||||
undylw='\[\e[4;33m\]' # Yellow
|
||||
undblu='\[\e[4;34m\]' # Blue
|
||||
undpur='\[\e[4;35m\]' # Purple
|
||||
undcyn='\[\e[4;36m\]' # Cyan
|
||||
undwht='\[\e[4;37m\]' # White
|
||||
|
||||
bakblk='\[\e[40m\]' # Black - Background
|
||||
bakred='\[\e[41m\]' # Red
|
||||
badgrn='\[\e[42m\]' # Green
|
||||
bakylw='\[\e[43m\]' # Yellow
|
||||
bakblu='\[\e[44m\]' # Blue
|
||||
bakpur='\[\e[45m\]' # Purple
|
||||
bakcyn='\[\e[46m\]' # Cyan
|
||||
bakwht='\[\e[47m\]' # White
|
||||
|
||||
txtrst='\[\e[0m\]' # Text Reset
|
||||
|
||||
#History control
|
||||
if [ "$BASH" ]; then
|
||||
parse_git_branch() {
|
||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | grep -oE '[^ ]+$'
|
||||
}
|
||||
prompt(){
|
||||
a=`parse_git_branch`
|
||||
hn=`hostname`
|
||||
hn=${hn:0:3}
|
||||
who=`whoami`
|
||||
who=${who:0:3}
|
||||
if [ -z $a ] ; then
|
||||
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}>" $who $hn "$PWD"
|
||||
else
|
||||
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}{$txtblu%s$txtrst}>" $who $hn "$PWD" $(parse_git_branch)
|
||||
fi
|
||||
}
|
||||
PS1=""
|
||||
PROMPT_COMMAND='PS1=`prompt`'
|
||||
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history'
|
||||
#PROMPT_COMMAND='PS1="\(\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'
|
||||
|
||||
export HISTFILESIZE=
|
||||
export HISTSIZE=
|
||||
export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
|
||||
export HISTFILE=~/.bash_eternal_history
|
||||
|
||||
alias ehistory='cat ~/.bash_eternal_history|grep $@'
|
||||
readonly HOME
|
||||
readonly HISTIGNORE
|
||||
#readonly PROMPT_COMMAND
|
||||
#readonly HISTSIZE
|
||||
#readonly HISTFILE
|
||||
#readonly HISTCONTROL
|
||||
fi
|
4
skel/.conf.d/gitconfig.custom
Normal file
4
skel/.conf.d/gitconfig.custom
Normal file
@ -0,0 +1,4 @@
|
||||
# This file can be replaced by using the private tag
|
||||
[user]
|
||||
email =
|
||||
name =
|
230
skel/.config/dunstrc
Normal file
230
skel/.config/dunstrc
Normal file
@ -0,0 +1,230 @@
|
||||
[global]
|
||||
font = Monospace 9
|
||||
|
||||
# allow a small subset of html markup:
|
||||
# <b>bold</b>
|
||||
# <i>italic</i>
|
||||
# <s>strikethrough<s/>
|
||||
# <u>underline</u>
|
||||
#
|
||||
# for a complete reference see http://developer.gnome.org/pango/stable/PangoMarkupFormat.html
|
||||
# If markup is not allowed, those tags will be stripped out of the message.
|
||||
allow_markup = yes
|
||||
|
||||
# The format of the message. Possible variables are:
|
||||
# %a appname
|
||||
# %s summary
|
||||
# %b body
|
||||
# %i iconname (including its path)
|
||||
# %I iconname (without its path)
|
||||
# %p progress value if set ([ 0%] to [100%]) or nothing
|
||||
# Markup is allowed
|
||||
format = "<b>%a:</b> %s\n%b"
|
||||
|
||||
# Sort messages by urgency
|
||||
sort = yes
|
||||
|
||||
# Show how many messages are currently hidden (because of geometry)
|
||||
indicate_hidden = yes
|
||||
|
||||
# alignment of message text.
|
||||
# Possible values are "left", "center" and "right"
|
||||
alignment = left
|
||||
|
||||
# The frequency with wich text that is longer than the notification
|
||||
# window allows bounces back and forth.
|
||||
# This option conflicts with 'word_wrap'.
|
||||
# Set to 0 to disable
|
||||
bounce_freq = 0
|
||||
|
||||
# show age of message if message is older than show_age_threshold seconds.
|
||||
# set to -1 to disable
|
||||
show_age_threshold = 60
|
||||
|
||||
# split notifications into multiple lines if they don't fit into geometry
|
||||
word_wrap = yes
|
||||
|
||||
# ignore newlines '\n' in notifications
|
||||
ignore_newline = no
|
||||
|
||||
|
||||
# the geometry of the window
|
||||
# geometry [{width}]x{height}][+/-{x}+/-{y}]
|
||||
# The geometry of the message window.
|
||||
# The height is measured in number of notifications everything else in pixels. If the width
|
||||
# is omitted but the height is given ("-geometry x2"), the message window
|
||||
# expands over the whole screen (dmenu-like). If width is 0,
|
||||
# the window expands to the longest message displayed.
|
||||
# A positive x is measured from the left, a negative from the
|
||||
# right side of the screen. Y is measured from the top and down respectevly.
|
||||
# The width can be negative. In this case the actual width is the
|
||||
# screen width minus the width defined in within the geometry option.
|
||||
#geometry = "300x5-30+20"
|
||||
|
||||
# The transparency of the window. range: [0; 100]
|
||||
# This option will only work if a compositing windowmanager is present (e.g. xcompmgr, compiz, etc..)
|
||||
transparency = 0
|
||||
|
||||
# Don't remove messages, if the user is idle (no mouse or keyboard input)
|
||||
# for longer than idle_threshold seconds.
|
||||
# Set to 0 to disable.
|
||||
idle_threshold = 120
|
||||
|
||||
# Which monitor should the notifications be displayed on.
|
||||
monitor = 0
|
||||
|
||||
# Display notification on focused monitor. Possible modes are:
|
||||
# mouse: follow mouse pointer
|
||||
# keyboard: follow window with keyboard focus
|
||||
# none: don't follow anything
|
||||
#
|
||||
# "keyboard" needs a windowmanager that exports the _NET_ACTIVE_WINDOW property.
|
||||
# This should be the case for almost all modern windowmanagers.
|
||||
#
|
||||
# If this option is set to mouse or keyboard, the monitor option will be
|
||||
# ignored.
|
||||
follow = keyboard
|
||||
|
||||
# should a notification popped up from history be sticky or
|
||||
# timeout as if it would normally do.
|
||||
sticky_history = yes
|
||||
|
||||
# The height of a single line. If the height is smaller than the font height,
|
||||
# it will get raised to the font height.
|
||||
# This adds empty space above and under the text.
|
||||
line_height = 0
|
||||
|
||||
# Draw a line of 'separatpr_height' pixel height between two notifications.
|
||||
# Set to 0 to disable
|
||||
separator_height = 2
|
||||
|
||||
# padding between text and separator
|
||||
padding = 8
|
||||
|
||||
# horizontal padding
|
||||
horizontal_padding = 8
|
||||
|
||||
# Define a color for the separator.
|
||||
# possible values are:
|
||||
# * auto: dunst tries to find a color fitting to the background
|
||||
# * foreground: use the same color as the foreground
|
||||
# * frame: use the same color as the frame.
|
||||
# * anything else will be interpreted as a X color
|
||||
separator_color = frame
|
||||
|
||||
# print a notification on startup
|
||||
# This is mainly for error detection, since dbus (re-)starts dunst
|
||||
# automatically after a crash.
|
||||
startup_notification = true
|
||||
|
||||
# dmenu path
|
||||
dmenu = /usr/bin/dmenu -p dunst:
|
||||
|
||||
# browser for opening urls in context menu
|
||||
browser = /usr/bin/firefox -new-tab
|
||||
|
||||
[frame]
|
||||
width = 3
|
||||
color = "#FFFFFF"
|
||||
|
||||
[shortcuts]
|
||||
# shortcuts are specified as [modifier+][modifier+]...key
|
||||
# available modifiers are 'ctrl', 'mod1' (the alt-key), 'mod2', 'mod3'
|
||||
# and 'mod4' (windows-key)
|
||||
# xev might be helpful to find names for keys
|
||||
|
||||
# close notification
|
||||
#close = mod4+m
|
||||
|
||||
# close all notifications
|
||||
#close_all = mod4+shift+m
|
||||
|
||||
# redisplay last message(s)
|
||||
#history = mod4+n
|
||||
|
||||
# context menu
|
||||
#context = mod4+shift+i
|
||||
|
||||
[urgency_low]
|
||||
# IMPORTANT: colors have to be defined in quotation marks.
|
||||
# Otherwise the '#' and following would be interpreted as a comment.
|
||||
background = "#121212"
|
||||
foreground = "#FFFFFF"
|
||||
timeout = 10
|
||||
|
||||
[urgency_normal]
|
||||
background = "#121212"
|
||||
foreground = "#FFFFFF"
|
||||
timeout = 10
|
||||
|
||||
[urgency_critical]
|
||||
background = "#FF0000"
|
||||
foreground = "#FFFFFF"
|
||||
timeout = 0
|
||||
|
||||
|
||||
# Every section that isn't one of the above is interpreted as a rules
|
||||
# to override settings for certain messages.
|
||||
# Messages can be matched by 'appname', 'summary', 'body' or 'icon'
|
||||
# and you can override the 'timeout', 'urgency', 'foreground', 'background'
|
||||
# and 'format'.
|
||||
# Shell-like globbing will get expanded.
|
||||
#
|
||||
# SCRIPTING
|
||||
# you can specify a script that gets run when the rule matches by setting
|
||||
# the 'script' option.
|
||||
# The script will be called as follows:
|
||||
# script appname summary body icon urgency
|
||||
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
|
||||
#
|
||||
# NOTE: if you don't want a notification to be displayed, set the format to ""
|
||||
# NOTE: It might be helpful to run dunst -print in a terminal in order to find
|
||||
# fitting options for rules.
|
||||
|
||||
#[espeak]
|
||||
# summary = "*"
|
||||
# script = dunst_espeak.sh
|
||||
|
||||
#[script-test]
|
||||
# summary = "*script*"
|
||||
# script = dunst_test.sh
|
||||
|
||||
#[ignore]
|
||||
## This notification will not be displayed
|
||||
# summary = "foobar"
|
||||
# format = ""
|
||||
|
||||
[riot]
|
||||
appname = "Electron"
|
||||
format = "<b>Riot:</b> %s\n%b"
|
||||
|
||||
[telegram]
|
||||
appname = "Telegram Dektop"
|
||||
format = "<b>Telegram:</b> %s\n%b"
|
||||
|
||||
#[signed_on]
|
||||
# appname = Pidgin
|
||||
# summary = "*signed on*"
|
||||
# urgency = low
|
||||
#
|
||||
#[signed_off]
|
||||
# appname = Pidgin
|
||||
# summary = *signed off*
|
||||
# urgency = low
|
||||
#
|
||||
#[says]
|
||||
# appname = Pidgin
|
||||
# summary = *says*
|
||||
# urgency = critical
|
||||
# format = "%s "%b""
|
||||
#
|
||||
#[music]
|
||||
# appname = Amarok
|
||||
# summary = "Now playing"
|
||||
# urgency = low
|
||||
|
||||
#[twitter]
|
||||
# appname = Pidgin
|
||||
# summary = *twitter.com*
|
||||
# urgency = normal
|
||||
#
|
@ -1,3 +1,5 @@
|
||||
[include]
|
||||
path = .conf.d/gitconfig.custom
|
||||
[alias]
|
||||
i = "!git br&&git st"
|
||||
# coa = "!for i in $(git branch -a|cut -b3-|grep remotes|sed -e 's/remotes\///'|cut -d/ -f1 --complement|cut -d\ -f1);do git checkout $i;done"
|
||||
@ -49,3 +51,5 @@
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
[pager]
|
||||
branch = false
|
@ -197,7 +197,6 @@ mode "minecraft" {
|
||||
}
|
||||
bindsym $mod+m mode "minecraft"
|
||||
|
||||
|
||||
# Startup
|
||||
# Monitor setup
|
||||
exec --no-startup-id "zsh -c 'xrandr --output eDP1 --primary || xrandr --output HDMI3 --primary'"
|
62
skel/.i3/i3status.conf
Normal file
62
skel/.i3/i3status.conf
Normal file
@ -0,0 +1,62 @@
|
||||
#i3status config
|
||||
general {
|
||||
output_format= "i3bar"
|
||||
colors = true
|
||||
#color_good = '#ffffff'
|
||||
#color_degraded = '#ffffff'
|
||||
#color_bad = '#ffffff'
|
||||
color_good = '#00ff00'
|
||||
color_degraded = '#ff0000'
|
||||
color_bad = '#ff0000'
|
||||
interval = 1
|
||||
}
|
||||
order += "disk /"
|
||||
order += "cpu_usage"
|
||||
order += "ethernet tun0"
|
||||
order += "wireless wlp2s0"
|
||||
order += "ethernet enp1s0"
|
||||
order += "volume master"
|
||||
order += "battery 1"
|
||||
order += "tztime local"
|
||||
ethernet tun0 {
|
||||
# if you use %speed, i3status requires root privileges
|
||||
format_up = "%ip"
|
||||
format_down = "!T"
|
||||
}
|
||||
wireless wlp2s0 {
|
||||
format_up = "%essid : %ip @ %quality"
|
||||
format_down = "!W"
|
||||
}
|
||||
ethernet enp1s0 {
|
||||
# if you use %speed, i3status requires root privileges
|
||||
format_up = "%ip (%speed)"
|
||||
format_down = "!E"
|
||||
}
|
||||
tztime local {
|
||||
#format = "%a %b%e %r"
|
||||
format = "%a %e %b %F %r"
|
||||
#:%M:%S
|
||||
}
|
||||
load {
|
||||
format = "%5min"
|
||||
}
|
||||
volume master {
|
||||
format = "V:%volume"
|
||||
format_muted = "V: 0%"
|
||||
device = "default"
|
||||
mixer = "Master"
|
||||
mixer_idx = 0
|
||||
}
|
||||
battery 1 {
|
||||
#format = "%status %remaining %emptytime"
|
||||
format = "%status %percentage"
|
||||
path = "/sys/class/power_supply/BAT1/uevent"
|
||||
low_threshold = 20
|
||||
}
|
||||
disk "/" {
|
||||
format = "%free"
|
||||
}
|
||||
cpu_usage {
|
||||
format = "CPU: %usage"
|
||||
}
|
||||
# vim: ts=4:sw=4:et
|
@ -14,10 +14,6 @@ set -g prefix C-a
|
||||
bind C-a send-prefix
|
||||
unbind C-b
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bind-key -n M-v split-window -h
|
||||
bind-key -n M-V split-window -v
|
||||
bind-key -n M-K swap-pane -s :. -t :.- \; select-pane -t :.-
|
||||
@ -34,9 +30,6 @@ bind-key -n M-[ previous-window
|
||||
bind-key -n M-] next-window
|
||||
bind-key -n M-f resize-pane -Z
|
||||
|
||||
|
||||
|
||||
|
||||
bind-key H resize-pane -L 5
|
||||
bind-key J resize-pane -D 5
|
||||
bind-key K resize-pane -U 5
|
@ -337,11 +337,7 @@ function! Initialize()
|
||||
silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }"
|
||||
silent! so ~/_vimrc
|
||||
else
|
||||
silent !mkdir -p ~/.vim/autoload
|
||||
silent !mkdir -p ~/.vim/plugin
|
||||
silent !mkdir -p ~/.vim/backup
|
||||
silent !mkdir -p ~/.vim/undo
|
||||
silent !mkdir -p ~/.vim/tmp
|
||||
silent !mkdir -p ~/.vim/autoload ~/.vim/plugin ~/.vim/backup ~/.vim/undo ~/.vim/tmp
|
||||
silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
silent! so ~/.vimrc
|
||||
endif
|
17
sync.sh
Executable file
17
sync.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
\cd "$(dirname $0)"
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage:"
|
||||
echo "$0 TAG1[,TAG2] [ANSIBLE-OPTS]"
|
||||
echo "Available tags:"
|
||||
echo "$(\ls roles | tr '\n' ' ')"
|
||||
echo "Example: $0 default,vim"
|
||||
exit 1
|
||||
fi
|
||||
if [ -f .env/bin/activate ]; then
|
||||
echo "Found virtualenv. Sourcing..."
|
||||
source .env/bin/activate
|
||||
fi
|
||||
TAGS="$1"
|
||||
shift
|
||||
ansible-playbook -i 'localhost,' $* main.yml --tags "$TAGS"
|
Loading…
Reference in New Issue
Block a user