From 927e0c5407550592e0e527a90770b20682135e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20B=C3=BCckendorf?= Date: Fri, 17 May 2019 23:07:51 +0200 Subject: [PATCH 1/6] aws-cli: Updated the config with tools for saml login --- .bashrc.d/aws-azure-login.sh | 17 +++++++++++++++++ .bashrc.d/dotfiles_install.sh | 10 +++++----- .environment.d/aws.env | 6 ++++-- .environment.d/wsl.env | 6 ++++++ 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 .bashrc.d/aws-azure-login.sh create mode 100644 .environment.d/wsl.env diff --git a/.bashrc.d/aws-azure-login.sh b/.bashrc.d/aws-azure-login.sh new file mode 100644 index 0000000..07cd9e2 --- /dev/null +++ b/.bashrc.d/aws-azure-login.sh @@ -0,0 +1,17 @@ +# If aws-azure-login is not installed do nothing +if ! command -v aws-azure-login >/dev/null 2>&1 +then + return +fi + +# In WSL the no-sandbox parameter is mandatory for aws-azure-login to function +# correctly +if truthy $DOTFILES_WSL +then + alias aws-azure-login="aws-azure-login --no-sandbox" +fi + +# Make it so I just have to type a command and the (optionally) a profile +function aws-token { + aws-azure-login --no-prompt ${1:+--profile $1} +} diff --git a/.bashrc.d/dotfiles_install.sh b/.bashrc.d/dotfiles_install.sh index ebe5b50..9258d2b 100644 --- a/.bashrc.d/dotfiles_install.sh +++ b/.bashrc.d/dotfiles_install.sh @@ -32,18 +32,18 @@ if [[ $checksum != $DOTFILES_INSTALL_CHECKSUM ]]; then echo "Dotfiles: Downloading vim-plug..." if curl \ --fail \ - --location \ - --retry 5 \ - --retry-delay 1 \ + --location \ + --retry 5 \ + --retry-delay 1 \ --create-dirs \ - --progress-bar \ + --progress-bar \ --output ~/.local/share/nvim/site/autoload/plug.vim \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim then echo "Dotfiles: Done" else echo "Dotfiles: Error downloading vim-plug" - dotfiles_install_error="yes" + dotfiles_install_error="yes" fi fi diff --git a/.environment.d/aws.env b/.environment.d/aws.env index cfe69c1..37a787b 100644 --- a/.environment.d/aws.env +++ b/.environment.d/aws.env @@ -1,3 +1,5 @@ -AWS_PROFILE=default-role -AWS_DEFAULT_REGION=eu-west-1 +AWS_DEFAULT_REGION=eu-central-1 AWS_DEFAULT_OUTPUT=json + +AZURE_APP_ID_URI=https://signin.aws.amazon.com/saml +AZURE_DEFAULT_DURATION_HOURS=12 diff --git a/.environment.d/wsl.env b/.environment.d/wsl.env new file mode 100644 index 0000000..73d2a29 --- /dev/null +++ b/.environment.d/wsl.env @@ -0,0 +1,6 @@ +if [[ $OSTYPE == linux-gnu && $(< /proc/sys/kernel/osrelease) == *Microsoft ]] +then + DOTFILES_WSL=true +else + DOTFILES_WSL=false +fi From 5d1b1c30e07ffb548ff07be325f637d9a5ac13d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20B=C3=BCckendorf?= Date: Fri, 17 May 2019 23:28:48 +0200 Subject: [PATCH 2/6] environment.d: Added skeletons for files that need to be filled in manually --- .environment.d/aws_secrets.env.skel | 2 ++ .environment.d/git_secrets.env.skel | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 .environment.d/aws_secrets.env.skel create mode 100644 .environment.d/git_secrets.env.skel diff --git a/.environment.d/aws_secrets.env.skel b/.environment.d/aws_secrets.env.skel new file mode 100644 index 0000000..c78635f --- /dev/null +++ b/.environment.d/aws_secrets.env.skel @@ -0,0 +1,2 @@ +AZURE_TENANT_ID= +AZURE_DEFAULT_USERNAME= diff --git a/.environment.d/git_secrets.env.skel b/.environment.d/git_secrets.env.skel new file mode 100644 index 0000000..aecd8ce --- /dev/null +++ b/.environment.d/git_secrets.env.skel @@ -0,0 +1,5 @@ +GIT_AUTHOR_NAME="" +GIT_AUTHOR_EMAIL="" +GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME +GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL + From 1f63e97472bd11fb71f202fc3ce3632f87b0c81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20B=C3=BCckendorf?= Date: Fri, 17 May 2019 23:57:17 +0200 Subject: [PATCH 3/6] fuck.bashrc: Added usage message to failure state --- .bashrc.d/fuck.sh | 3 +++ .github/README.md | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.bashrc.d/fuck.sh b/.bashrc.d/fuck.sh index 57dcead..14082a0 100644 --- a/.bashrc.d/fuck.sh +++ b/.bashrc.d/fuck.sh @@ -3,6 +3,9 @@ function fuck { local nth_last=${1:-1} if [[ "$nth_last" =~ ^[0-9]+$ ]]; then sudo $(fc -ln -$nth_last -$nth_last) + else + echo "Usage: fuck [offset]" + return 1 fi } diff --git a/.github/README.md b/.github/README.md index 836ccf1..3986348 100644 --- a/.github/README.md +++ b/.github/README.md @@ -26,7 +26,7 @@ git --work-tree=$HOME --git-dir=$HOME/.dotgit checkout master - Status area horizonzal spacing - Vitals -# Missing Features (TODO) +## Missing Features (TODO) - Vim relative line numbering - unset all variables - Initial Setup @@ -38,3 +38,7 @@ git --work-tree=$HOME --git-dir=$HOME/.dotgit checkout master - environment templates? (git.env!) - fix the umask +## Echos to be replaced by msg() +- fuck error msg +- initial setup + From f8ec58d8c7b84e743765a4899d8b814c2f725076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20B=C3=BCckendorf?= Date: Sat, 18 May 2019 00:02:21 +0200 Subject: [PATCH 4/6] dotfiles_command.bashrc: Added git bash-completion location for Ubuntu/WSL --- .bashrc.d/dotfiles_command.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.bashrc.d/dotfiles_command.sh b/.bashrc.d/dotfiles_command.sh index 21fcd78..c29caf1 100644 --- a/.bashrc.d/dotfiles_command.sh +++ b/.bashrc.d/dotfiles_command.sh @@ -16,6 +16,7 @@ fi possible_locations=( "/usr/share/doc/git/contrib/completion/git-completion.bash" "/usr/share/git/completion/git-completion.bash" + "/usr/share/bash-completion/completions/git" ) for completion_file in "${possible_locations[@]}" From 830a4e50e1d7a68f1772a3f8f72dc46d2b4a9182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20B=C3=BCckendorf?= Date: Sat, 18 May 2019 00:10:50 +0200 Subject: [PATCH 5/6] dotconfig: This kills the carriage return --- .gitconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitconfig b/.gitconfig index da37e52..1c04ecc 100644 --- a/.gitconfig +++ b/.gitconfig @@ -12,6 +12,7 @@ default = simple [core] excludesfile = ~/.gitignore + autocrlf = input [status] submoduleSummary = true [pager] From c7b281939571e5a70e5b10f9ad3ee31bd6c554da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20B=C3=BCckendorf?= Date: Sat, 18 May 2019 00:21:35 +0200 Subject: [PATCH 6/6] neovim: Checking in changes I have been making to my config during work --- .config/nvim/init.vim | 7 ++++++- .github/README.md | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 0532012..f969378 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -3,11 +3,13 @@ call plug#begin() Plug 'semanser/vim-outdated-plugins' " Show trailing whitespaces (this could also easaly be achieved by settings Plug 'ntpeters/vim-better-whitespace' +Plug 'vim-airline/vim-airline' +Plug 'w0rp/ale' call plug#end() " Add a set of commands that will make the 80th column of a document visible highlight ColorColumn ctermbg=244 guibg=lightgrey -command Col let &colorcolumn=join(range(81,999),",") +command Col let &colorcolumn=join(range(81,100),",") command NoCol set colorcolumn= Col @@ -28,3 +30,6 @@ set scrolloff=2 " Classic set number +" Yaml Indent +"autocmd BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent +"autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab diff --git a/.github/README.md b/.github/README.md index 3986348..60be858 100644 --- a/.github/README.md +++ b/.github/README.md @@ -37,6 +37,8 @@ git --work-tree=$HOME --git-dir=$HOME/.dotgit checkout master - missing executables warnings - environment templates? (git.env!) - fix the umask +- Vim put the Yaml indent Stuff in a proper filetype detection script (ftplugin?) +- Vim also add cfn filetype for cfn-lint ## Echos to be replaced by msg() - fuck error msg