vault backup: 2024-04-13 17:32:12
This commit is contained in:
Vendored
+20
-29
@@ -4,35 +4,18 @@
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "d06556e09298d624",
|
||||
"id": "efab876a0fbc4edb",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "fad9f2a4d62c964b",
|
||||
"id": "9d73cd426040a98c",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Nextcloud-Ubuntu.md.md",
|
||||
"mode": "preview",
|
||||
"source": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "f424d6ca11a0775c",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Nextcloud-bare-metal-install-on-Debian.md.md",
|
||||
"mode": "preview",
|
||||
"source": false
|
||||
}
|
||||
"type": "empty",
|
||||
"state": {}
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 1
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
@@ -98,7 +81,6 @@
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "Nextcloud-bare-metal-install-on-Debian.md.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
@@ -115,7 +97,6 @@
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "Nextcloud-bare-metal-install-on-Debian.md.md",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
@@ -137,9 +118,7 @@
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "Nextcloud-bare-metal-install-on-Debian.md.md"
|
||||
}
|
||||
"state": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -160,10 +139,22 @@
|
||||
"command-palette:Open command palette": false
|
||||
}
|
||||
},
|
||||
"active": "f424d6ca11a0775c",
|
||||
"active": "9d73cd426040a98c",
|
||||
"lastOpenFiles": [
|
||||
"Nextcloud-Ubuntu.md.md",
|
||||
"LGV30S.md",
|
||||
"alpine-resize-disk.md.md",
|
||||
"alpine-cloud-init-setup.md.md",
|
||||
"wireguard-install-lxc.md.md",
|
||||
"Nextcloud-bare-metal-install-on-Debian.md.md",
|
||||
"Nextcloud-Ubuntu.md.md",
|
||||
"docker-install-lxc.md",
|
||||
"git-commands.md.md",
|
||||
"Proxmox.md.md",
|
||||
"Python-virtual-environment.md.md",
|
||||
"limit-upload-speed.md.md",
|
||||
"Proxmox-lxc-mountpoints.md.md",
|
||||
"Windows.md.md",
|
||||
"InstallAdguardhome.md.md",
|
||||
"tessssssss.md",
|
||||
"testttt.md",
|
||||
"test",
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Run as root
|
||||
|
||||
#### Download latest from https://github.com/AdguardTeam/AdGuardHome/releases/latest
|
||||
|
||||
#### Extract to /opt
|
||||
```bash
|
||||
tar xvf AdGuardHome_linux_amd64.tar.gz -C /opt
|
||||
rm AdGuardHome_linux_amd64.tar.gz
|
||||
```
|
||||
|
||||
#### Run setup
|
||||
```bash
|
||||
cd /opt/AdGuardHome
|
||||
./AdGuardHome -s install
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
```bash
|
||||
IMEI 356834090010374
|
||||
```
|
||||
```bash
|
||||
US Mobile SIM 89148000006147534992
|
||||
```
|
||||
@@ -0,0 +1,5 @@
|
||||
```bash
|
||||
lxc resticbackups mount point
|
||||
mp0: /mnt/truenas-backups/resticbackups/<servername>,mp=/mnt/resticbackups
|
||||
mkdir /mnt/truenas-backups/resticbackups/<servername>
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
```bin
|
||||
update-initramfs -u -k all
|
||||
```
|
||||
```bin
|
||||
pveam update
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
To create a virtual environment, go to your project’s directory and run the following command. This will create a new virtual environment in a local folder named .venv:
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
```
|
||||
The second argument is the location to create the virtual environment. Generally, you can just create this in your project and call it .venv.
|
||||
|
||||
venv will create a virtual Python installation in the .venv folder.
|
||||
|
||||
Note: You should exclude your virtual environment directory from your version control system using .gitignore or similar.
|
||||
|
||||
Activate a virtual environment
|
||||
Before you can start installing or using packages in your virtual environment you’ll need to activate it. Activating a virtual environment will put the virtual environment-specific python and pip executables into your shell’s PATH.
|
||||
```bash
|
||||
source .venv/bin/activate
|
||||
```
|
||||
To confirm the virtual environment is activated, check the location of your Python interpreter:
|
||||
```bash
|
||||
which python
|
||||
```
|
||||
While the virtual environment is active, the above command will output a filepath that includes the .venv directory, by ending with the following:
|
||||
|
||||
'.venv/bin/python'
|
||||
|
||||
While a virtual environment is activated, pip will install packages into that specific environment. This enables you to import and use packages in your Python application.
|
||||
|
||||
Deactivate a virtual environment
|
||||
If you want to switch projects or leave your virtual environment, deactivate the environment:
|
||||
```bash
|
||||
deactivate
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
kill specific process from path
|
||||
wmic process where ExecutablePath='C:\\Path\\to\\process\\name.exe' delete
|
||||
|
||||
|
||||
user shell folders
|
||||
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
|
||||
@@ -0,0 +1,121 @@
|
||||
########################################
|
||||
########################################
|
||||
# install and initial set up
|
||||
|
||||
# first boot
|
||||
boot alpine from network
|
||||
log in as root
|
||||
setup-alpine
|
||||
---------------
|
||||
keyboard: us
|
||||
keyboard locale: us-intl
|
||||
hostname: default
|
||||
network interface: default
|
||||
dhcp: default
|
||||
netmask: default
|
||||
gateway: default
|
||||
manual network changes: default
|
||||
network suffix: lan
|
||||
dns: default
|
||||
set root password
|
||||
timezone: America/Chicago
|
||||
proxy: default
|
||||
mirror: default
|
||||
add user: default
|
||||
ssh server: default
|
||||
allow ssh root login: yes
|
||||
ssh key for root: default
|
||||
format: /dev/sda
|
||||
filesystem: sys
|
||||
write disk: y
|
||||
---------------
|
||||
reboot
|
||||
|
||||
########################################
|
||||
########################################
|
||||
# CONFIGURATION
|
||||
|
||||
# set nano as default editor
|
||||
---------------
|
||||
apk add nano
|
||||
---------------
|
||||
echo "EDITOR=nano" > /etc/profile.d/default_editor.sh
|
||||
echo "export EDITOR" >> /etc/profile.d/default_editor.sh
|
||||
---------------
|
||||
save and exit
|
||||
log out and back in
|
||||
|
||||
# update repos
|
||||
---------------
|
||||
echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/main" > /etc/apk/repositories
|
||||
echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
|
||||
---------------
|
||||
|
||||
# update and install packages
|
||||
---------------
|
||||
apk update && apk upgrade
|
||||
apk add util-linux e2fsprogs-extra qemu-guest-agent sudo cfdisk cloud-init
|
||||
---------------
|
||||
|
||||
# enable qemu-guest-agent on boot
|
||||
---------------
|
||||
rc-update add qemu-guest-agent
|
||||
---------------
|
||||
|
||||
# add root ssh public keys
|
||||
---------------
|
||||
mkdir /root/.ssh
|
||||
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHWiw5lVzQIZiZc1SPphvHhdSpFl9UN6Xm4znFqq5xs4 server-root" > /root/.ssh/authorized_keys
|
||||
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBI/kuy/SVCxShVBNtWtNREX9cpWrlsthV3z15ky+bPy winpc-root" >> /root/.ssh/authorized_keys
|
||||
chmod 600 /root/.ssh/*
|
||||
---------------
|
||||
|
||||
# change sshd config back to default
|
||||
---------------
|
||||
sed -i 's/PermitRootLogin yes/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
|
||||
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||
---------------
|
||||
save and exit
|
||||
---------------
|
||||
/etc/init.d/sshd restart
|
||||
---------------
|
||||
log out and back in with root public key
|
||||
|
||||
# configure sudo
|
||||
---------------
|
||||
visudo
|
||||
---------------
|
||||
remove comment on #%wheel ALL=(ALL:ALL) ALL
|
||||
remove comment on #%sudo ALL=(ALL:ALL) ALL
|
||||
---------------
|
||||
save and exit
|
||||
|
||||
# configure cloud-init
|
||||
---------------
|
||||
nano /etc/cloud/cloud.cfg
|
||||
---------------
|
||||
sed -i 's/disable_root: true/disable_root: false/g' /etc/cloud/cloud.cfg
|
||||
sed -i 's/groups: [adm, wheel]/groups: [adm, wheel, sudo]/g' /etc/cloud/cloud.cfg
|
||||
---------------
|
||||
nano /etc/cloud/cloud.cfg
|
||||
remove all but NoCloud for datasource_list
|
||||
---------------
|
||||
save and exit
|
||||
|
||||
# download scripts
|
||||
---------------
|
||||
mkdir /root/scripts
|
||||
wget -qO /root/scripts/download-alpine-scripts.sh aknlw.com/download-alpine-scripts
|
||||
wget -qO /root/scripts/alpine-resize-disk.sh aknlw.com/alpine-resize-disk
|
||||
chmod +x /root/scripts/download-alpine-scripts.sh
|
||||
chmod +x /root/scripts/alpine-resize-disk.sh
|
||||
---------------
|
||||
|
||||
########################################
|
||||
########################################
|
||||
# FINALIZE - DO NOT POWER BACK ON BEFORE CONVERTING TO TEMPLATE
|
||||
---------------
|
||||
setup-cloud-init
|
||||
---------------
|
||||
poweroff
|
||||
---------------
|
||||
@@ -0,0 +1,10 @@
|
||||
after the virtual disk has already been expanded (e.g. in proxmox)
|
||||
```bin
|
||||
apk add --no-cache cfdisk e2fsprogs-extra
|
||||
|
||||
# choose partition then "Resize" > "Write" (to finalize)
|
||||
cfdisk
|
||||
|
||||
# replace * with partition you are resizing
|
||||
resize2fs /dev/sda3
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
## Run as root
|
||||
|
||||
#### Create unprivileged container with fuse enabled
|
||||
|
||||
#### Install prereqs
|
||||
|
||||
```bash
|
||||
apt update && apt upgrade -y
|
||||
apt install -y curl fuse-overlayfs
|
||||
```
|
||||
|
||||
#### Install docker
|
||||
```bash
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
```
|
||||
|
||||
#### Configure fuse driver for docker
|
||||
|
||||
```bash
|
||||
cat <<EOF >/etc/docker/daemon.json
|
||||
{
|
||||
"storage-driver": "fuse-overlayfs"
|
||||
}
|
||||
EOF
|
||||
systemctl restart docker.service
|
||||
```
|
||||
|
||||
Power off and enable fuse in lxc settings
|
||||
|
||||
Download and run essentials script
|
||||
|
||||
Log in as akanealw and switch to root
|
||||
|
||||
```bash
|
||||
adduser akanealw docker
|
||||
```
|
||||
|
||||
Relog as akanealw
|
||||
@@ -0,0 +1,4 @@
|
||||
```bin
|
||||
git config --global credential.helper store
|
||||
```
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
### check speed
|
||||
```bash
|
||||
speedtest
|
||||
```
|
||||
### view eth0 speed
|
||||
```bash
|
||||
nload eth0
|
||||
```
|
||||
### limit upload to 50Mbit
|
||||
```bash
|
||||
tc qdisc add dev eth0 root tbf rate 500kbit burst 16kbit latency 50ms
|
||||
```
|
||||
### remove limit on upload
|
||||
```bash
|
||||
tc qdisc del dev eth0 root
|
||||
```
|
||||
@@ -0,0 +1,23 @@
|
||||
## Run as root
|
||||
|
||||
#### Install prereqs
|
||||
|
||||
```bash
|
||||
apt install -y wireguard-tools resolvconf
|
||||
```
|
||||
|
||||
#### Generate keys
|
||||
|
||||
```bash
|
||||
cd /etc/wireguard
|
||||
wg genkey | tee privatekey | wg pubkey > publickey
|
||||
```
|
||||
|
||||
#### Create server config
|
||||
```bash
|
||||
echo "[Interface]" > /etc/wireguard/wg0.conf
|
||||
echo "PrivateKey = " >> /etc/wireguard/wg0.conf
|
||||
echo "Address = 10.8.0.1/24" >> /etc/wireguard/wg0.conf
|
||||
echo "ListenPort = 51820" >> /etc/wireguard/wg0.conf
|
||||
echo "DNS = 1.1.1.1" >> /etc/wireguard/wg0.conf
|
||||
```
|
||||
Reference in New Issue
Block a user