formatting v2

main
Mel 3 years ago
parent 8a9b9c3407
commit 7fbc07353e

@ -1,8 +1,39 @@
{
"userAdmonitions": {},
"userAdmonitions": {
"command": {
"type": "command",
"color": "0, 66, 169",
"icon": {
"name": "terminal",
"type": "font-awesome"
},
"command": false,
"title": "command"
},
"path": {
"type": "path",
"color": "120, 88, 0",
"icon": {
"name": "folder-open",
"type": "font-awesome"
},
"command": false,
"title": "path"
},
"code": {
"type": "code",
"color": "56, 87, 26",
"icon": {
"name": "code",
"type": "font-awesome"
},
"command": false,
"title": "Code"
}
},
"syntaxHighlight": false,
"copyButton": false,
"version": "6.3.2",
"version": "6.3.3",
"autoCollapse": false,
"defaultCollapseType": "open",
"syncLinks": true,

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
{
"id": "obsidian-admonition",
"name": "Admonition",
"version": "6.3.2",
"version": "6.3.3",
"minAppVersion": "0.11.0",
"description": "Admonition block-styled content for Obsidian.md",
"author": "Jeremy Valentine",

@ -200,6 +200,33 @@ input.is-invalid {
color: #dc3545;
}
.suggestion-content.admonition-icon {
display: flex;
align-items: center;
justify-content: space-between;
flex-flow: row wrap;
}
.suggestion-content.admonition-icon > .suggestion-text.admonition-text {
width: fit-content;
}
.suggestion-content.admonition-icon
> .suggestion-flair.admonition-suggester-icon {
width: min-content;
position: relative;
top: unset;
left: unset;
right: unset;
bottom: unset;
display: flex;
align-items: center;
}
.suggestion-content.admonition-icon > .suggestion-note {
width: 100%;
}
.admonition-suggester-icon svg {
width: 1em;
}

File diff suppressed because one or more lines are too long

@ -1,8 +1,8 @@
{
"id": "obsidian-dice-roller",
"name": "Dice Roller",
"version": "7.0.1",
"minAppVersion": "0.12.0",
"version": "7.1.2",
"minAppVersion": "0.12.15",
"description": "Inline dice rolling for Obsidian.md",
"author": "Jeremy Valentine",
"authorUrl": "",

@ -148,7 +148,7 @@
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
z-index: 9999999;
transition: opacity 1s ease-out;
@ -231,11 +231,20 @@
margin-bottom: 0;
}
.dice-roller-view .dice-roller-results-container h4 {
margin-top: 6px;
.dice-roller-view .dice-roller-results-container .dice-roller-results-header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 6px 0px;
width: 100%;
border-bottom: 1px solid var(--background-modifier-border);
}
.dice-roller-view
.dice-roller-results-container
.dice-roller-results-header
h4 {
margin: 0px;
}
.dice-roller-view .dice-roller-results {
display: flex;

@ -9,7 +9,7 @@
"state": {
"type": "markdown",
"state": {
"file": "Admin/Templates/Template Travel.md",
"file": "Reading list/@Reading master.md",
"mode": "preview"
}
}
@ -68,7 +68,7 @@
"state": {
"type": "backlink",
"state": {
"file": "Admin/Templates/Template Travel.md",
"file": "Reading list/@Reading master.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -96,26 +96,27 @@
}
},
{
"id": "f60d9c317853dd8a",
"id": "745da70f72b221b1",
"type": "leaf",
"state": {
"type": "DICE_ROLLER_VIEW",
"state": {}
}
}
]
],
"currentTab": 3
},
"active": "c1cbd199334b4022",
"lastOpenFiles": [
"Admin/Templates/Template Travel.md",
"Admin/Templates/Template Task.md",
"Admin/Templates/Template Source.md",
"Admin/Templates/Template Server.md",
"Admin/Templates/Template Product.md",
"Admin/Templates/Template Pocket Source.md",
"Admin/Templates/Template Place.md",
"Admin/Templates/Template Note.md",
"Admin/Templates/Template Investment.md",
"Admin/Templates/@Task Master.md"
"Reading list/@Reading master.md",
"Reading list/Comprendre l'islam.md",
"Travels/Ethiopia.md",
"Networks/Configuring UFW.md",
"Networks/Selfhosting.md",
"Networks/Server Alias.md",
"Networks/Server Cloud.md",
"Networks/Server Tools.md",
"Networks/VPS Console Dialogue.md",
"Admin/Templates/Template Travel.md"
]
}

@ -230,13 +230,21 @@ Running and troubleshooting for CertBot can be found [here](https://certbot.eff.
The service itself does not require particular management as all features are embedded in the client interface running from the docker container 'sl-app', including user management.
Parameters can only be amended through the config file under the root user:
`sudo vim ~/simplelogin.env`
```ad-path
~~~
sudo vim ~/simplelogin.env
~~~
```
Sample configs can be found [here](https://github.com/simple-login/app/blob/master/example.env)
Once the change is made, restart the app container:
`docker restart sl-app`
```ad-command
~~~
docker restart sl-app
~~~
```
 
@ -244,11 +252,19 @@ Once the change is made, restart the app container:
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:
`docker exec -it sl-db psql -U (dbusername) simplelogin`
```ad-command
~~~
docker exec -it sl-db psql -U (dbusername) simplelogin
~~~
```
And then run:
`UPDATE users SET lifetime = 'TRUE' WHERE EMAIL = '(emailaddress)';`
```ad-command
~~~
UPDATE users SET lifetime = 'TRUE' WHERE EMAIL = '(emailaddress)';
~~~
```
And `\q` to exit the db.

@ -132,10 +132,12 @@ A comprehensive tutorial on the MPM switch can be found [here](https://www.digit
**php.ini** files can be found at:
```
```ad-path
~~~
/etc/php/7.4/fpm/php.ini
/etc/php/7.4/apache2/php.ini
/etc/php/7.4/cli/php.ini
~~~
```
 
@ -152,19 +154,28 @@ Nothing particular to note on MySQL apart from initial set-up and user managemen
Configuration file is under:
`/etc/mysql/mysql.conf.d/mysqld.cnf`
```ad-path
~~~
/etc/mysql/mysql.conf.d/mysqld.cnf
~~~
```
```ad-tip
```ad-code
title: Optimise memory usage of mysql
In the conf file under the **_[mysqld]_** tag, add:
 
~~~
[mysqld]
% Disable performance schema to hugely reduce RAM usage
performance_schema = OFF
~~~
```
In order to restart mysql, the command is:
`sudo service mysql restart`
```ad-command
~~~
sudo service mysql restart
~~~
```
 
@ -190,15 +201,27 @@ Memory caching addon for Nextcloud. Memory caching management is provided by Nex
1. **Define the cronjob**
`sudo crontab -u www-data -e`
```ad-command
~~~
sudo crontab -u www-data -e
~~~
```
2. **Add cronjob**
> \*/5 * * * * php -f /var/www/html/nextcloud/cron.php --define apc.enable_cli=1
```ad-code
~~~
\*/5 * * * * php -f /var/www/html/nextcloud/cron.php --define apc.enable_cli=1
~~~
```
3. **Verify that the cron job is added**
`sudo crontab -u www-data -l`
```ad-command
~~~
sudo crontab -u www-data -l
~~~
```
 
@ -206,9 +229,11 @@ Memory caching addon for Nextcloud. Memory caching management is provided by Nex
SVG support is installed in the form of a package.
```
```ad-command
~~~
sudo apt-get update -y
sudo apt-get install -y libmagickcore-6.q16-6-extra
~~~
```
##### UFW
@ -264,11 +289,19 @@ From the server's command line, Nextcloud offers the ability to perform some tas
[[Nextcloud]] offers a command-line tool which permission needs to be set to "executable". It is located here:
`/var/www/html/nextcloud/occ`
```ad-path
~~~
/var/www/html/nextcloud/occ
~~~
```
The tool needs to be invoked by the "www-data" user and compiled with PHP:
`sudo -u www-data php /var/www/html/nextcloud/occ`
```ad-command
~~~
sudo -u www-data php /var/www/html/nextcloud/occ
~~~
```
 
@ -286,7 +319,11 @@ The tool needs to be invoked by the "www-data" user and compiled with PHP:
After each data transfer, run the following command to refresh [[Nextcloud]]'s webapp:
`sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all`
```ad-command
~~~
sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all
~~~
```
More info can be found [here](https://docs.nextcloud.com/server/22/admin_manual/configuration_server/occ_command.html)
@ -301,20 +338,28 @@ title: Data transfer tool
rClone uses a simple config interface to configure remote hosts (including [[Nextcloud]]):
`rclone config`
```ad-command
~~~
rclone config
~~~
```
The config data can be password-protected for security.
1. **Copy data**
```
```ad-command
~~~
rclone copy source:'datapath' dest:'datapath'
~~~
```
2. **Sync data**
```
```ad-command
~~~
rclone sync source:'datapath' dest:'datapath'
~~~
```
 
@ -332,11 +377,19 @@ rclone sync source:'datapath' dest:'datapath'
1. **Local file structure**
`/var/www/html/nextcloud/data/USERNAME/files`
```ad-path
~~~
/var/www/html/nextcloud/data/USERNAME/files
~~~
```
2. **Webdav file structure**
`/remote.php/dav/files/USERNAME`
```ad-path
~~~
/remote.php/dav/files/USERNAME
~~~
```
 

@ -153,15 +153,23 @@ LWERS4M7njDLiAJe5A6gkv9jRDabvnzBGyYk9vPr1F5dY0LMu47FSjB0v21BAE83rYTOksElzcYmioWA
Classic installation with a dedicated configuration:
`sudo nano /etc/fail2ban/jail.d/sshd.local`
```ad-command
~~~
sudo nano /etc/fail2ban/jail.d/sshd.local
~~~
```
With the following parameters:
>\[sshd\]
>enabled = true
>port=2227
>maxretry = 10
>bantime = 1m
```ad-code
~~~
[sshd]
enabled = true
port=2227
maxretry = 10
bantime = 1m
~~~
```
 
@ -273,9 +281,17 @@ title: service parameters
2 files are used to configure the service:
`~/standalone/.env`
```ad-path
~~~
~/standalone/.env
~~~
```
`~/standalone/docker/auth/.env`
```ad-path
~~~
~/standalone/docker/auth/.env
~~~
```
Docs can be found [here](https://docs.standardnotes.com/self-hosting/docker).
@ -317,11 +333,21 @@ One GitHub user is offering a [repo](https://github.com/iganeshk/standardnotes-e
* **Configuration file**
`~/standardnotes-extensions/.env`
```ad-command
~~~
~/standardnotes-extensions/.env
~~~
```
* **Repository update**
`sudo python3 build_repo.py` In the main folder.
```ad-command
~~~
sudo python3 build_repo.py
~~~
```
In the main folder.
 
@ -374,20 +400,24 @@ User management has not been parametered to exclude new users but an admin panel
##### Utilities
```ad-bug
```ad-path
title: Config file
~~~
~/gitea/gitea/gitea/conf/app.ini
~~~
```
 
```ad-bug
```ad-code
title: email setup
Gitea can work on internal mail points through:
>ENABLED = true
>FROM = (user addresss)
>USE_SENDMAIL = false
>HOST = (hostname):25
~~~
ENABLED = true
FROM = (user addresss)
USE_SENDMAIL = false
HOST = (hostname):25
~~~
```
 
@ -424,7 +454,11 @@ List of monitored services:
#### Cert storage
`/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/`
```ad-path
~~~
/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/
~~~
```
 

@ -77,21 +77,21 @@ It is usual to change password:
#### User accounts
```ad-info
```ad-command
title: Add user
~~~
sudo adduser 'username'
~~~
```
```ad-info
```ad-command
title: Delete user
~~~
sudo userdel -r 'username'
~~~
```
```ad-info
```ad-command
title: Grant admin privileges
~~~
usermod -aG sudo 'username'
@ -102,17 +102,29 @@ usermod -aG sudo 'username'
#### Switch between user accounts
`su - (username)`
```ad-command
~~~
su - (username)
~~~
```
 
#### Reboot
`Sudo reboot now`
```ad-command
~~~
sudo reboot now
~~~
```
Or
`sudo systemctl reboot`
```ad-command
~~~
sudo systemctl reboot
~~~
```
 
@ -120,11 +132,19 @@ Or
1. **Check the static hostname**
`sudo hostnamectl`
```ad-command
~~~
sudo hostnamectl
~~~
```
2. **Change the hostname**
`sudo hostnamectl set-hostname (hostname)`
```ad-command
~~~
sudo hostnamectl set-hostname (hostname)
~~~
```
 
@ -148,9 +168,17 @@ This section gives an overview of how to switch signing-in to a machine without
2 simple commands to prepare the server:
`mkdir -p ~/.ssh`
```ad-command
~~~
mkdir -p ~/.ssh
~~~
```
`chmod 700 ~/.ssh`
```ad-command
~~~
chmod 700 ~/.ssh
~~~
```
 
@ -158,13 +186,21 @@ This section gives an overview of how to switch signing-in to a machine without
On Linux & MacOS clients, the process is simple:
`ssh-keygen -t rsa`
```ad-command
~~~
ssh-keygen -t rsa
~~~
```
And follow the prompts.
You can then send the public key to the server:
`ssh-copy-id -i ~/.ssh/(key name).pub (user)@(server)`
```ad-command
~~~
ssh-copy-id -i ~/.ssh/(key name).pub (user)@(server)
~~~
```
 
@ -174,11 +210,19 @@ You can then send the public key to the server:
In order to active SSH Agent, run:
`ssh-agent $BASH`
```ad-command
~~~
ssh-agent $BASH
~~~
```
To add any key to the agent:
`ssh-add ~/.ssh/(key name)`
```ad-command
~~~
ssh-add ~/.ssh/(key name)
~~~
```
 
@ -186,20 +230,31 @@ To add any key to the agent:
SSH can understand scripting for ease of use. To create and edit a config file on the local machine:
`touch/vim ~/.ssh/config`
```ad-command
~~~
touch/vim ~/.ssh/config
~~~
```
The declaration of a connection follows this nomenclature:
>Host (scriptname) (serverIP)
> HostName (serverIP)
> IdentityFile ~/.ssh/(private key path)
> User (remoteusername)
```ad-code
~~~
Host (scriptname) (serverIP)
HostName (serverIP)
IdentityFile ~/.ssh/(private key path)
User (remoteusername)
~~~
```
Once set up, a connection can be called from Terminal with the following command:
`ssh (scriptname)`
```ad-command
~~~
ssh (scriptname)
~~~
```
 
@ -207,67 +262,91 @@ Once set up, a connection can be called from Terminal with the following command
To open the config file:
`sudo (nano/vim) /etc/ssh/sshd_config`
```ad-command
~~~
sudo (nano/vim) /etc/ssh/sshd_config
~~~
```
The following parameters enable to restrict access to the server:
> // **Enables SSH Key authentication**
```ad-code
~~~
// Enables SSH Key authentication
PubkeyAuthentication yes
>
> // **Disables password authentication (not recommended)**
// Disables password authentication (not recommended)
PasswordAuthentication no
>
> // **Disable root access (to diminish a known attack surface)**
// Disable root access (to diminish a known attack surface)
PermitRootLogin no
>
> // **Disables empty passwords**
// Disables empty passwords
PermitEmptyPasswords no
>
> // **Set a Banner**
// Set a Banner
Banner /etc/issue.net
>
> // **Manage White/Blacklists**
// Manage White/Blacklists
AllowUsers (username)
AllowGroups (groupname)
DenyUsers (username)
DenyGroups (groupname)
>
> // **Change connection Port**
// Change connection Port
Port xxxxx
~~~
```
After any change of the config file, restart the SSH service:
`sudo systemctl restart sshd`
```ad-command
~~~
sudo systemctl restart sshd
~~~
```
**Note**:
issue.net needs to be set:
`sudo nano/vim /etc/issue.net`
```ad-command
~~~
sudo nano/vim /etc/issue.net
~~~
```
With a text as set out below:
> Warning! Authorised use only.
> This server is the property of mydomain.example
```ad-code
~~~
Warning! Authorised use only.
This server is the property of mydomain.example
~~~
```
 
#### Network monitoring
```ad-info
```ad-command
title: simple port monitoring
`sudo netstat -an`
~~~
sudo netstat -an
~~~
```
```ad-info
```ad-command
title: acti r port monitoring
`sudo netstat -anp (IP/TCP/UDP)`
~~~
sudo netstat -anp (IP/TCP/UDP)
~~~
```
```ad-info
title: simple port stats
`sudo netstat -sp (IP/TCP/UDP)`
~~~
sudo netstat -sp (IP/TCP/UDP)
~~~
```
 
@ -290,32 +369,46 @@ Simple commands to access files on the server.
#### File navigation
```ad-note
```ad-command
title: Explore current directory
`ls -alh`
~~~
ls -alh
~~~
```
```ad-note
```ad-command
title: Change directory
`cd (folder path)`
~~~
cd (folder path)
~~~
```
```ad-note
```ad-command
title: Find a file
`sudo find / -iname (filename)`
~~~
sudo find / -iname (filename)
~~~
```
 
#### Create file
`touch (filepath/name)`
```ad-command
~~~
touch (filepath/name)
~~~
```
 
#### Edit file
`vi (filepath/name)`
```ad-command
~~~
vi (filepath/name)
~~~
```
1. Press 'i' for the edit mode
2. 'Esc' key to exit edit mode
@ -325,14 +418,18 @@ title: Find a file
#### Delete files & folders
```ad-note
```ad-command
title: Delete file
`rm (file path & name)`
~~~
rm (file path & name)
~~~
```
```ad-note
```ad-command
title: Delete folder and contents
`rm -r (folder path)`
~~~
rm -r (folder path)
~~~
```
 
@ -341,19 +438,21 @@ title: Delete folder and contents
##### Checking file permissions
```ad-note
```ad-command
title: Permissions
For a file: `ls -l (file path & name)`
For a folder: `ls -ld (folder path)`
**For a file**: ls -l (file path & name)
**For a folder**: ls -ld (folder path)
```
 
##### Changing file permissions
```ad-note
```ad-command
title: Change permissions
`chmod xxx (folder/file path)`
~~~
chmod xxx (folder/file path)
~~~
```
For x:
@ -361,28 +460,36 @@ For x:
2. write: 2
3. execute: 1
```ad-note
```ad-command
title: Change owner
`chown (owner):(group) (folder/file path)`
~~~
chown (owner):(group) (folder/file path)
~~~
```
```ad-note
```ad-command
title: Change group
`chgrp -R (new group) (folder/file path)`
~~~
chgrp -R (new group) (folder/file path)
~~~
```
 
##### Bulk changes
```ad-note
```ad-command
title: Change file permission in a folder
`find (folder path) -type f -exec chmod xxx {} \;`
~~~
find (folder path) -type f -exec chmod xxx {} \;
~~~
```
```ad-note
```ad-command
title: Change sub-folder permission in a folder
`find (folder path) -type d -exec chmod xxx {} \;`
~~~
find (folder path) -type d -exec chmod xxx {} \;
~~~
```
 
@ -405,7 +512,11 @@ Instructions to use rclone for file transfers can be found [[Server Cloud#Cloud2
Create a directory for backup:
`sudo mkdir /Backup`
```ad-command
~~~
sudo mkdir /Backup
~~~
```
 
@ -413,11 +524,19 @@ Create a directory for backup:
Best is to launch the command from the Backup folder:
`cd /Backup`
```ad-command
~~~
cd /Backup
~~~
```
Command:
`sudo tar -cvpfz /Backup/backup.tar.gz --exlude=/Backup/backup.tar.gz --exlude=/proc --exlude=/tmp --exlude=/mnt --exlude=/dev --exlude=/sys --exlude=/run --exlude=/var/cache/apt/archives --exlude=/usr/src/linux-headers* --exlude=/home/*/.gvfs --exlude=/home/*/.local/share/Trash /`
```ad-command
~~~
sudo tar -cvpfz /Backup/backup.tar.gz --exlude=/Backup/backup.tar.gz --exlude=/proc --exlude=/tmp --exlude=/mnt --exlude=/dev --exlude=/sys --exlude=/run --exlude=/var/cache/apt/archives --exlude=/usr/src/linux-headers* --exlude=/home/*/.gvfs --exlude=/home/*/.local/share/Trash /
~~~
```
Once created, the backup can be transferred using the [[#File transfer]] script.
@ -433,11 +552,19 @@ After transfer, [[#Delete files folders|delete]] the .tar.gz file from its folde
1. From the server:
`sudo nc -l 1024 | sudo tar -xvpzf - -C /media/backup`
```ad-command
~~~
sudo nc -l 1024 | sudo tar -xvpzf - -C /media/backup
~~~
```
2. From the Client's machine, instruct:
`cat (backup path & name.tar.gz) | nc -q 0 (hostname) 1024`
```ad-command
~~~
cat (backup path & name.tar.gz) | nc -q 0 (hostname) 1024
~~~
```
 
@ -446,18 +573,30 @@ Or through **FTP**:
1. Send backup to the root folder over FTP
2. Copy /boot/grub/menu.lst to menu.lst.bak
3. Restore
`sudo tar xvpfz backup.tar.gz -C /`
4. Recreate excluded directories
```ad-command
~~~
sudo tar xvpfz backup.tar.gz -C /
~~~
```
4. Recreate excluded directories
```ad-command
~~~
mkdir proc
Mkdir lost+found
mkdir mnt
mkdir sys
...
~~~
```
5. Replace the restored *menu.lst* file with the *.bak* created in Step 2 (dropping bak)
6. MAC address may need to be change
Check `/etc/udev/rules.d/70-persistent-net.rules`
Check:
```ad-path
~~~
/etc/udev/rules.d/70-persistent-net.rules
~~~
```
@ -475,29 +614,49 @@ Check `/etc/udev/rules.d/70-persistent-net.rules`
And how many instances:
`sudo ps ax | grep (program)`
```ad-command
~~~
sudo ps ax | grep (program)
~~~
```
 
#### Check what program uses a port
`sudo netstar -lntup | grep (port#)`
```ad-command
~~~
sudo netstar -lntup | grep (port#)
~~~
```
 
#### List all programs
`sudo apt list --installed`
```ad-command
~~~
sudo apt list --installed
~~~
```
 
#### Remove a package
`sudo apt remove (package name)`
```ad-command
~~~
sudo apt remove (package name)
~~~
```
For cleaner removal:
`sudo apt purge (package name)`
```ad-command
~~~
sudo apt purge (package name)
~~~
```
 

Loading…
Cancel
Save