diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-02-24 18:36:32 +0000 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2024-02-24 18:36:32 +0000 |
commit | 2b29e812468ae2f33a4d37e2e280b7080f11ee86 (patch) | |
tree | 15826a929d63c05081399d970e8caaf6d0ecdc23 /misc/dotfiles | |
parent | 505d0e3202677729f9c5a9c03cb5ddfd9faf6d78 (diff) | |
download | infra-2b29e812468ae2f33a4d37e2e280b7080f11ee86.tar.gz infra-2b29e812468ae2f33a4d37e2e280b7080f11ee86.tar.bz2 infra-2b29e812468ae2f33a4d37e2e280b7080f11ee86.zip |
Add simple dotfiles management playbook
Diffstat (limited to 'misc/dotfiles')
-rw-r--r-- | misc/dotfiles/bash_profile | 9 | ||||
-rw-r--r-- | misc/dotfiles/bashrc.j2 | 22 | ||||
-rw-r--r-- | misc/dotfiles/gdbinit | 2 | ||||
-rw-r--r-- | misc/dotfiles/gitconfig | 3 | ||||
-rw-r--r-- | misc/dotfiles/muttrc | 25 | ||||
-rw-r--r-- | misc/dotfiles/screenrc.j2 | 49 | ||||
-rw-r--r-- | misc/dotfiles/ssh/config.j2 | 29 | ||||
-rwxr-xr-x | misc/dotfiles/ssh/rc | 20 | ||||
-rw-r--r-- | misc/dotfiles/templates/template.cpp | 23 | ||||
-rw-r--r-- | misc/dotfiles/templates/template.py | 10 | ||||
-rw-r--r-- | misc/dotfiles/vimrc | 25 |
11 files changed, 217 insertions, 0 deletions
diff --git a/misc/dotfiles/bash_profile b/misc/dotfiles/bash_profile new file mode 100644 index 0000000..7bbee3f --- /dev/null +++ b/misc/dotfiles/bash_profile @@ -0,0 +1,9 @@ +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +export EDITOR=vim +export PATH="$HOME/bin:/usr/local/sbin:$PATH" + +if [ -f $HOME/.bashrc ]; then + . $HOME/.bashrc +fi diff --git a/misc/dotfiles/bashrc.j2 b/misc/dotfiles/bashrc.j2 new file mode 100644 index 0000000..4a872fc --- /dev/null +++ b/misc/dotfiles/bashrc.j2 @@ -0,0 +1,22 @@ +# Source system-wide settings of there are any. +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +{% if ansible_facts['os_family'] == "Darwin" %} +# Specific settings for macOS. +if [[ "$OSTYPE" == "darwin"* ]]; then + +# Silence bash deprecation warning. +export BASH_SILENCE_DEPRECATION_WARNING=1 + +# Enable colors for `ls` output. +export CLICOLOR=1 + +# Get GitHub token from keychain to avoid homebrew rate limiting on GitHub +# side. +export HOMEBREW_GITHUB_API_TOKEN=`security \ + find-generic-password -s "Homebrew GitHub Token" -w` + +fi +{% endif %} diff --git a/misc/dotfiles/gdbinit b/misc/dotfiles/gdbinit new file mode 100644 index 0000000..eeb5e28 --- /dev/null +++ b/misc/dotfiles/gdbinit @@ -0,0 +1,2 @@ +set history save on +set history filename ~/.gdb_history diff --git a/misc/dotfiles/gitconfig b/misc/dotfiles/gitconfig new file mode 100644 index 0000000..4ac77b1 --- /dev/null +++ b/misc/dotfiles/gitconfig @@ -0,0 +1,3 @@ +[user] + name = Dmitry Ilvokhin + email = d@ilvokhin.com diff --git a/misc/dotfiles/muttrc b/misc/dotfiles/muttrc new file mode 100644 index 0000000..2f5b7f1 --- /dev/null +++ b/misc/dotfiles/muttrc @@ -0,0 +1,25 @@ +# imap +set imap_user = d@ilvokhin.com +set folder = imaps://mail.ilvokhin.com +set spoolfile = +INBOX +set record = +INBOX/Sent +set postponed = +INBOX/Drafts +set mbox = +INBOX/All + +# smtp +set smtp_url = smtps://$imap_user@mail.ilvokhin.com +set smtp_pass = $imap_pass +set ssl_force_tls = yes + +# composition +set editor = `echo \$EDITOR` +set edit_headers = yes +set charset = UTF-8 +unset use_domain +set realname = "Dmitry Ilvokhin" +set from = "d@ilvokhin.com" +set use_from = yes + +set sort=threads +set sort_browser=date +set sort_aux=reverse-last-date-received diff --git a/misc/dotfiles/screenrc.j2 b/misc/dotfiles/screenrc.j2 new file mode 100644 index 0000000..acc934a --- /dev/null +++ b/misc/dotfiles/screenrc.j2 @@ -0,0 +1,49 @@ +# Automatically detach screen on hangup. +autodetach on + +# Change escape key to Ctrl + b. +escape ^bb + +# Increase size of the scrollback buffer. +defscrollback 32768 + +# Disable copyright notice during startup. +startup_message off + +# Set `$TERM` value for xterm instead of screen. +term xterm + +# Enable "alternate screen" terminal capability. Screen will behave like +# regular terminal. For example, after vim was closed, shell history will be +# displayed instead of contents of the file just closed. +altscreen on + +# Always display windows captions with the following format. +# %{Wb}: bright white letters on blue background. +# %H: hostname of the system. +# %c: current time HH:MM in 24h format. +# %{wk}: white letter on black background. +# %-w: all window numbers and names up to the current window. +# %{kw}: black letters on white background. +# [%n %t]: window number and window title. +# %{-}: restores the attributes and colors that were set before the last change +# was made. +# %+w: all window numbers and names starting with the window after the current +# one. +caption always "%{Wb} %H - %c %{wk} %-w%{kw}[%n %t]%{-}%+w" + +# Enable visual bell. +vbell off + +# Use bright colors for bold text (most terminal emulators do this already). +attrcolor b ".I" + +# Change background-color-erase setting. If ‘bce’ is set to on, all characters +# cleared by an erase/insert/scroll/clear operation will be displayed in the +# current background color. +defbce "on" + +{% if jumphost %} +# Make ssh-agent forwarding work with screen. +setenv SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock +{% endif %} diff --git a/misc/dotfiles/ssh/config.j2 b/misc/dotfiles/ssh/config.j2 new file mode 100644 index 0000000..d56f1d0 --- /dev/null +++ b/misc/dotfiles/ssh/config.j2 @@ -0,0 +1,29 @@ +Host * + User d +{% if ansible_facts['os_family'] == "Darwin" %} + # macOS specific settings. + UseKeychain yes + AddKeysToAgent yes +{% endif %} + +Host gate + Hostname gate.ilvokhin.com + ForwardAgent yes + +Host sun + Hostname sun.ilvokhin.com + +Host mail + Hostname mail.ilvokhin.com + User root + +# Moscow machines behind NAT. +Host water + ProxyJump gate + Hostname 10.9.8.2 + ForwardAgent yes + +Host flame + ProxyJump gate + Hostname 10.9.9.2 + ForwardAgent yes diff --git a/misc/dotfiles/ssh/rc b/misc/dotfiles/ssh/rc new file mode 100755 index 0000000..c129eb8 --- /dev/null +++ b/misc/dotfiles/ssh/rc @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +# Credits: https://gist.github.com/martijnvermaat/8070533 + +# Fix SSH auth socket location so agent forwarding works with screen. +if test "$SSH_AUTH_SOCK" ; then + ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock +fi + +# Taken from the sshd(8) manpage. +if read proto cookie && [ -n "$DISPLAY" ]; then + if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then + # X11UseLocalhost=yes + echo add unix:`echo $DISPLAY | + cut -c11-` $proto $cookie + else + # X11UseLocalhost=no + echo add $DISPLAY $proto $cookie + fi | xauth -q - +fi diff --git a/misc/dotfiles/templates/template.cpp b/misc/dotfiles/templates/template.cpp new file mode 100644 index 0000000..16f3e15 --- /dev/null +++ b/misc/dotfiles/templates/template.cpp @@ -0,0 +1,23 @@ +#include <algorithm> +#include <iterator> +#include <iostream> +#include <iomanip> +#include <cassert> +#include <utility> +#include <string> +#include <vector> +#include <limits> +#include <queue> +#include <cmath> +#include <map> +#include <set> + +using namespace std; + +using ll = long long; + +int main() +{ + + return 0; +} diff --git a/misc/dotfiles/templates/template.py b/misc/dotfiles/templates/template.py new file mode 100644 index 0000000..e35598b --- /dev/null +++ b/misc/dotfiles/templates/template.py @@ -0,0 +1,10 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -* + + +def main(): + pass + + +if __name__ == "__main__": + main() diff --git a/misc/dotfiles/vimrc b/misc/dotfiles/vimrc new file mode 100644 index 0000000..9e3afc2 --- /dev/null +++ b/misc/dotfiles/vimrc @@ -0,0 +1,25 @@ +" Enable ruler (will display line number and column number by default). +set ruler + +" Enable syntax highlight. +syntax on + +" Expand tabs to spaces. +set expandtab + +" Use four-space indentation. +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 + +" Limit text width. +set textwidth=79 + +" Disable incremental search. +set noincsearch + +" Disable highlighting of the search results. +set nohlsearch + +" Disable incremental search. +set noincsearch |