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 | |
/** | |
* Decode a string with URL-safe Base64. | |
* | |
* @param string $input A Base64 encoded string | |
* | |
* @return string A decoded string | |
*/ | |
function urlsafeB64Decode($input) |
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 | |
/** | |
* 首页静态化脚本 | |
* Author: Yusure | |
* Blog: yusure.cn | |
*/ | |
ini_set( 'date.timezone', 'PRC' ); | |
/* 缓存过期时间 单位:秒 */ | |
$expire = 86400; |
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
cd /etc/apt/ | |
cp sources.list sources.list.bak | |
# 替换以下文件 # | |
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse | |
##测试版源 |
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 | |
step=2 #间隔的秒数,不能大于60 | |
for (( i = 0; i < 60; i=(i+step) )); do | |
/usr/bin/curl 'http:/xxx.com/api/hello' | |
sleep $step | |
done | |
exit 0 |
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
function ArrToXml($arr) | |
{ | |
if(!is_array($arr) || count($arr) == 0) return ''; | |
$xml = "<xml>"; | |
foreach ($arr as $key=>$val) | |
{ | |
if (is_numeric($val)){ | |
$xml.="<".$key.">".$val."</".$key.">"; | |
}else{ |
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
if ($remote_addr !~ ^(100.110.15.16|100.110.15.17|100.110.15.18|127.0.0.1)) { | |
return 403; | |
} |
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 | |
/** | |
* 获取客户端 IP | |
* @author Sure Yu http://yusure.cn | |
* @date 2018-03-21 | |
* @param [param] | |
* @return [type] [description] | |
*/ | |
function getIP() | |
{ |
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
/* $ javac CommandLine.java | |
$ java CommandLine this is a command line 200 -100 */ | |
public class CommandLine | |
{ | |
public static void main(String[] args) | |
{ | |
int len = args.length; | |
for ( int i = 0; i < len; i++ ) | |
{ |
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
import java.util.*; | |
public class DiffDemo | |
{ | |
public static void main(String[] args) | |
{ | |
try | |
{ | |
long start = System.currentTimeMillis(); |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\cmd_here] | |
@="在此处打开命令行" | |
"Icon"="cmd.exe" | |
NewerOlder