Debian ≥ 10, Ubuntu ≥ 18, CentOS ≥ 7,
Others
Refs:
<?php | |
if (!function_exists('is_valid_ip')) { | |
// PHP ≥ 8.0 | |
function is_valid_ip(string $ip, ?string $type = null): bool | |
{ | |
return false !== match ($type) { | |
'IPv4' => filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4), | |
'IPv6' => filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6), | |
default => filter_var($ip, FILTER_VALIDATE_IP), |
<?php | |
if (!function_exists('arr_sum')) { | |
/** | |
* Replacement with bc math function for internal array_sum | |
* | |
* @param array $arr | |
* @param int $scale | |
* | |
* @return mixed |
<?php | |
if (!function_exists('random_str')) { | |
/** | |
* Generate specific length random string | |
* | |
* @param $len | |
* @param $special | |
* @return string | |
*/ |
# /run/systemd/generator/www.mount | |
# Automatically generated by systemd-fstab-generator | |
[Unit] | |
SourcePath=/etc/fstab | |
Documentation=man:fstab(5) man:systemd-fstab-generator(8) | |
Before=local-fs.target | |
[Mount] | |
What=/dev/sdb1 |
Debian ≥ 10, Ubuntu ≥ 18, CentOS ≥ 7,
Others
Refs:
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Policies\Google\Chrome] | |
"SuppressUnsupportedOSWarning"=dword:00000001 |
https://www.reddit.com/api/v1/generate_username.json |
#!/bin/bash | |
# for [V2rayU](https://github.com/yanue/V2rayU). | |
V2RAY_HOME=~/v2ray-core | |
INAPP_DIR=/Applications/V2rayU.app/Contents/Resources/v2ray-core | |
INUSER_DIR=~/.V2rayU/v2ray-core | |
# brew install --cask v2rayu | |
# brew install v2ray xray |
real_ip_header X-Forwarded-For; | |
set_real_ip_from 0.0.0.0/0; | |
set_real_ip_from 2400:cb00::/32; | |
set_real_ip_from 2606:4700::/32; | |
set_real_ip_from 2803:f800::/32; | |
set_real_ip_from 2405:b500::/32; | |
set_real_ip_from 2405:8100::/32; | |
set_real_ip_from 2c0f:f248::/32; | |
set_real_ip_from 2a06:98c0::/29; |
[Unit] | |
Description=app | |
After=syslog.target | |
[Service] | |
User=nobody | |
Restart=on-failure | |
RestartSec=5s | |
WorkingDirectory=/path/to/dir | |
ExecStart=/usr/bin/java -jar app.jar >> /dev/null 2>&1 |