This file contains hidden or 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
| wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb | |
| sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb | |
| sudo apt-get update | |
| sudo apt-get install percona-xtrabackup-24 |
This file contains hidden or 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
| 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-proposed main restricted universe multiverse | |
| deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse | |
| deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse |
This file contains hidden or 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
| deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse | |
| deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse | |
| deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse |
This file contains hidden or 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{ | |
| listen 80; | |
| server_name example.com; | |
| //mobile agent | |
| set $mobile_rewrite do_not_perform; | |
| if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") { | |
| set $mobile_rewrite perform; | |
| } |
This file contains hidden or 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
| char *get_uniqid() | |
| { | |
| char *uniqid; | |
| struct timeval tv; | |
| timerclear(&tv); | |
| gettimeofday(&tv, NULL); | |
| spprintf(&uniqid, 0, "%08x%05x", (int)tv.tv_sec, (int)tv.tv_usec % 0x100000); | |
| return uniqid; |
This file contains hidden or 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 | |
| //@see https://stackoverflow.com/questions/3531857/convert-var-dump-of-array-back-to-array-variable | |
| function unvar_dump($str) { | |
| if (strpos($str, "\n") === false) { | |
| //Add new lines: | |
| $regex = array( | |
| '#(\\[.*?\\]=>)#', | |
| '#(string\\(|int\\(|float\\(|array\\(|NULL|object\\(|})#', | |
| ); | |
| $str = preg_replace($regex, "\n\\1", $str); |
This file contains hidden or 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 | |
| switch office wifi | |
| networksetup -setairportnetwork en0 wifi网络名 | |
| if [ $? -ne 0 ]; then | |
| echo "swtich office network fail" | |
| exit | |
| fi | |
| leep 2 | |
| echo "switch office wifi success"; |
This file contains hidden or 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
| 关闭系统的 IPV6 功能。 | |
| OS X 下关闭方法: | |
| networksetup -setv6off Wi-Fi | |
| networksetup -setv6off Ethernet(如果电脑有以太网接口) | |
| 开启方法: | |
| networksetup -setv6automatic Wi-Fi | |
| networksetup -setv6automatic Ethernet(如果电脑有以太网接口) |
This file contains hidden or 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 | |
| /** | |
| * Class File | |
| * @package app\commands | |
| */ | |
| class File | |
| { | |
| /** | |
| * @param string $filename |
This file contains hidden or 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 | |
| $string = "I tried, honestly!"; | |
| $stream = fopen('data://text/plain,' . $string,'r'); | |
| echo stream_get_contents($stream); | |
| $string = 'Some bad-ass string'; | |
| $stream = fopen('php://memory','r+'); |