Open coding-to-music opened 3 years ago
1 sudo apt-get install cockpit
10 sudo adduser sammy
11 sudo usermod -aG sudo sammy
12 su sammy
13 curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
14 sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
16 sudo apt-get install apt-transport-https
21 sudo apt install software-properties-common
22 sudo apt-get update
23 sudo apt-cache policy
25 sudo apt-get update --allow-releaseinfo-change
28 sudo apt install gnome-keyring
29 sudo apt-get install apt-transport-https
30 sudo apt-get install code
31 sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/
32 sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
33 sudo apt install code
34 wget https://go.microsoft.com/fwlink/?LinkID=760868
38 sudo apt-get install -f
39 sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
"
40 sudo apt update
41 wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
42 sudo apt update
43 sudo apt install code
44 code
45 df -h
46 sudo apt-get install cockpit
48 sudo apt-get install git
49 git --version
50 git config --global user.name coding-to-music
51 git config --global user.email connors.tom@gmail.com
52 ssh-keygen -t ed25519 -C "connors.tom@gmail.com"
53 eval "$(ssh-agent -s)"
54 ssh-add -K ~/.ssh/id_ed25519
55 cd .ssh
60 cat ~/.ssh/id_ed25519.pub
61 ssh -vT git@github.com
tmc@penguin:~/.ssh$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vdb 6.0G 2.8G 2.5G 53% /
none 492K 0 492K 0% /dev
devtmpfs 1.4G 0 1.4G 0% /dev/tty
/dev/vdb 6.0G 2.8G 2.5G 53% /dev/wl0
tmpfs 100K 0 100K 0% /dev/lxd
tmpfs 100K 0 100K 0% /dev/.lxd-mounts
run 1.4G 28K 1.4G 1% /dev/.host_ip
/dev/root 417M 285M 124M 70% /dev/.ssh/sshd_config
9p 1.9G 828K 1.9G 1% /mnt/chromeos
tmpfs 1.4G 0 1.4G 0% /mnt/external
/dev/vda 50M 50M 0 100% /opt/google/cros-containers
tmpfs 1.4G 529M 861M 39% /dev/shm
tmpfs 1.4G 164K 1.4G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
tmpfs 278M 44K 278M 1% /run/user/1000
Provision a new Chromebook development environment
Terraform Repository Configuration
The Terraform packages are signed using a private key controlled by HashiCorp, so in most situations the first step would be to configure your system to trust that HashiCorp key for package authentication. For example:
However, this perhaps is a recent bug: https://github.com/hashicorp/terraform/issues/29663
After registering the key, you can add the official HashiCorp repository to your system:
The above command line uses the following sub-shell commands:
dpkg --print-architecture
to determine your system's primary APT architecture/ABI, such asamd64
.lsb_release -cs
to find the distribution release codename for your current system, such as buster, groovy, or sid.apt-add-repository
usually automatically runs apt update as part of its work in order to fetch the new package indices, but if it does not then you will need to so manually before the packages will be available.To install Terraform from the new repository:
Installing Ansible via apt-get
To begin using Ansible as a means of managing your server infrastructure, you need to install the Ansible software on the machine that will serve as the Ansible control node. We’ll use the default Ubuntu repositories for that.
First, refresh your system’s package index with:
Following this update, you can install the Ansible software with:
Press Y when prompted to confirm installation.
Your Ansible control node now has all of the software required to administer your hosts. Next, we’ll go over how to set up an inventory file, so that Ansible can communicate with your managed nodes.
Ansible Setup
Tasks:
Finally, we’ll ensure that the ~/.ssh directory and authorized_keys file have the appropriate permissions set:
This recursively removes all “group” and “other” permissions for the ~/.ssh/ directory.
If you’re using the root account to set up keys for a user account, it’s also important that the ~/.ssh directory belongs to the user and not to root:
In this tutorial our user is named sammy but you should substitute the appropriate username into the above command.
Create an inventory file
Set the contents as follows:
Set the contents of /etc/ansible/hosts
Set the following content:
Test the connection
Output
some examples of ad-hoc ansible commands
Step 2 — Copying the Public Key to Your Ubuntu Server
The quickest way to copy your public key to the Ubuntu host is to use a utility called ssh-copy-id. Due to its simplicity, this method is highly recommended if available. If you do not have ssh-copy-id available to you on your client machine, you may use one of the two alternate methods provided in this section (copying via password-based SSH, or manually copying the key).
Copying the Public Key Using ssh-copy-id
The ssh-copy-id tool is included by default in many operating systems, so you may have it available on your local system. For this method to work, you must already have password-based SSH access to your server.
To use the utility, you specify the remote host that you would like to connect to, and the user account that you have password-based SSH access to. This is the account to which your public SSH key will be copied.
The syntax is:
You may see the following message:
Output
This means that your local computer does not recognize the remote host. This will happen the first time you connect to a new host. Type “yes” and press ENTER to continue.
Next, the utility will scan your local account for the id_rsa.pub key that we created earlier. When it finds the key, it will prompt you for the password of the remote user’s account:
Output
Type in the password (your typing will not be displayed, for security purposes) and press ENTER. The utility will connect to the account on the remote host using the password you provided. It will then copy the contents of your ~/.ssh/id_rsa.pub key into a file in the remote account’s home ~/.ssh directory called authorized_keys.
You should see the following output:
Output
Now try logging into the machine, with:
and check to make sure that only the key(s) you wanted were added. At this point, your id_rsa.pub key has been uploaded to the remote account. You can continue on to Step 3.
Copying the Public Key Using SSH
If you do not have ssh-copy-id available, but you have password-based SSH access to an account on your server, you can upload your keys using a conventional SSH method.
We can do this by using the cat command to read the contents of the public SSH key on our local computer and piping that through an SSH connection to the remote server.
On the other side, we can make sure that the ~/.ssh directory exists and has the correct permissions under the account we’re using.
We can then output the content we piped over into a file called authorized_keys within this directory. We’ll use the >> redirect symbol to append the content instead of overwriting it. This will let us add keys without destroying previously added keys.
The full command looks like this:
You may see the following message:
Output
This means that your local computer does not recognize the remote host. This will happen the first time you connect to a new host. Type yes and press ENTER to continue.
Afterwards, you should be prompted to enter the remote user account password:
Output
After entering your password, the content of your id_rsa.pub key will be copied to the end of the authorized_keys file of the remote user’s account.
Alternate install method - download terraform zip file
create file terraform.tfvars
terraform.tfvars
Fill in each variable:
do_token
: is your personal access token for the DigitalOcean APIssh_fingerprint
: the DigitalOcean API refers to SSH keys using their fingerprint, which is a shorthand identifier based on the key itself.To get the fingerprint for your key, run the following command, being sure to update the path (currently ~/.ssh/id_rsa.pub) to the key you're using with DigitalOcean, if necessary:
The output will be similar to this:
Copy everything except the initial MD5: and paste it into the variable.
Now we can initialize Terraform. This will download some information for the DigitalOcean Terraform provider, and check our configuration for errors.
You should get some output about initializing plugins. Now we're ready to provision the infrastructure and configure it.
Add Cockpit for system monitoring
Add local users
https://github.com/coding-to-music/coding-to-music.github.io/issues/238
Installing the .deb package will automatically install the apt repository and signing key to enable auto-updating using the system's package manager. Note that 32-bit and .tar.gz binaries are also available on the VS Code download page.
The repository and key can also be installed manually with the following script: ::
Then update the package cache and install the package using:
Installing Visual Studio Code on Ubuntu
https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-18-04
To install Visual Studio Code on your Ubuntu system, follow these steps:
That’s it. Visual Studio Code has been installed on your Ubuntu desktop and you can start using it.
Mount external Drive
https://github.com/coding-to-music/coding-to-music.github.io/issues/259
Install frequent software
Install Mongo
https://hub.docker.com/_/mongo
... via docker stack deploy or docker-compose
Example stack.yml for mongo:
Try in PWD
http://localhost:8081/
Installing MongoDB Compass on Ubuntu 20.04 | Debian 11/10
Download MongoDB Compass with wget command:
Download MongoDB Compass with wget command:
Configure mongocli get API Public and Private Key
https://docs.mongodb.com/mongocli/stable/configure/#std-label-mcli-configure
Installing Git so you can work with GitHub
Download and install Git
Now git should be installed. To check use
Configuring GitHub git config user.name user.email
Once the installation has successfully completed, the next thing to do is to set up the configuration details of the GitHub user. To do this use the following two commands by replacing “user_name” with your GitHub username and replacing “email_id” with your email-id you used to create your GitHub account.
Set the git config global values
To validate correct git setup
Check that GitHub can be reached
Configure Dotfiles