mkdir /etc/nginx/geoip
cd /etc/nginx/geoip
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name love.endaosi.com; | |
charset utf-8; | |
location / { | |
index index.html; | |
root /data/www/love-vue/dist; | |
try_files $uri $uri/ /index.html; | |
} | |
location ~ /api { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$handle = fopen("php://stdin", 'r'); | |
while (!feof($handle)) { | |
$line = stream_get_line($handle, 1024*1024*10, "\r\n"); | |
$requestObj = json_decode($line, true); | |
$response = (new $requestObj['calss'])->$requestObj['method'](...$requestObj['args']); | |
echo json_encode($response) . "\r\n"; | |
} | |
fclose($handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
handler(){ | |
path=$@ | |
filename=$(basename "${path}") | |
basename=${filename%.*} | |
dirname=$(dirname "${path}") | |
newname=$dirname/$basename.mp4 | |
ffmpeg -i "$path" "$newname" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param $tag | |
* @param int $num | |
* @return int|mixed | |
*/ | |
public static function incr($tag, $num = 1) | |
{ | |
if ($num < 1) { | |
throw new \Exception('num err'); |
OlderNewer