Sign inSign up

pivert/seashell

By pivert

•Updated 17 days ago

Image
0

9.8K

pivert/seashell repository overview

⁠seashell - Python & Neovim centric DevOps toolbox

Provides development & runner environment for DevOps engineers.

Welcome to a pre-configured DevOps toolbox including a hundred of tools. Few of them:

  • K8S & Cloud: kubectl, oc, docker, helm, arkade, OpenFaaS, Krew, 800 easy-to-remember kubectl aliases from Ahmet⁠
  • Use <ctrl>j to expand aliases - (useful for bash completion), aws SAM (Lambda)
  • Web: nodejs, and Vue3.
  • Latest Python with Boto3, aws-cli, DebOps, Ansible
  • Neovim plugins via Plug or Coc language servers for formatting, linting and development.
  • Bash completion and manuals available for most most tools and aliases
  • 800 tools and libraries - vim /sbom.txt.gz for full list
  • Latest stable versions with a consistent sober Solarized dark theme for Bash and Neovim
  • Optimized image of only 800MB compressed, built to be used in offline environments.

⁠How to start

The seashell script will detect and keep your userid to preserve your local environment.

  • Make sure you have docker executable installed and that your user has access to it. (i.e. you're member of the docker group)

  • cd to a folder in your $PATH, for instance in /usr/local/bin as root, or in your $HOME/bin

  • Download the runner script:

    curl -O https://gitlab.com/pivert/seashell/-/raw/main/seashell⁠ && chmod a+x seashell

  • Run it:

    ./seashell # To get a shell with tmux, neovim, python, pyright, ansible, ... OR ./seashell vim file.py # To start editing directly in the environment. Template will be used if file.py does not exist. OR ./seashell -u # Check & update to latest docker image before starting

  • Or with wget

    wget https://gitlab.com/pivert/seashell/-/raw/main/seashell⁠ && chmod a+x seashell && ./seashell -u

⁠Colors & Fonts

  • Terminal should use a Solarized Dark color scheme.
  • Use Powerline patched fonts such as Nerd Fonts⁠. Start with Hack font. It might be installed by default on your Workstation (i.e. on Kubuntu). A patched font provide many glyphs including the ones for Powerline/Airline.

Screenshot of what you see after starting seashell then vim a new empty Dockerfile (it loads a template if file does not exist) Neovim screenshot

⁠Command details

⁠Features:

  • Syntax for Python, Ansible, Dockerfile, vimrc, YAML & JSON
  • Latest Ansible & Collection (Run /untaransiblecollection.sh before using Ansible Collection)
  • Other tools git tmux nodejs(latest) npm yarn curl wget htop rsync nc nmap unzip xz ...
  • Latest neovim with plugins:
    • Python, Dockerfile & Bash basic templates for new scripts
    • neoclide/coc.nvim intellisense engine with several plugins:
    • arouene/vim-ansible-vault Ansible vault or un-vault values⁠
    • kien/ctrlp.vim Fuzzy finder for vim⁠
    • scrooloose/nerdcommenter Comment/Uncomment tool⁠
    • scrooloose/nerdtree A Tree-like side bar for better navigation
    • tmhedberg/matchit Switch to the beginning and the end of a block by pressing %
    • vim-airline/vim-airline A cool status bar
    • vim-airline/vim-airline-themes Airline themes
    • altercation/vim-colors-solarized Solarized colorscheme (default to dark theme)
    • arcticicestudio/nord-vim Nord
    • sheerun/vim-polyglot Better syntax-highlighting for filetypes in vim
    • tpope/vim-fugitive Git integration
    • tpope/vim-surround Surround.vim is all about "surroundings": parentheses, brackets, quotes, XML tags, and more.
    • jiangmiao/auto-pairs Auto-close braces and scopes
    • jpalardy/vim-slime', { 'for': 'python' }
    • hanschen/vim-ipython-cell', { 'for': 'python' } Tmux integration
    • tmhedberg/SimplyFold Python code folding - zo zO zc zC
  • Solarized terminal colors for:
    • tmux
    • bash
    • neovim
  • Other tools
    • AWS Serverless Application Model tools: aws-cli and sam
    • vue
    • Most command-line tools such as git, rsync, nc, nmap, unzip, xz,...

⁠Neovim

  • Neovim Documentation⁠
  • use :checkhealth to get status of the editor setup
  • ]g and [g go to next/previous coc diagnostic error/warning
  • K on keywords to get doc, C-w + w to go in doc buffer/floating window, :q to go back to main buffer
  • gr/gd : Go Reference, Go Definition
  • Basic buffer commands (read help for more):
    • :bn[ext]/:bp[revious]/:bf[irst]/:bl[ast]/:b2/:bc[lose] : go to buffer next/previous/first/last/second/close current buffer
    • :e[dit] newfile.py : Create a new buffer, add it to the list, and open the newfile.py in it
  • Check installed Plug plugins : PlugStatus
  • Check installed Coc extensions : CocList extensions

⁠Quick tips

  • tmux (C-b instead of screen C-a ): C-b-% C-b-" C-o C-b-,
  • Neovim
    • vim : :checkhealth :CocList :CocInfo
    • vim-slime + tmux + ipython : C-c C-c from nvim
    • vim-surround⁠: cs'" / S" (visual) / ysiw(
    • vim Leader key is Space key: Space-r-n (rename symbol)
    • Try :CocAction :CocCommands :verbose
    • vim-fold: za/zA zo/zO zc/zC zm/zr
    • nerdcommenter⁠: Space-cc Space-cu
    • suda.nvim⁠ : Uses sudo when file not writeable
    • a: CocAction, will propose action on misspelled words or other tips
  • Bash
    • Many aliases with autocompletion:

      • k for all 800 kubectl aliases Check documentation⁠. Just take the bold characters from the table below to call the alias. For instance: kubectl --namespace=kube-system get secret -o=json can be called with alias ksysgsecojson
      base[system]commandsresources[flags][value flags]
      getpodoyaml
      describedeploymentojson
      -n=kube-rm = deleteinggressowide--namespace
      ksystemapply -fservice--all[-namespace]--filename
      apply -kconfigmap--show-labels--selector
      kustomizesecret--watch
      exec -i -tnamespace
      logs -fnode
    • +j expand any alias

    • Solarized⁠ dark colors (like in nvim)

    • alias gcam='git commit -am'

    • alias cdwd='cd /workdir/'

  • kubectx⁠ (with bash completion)
    • kubens to change active namespace
    • kubectx to change context/cluster

⁠SSH

You might want to use ssh with pubkey authentication from the container. You might also want to cache your ssh key password. The first thing is to mount your .ssh folder when running the container. Add -v ~/.ssh:/user/.ssh

Then you have 2 options:

  • run 'eval $(ssh-agent) > /dev/null' then 'ssh-add' in the container.
  • run ssh-add before running the container, then reuse the agent by adding '-f $SSH_AUTH_SOCK):/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent' to your docker run command

⁠Customization

Most customization can be done by mounting updated config file and/or adapting the seashell local shell script.

You can place an executable init script in the root of the folder named docker-environment-root.sh (executed as root before the su -l) This feature might be removed in the future.

⁠Further Help

Source code & issues: https://gitlab.com/pivert/seashell/⁠ Check online documentation from tmux, nvim, and the plugin you would like to use. Run 'config' alias from bash in the container. Also check SLIME and ipython-cell plugin for Tmux & ipython integrations.

⁠Security

Security limitations from docker Built to be used in offline environments without internet access

⁠Limitations

  • Solarized dark theme & Patched font dependencies on your local terminal.

⁠Seek for help

  • I'm interested in any help to further shrink the image or to improve UX.

Tag summary

Content type

Image

Digest

sha256:1d62ba60b…

Size

596.1 MB

Last updated

17 days ago

docker pull pivert/seashell