8000 GitHub - pirafrank/workspace at 1.4.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pirafrank/workspace

Repository files navigation

dotfiles

build_images

My dotfiles and workspace-in-a-container project.

This is an endless WIP and holds my work and personal setup. My daily drivers are:

  • Ubuntu 20.04 WSL on Windows 10 (20H2)
  • Ubuntu 20.04 desktop
  • Debian 10 server accessed via mosh connection on ipad
  • macOS + macports

My MacBook runs the latest 10.15.x, but these dotfiles should work on earlier versions, too.

While almost all files in this repo will also work on non-Debian distros, setup scripts in root are designed for the Debian-based ones. That said, the only differences shoud rely only on a few package and binary names.

Installation

cd && git clone https://github.com/pirafrank/dotfiles.git

Then symlink config you want to use.

If you clone to another dir, please symlink it to ~/dotfiles.

Full setup

Debian-based distros only.

A full setup involves programs installation and creation of symlinks. It is meant to setup a vanilla environment and to build the Docker workspace baseimage. The setup comes in two flavors, with and without user creation:

curl -sSL https://github.com/pirafrank/dotfiles/raw/main/setup.sh
# OR
curl -sSL https://github.com/pirafrank/dotfiles/raw/main/setup_w_user.sh

Run the one that best fits your needs. Remember to always check the content of scripts you're about to execute before running them!

Usage

Setup scripts in setups and workspaces dirs are meant to be executed manually on Linux or macOS, or to build Docker Image workspaces (read below). They assume ~/dotfiles exists.

Core setup uses zsh and zprezto. Files for oh-my-zsh config are available (yet I don't use such config anymore).

~/.zsh_custom is automatically sourced if it exists, and ~/bin2 is automatically added to $PATH. Both are not part of the repo and can be used to add your-own or machine-specific customizations and other executables.

That's all, there is no real how-to actually. For more info just look at the code. Google is your friend.

Docker Images

A command-line workspace-in-a-container, based on this repo.

The aim is to create a disposable development environment taking advantage of Docker. Images are publicly available on Docker Hub in various flavors. They are:

  • pirafrank/workspace: base image the others are based on. It contains dotfiles, various CLI utils and shell setup
  • pirafrank/workspace:bundle: bundle of the ones below. Use workspace_version inside the container to know about the versions bundled.

Also available as standalone flavors:

  • pirafrank/workspace:java: Java workspace based on OpenJDK or AdoptOpenJDK (check the Docker image tag)
  • pirafrank/workspace:node: nvm and node env
  • pirafrank/workspace:python3: pyenv and Python 3
  • pirafrank/workspace:ruby: rvm and Ruby
  • pirafrank/workspace:rust: latest Rust version and its toolchain
  • pirafrank/workspace:go: Golang workspace

All workspaces setups are in userspace.

Build

Use ./build-all.sh to build all images.

Add to pre_start.zsh to exec anything at Docker image launch.

Run an image

Use run_workspace.sh to do so. For example:

# to run the baseimage
./run-workspace.sh latest
# or to run the java11 one
./run-workspace.sh java11
# or to run it as a disposable container
./run-workspace.sh java11 --rm
# or to name it
./run-workspace.sh java11 '--name somename --rm'

Use cases

You can run the workspace-in-a-container in many occasions.

  • easy and fast setup of CLI environment e.g. in a VPS
  • Blink Build
  • interactive CaaS
  • more...

Usage in Blink Build

Build is a new service being built by the guys behind Blink Shell, the best SSH and mosh client for iOS and iPadOS. It's currently in beta and allows you to SSH into any container publicly available without taking care of the underlying infrastructure, network or firewall. And it's fully integrated in Blink Shell. I have started tinkering with it and I have to say it's a great match with my workspace for a portable dev environment!

First setup: authenticate and turn on the VM (aka the machine)

build device authenticate
build status
build machine start
build machine status
build ssh-key add
build ssh-key list

then bring the workspace up and enter it

build up --image pirafrank/workspace:bundle bundle
build ssh bundle

Builds is currently available in the community edition.

For more information, run the commands with the --help flag.

Credits

Scripts

I wrote most of the scripts in the bin folder, with some of them already publicly available as gists. But others come or contain pieces from the web (twitter? google? stackoverflow?). Honestly I can't remember where I got them from, but you should find the original authors in the comments.

Themes

Those without pirafrank in their name come from the web, credits go to their creators. I keep them here for the sake of simplicity. I'll try to keep this readme updated to keep them all.

License

Many of the files and scripts in the bin folder come from some other repos of mine. Although those repositories are publicly available on GitHub, I am going to continue to maintain them in dotfiles. These file will get the same license they had (GNU GPL v3).

All the rest is given away for free, as-is and with NO WARRANTY.

By the way, if something really blows your mind, I'll be happy if you cite me.

Enjoy!

0