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
/** | |
* @param $tag | |
* @param int $num | |
* @return int|mixed | |
*/ | |
public static function incr($tag, $num = 1) | |
{ | |
if ($num < 1) { | |
throw new \Exception('num err'); |
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
$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
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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: shellus-in | |
* Date: 2017/9/28 | |
* Time: 17:50 | |
*/ | |
class Test | |
{ |
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
package main | |
import ( | |
"encoding/gob" | |
"bytes" | |
"reflect" | |
"fmt" | |
) | |
type MyStruct struct { |
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
package main | |
import ( | |
"net/http" | |
"net/url" | |
"io/ioutil" | |
"strings" | |
"fmt" | |
"bufio" | |
"os" |
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
123456789 | |
1234567890 | |
a123456789 | |
123456 | |
qq123456 | |
abc123456 | |
123456789a | |
WOAINI1314 | |
12345678 | |
11111111 |
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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: shellus | |
* Date: 2017/8/28 | |
* Time: 11:30 | |
*/ | |
$fd = fopen("pass.txt", "r"); | |
// 如果php运行在linux,那么pass.txt里面的换行符用\n | |
// 如果php运行在windows,那就用\r\n |
NewerOlder