formatting upgrade

main
Mel 4 years ago
parent 4f5f6e77b4
commit 4f015a84aa

@ -0,0 +1,33 @@
/* Adding a "Back to Top" function on Page end. Modified with the help from other members at Obsidian Forum */
/* To use this function:
1. first put a " ^Top" as an anchor at the begining of the page (exclude the double quotation marks)
2. then put "[[#^Top|TOP]]" at the end of the page (exclude the double quotation marks)
*/
.internal-link[data-href="#^Top"] {
width: 80px;
height: 40px;
border-radius: 10px 10px 0px 0px;
background-color: var(--background-primary-alt);
box-shadow: 0px 0px 4px darkgrey;
text-align: center;
color: #E01A45;
padding-top: 15px;
line-height: 100%;
font-weight: bold;
font-size: 14px;
position: fixed;
bottom: 0;
right: 5%;
margin: 0;
}
.internal-link[data-href="#^Top"]:hover {
background-color: #E01A45;
color: white;
box-shadow: 0px 5px 8px black;
}
.popover.hover-popover {
display: none;
}

@ -9,7 +9,7 @@
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "03.01 Reading list/@Reading master.md", "file": "05.01 Computer setup/Threats and Intrusions.md",
"mode": "preview" "mode": "preview"
} }
} }
@ -76,7 +76,7 @@
"state": { "state": {
"type": "backlink", "type": "backlink",
"state": { "state": {
"file": "03.01 Reading list/@Reading master.md", "file": "05.01 Computer setup/Threats and Intrusions.md",
"collapseAll": false, "collapseAll": false,
"extraContext": false, "extraContext": false,
"sortOrder": "alphabetical", "sortOrder": "alphabetical",
@ -115,15 +115,15 @@
}, },
"active": "c1cbd199334b4022", "active": "c1cbd199334b4022",
"lastOpenFiles": [ "lastOpenFiles": [
"03.01 Reading list/@Reading master.md", "05.01 Computer setup/Threats and Intrusions.md",
"03.03 Recipes/@@Recipes.md", "05.01 Computer setup/Storage and Syncing.md",
"05.02 Networks/@Networks.md", "05.01 Computer setup/Privacy & Security.md",
"05.01 Computer setup/Internet services.md",
"05.01 Computer setup/Email & Communication.md",
"05.01 Computer setup/@Computer Set Up.md", "05.01 Computer setup/@Computer Set Up.md",
"03.03 Recipes/@Main dishes.md", "03.02 Travels/@Travels.md",
"06.02 Investments/Crypto Investments.md", "06.01 Finances/hLedger.md",
"02.02 Paris/@@Paris.md", "06.02 Investments/@Investment master.md",
"02.01 London/@@London.md", "06.02 Investments/VC Investments.md"
"02.01 London/@Restaurants London.md",
"02.01 London/@Café London.md"
] ]
} }

@ -1,5 +1,5 @@
```ad-command ```ad-command
~~~ ~~~bash
<% tp.file.selection() %> <% tp.file.selection() %>
~~~ ~~~
``` ```

@ -11,7 +11,7 @@ class globalFunc {
} else if (!Array.isArray(iarg1)) { } else if (!Array.isArray(iarg1)) {
let tempresult = false let tempresult = false
for (let i = 0; i < iarg2.length; i++) { for (let i = 0; i < iarg2.length; i++) {
tempresult = tempresult || this.compareData(iarg1, iarg2[i]) > -1 tempresult = tempresult || this.compareData(iarg1, iarg2[i])
} }
var resultdc = tempresult var resultdc = tempresult
} else if (!Array.isArray(iarg2)) { } else if (!Array.isArray(iarg2)) {
@ -400,7 +400,7 @@ class globalFunc {
switch(label) { switch(label) {
case 'French': case 'French':
tempresult = "🇫🇷" tempresult = "🇫🇷"
break; break;
case 'Italian': case 'Italian':
tempresult = "🇮🇹" tempresult = "🇮🇹"
break; break;
@ -471,7 +471,7 @@ class globalFunc {
tempresult = "🐠" tempresult = "🐠"
break; break;
default: default:
tempresult = cuisine tempresult = label
} }
return tempresult return tempresult
} }

@ -0,0 +1,4 @@
const {globalFunc} = customJS
let {invtype, dateadded, style, stage, ccy, theme, tradingd, tradingp} = input;
dv.el('t', "<b>🔎 search terms:</b> \n• " + globalFunc.buildToPrint([invtype, dateadded, style, stage, ccy, theme, tradingd, tradingp], ["invtype", "dateadded", "style", "stage", "ccy", "theme", "tradingd", "tradingp"], "\n• "));

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
QPType: Restaurant QPType: Restaurant
QPStyle: QPStyle:
QPAmbiance: QPAmbiance:

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Bars London", "Bars in London"] Alias: ["Bars London", "Bars in London"]
Tag: ["London", "Bar"] Tag: ["London", "Bar"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Brunches London", "Brunches in London"] Alias: ["Brunches London", "Brunches in London"]
Tag: ["London", "Brunch"] Tag: ["London", "Brunch"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Cafés in London"] Alias: ["Cafés in London"]
Tag: ["Personal", "Lifestyle", "Café"] Tag: ["Personal", "Lifestyle", "Café"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Restaurants London", "Restaurants in London"] Alias: ["Restaurants London", "Restaurants in London"]
Tag: ["London", "Restaurant"] Tag: ["London", "Restaurant"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Sport in London"] Alias: ["Sport in London"]
Tag: ["Personal", "Lifestyle", "Sport"] Tag: ["Personal", "Lifestyle", "Sport"]
Date: 2021-10-04 Date: 2021-10-04

@ -7,6 +7,7 @@ QPKeyword: Terrace
QPArea: QPArea:
QPStatus: QPStatus:
QPDAdded: QPDAdded:
cssclass: recipeTable
Alias: ["Paris"] Alias: ["Paris"]
Tag: ["Personal", "Life"] Tag: ["Personal", "Life"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Bars Paris", "Bars in Paris"] Alias: ["Bars Paris", "Bars in Paris"]
Tag: ["Paris", "Bar"] Tag: ["Paris", "Bar"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Hotels Paris", "Hotels in Paris"] Alias: ["Hotels Paris", "Hotels in Paris"]
Tag: ["Paris", "Hotel"] Tag: ["Paris", "Hotel"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Restaurants Paris", "Restaurants in Paris"] Alias: ["Restaurants Paris", "Restaurants in Paris"]
Tag: ["Paris", "Restaurant"] Tag: ["Paris", "Restaurant"]
Date: 2021-10-04 Date: 2021-10-04

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Sport in Paris"] Alias: ["Sport in Paris"]
Tag: ["Personal", "Lifestyle", "Sport"] Tag: ["Personal", "Lifestyle", "Sport"]
Date: 2021-10-04 Date: 2021-10-04

@ -6,6 +6,7 @@ QueryLanguage:
QueryAuthor: QueryAuthor:
QueryPublishedD: QueryPublishedD:
QueryReadD: QueryReadD:
cssclass: recipeTable
Alias: ["Reading", "Reading list"] Alias: ["Reading", "Reading list"]
Tag: ["Lifestyle", "LifeHacks", "Book"] Tag: ["Lifestyle", "LifeHacks", "Book"]
Date: 2021-09-25 Date: 2021-09-25

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Travels"] Alias: ["Travels"]
Tag: ["Lifehacks", "Travel"] Tag: ["Lifehacks", "Travel"]
Date: 2021-09-21 Date: 2021-09-21

@ -8,6 +8,7 @@ QueryTheme: Healthy
QueryFavourite: QueryFavourite:
QueryRating: "" QueryRating: ""
QueryCookingTime: "" QueryCookingTime: ""
cssclass: recipeTable
Alias: ["Recipes"] Alias: ["Recipes"]
Tag: ["Lifestyle", "Food", "Cooking"] Tag: ["Lifestyle", "Food", "Cooking"]
Date: 2021-10-20 Date: 2021-10-20

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Desserts"] Alias: ["Desserts"]
Tag: ["Sweet"] Tag: ["Sweet"]
Date: 2021-10-21 Date: 2021-10-21

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Main dishes", "Main Dishes"] Alias: ["Main dishes", "Main Dishes"]
Tag: [""] Tag: [""]
Date: 2021-10-21 Date: 2021-10-21

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Side dishes"] Alias: ["Side dishes"]
Tag: ["Vegetable", "Salad"] Tag: ["Vegetable", "Salad"]
Date: 2021-10-21 Date: 2021-10-21

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Snacks"] Alias: ["Snacks"]
Tag: ["Sweet", "Savoury", "ComfortFood"] Tag: ["Sweet", "Savoury", "ComfortFood"]
Date: 2021-10-21 Date: 2021-10-21

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["ComputerSetup", "Computer Setup"] Alias: ["ComputerSetup", "Computer Setup"]
Tag: ["Admin", "Computer", "App", "Cloud"] Tag: ["Admin", "Computer", "App", "Cloud"]
Date: 2021-08-10 Date: 2021-08-10

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Tag: ["Computer", "Email"] Tag: ["Computer", "Email"]
Date: 2021-09-28 Date: 2021-09-28
DocType: Personal DocType: Personal

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Privacy"] Alias: ["Privacy"]
Tag: ["Admin", "Computer", "Security", "Privacy"] Tag: ["Admin", "Computer", "Security", "Privacy"]
Date: 2021-08-10 Date: 2021-08-10

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Storage & Sync"] Alias: ["Storage & Sync"]
Tag: ["Admin", "Computer", "Cloud", "Privacy"] Tag: ["Admin", "Computer", "Cloud", "Privacy"]
Date: 2021-08-10 Date: 2021-08-10

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Tag: ["Admin", "Computer", "Security", "CommandLine", "STIX"] Tag: ["Admin", "Computer", "Security", "CommandLine", "STIX"]
Date: 2021-08-10 Date: 2021-08-10
DocType: "Personal" DocType: "Personal"

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Tag: ["Computer", "Networks", "Web", "App"] Tag: ["Computer", "Networks", "Web", "App"]
Date: 2021-08-28 Date: 2021-08-28
DocType: "Personal" DocType: "Personal"

@ -58,7 +58,7 @@ style: number
1. **Pull the software signature key & image** 1. **Pull the software signature key & image**
```ad-command ```ad-command
~~~ ~~~bash
echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
~~~ ~~~
``` ```
@ -66,7 +66,7 @@ echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" | sudo tee -a /etc/apt/sou
3. **Install caddy** 3. **Install caddy**
```ad-command ```ad-command
~~~ ~~~bash
sudo apt update sudo apt update
sudo apt install caddy sudo apt install caddy
~~~ ~~~
@ -85,7 +85,7 @@ Go to the homepage to see the caddy default page.
PHP needs to be enabled for caddy to work. PHP needs to be enabled for caddy to work.
```ad-command ```ad-command
~~~ ~~~bash
sudo add-apt-repository ppa:ondrej/php sudo add-apt-repository ppa:ondrej/php
sudo apt install php-cli php-fpm php-mysql sudo apt install php-cli php-fpm php-mysql
~~~ ~~~
@ -94,7 +94,7 @@ sudo apt install php-cli php-fpm php-mysql
Check if php is installed correctly: Check if php is installed correctly:
```ad-command ```ad-command
~~~ ~~~bash
php --version php --version
~~~ ~~~
``` ```
@ -118,7 +118,7 @@ Caddy will fetch a **SSL certificate** for all sub-domains and addresses present
1. Create a default website folder 1. Create a default website folder
```ad-command ```ad-command
~~~ ~~~bash
sudo mkdir -p /var/www/html sudo mkdir -p /var/www/html
~~~ ~~~
``` ```
@ -126,7 +126,7 @@ sudo mkdir -p /var/www/html
2. Create a default log folder 2. Create a default log folder
```ad-command ```ad-command
~~~ ~~~bash
sudo mkdir /var/log/caddy sudo mkdir /var/log/caddy
sudo chown -R caddy:caddy /var/log/caddy sudo chown -R caddy:caddy /var/log/caddy
~~~ ~~~
@ -191,7 +191,7 @@ listen.group = caddy
Once this is done, restart php: Once this is done, restart php:
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl restart php7.4-fpm sudo systemctl restart php7.4-fpm
~~~ ~~~
``` ```
@ -287,7 +287,7 @@ title: Tutorial
1. **Creat hashed passwords** 1. **Creat hashed passwords**
```ad-command ```ad-command
~~~ ~~~bash
caddy hash-password caddy hash-password
~~~ ~~~
``` ```
@ -399,7 +399,7 @@ A full repository of commands can be found [here](https://caddyserver.com/docs/)
#### Start/Stop/Restart #### Start/Stop/Restart
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl start/stop/restart caddy sudo systemctl start/stop/restart caddy
~~~ ~~~
``` ```
@ -411,7 +411,7 @@ sudo systemctl start/stop/restart caddy
Once config amended just run: Once config amended just run:
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl reload caddy sudo systemctl reload caddy
~~~ ~~~
``` ```

@ -58,7 +58,7 @@ style: number
1. **Prerequisites** 1. **Prerequisites**
```ad-command ```ad-command
~~~ ~~~bash
sudo apt update sudo apt update
sudo apt install curl apt-transport-https ca-certificates software-properties-common sudo apt install curl apt-transport-https ca-certificates software-properties-common
~~~ ~~~
@ -69,7 +69,7 @@ If the packages are already installed and to the latest version, the OS will ski
2. **Pull the software signature key & image** 2. **Pull the software signature key & image**
```ad-command ```ad-command
~~~ ~~~bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key ad curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key ad
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
~~~ ~~~
@ -78,7 +78,7 @@ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubun
3. **Install docker** 3. **Install docker**
```ad-command ```ad-command
~~~ ~~~bash
sudo apt update sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io sudo apt install docker-ce docker-ce-cli containerd.io
~~~ ~~~
@ -87,7 +87,7 @@ sudo apt install docker-ce docker-ce-cli containerd.io
4. **Test install** 4. **Test install**
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl status docker sudo systemctl status docker
~~~ ~~~
``` ```
@ -99,7 +99,7 @@ sudo systemctl status docker
Users with sudo rights need to be added to the 'docker' group for being able to instruct docker: Users with sudo rights need to be added to the 'docker' group for being able to instruct docker:
```ad-command ```ad-command
~~~ ~~~bash
sudo gpasswd -a (username) docker sudo gpasswd -a (username) docker
sudo newgrp docker sudo newgrp docker
~~~ ~~~
@ -112,7 +112,7 @@ sudo newgrp docker
Docker-compose is a script generatir enabling leaner execution and update of each container. The following commands install the wizard. Docker-compose is a script generatir enabling leaner execution and update of each container. The following commands install the wizard.
```ad-command ```ad-command
~~~ ~~~bash
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
~~~ ~~~
``` ```
@ -120,7 +120,7 @@ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-
File permissions need to be changed for docker-compose to be executable: File permissions need to be changed for docker-compose to be executable:
```ad-command ```ad-command
~~~ ~~~bash
sudo chmod +x /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
~~~ ~~~
``` ```
@ -128,7 +128,7 @@ sudo chmod +x /usr/local/bin/docker-compose
Installation can be checked as follows: Installation can be checked as follows:
```ad-command ```ad-command
~~~ ~~~bash
sudo dockercompose --version sudo dockercompose --version
~~~ ~~~
``` ```
@ -148,7 +148,7 @@ sudo dockercompose --version
In order for docker to work, each container needs an internal IP address. This is defined by an internal docker network as follows: In order for docker to work, each container needs an internal IP address. This is defined by an internal docker network as follows:
```ad-command ```ad-command
~~~ ~~~bash
sudo docker network create --driver=bridge --subnet=xxx.yyy.zzz.0/24 --gateway=xxx.yyy.zzz.1 dockernet sudo docker network create --driver=bridge --subnet=xxx.yyy.zzz.0/24 --gateway=xxx.yyy.zzz.1 dockernet
~~~ ~~~
``` ```
@ -166,7 +166,7 @@ Containers are created through docker-compose. Tutorial exist for each applicati
3. The docker-compose command for initialisation must be run from the folder: 3. The docker-compose command for initialisation must be run from the folder:
```ad-command ```ad-command
~~~ ~~~bash
sudo docker-compose up -d sudo docker-compose up -d
~~~ ~~~
``` ```
@ -203,7 +203,7 @@ The command needs to be run periodically.
For updating containers, just amend the docker-compose file and run the following command to preserve the mounted data: For updating containers, just amend the docker-compose file and run the following command to preserve the mounted data:
```ad-command ```ad-command
~~~ ~~~bash
docker-compose up -d docker-compose up -d
~~~ ~~~
``` ```
@ -219,7 +219,7 @@ Docker does not have a standard way to update environment variables, and require
1. **stop docker** 1. **stop docker**
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl stop docker sudo systemctl stop docker
~~~ ~~~
``` ```
@ -243,7 +243,7 @@ Within the 'Env' declaration, add the requested data field:
3. **Restart docker** 3. **Restart docker**
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl start docker sudo systemctl start docker
~~~ ~~~
``` ```
@ -261,7 +261,7 @@ sudo systemctl start docker
#### List containers #### List containers
```ad-command ```ad-command
~~~ ~~~bash
docker container ls docker container ls
~~~ ~~~
``` ```
@ -271,7 +271,7 @@ docker container ls
#### Execute commands in container #### Execute commands in container
```ad-command ```ad-command
~~~ ~~~bash
docker exec -it -u (username) (command) docker exec -it -u (username) (command)
~~~ ~~~
``` ```

@ -88,7 +88,7 @@ http://vpn.mfxm.fr:2812
The program is within the **apt** library: The program is within the **apt** library:
```ad-command ```ad-command
~~~ ~~~bash
sudo apt-get install monit sudo apt-get install monit
~~~ ~~~
``` ```
@ -96,7 +96,7 @@ sudo apt-get install monit
Once installed, it needs to be enabled: Once installed, it needs to be enabled:
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl enable --now monit sudo systemctl enable --now monit
~~~ ~~~
``` ```
@ -104,7 +104,7 @@ sudo systemctl enable --now monit
Check that the service is running appropriately: Check that the service is running appropriately:
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl status monit sudo systemctl status monit
~~~ ~~~
``` ```
@ -135,7 +135,7 @@ set httpd port 2812
After making the change, monit needs to be restarted: After making the change, monit needs to be restarted:
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl restart monit sudo systemctl restart monit
~~~ ~~~
``` ```
@ -143,7 +143,7 @@ sudo systemctl restart monit
And the corresponding port opened: And the corresponding port opened:
```ad-command ```ad-command
~~~ ~~~bash
sudo ufw allow 2812 sudo ufw allow 2812
~~~ ~~~
``` ```
@ -173,7 +173,7 @@ set alert (dest email address)
After making the change, monit needs to be restarted: After making the change, monit needs to be restarted:
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl restart monit sudo systemctl restart monit
~~~ ~~~
``` ```
@ -193,7 +193,7 @@ sudo systemctl restart monit
Monit has a number of pre-loaded configurations that can be accessed here: Monit has a number of pre-loaded configurations that can be accessed here:
```ad-command ```ad-command
~~~ ~~~bash
ls -alh /etc/monit/conf-available ls -alh /etc/monit/conf-available
~~~ ~~~
``` ```
@ -201,7 +201,7 @@ ls -alh /etc/monit/conf-available
To enable some of the pre-loaded confs, command below: To enable some of the pre-loaded confs, command below:
```ad-command ```ad-command
~~~ ~~~bash
sudo ln -s /etc/monit/conf-available/(process) /etc/monit/conf-enabled/ sudo ln -s /etc/monit/conf-available/(process) /etc/monit/conf-enabled/
~~~ ~~~
``` ```
@ -213,7 +213,7 @@ sudo ln -s /etc/monit/conf-available/(process) /etc/monit/conf-enabled/
Create a conf document in the following folder: Create a conf document in the following folder:
```ad-command ```ad-command
~~~ ~~~bash
sudo touch /etc/monit/conf-available/(processname) sudo touch /etc/monit/conf-available/(processname)
~~~ ~~~
``` ```
@ -231,7 +231,7 @@ check process (processname) matching "(processname)"
Once done, enable the config: Once done, enable the config:
```ad-command ```ad-command
~~~ ~~~bash
sudo ln -s /etc/monit/conf-available/(process) /etc/monit/conf-enabled/ sudo ln -s /etc/monit/conf-available/(process) /etc/monit/conf-enabled/
~~~ ~~~
``` ```
@ -245,7 +245,7 @@ Docker containers can be set up as programs with the use of a script.
1. Create a script for the docker container 1. Create a script for the docker container
```ad-command ```ad-command
~~~ ~~~bash
sudo mkdir /etc/monit/scripts/ sudo mkdir /etc/monit/scripts/
sudo touch /etc/monit/scripts/check_container_(container name).sh sudo touch /etc/monit/scripts/check_container_(container name).sh
sudo chmod 711 /etc/monit/scripts/check_container_(container name).sh sudo chmod 711 /etc/monit/scripts/check_container_(container name).sh
@ -265,7 +265,7 @@ exit $?
3. Create the configuration file 3. Create the configuration file
```ad-command ```ad-command
~~~ ~~~bash
sudo touch/vi /etc/monit/conf-available/(container name) sudo touch/vi /etc/monit/conf-available/(container name)
~~~ ~~~
``` ```
@ -285,7 +285,7 @@ CHECK PROGRAM (container name) WITH PATH /etc/monit/scripts/check\_container_(co
5. Enable the config 5. Enable the config
```ad-command ```ad-command
~~~ ~~~bash
sudo ln -s /etc/monit/conf-available/(container name) /etc/monit/conf-enabled/ sudo ln -s /etc/monit/conf-available/(container name) /etc/monit/conf-enabled/
~~~ ~~~
``` ```
@ -297,7 +297,7 @@ sudo ln -s /etc/monit/conf-available/(container name) /etc/monit/conf-enabled/
Once configuration is updated, monit provides a tool to check the script: Once configuration is updated, monit provides a tool to check the script:
```ad-command ```ad-command
~~~ ~~~bash
sudo monit -t sudo monit -t
~~~ ~~~
``` ```
@ -305,7 +305,7 @@ sudo monit -t
The program needs to be restarted: The program needs to be restarted:
```ad-command ```ad-command
~~~ ~~~bash
sudo monit reload sudo monit reload
~~~ ~~~
``` ```
@ -323,7 +323,7 @@ sudo monit reload
#### Print monit activity #### Print monit activity
```ad-command ```ad-command
~~~ ~~~bash
sudo monit summary sudo monit summary
~~~ ~~~
``` ```

@ -56,7 +56,7 @@ Installation is simple and opens a dialogue box. Steps are described below:
1. **Install Postfix** 1. **Install Postfix**
```ad-command ```ad-command
~~~ ~~~bash
sudo apt-get install -y postfix postfix-pgsql -y sudo apt-get install -y postfix postfix-pgsql -y
~~~ ~~~
``` ```
@ -231,7 +231,7 @@ query = SELECT 'smtp:127.0.0.1:20381' FROM custom_domain WHERE domain = '%s' AND
##### Restart the service ##### Restart the service
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl restart postfix sudo systemctl restart postfix
~~~ ~~~
``` ```
@ -260,7 +260,7 @@ title: Documentation
Ports (25, 465, 587) need to be opened by the firewall: Ports (25, 465, 587) need to be opened by the firewall:
```ad-command ```ad-command
~~~ ~~~bash
sudo ufw allow (port)/tcp sudo ufw allow (port)/tcp
~~~ ~~~
``` ```
@ -301,14 +301,14 @@ Postfix SSL certs need to match that of the server (in [[Configuring Postfix#Mai
```ad-command ```ad-command
title: add a user title: add a user
~~~ ~~~bash
sudo saslpasswd2 -c -u (mydomain.tld) (username) sudo saslpasswd2 -c -u (mydomain.tld) (username)
~~~ ~~~
``` ```
```ad-command ```ad-command
title: check number of users title: check number of users
~~~ ~~~bash
sudo sasldblistusers2 sudo sasldblistusers2
~~~ ~~~
``` ```
@ -335,7 +335,7 @@ Allow for connecting to an external SMTP - not tested.
Unfortunately there is no built-in functionality to monitor specifically outgoing emails. The following command can however be used and grans relevant info from `mail.log`: Unfortunately there is no built-in functionality to monitor specifically outgoing emails. The following command can however be used and grans relevant info from `mail.log`:
```ad-command ```ad-command
~~~ ~~~bash
sudo grep "status=sent" /var/log/mail.log | egrep -ve 'postfix/(cleanup|pickup|master|qmgr|smtpd|local|pipe)' sudo grep "status=sent" /var/log/mail.log | egrep -ve 'postfix/(cleanup|pickup|master|qmgr|smtpd|local|pipe)'
~~~ ~~~
``` ```
@ -345,7 +345,7 @@ sudo grep "status=sent" /var/log/mail.log | egrep -ve 'postfix/(cleanup|pickup|m
#### Monitor SMTP connections #### Monitor SMTP connections
```ad-command ```ad-command
~~~ ~~~bash
sudo tail -f /var/log/mail.log sudo tail -f /var/log/mail.log
~~~ ~~~
``` ```

@ -60,7 +60,7 @@ UFW should be installed by default in Ubuntu servers. If not, see below.
#### Installation of UFW #### Installation of UFW
```ad-command ```ad-command
~~~ ~~~bash
sudo apt install ufw sudo apt install ufw
~~~ ~~~
``` ```
@ -70,7 +70,7 @@ sudo apt install ufw
#### Activation of UFW #### Activation of UFW
```ad-command ```ad-command
~~~ ~~~bash
sudo ufw status sudo ufw status
~~~ ~~~
``` ```
@ -78,7 +78,7 @@ sudo ufw status
If disabled: If disabled:
```ad-command ```ad-command
~~~ ~~~bash
sudo ufw enable sudo ufw enable
~~~ ~~~
``` ```
@ -96,7 +96,7 @@ sudo ufw enable
#### UFW rules status #### UFW rules status
```ad-command ```ad-command
~~~ ~~~bash
sudo ufw status sudo ufw status
~~~ ~~~
``` ```
@ -112,7 +112,7 @@ Commands can be appended:
##### Allow / Deny ##### Allow / Deny
```ad-command ```ad-command
~~~ ~~~bash
sudo ufw allow/deny sudo ufw allow/deny
~~~ ~~~
``` ```
@ -133,7 +133,7 @@ Then:
Certain rules like IP denial need to be put on top of the rule stack as UFW reads rules in order one after another. Insert the following in the command to force insertion: Certain rules like IP denial need to be put on top of the rule stack as UFW reads rules in order one after another. Insert the following in the command to force insertion:
```ad-command ```ad-command
~~~ ~~~bash
insert 1 (or any place in the pecking order) insert 1 (or any place in the pecking order)
~~~ ~~~
``` ```

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Tag: ["Computer", "Web", "Networks", "Domain"] Tag: ["Computer", "Web", "Networks", "Domain"]
Date: 2021-09-01 Date: 2021-09-01
DocType: "Personal" DocType: "Personal"

@ -1,11 +1,11 @@
--- ---
cssclass: recipeTable
Alias: ["Self host", "Self hosting", "Self-host", "Self-hosting"] Alias: ["Self host", "Self hosting", "Self-host", "Self-hosting"]
Tag: ["Server", "Computer", "Security", "Privacy", "Web"] Tag: ["Server", "Computer", "Security", "Privacy", "Web"]
Date: 2021-08-26 Date: 2021-08-26
DocType: "Personal" DocType: "Personal"
Hierarchy: "Root2" Hierarchy: "Root2"
Parent: [[@Networks|Networks]]
TimeStamp: TimeStamp:
location: [45.8714213, 2.3970385] location: [45.8714213, 2.3970385]
CollapseMetaTable: Yes CollapseMetaTable: Yes
@ -14,6 +14,10 @@ CollapseMetaTable: Yes
Parent:: [[@Networks|Networks]], [[@Computer Set Up|Computer Setup]] Parent:: [[@Networks|Networks]], [[@Computer Set Up|Computer Setup]]
---
^Top
&emsp; &emsp;
```button ```button
@ -67,11 +71,11 @@ A good aggregator for low-cost VPS [here](https://lowendbox.com)
Otherwise, **physical hardware** include: Otherwise, **physical hardware** include:
Product | Type | Price range | Product | Type | Price range
--------|-------|----------- |--------|-------|-----------
<p style="color:green">**Synology (DS218/220+)**</p> | NAS | £250/300 |<p style="color:green">**Synology (DS218/220+)**</p> | NAS | £250/300
<p style="color:cyan">**Dell Poweredge Tower Server T30**</p> | Server | £300/400 |<p style="color:cyan">**Dell Poweredge Tower Server T30**</p> | Server | £300/400
<p style="color:maroon">**HP Z420**</p> | Workstation | £400 |<p style="color:maroon">**HP Z420**</p> | Workstation | £400
==WIP== ==WIP==
@ -190,9 +194,9 @@ In essence, to run multiple services on the same hardware, a few basic steps nee
| Consideration | Tool | Description | Consideration | Tool | Description
|---------------|------|------------ |---------------|------|------------
<p style="color:cyan">**Compartimentalise services into containers**</p> | **docker** | Creates containers that can be run independently | <p style="color:cyan">**Compartimentalise services into containers**</p> | **docker** | Creates containers that can be run independently
<p style="color:turquoise">**Simplify docker commands**</p> | **docker-compose** | Enables to create 'script' for docker commands | <p style="color:turquoise">**Simplify docker commands**</p> | **docker-compose** | Enables to create 'script' for docker commands
<p style="color:teal">**Route internet traffic appropriately**</p> | reverse proxy: **nginx**, **Caddy2** | Enables to route addresses to the appropriate containers and manage SSL certificates (and https forcing) | <p style="color:teal">**Route internet traffic appropriately**</p> | reverse proxy: **nginx**, **Caddy2** | Enables to route addresses to the appropriate containers and manage SSL certificates (and https forcing)
&emsp; &emsp;
@ -207,8 +211,8 @@ In essence, to run multiple services on the same hardware, a few basic steps nee
A list of FOSS services can be found [here](https://github.com/awesome-selfhosted/awesome-selfhosted) A list of FOSS services can be found [here](https://github.com/awesome-selfhosted/awesome-selfhosted)
Service | OS | Technical reqs | Description | Service | OS | Technical reqs | Description
--------|----|----------------|-- |--------|----|----------------|--
<p style="color:orange">**Email service**</p> | Linux | 2GB RAM recommended | self-host an [[#Email service]] <p style="color:orange">**Email service**</p> | Linux | 2GB RAM recommended | self-host an [[#Email service]]
<p style="color:green">**Email aliases**</p> | Linux | 2GB RAM; ports: 22, 25, 80, 443 | an [[#Email alias service\|alias service]] like [SimpleLogin](https://simplelogin.io) <p style="color:green">**Email aliases**</p> | Linux | 2GB RAM; ports: 22, 25, 80, 443 | an [[#Email alias service\|alias service]] like [SimpleLogin](https://simplelogin.io)
**[[Nextcloud]]** | Linux | 500M RAM; MySQL & SQL Lite; PHP 8.0; Apache 2.4 with PHP or nginx with PHP | [[#Personal cloud syncing]] instance **[[Nextcloud]]** | Linux | 500M RAM; MySQL & SQL Lite; PHP 8.0; Apache 2.4 with PHP or nginx with PHP | [[#Personal cloud syncing]] instance
@ -321,7 +325,7 @@ Open source CMS solution: [here](https://gohugo.io/)
| Tool | Self-hosted service | Link to tutorial | Sub-domain | Tool | Self-hosted service | Link to tutorial | Sub-domain
|------|---------------------|---------------|---------- |------|---------------------|---------------|----------
<p style="color:orange">**Password manager**</p> | **Bitwarden** | [here](https://cyberhost.uk/selfhost-bitwarden/) | pw-manager <p style="color:orange">**Password manager**</p> | **Bitwarden** | [here](https://cyberhost.uk/selfhost-bitwarden/) | pw-manager
<p style="color:orangered">**[[NextDNS|DNS resolver]]**</p> | **AdGuard Home** | [here](https://cyberhost.uk/adguard-setup/) | dns-resolver <p style="color:orangered">**[[NextDNS\|DNS resolver]]**</p> | **AdGuard Home** | [here](https://cyberhost.uk/adguard-setup/) | dns-resolver
<p style="color:coral">**Note-taking app**</p> | **[Notea](https://cinwell.com/notea/)**, **[Turtl](https://turtlapp.com)**, **[Boost Note](https://boostnote.io)**, **[Trilium](https://github.com/zadam/trilium)** | [Notea](https://cyberhost.uk/notea/), [Turtl with docker](https://github.com/turtl/server#running-the-server) | notes <p style="color:coral">**Note-taking app**</p> | **[Notea](https://cinwell.com/notea/)**, **[Turtl](https://turtlapp.com)**, **[Boost Note](https://boostnote.io)**, **[Trilium](https://github.com/zadam/trilium)** | [Notea](https://cyberhost.uk/notea/), [Turtl with docker](https://github.com/turtl/server#running-the-server) | notes
<p style="color:lightsalmon"> **Git instance**</p> | **[Gitea](https://gitea.io/en-us/)** | [for Gitea](https://www.techrepublic.com/article/how-to-install-the-self-hosted-git-server-gitea-on-ubuntu-18-04/), [Gitea with docker](https://www.how2shout.com/linux/gitea-on-docker-installation-of-self-hosted-git-service/), [Gitea with docker-compose](https://docs.gitea.io/en-us/install-with-docker/) | git <p style="color:lightsalmon"> **Git instance**</p> | **[Gitea](https://gitea.io/en-us/)** | [for Gitea](https://www.techrepublic.com/article/how-to-install-the-self-hosted-git-server-gitea-on-ubuntu-18-04/), [Gitea with docker](https://www.how2shout.com/linux/gitea-on-docker-installation-of-self-hosted-git-service/), [Gitea with docker-compose](https://docs.gitea.io/en-us/install-with-docker/) | git
@ -329,16 +333,19 @@ Open source CMS solution: [here](https://gohugo.io/)
Database: MySQL, MariaDB, Postgres Database: MySQL, MariaDB, Postgres
| App | Database | App | Database
|-----|:----------: |------|----------
**Turtl** | Postgres | **Turtl** | Postgres
**Gitea** | MariaDB | **Gitea** | MariaDB
**AdGuard** | *none* | **AdGuard** | *none*
**Bitwarden** | *none* | **Bitwarden** | *none*
```ad-info ```ad-info
title: VPS ideas title: VPS ideas
[MikroVPS - FR](https://my.mikrovps.net/cart.php?a=checkout&gid=34&language=English&pid=584&promocode=LEB2021LXC50&utm_source=lowendbox&utm_medium=display&utm_campaign=lbpromo2021) [MikroVPS - FR](https://my.mikrovps.net/cart.php?a=checkout&gid=34&language=English&pid=584&promocode=LEB2021LXC50&utm_source=lowendbox&utm_medium=display&utm_campaign=lbpromo2021)
``` ```
[[#^Top|TOP]]
&emsp; &emsp;
&emsp; &emsp;

@ -127,11 +127,15 @@ All dependencies for running the alias service.
title: Docker for non root users title: Docker for non root users
[[Docker config|docker]] predominantly works for the root user. In order to let non-root users instruct Docker, users need to be added to the Docker group: [[Docker config|docker]] predominantly works for the root user. In order to let non-root users instruct Docker, users need to be added to the Docker group:
`sudo usermod -aG docker (username)` ~~~bash
sudo usermod -aG docker (username)
~~~
Potentially, the Docker group needs to be defined: Potentially, the Docker group needs to be defined:
`sudo groupadd docker` ~~~bash
sudo groupadd docker
~~~
``` ```
Currently running [[Configuring Docker|docker]] containers Currently running [[Configuring Docker|docker]] containers
@ -241,7 +245,7 @@ Sample configs can be found [here](https://github.com/simple-login/app/blob/mast
Once the change is made, restart the app container: Once the change is made, restart the app container:
```ad-command ```ad-command
~~~ ~~~bash
docker restart sl-app docker restart sl-app
~~~ ~~~
``` ```
@ -253,7 +257,7 @@ docker restart sl-app
Users will be defaulted to the 'Free' plan and asked to subscribe to the premium plan. In order to force users onto the Premium plan, please update the database: Users will be defaulted to the 'Free' plan and asked to subscribe to the premium plan. In order to force users onto the Premium plan, please update the database:
```ad-command ```ad-command
~~~ ~~~bash
docker exec -it sl-db psql -U (dbusername) simplelogin docker exec -it sl-db psql -U (dbusername) simplelogin
~~~ ~~~
``` ```
@ -261,7 +265,7 @@ docker exec -it sl-db psql -U (dbusername) simplelogin
And then run: And then run:
```ad-command ```ad-command
~~~ ~~~bash
UPDATE users SET lifetime = 'TRUE' WHERE EMAIL = '(emailaddress)'; UPDATE users SET lifetime = 'TRUE' WHERE EMAIL = '(emailaddress)';
~~~ ~~~
``` ```

@ -172,7 +172,7 @@ performance_schema = OFF
In order to restart mysql, the command is: In order to restart mysql, the command is:
```ad-command ```ad-command
~~~ ~~~bash
sudo service mysql restart sudo service mysql restart
~~~ ~~~
``` ```
@ -202,7 +202,7 @@ Memory caching addon for Nextcloud. Memory caching management is provided by Nex
1. **Define the cronjob** 1. **Define the cronjob**
```ad-command ```ad-command
~~~ ~~~bash
sudo crontab -u www-data -e sudo crontab -u www-data -e
~~~ ~~~
``` ```
@ -218,7 +218,7 @@ sudo crontab -u www-data -e
3. **Verify that the cron job is added** 3. **Verify that the cron job is added**
```ad-command ```ad-command
~~~ ~~~bash
sudo crontab -u www-data -l sudo crontab -u www-data -l
~~~ ~~~
``` ```
@ -230,7 +230,7 @@ sudo crontab -u www-data -l
SVG support is installed in the form of a package. SVG support is installed in the form of a package.
```ad-command ```ad-command
~~~ ~~~bash
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y libmagickcore-6.q16-6-extra sudo apt-get install -y libmagickcore-6.q16-6-extra
~~~ ~~~
@ -298,7 +298,7 @@ From the server's command line, Nextcloud offers the ability to perform some tas
The tool needs to be invoked by the "www-data" user and compiled with PHP: The tool needs to be invoked by the "www-data" user and compiled with PHP:
```ad-command ```ad-command
~~~ ~~~bash
sudo -u www-data php /var/www/html/nextcloud/occ sudo -u www-data php /var/www/html/nextcloud/occ
~~~ ~~~
``` ```
@ -320,7 +320,7 @@ sudo -u www-data php /var/www/html/nextcloud/occ
After each data transfer, run the following command to refresh [[Nextcloud]]'s webapp: After each data transfer, run the following command to refresh [[Nextcloud]]'s webapp:
```ad-command ```ad-command
~~~ ~~~bash
sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all
~~~ ~~~
``` ```
@ -339,7 +339,7 @@ title: Data transfer tool
rClone uses a simple config interface to configure remote hosts (including [[Nextcloud]]): rClone uses a simple config interface to configure remote hosts (including [[Nextcloud]]):
```ad-command ```ad-command
~~~ ~~~bash
rclone config rclone config
~~~ ~~~
``` ```
@ -349,7 +349,7 @@ The config data can be password-protected for security.
1. **Copy data** 1. **Copy data**
```ad-command ```ad-command
~~~ ~~~bash
rclone copy source:'datapath' dest:'datapath' rclone copy source:'datapath' dest:'datapath'
~~~ ~~~
``` ```
@ -357,7 +357,7 @@ rclone copy source:'datapath' dest:'datapath'
2. **Sync data** 2. **Sync data**
```ad-command ```ad-command
~~~ ~~~bash
rclone sync source:'datapath' dest:'datapath' rclone sync source:'datapath' dest:'datapath'
~~~ ~~~
``` ```

@ -154,7 +154,7 @@ LWERS4M7njDLiAJe5A6gkv9jRDabvnzBGyYk9vPr1F5dY0LMu47FSjB0v21BAE83rYTOksElzcYmioWA
Classic installation with a dedicated configuration: Classic installation with a dedicated configuration:
```ad-command ```ad-command
~~~ ~~~bash
sudo nano /etc/fail2ban/jail.d/sshd.local sudo nano /etc/fail2ban/jail.d/sshd.local
~~~ ~~~
``` ```
@ -334,7 +334,7 @@ One GitHub user is offering a [repo](https://github.com/iganeshk/standardnotes-e
* **Configuration file** * **Configuration file**
```ad-command ```ad-command
~~~ ~~~bash
~/standardnotes-extensions/.env ~/standardnotes-extensions/.env
~~~ ~~~
``` ```
@ -342,7 +342,7 @@ One GitHub user is offering a [repo](https://github.com/iganeshk/standardnotes-e
* **Repository update** * **Repository update**
```ad-command ```ad-command
~~~ ~~~bash
sudo python3 build_repo.py sudo python3 build_repo.py
~~~ ~~~
``` ```

@ -124,7 +124,7 @@ The VPN server will host a single VPN service and dependencies bare metal.
Classic installation with a dedicated configuration: Classic installation with a dedicated configuration:
```ad-command ```ad-command
~~~ ~~~bash
sudo nano /etc/fail2ban/jail.d/sshd.local sudo nano /etc/fail2ban/jail.d/sshd.local
~~~ ~~~
``` ```
@ -208,7 +208,7 @@ title: Server Config file
```ad-command ```ad-command
title: In `~` for `melchiorbv` title: In `~` for `melchiorbv`
~~~ ~~~bash
./wireguard-install.sh ./wireguard-install.sh
~~~ ~~~
``` ```

@ -11,6 +11,8 @@ CollapseMetaTable: Yes
--- ---
^Top
Parent:: [[Selfhosting]], [[Server Alias]], [[Server Cloud]], [[Server Tools]], [[Server VPN]] Parent:: [[Selfhosting]], [[Server Alias]], [[Server Cloud]], [[Server Tools]], [[Server VPN]]
&emsp; &emsp;
@ -61,17 +63,28 @@ Simple commands to start using a Virtual Private Server.
#### Connection #### Connection
`ssh username@IPv4` ```ad-command
~~~bash
ssh username@IPv4
~~~
```
It is usual to change password: It is usual to change password:
`passwd` ```ad-command
~~~bash
passwd
~~~
```
&emsp; &emsp;
#### Initialisation and updates #### Initialisation and updates
`sudo apt update` ```ad-command
`sudo apt upgrade` ~~~bash
sudo apt update && sudo apt upgrade
~~~
```
&emsp; &emsp;
@ -79,21 +92,21 @@ It is usual to change password:
```ad-command ```ad-command
title: Add user title: Add user
~~~ ~~~bash
sudo adduser 'username' sudo adduser 'username'
~~~ ~~~
``` ```
```ad-command ```ad-command
title: Delete user title: Delete user
~~~ ~~~bash
sudo userdel -r 'username' sudo userdel -r 'username'
~~~ ~~~
``` ```
```ad-command ```ad-command
title: Grant admin privileges title: Grant admin privileges
~~~ ~~~bash
usermod -aG sudo 'username' usermod -aG sudo 'username'
~~~ ~~~
``` ```
@ -103,7 +116,7 @@ usermod -aG sudo 'username'
#### Switch between user accounts #### Switch between user accounts
```ad-command ```ad-command
~~~ ~~~bash
su - (username) su - (username)
~~~ ~~~
``` ```
@ -113,7 +126,7 @@ su - (username)
#### Reboot #### Reboot
```ad-command ```ad-command
~~~ ~~~bash
sudo reboot now sudo reboot now
~~~ ~~~
``` ```
@ -121,7 +134,7 @@ sudo reboot now
Or Or
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl reboot sudo systemctl reboot
~~~ ~~~
``` ```
@ -133,7 +146,7 @@ sudo systemctl reboot
1. **Check the static hostname** 1. **Check the static hostname**
```ad-command ```ad-command
~~~ ~~~bash
sudo hostnamectl sudo hostnamectl
~~~ ~~~
``` ```
@ -141,7 +154,7 @@ sudo hostnamectl
2. **Change the hostname** 2. **Change the hostname**
```ad-command ```ad-command
~~~ ~~~bash
sudo hostnamectl set-hostname (hostname) sudo hostnamectl set-hostname (hostname)
~~~ ~~~
``` ```
@ -169,13 +182,13 @@ This section gives an overview of how to switch signing-in to a machine without
2 simple commands to prepare the server: 2 simple commands to prepare the server:
```ad-command ```ad-command
~~~ ~~~bash
mkdir -p ~/.ssh mkdir -p ~/.ssh
~~~ ~~~
``` ```
```ad-command ```ad-command
~~~ ~~~bash
chmod 700 ~/.ssh chmod 700 ~/.ssh
~~~ ~~~
``` ```
@ -187,7 +200,7 @@ chmod 700 ~/.ssh
On Linux & MacOS clients, the process is simple: On Linux & MacOS clients, the process is simple:
```ad-command ```ad-command
~~~ ~~~bash
ssh-keygen -t rsa ssh-keygen -t rsa
~~~ ~~~
``` ```
@ -197,7 +210,7 @@ And follow the prompts.
You can then send the public key to the server: You can then send the public key to the server:
```ad-command ```ad-command
~~~ ~~~bash
ssh-copy-id -i ~/.ssh/(key name).pub (user)@(server) ssh-copy-id -i ~/.ssh/(key name).pub (user)@(server)
~~~ ~~~
``` ```
@ -211,7 +224,7 @@ ssh-copy-id -i ~/.ssh/(key name).pub (user)@(server)
In order to active SSH Agent, run: In order to active SSH Agent, run:
```ad-command ```ad-command
~~~ ~~~bash
ssh-agent $BASH ssh-agent $BASH
~~~ ~~~
``` ```
@ -219,7 +232,7 @@ ssh-agent $BASH
To add any key to the agent: To add any key to the agent:
```ad-command ```ad-command
~~~ ~~~bash
ssh-add ~/.ssh/(key name) ssh-add ~/.ssh/(key name)
~~~ ~~~
``` ```
@ -231,7 +244,7 @@ ssh-add ~/.ssh/(key name)
SSH can understand scripting for ease of use. To create and edit a config file on the local machine: SSH can understand scripting for ease of use. To create and edit a config file on the local machine:
```ad-command ```ad-command
~~~ ~~~bash
touch/vim ~/.ssh/config touch/vim ~/.ssh/config
~~~ ~~~
``` ```
@ -251,7 +264,7 @@ Host (scriptname) (serverIP)
Once set up, a connection can be called from Terminal with the following command: Once set up, a connection can be called from Terminal with the following command:
```ad-command ```ad-command
~~~ ~~~bash
ssh (scriptname) ssh (scriptname)
~~~ ~~~
``` ```
@ -263,7 +276,7 @@ ssh (scriptname)
To open the config file: To open the config file:
```ad-command ```ad-command
~~~ ~~~bash
sudo (nano/vim) /etc/ssh/sshd_config sudo (nano/vim) /etc/ssh/sshd_config
~~~ ~~~
``` ```
@ -301,7 +314,7 @@ Port xxxxx
After any change of the config file, restart the SSH service: After any change of the config file, restart the SSH service:
```ad-command ```ad-command
~~~ ~~~bash
sudo systemctl restart sshd sudo systemctl restart sshd
~~~ ~~~
``` ```
@ -310,7 +323,7 @@ sudo systemctl restart sshd
issue.net needs to be set: issue.net needs to be set:
```ad-command ```ad-command
~~~ ~~~bash
sudo nano/vim /etc/issue.net sudo nano/vim /etc/issue.net
~~~ ~~~
``` ```
@ -330,14 +343,14 @@ This server is the property of mydomain.example
```ad-command ```ad-command
title: simple port monitoring title: simple port monitoring
~~~ ~~~bash
sudo netstat -an sudo netstat -an
~~~ ~~~
``` ```
```ad-command ```ad-command
title: active port monitoring title: active port monitoring
~~~ ~~~bash
sudo netstat -anp (IP/TCP/UDP) sudo netstat -anp (IP/TCP/UDP)
~~~ ~~~
``` ```
@ -371,21 +384,21 @@ Simple commands to access files on the server.
```ad-command ```ad-command
title: Explore current directory title: Explore current directory
~~~ ~~~bash
ls -alh ls -alh
~~~ ~~~
``` ```
```ad-command ```ad-command
title: Change directory title: Change directory
~~~ ~~~bash
cd (folder path) cd (folder path)
~~~ ~~~
``` ```
```ad-command ```ad-command
title: Find a file title: Find a file
~~~ ~~~bash
sudo find / -iname (filename) sudo find / -iname (filename)
~~~ ~~~
``` ```
@ -395,7 +408,7 @@ sudo find / -iname (filename)
#### Create file #### Create file
```ad-command ```ad-command
~~~ ~~~bash
touch (filepath/name) touch (filepath/name)
~~~ ~~~
``` ```
@ -405,7 +418,7 @@ touch (filepath/name)
#### Edit file #### Edit file
```ad-command ```ad-command
~~~ ~~~bash
vi (filepath/name) vi (filepath/name)
~~~ ~~~
``` ```
@ -420,14 +433,14 @@ vi (filepath/name)
```ad-command ```ad-command
title: Delete file title: Delete file
~~~ ~~~bash
rm (file path & name) rm (file path & name)
~~~ ~~~
``` ```
```ad-command ```ad-command
title: Delete folder and contents title: Delete folder and contents
~~~ ~~~bash
rm -r (folder path) rm -r (folder path)
~~~ ~~~
``` ```
@ -450,7 +463,7 @@ title: Permissions
```ad-command ```ad-command
title: Change permissions title: Change permissions
~~~ ~~~bash
chmod xxx (folder/file path) chmod xxx (folder/file path)
~~~ ~~~
``` ```
@ -462,14 +475,14 @@ For x:
```ad-command ```ad-command
title: Change owner title: Change owner
~~~ ~~~bash
chown (owner):(group) (folder/file path) chown (owner):(group) (folder/file path)
~~~ ~~~
``` ```
```ad-command ```ad-command
title: Change group title: Change group
~~~ ~~~bash
chgrp -R (new group) (folder/file path) chgrp -R (new group) (folder/file path)
~~~ ~~~
``` ```
@ -480,14 +493,14 @@ chgrp -R (new group) (folder/file path)
```ad-command ```ad-command
title: Change file permission in a folder title: Change file permission in a folder
~~~ ~~~bash
find (folder path) -type f -exec chmod xxx {} \; find (folder path) -type f -exec chmod xxx {} \;
~~~ ~~~
``` ```
```ad-command ```ad-command
title: Change sub-folder permission in a folder title: Change sub-folder permission in a folder
~~~ ~~~bash
find (folder path) -type d -exec chmod xxx {} \; find (folder path) -type d -exec chmod xxx {} \;
~~~ ~~~
``` ```
@ -513,7 +526,7 @@ Instructions to use rclone for file transfers can be found [[Server Cloud#Cloud2
Create a directory for backup: Create a directory for backup:
```ad-command ```ad-command
~~~ ~~~bash
sudo mkdir /Backup sudo mkdir /Backup
~~~ ~~~
``` ```
@ -525,7 +538,7 @@ sudo mkdir /Backup
Best is to launch the command from the Backup folder: Best is to launch the command from the Backup folder:
```ad-command ```ad-command
~~~ ~~~bash
cd /Backup cd /Backup
~~~ ~~~
``` ```
@ -533,7 +546,7 @@ cd /Backup
Command: Command:
```ad-command ```ad-command
~~~ ~~~bash
sudo tar -cvpzf /Backup --exclude=/Backup/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/run --exclude=/var/cache/apt/archives --exclude=/usr/src/linux-headers* --exclude=/home/*/.gvfs --exclude=/home/*/.local/share/Trash / sudo tar -cvpzf /Backup --exclude=/Backup/backup.tar.gz --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --exclude=/run --exclude=/var/cache/apt/archives --exclude=/usr/src/linux-headers* --exclude=/home/*/.gvfs --exclude=/home/*/.local/share/Trash /
~~~ ~~~
``` ```
@ -553,7 +566,7 @@ After transfer, [[#Delete files folders|delete]] the .tar.gz file from its folde
1. From the server: 1. From the server:
```ad-command ```ad-command
~~~ ~~~bash
sudo nc -l 1024 | sudo tar -xvpzf - -C /media/backup sudo nc -l 1024 | sudo tar -xvpzf - -C /media/backup
~~~ ~~~
``` ```
@ -561,7 +574,7 @@ sudo nc -l 1024 | sudo tar -xvpzf - -C /media/backup
2. From the Client's machine, instruct: 2. From the Client's machine, instruct:
```ad-command ```ad-command
~~~ ~~~bash
cat (backup path & name.tar.gz) | nc -q 0 (hostname) 1024 cat (backup path & name.tar.gz) | nc -q 0 (hostname) 1024
~~~ ~~~
``` ```
@ -574,13 +587,13 @@ Or through **FTP**:
2. Copy /boot/grub/menu.lst to menu.lst.bak 2. Copy /boot/grub/menu.lst to menu.lst.bak
3. Restore 3. Restore
```ad-command ```ad-command
~~~ ~~~bash
sudo tar xvpfz backup.tar.gz -C / sudo tar xvpfz backup.tar.gz -C /
~~~ ~~~
``` ```
4. Recreate excluded directories 4. Recreate excluded directories
```ad-command ```ad-command
~~~ ~~~bash
mkdir proc mkdir proc
Mkdir lost+found Mkdir lost+found
mkdir mnt mkdir mnt
@ -615,7 +628,7 @@ Check:
And how many instances: And how many instances:
```ad-command ```ad-command
~~~ ~~~bash
sudo ps ax | grep (program) sudo ps ax | grep (program)
~~~ ~~~
``` ```
@ -625,7 +638,7 @@ sudo ps ax | grep (program)
#### Check what program uses a port #### Check what program uses a port
```ad-command ```ad-command
~~~ ~~~bash
sudo netstar -lntup | grep (port#) sudo netstar -lntup | grep (port#)
~~~ ~~~
``` ```
@ -635,7 +648,7 @@ sudo netstar -lntup | grep (port#)
#### List all programs #### List all programs
```ad-command ```ad-command
~~~ ~~~bash
sudo apt list --installed sudo apt list --installed
~~~ ~~~
``` ```
@ -645,7 +658,7 @@ sudo apt list --installed
#### Remove a package #### Remove a package
```ad-command ```ad-command
~~~ ~~~bash
sudo apt remove (package name) sudo apt remove (package name)
~~~ ~~~
``` ```
@ -653,7 +666,7 @@ sudo apt remove (package name)
For cleaner removal: For cleaner removal:
```ad-command ```ad-command
~~~ ~~~bash
sudo apt purge (package name) sudo apt purge (package name)
~~~ ~~~
``` ```
@ -687,3 +700,4 @@ title: Scripting OSX
&emsp; &emsp;
&emsp; &emsp;
[[#^Top|TOP]]

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["mfxm.fr", "mfxm Scope"] Alias: ["mfxm.fr", "mfxm Scope"]
Tag: ["Web", "Website", "Server"] Tag: ["Web", "Website", "Server"]
Date: 2021-09-02 Date: 2021-09-02

@ -78,7 +78,7 @@ Installation is simple:
```ad-command ```ad-command
~~~ ~~~bash
brew install hledger brew install hledger
~~~ ~~~
``` ```
@ -142,7 +142,7 @@ This method is well-guided with hLedger:
```ad-command ```ad-command
~~~ ~~~bash
hledger add -f 'journalname' hledger add -f 'journalname'
~~~ ~~~
``` ```
@ -166,7 +166,7 @@ Open the .journal file and manually enter transactions with the following format
```ad-command ```ad-command
title: Import from Note title: Import from Note
~~~ ~~~bash
hledger import -f 'journalname' 'filename' hledger import -f 'journalname' 'filename'
~~~ ~~~
``` ```
@ -289,7 +289,7 @@ Simple reports can be found [here](https://hledger.org/quickstart.html#run-repor
```ad-command ```ad-command
~~~ ~~~bash
hledger -f 'filename' is -Y (period argument) -3 (depth argument) -S (sorting by amount argument) -o (output file argument) hledger -f 'filename' is -Y (period argument) -3 (depth argument) -S (sorting by amount argument) -o (output file argument)
~~~ ~~~
``` ```
@ -298,7 +298,7 @@ hledger -f 'filename' is -Y (period argument) -3 (depth argument) -S (sorting by
**Balance sheet report** **Balance sheet report**
```ad-command ```ad-command
~~~ ~~~bash
hledger -f 'filename' bs -Y (period argument) -V (optional price basis: end of year each year, local ccy; --value=end,(ccy) for forcing GBP/EUR) (optional --infer-value) -o (output file argument) hledger -f 'filename' bs -Y (period argument) -V (optional price basis: end of year each year, local ccy; --value=end,(ccy) for forcing GBP/EUR) (optional --infer-value) -o (output file argument)
~~~ ~~~
``` ```
@ -309,7 +309,7 @@ hledger -f 'filename' bs -Y (period argument) -V (optional price basis: end of y
**ROI report** **ROI report**
```ad-command ```ad-command
~~~ ~~~bash
hledger -f 'filename' roi --investment (investment account) -Y (period argument) --value=then,"(ccy)" --infer-market-price --pnl "unrealized" hledger -f 'filename' roi --investment (investment account) -Y (period argument) --value=then,"(ccy)" --infer-market-price --pnl "unrealized"
~~~ ~~~
``` ```

@ -9,6 +9,7 @@ QICcy:
QITheme: QITheme:
QITradingd: QITradingd:
QITradingp: QITradingp:
cssclass: recipeTable
Alias: ["Investment Master"] Alias: ["Investment Master"]
Tag: ["Wealth", "Investment", "Equity", "VC", "Crypto"] Tag: ["Wealth", "Investment", "Equity", "VC", "Crypto"]
Date: 2021-08-17 Date: 2021-08-17
@ -86,21 +87,6 @@ style: number
&emsp; &emsp;
### Master Navigation
&emsp;
```dataview
Table Date as "Creation Date" from "06.02 Investments"
Sort file.name ascending
```
&emsp;
---
&emsp;
### Search ### Search
&emsp; &emsp;
@ -115,9 +101,11 @@ id EditMetaData
&emsp; &emsp;
```dataviewjs ```dataviewjs
dv.view("00.01 Admin/dv-views/print_data", {toprint: [dv.current().QITableType, dv.current().QIInvType, dv.current().QIAddedD, dv.current().QIStyle, dv.current().QIStage, dv.current().QICcy, dv.current().QITheme, dv.current().QITradingd, dv.current().QITradingp]}) dv.view("00.01 Admin/dv-views/print_invsearch", {invtype: dv.current().QIInvType, dateadded: dv.current().QIAddedD, style: dv.current().QIStyle, stage: dv.current().QIStage, ccy: dv.current().QICcy, theme: dv.current().QITheme, tradingd: dv.current().QITradingd, tradingp: dv.current().QITradingp})
``` ```
&emsp;
```dataviewjs ```dataviewjs
dv.view("00.01 Admin/dv-views/query_inv", {tabletype: dv.current().QITableType, invtype: dv.current().QIInvType, dateadded: dv.current().QIAddedD, style: dv.current().QIStyle, stage: dv.current().QIStage, ccy: dv.current().QICcy, theme: dv.current().QITheme, tradingd: dv.current().QITradingd, tradingp: dv.current().QITradingp}) dv.view("00.01 Admin/dv-views/query_inv", {tabletype: dv.current().QITableType, invtype: dv.current().QIInvType, dateadded: dv.current().QIAddedD, style: dv.current().QIStyle, stage: dv.current().QIStage, ccy: dv.current().QICcy, theme: dv.current().QITheme, tradingd: dv.current().QITradingd, tradingp: dv.current().QITradingp})
``` ```
@ -128,6 +116,21 @@ dv.view("00.01 Admin/dv-views/query_inv", {tabletype: dv.current().QITableType,
&emsp; &emsp;
### Investment list
&emsp;
```dataview
Table Date as "Creation Date" from "06.02 Investments"
Sort file.name ascending
```
&emsp;
---
&emsp;
### Tag Navigation ### Tag Navigation
&emsp; &emsp;

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Crypto Investment"] Alias: ["Crypto Investment"]
Tag: ["Wealth", "Investment", "Crypto"] Tag: ["Wealth", "Investment", "Crypto"]
Date: 2021-08-17 Date: 2021-08-17

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["Equity Investment"] Alias: ["Equity Investment"]
Tag: ["Wealth", "Equity"] Tag: ["Wealth", "Equity"]
Date: 2021-08-17 Date: 2021-08-17

@ -1,5 +1,6 @@
--- ---
cssclass: recipeTable
Alias: ["VC Investment"] Alias: ["VC Investment"]
Tag: ["Wealth", "Investment", "VC"] Tag: ["Wealth", "Investment", "VC"]
Date: 2021-08-17 Date: 2021-08-17

Loading…
Cancel
Save