Spinning up new VM and initial configuration
Spinning up new VM and initial configuration
Once I spin up new Linux VM, these are the steps to make it work efficiently for me.
I am using AWS Lightsail, but you don’t have to. In the past I have been working with Linode and Digital Ocean, but eventually settled with Lightsail. No particular reason, for most users, most systems will work just fine. For no particular reason either, I usually go with Ubuntu, preferably LTS release. I find it easier that way.
Working with different Linux distros, I have build a small set of tools that make me more productive and I like to have them around. Everything is CLI, so very quick and easy to install. Usually spinning up and full configuration of new machine takes me less than an hour using these tools and steps to install them.
Here is the list, and description is below.
- fish shell plus some helper functions
- nnn file manager
- fzf
- neovim
- peco
- exa (ls replacement)
- MidnighCommander
I chose fish shell long time ago and with time I accumulated a few customizations
I managed to learn just enough vim key-bindings to be dangerous and I prefer neovim variant. I usually download appimage and then: ln -s ~/.local/bin/nvim.appimage /usr/bin/nvim
Some other tools which I mostly simply copy as executable:
Setting up ssh login using private key
Our VM is up and running and it is time to:
sudo apt update ; sudo apt upgrade
Now we are ready to setup ssh connection.
Configuring tools and aliases
Step 1
After building a collection of useful tools through long trial and error process, I found this one via Google: https://ileriseviye.wordpress.com/2018/10/30/command-line-for-the-21-century-the-low-hanging-fruit/ There is not much I can add - this list covers everything I found, some extra tools and describes it all much better than I could. Big thanks and congrats to Emre for assembling this.
Configuring unison for two way syncing (using ssh)
I used the following commands to get this going:
more ~/.ssh/config
ssh linode_ubuntu
unison -version
ssh linode_ubuntu unison -version
unison -testServer test.txt ssh://linode_ubuntu/test.txt
unison test.txt ssh://linode_ubuntu/test.txt
unison ~/practice/ ssh://linode_ubuntu//home/pero/aaa/unison/
What was the problem with that profile from the Internet was one of the root lines - it could not establish ssh connection. This is the syntax that worked for me: root = /home/pero
and root = ssh://torx///home/bitnami/sync_dir
Profile file here
This code block I found on the internet. And it does not work for me. I am not sure what is the problem, but since I managed to construct command line that works, I might just stick with it and not waste time in debugging the profile file. Or I might use profile for listing include and ignore paths leaving the actual commands for the command line parameters.
name = linode_ubuntu.prf
# the roots to synchronise:
root = /path/to/your/home
root = ssh://username@sftpmath.math.ethz.ch/home
# some useful options
times = true
# servercmd = unison-2.40
# Files to ignore
ignore = Regex ^\...*
ignore = Name VIDEO_TS
ignore = Name AUDIO_TS
ignore = Name *.mp4
ignore = Name *.mp3
ignore = Regex ^Downloads
ignore = Regex ^Music
ignore = Regex ^Pictures
ignore = Regex ^Public
ignore = Regex ^Videos