mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-25 02:46:39 +07:00
added whole content
This commit is contained in:
parent
1b5df685cb
commit
8b25e0631a
70 changed files with 5962 additions and 19 deletions
29
content/Linux/Gitea for git hosting.md
Normal file
29
content/Linux/Gitea for git hosting.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
Self-hosted #git repositories with [gitea](https://gitea.io/ru-ru/) and #docker.
|
||||
|
||||
## Setting up with docker-compose
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:latest
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./var/lib/gitea:/data
|
||||
- ./etc/gitea:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
```
|
70
content/Linux/Google photos alternative with Photoprism.md
Normal file
70
content/Linux/Google photos alternative with Photoprism.md
Normal file
|
@ -0,0 +1,70 @@
|
|||
[Photo Prism](https://photoprism.app/) is a free alternative to Google photos, can be set up with #docker.
|
||||
|
||||
## Docker compose file to run it
|
||||
|
||||
Check out current [example](https://dl.photoprism.app/docker/docker-compose.yml) at photoprism's [documentation](https://docs.photoprism.app/getting-started/docker-compose/).
|
||||
|
||||
```yaml
|
||||
version: '3.5'
|
||||
|
||||
services:
|
||||
photoprism:
|
||||
container_name: photoprism__app
|
||||
image: photoprism/photoprism:latest
|
||||
depends_on:
|
||||
- mariadb
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
- apparmor:unconfined
|
||||
ports:
|
||||
- 2342:2342 # HTTP port (host:container)
|
||||
environment:
|
||||
PHOTOPRISM_ADMIN_PASSWORD: "password"
|
||||
PHOTOPRISM_SITE_URL: "https://service.url/"
|
||||
PHOTOPRISM_ORIGINALS_LIMIT: 5000
|
||||
PHOTOPRISM_HTTP_COMPRESSION: "gzip"
|
||||
PHOTOPRISM_DEBUG: "false"
|
||||
PHOTOPRISM_PUBLIC: "false"
|
||||
PHOTOPRISM_READONLY: "false"
|
||||
PHOTOPRISM_EXPERIMENTAL: "false"
|
||||
PHOTOPRISM_DISABLE_CHOWN: "false"
|
||||
PHOTOPRISM_DISABLE_WEBDAV: "false"
|
||||
PHOTOPRISM_DISABLE_SETTINGS: "false"
|
||||
PHOTOPRISM_DISABLE_TENSORFLOW: "false"
|
||||
PHOTOPRISM_DISABLE_FACES: "false"
|
||||
PHOTOPRISM_DISABLE_CLASSIFICATION: "false"
|
||||
PHOTOPRISM_DARKTABLE_PRESETS: "false"
|
||||
PHOTOPRISM_DETECT_NSFW: "false"
|
||||
PHOTOPRISM_UPLOAD_NSFW: "true"
|
||||
PHOTOPRISM_DATABASE_DRIVER: "mysql"
|
||||
PHOTOPRISM_DATABASE_SERVER: "mariadb:3306"
|
||||
PHOTOPRISM_DATABASE_NAME: "photoprism"
|
||||
PHOTOPRISM_DATABASE_USER: "root"
|
||||
PHOTOPRISM_DATABASE_PASSWORD: "insecure"
|
||||
PHOTOPRISM_SITE_TITLE: "PhotoPrism"
|
||||
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
|
||||
PHOTOPRISM_SITE_DESCRIPTION: ""
|
||||
PHOTOPRISM_SITE_AUTHOR: ""
|
||||
HOME: "/photoprism"
|
||||
working_dir: "/photoprism"
|
||||
volumes:
|
||||
- "./data/originals:/photoprism/originals"
|
||||
- "./data/imports:/photoprism/import"
|
||||
- "./data/storage:/photoprism/storage"
|
||||
mariadb:
|
||||
container_name: photoprism__db
|
||||
restart: unless-stopped
|
||||
image: mariadb:10.6
|
||||
security_opt:
|
||||
- seccomp:unconfined
|
||||
- apparmor:unconfined
|
||||
command: mysqld --innodb-buffer-pool-size=128M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120
|
||||
volumes:
|
||||
- "./database:/var/lib/mysql" # Important, don't remove
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: insecure
|
||||
MYSQL_DATABASE: photoprism
|
||||
MYSQL_USER: photoprism
|
||||
MYSQL_PASSWORD: insecure
|
||||
```
|
5
content/Linux/Resume or start screen session.md
Normal file
5
content/Linux/Resume or start screen session.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
Running this script will enter currently running `screen` session or will start new one.
|
||||
|
||||
```shell
|
||||
( screen -r bash || ( screen -d bash && screen -r bash || screen -SAm bash bash ) )
|
||||
```
|
16
content/Linux/Rsync file with SSH.md
Normal file
16
content/Linux/Rsync file with SSH.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
Downloads file from #SSH with rsync and puts it in current folder.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
PORT=22
|
||||
USER=user
|
||||
HOST=example.com
|
||||
REMOTE_PATH=/tmp
|
||||
REMOTE_FILE=sample.text
|
||||
DEST_PATH=./
|
||||
|
||||
rsync -a -e "ssh -p $PORT" -P -v \
|
||||
"$USER@$HOST:$REMOTE_PATH/$REMOTE_FILE" \
|
||||
"$DEST_PATH"
|
||||
```
|
13
content/Linux/SSH.md
Normal file
13
content/Linux/SSH.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
## Config aliases for #SSH hosts
|
||||
|
||||
#SSH config can be used to made aliases for different hosts. Should be put at `~/.ssh/config`. To simply call `ssh router` without parameters, use this:
|
||||
|
||||
```
|
||||
Host router
|
||||
HostName 192.168.0.1
|
||||
IdentityFile ~/.ssh/id_rsa
|
||||
User root
|
||||
Port 22522
|
||||
```
|
||||
|
||||
|
57
content/Linux/Setting up NGINX.md
Normal file
57
content/Linux/Setting up NGINX.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
## Fallback url for SPA-s
|
||||
|
||||
```nginx
|
||||
server {
|
||||
# ...
|
||||
location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
# ...
|
||||
}
|
||||
```
|
||||
|
||||
## Set up for uploads
|
||||
|
||||
```nginx
|
||||
server {
|
||||
# ...
|
||||
client_max_body_size 200M;
|
||||
# ...
|
||||
}
|
||||
```
|
||||
|
||||
## Reverse proxy for https
|
||||
|
||||
Given config forwards `https` traffic to `http` on port `8080` for https://next.vault48.org
|
||||
with http2 support if possible.
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name next.vault48.org;
|
||||
return 301 https://next.vault48.org$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
# managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/vault48.org/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/vault48.org/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/vault48.org/chain.pem;
|
||||
|
||||
server_name next.vault48.org;
|
||||
|
||||
location / {
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue