代理

1
export {http,https}_proxy="http://ip:port"
1
2
set http_proxy=http://ip:port
set https_proxy=http://ip:port

mariadb

debian

1
2
3
4
5
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash
apt install mariadb-server
apt enable mariadb --now

mysql_secure_installation

/etc/mysql/mariadb.conf.d/10-custom.cnf

1
2
3
4
5
6
7
8
9
skip-name-resolve=ON
performance_schema=ON
innodb_buffer_pool_size=512M
innodb_log_file_size=128M
innodb_log_buffer_size=256M

slow-query-log=1
slow-query-log-file=/var/log/mysql-slow.log
long_query_time=2
1
2
3
4
5
6
7
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;

CREATE DATABASE `databasename`
CREATE USER 'databasename'@'%' IDENTIFIED BY 'databasename';
GRANT ALL PRIVILEGES ON `databasename`.* TO 'databasename'@'%';

redis

debian

1
2
3
4
5
6
7
8
apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install redis

systemctl enable redis --now

caddy

debian

1
2
3
4
5
apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
apt update
apt install caddy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import /data/conf/*.caddy

:80 {
root * /usr/share/caddy
file_server
}

domain.com {
encode zstd gzip
tls domain@email

reverse_proxy 127.0.0.1:6001

log {
output file /data/logs/domain.log
}
}

domain.com:80 {
encode zstd gzip

root * /data/www//dist
try_files {path} /index.html
file_server
}

nodejs

1
2
3
4
5
6
curl -sS https://deb.nodesource.com/setup_lts.x | bash
apt install nodejs

npm config set registry https://registry.npmmirror.com

npm install -g pnpm

git

1
2
3
4
5
6
git config core.filemode false

git daemon --verbose --export-all --base-path=.
git clone git://127.0.0.1/file file

git clone ../base/file file

pake

1
2
pake http://domain.test --name domain --icon favicon_128.ico --fullscreen --always-on-top --installer-language zh-CN
pake http://domain-dev.test --name domain-dev --icon favicon_128.ico --installer-language zh-CN --debug

frankenphp

1
2
3
wget https://github.com/dunglas/frankenphp/releases/download/v1.3.1/frankenphp-linux-x86_64
chmod +x frankenphp-linux-x86_64
mv frankenphp-linux-x86_64 /usr/local/bin

/usr/local/bin/php

1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
args=("$@")
index=0
for i in "$@"
do
if [ "$i" == "-d" ]; then
unset 'args[$index]'
unset 'args[$index+1]'
fi
index=$((index+1))
done

/usr/local/bin/frankenphp php-cli ${args[@]}
1
2
3
4
wget https://mirrors.tencent.com/composer/composer.phar
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
composer config -g repos.packagist composer https://mirrors.tencent.com/composer/

win

1
irm https://massgrave.dev/get | iex