查看GitHub上的源文件,跳转到raw.githubusercontent.com后,无法打开
DNS污染
Step1. 查看 raw.githubusercontent.com ip地址,通过 https://www.ipaddress.com/ 来查看
Step2. 修改本地Hosts 文件,199.232.96.133 raw.githubusercontent.com
Later equals never , just do now !
DNS污染
Step1. 查看 raw.githubusercontent.com ip地址,通过 https://www.ipaddress.com/ 来查看
Step2. 修改本地Hosts 文件,199.232.96.133 raw.githubusercontent.com
js中加密代码如下:
1 2 3 4 5 6 7 8 |
function encrypt(src, cryptoKey) { var key = window.CryptoJS.enc.Utf8.parse(cryptoKey); var encPassword = window.CryptoJS.AES.encrypt(src, key, { mode: window.CryptoJS.mode.ECB, padding: window.CryptoJS.pad.Pkcs7 }); return encPassword.ciphertext.toString().toUpperCase(); } |
php中相应代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/** * 加密字符串 */ function encrypt($data, $key) { $chiperRaw = openssl_encrypt($data, 'AES-128-ECB', $key, OPENSSL_RAW_DATA); return strtoupper(bin2hex($chiperRaw)); } /** * 解密字符串 */ public function decrypt($string, $key) { return openssl_decrypt(hex2bin($string), 'AES-128-ECB', $key, OPENSSL_RAW_DATA); } |
特别注意 bin2hex 、hex2bin 这个函数,
hex2bin() 函数把十六进制值的字符串转换为 ASCII 字符。
bin2hex() 函数把 ASCII 字符的字符串转换为十六进制值。
Happy new year,2020!
错误:MY_SOME_SIMPLME
正确:MY-SOME-SIMPLME
Nginx会将带有下划线的header头给清除掉
1 2 3 4 5 6 7 8 9 |
// Provide the body as a string. $response = $http->request('POST', $api . '?' . $build_query_data, [ 'headers' => ['Content-Encoding' => 'gzip'], 'body' => gzencode(json_encode($query)) ]); $result = json_decode($response->getBody(), true); $statusCode = $response->getStatusCode(); |
本地使用 homestead 开发,没怎么关过电脑,总是合上电脑就走,vagrant 也一直在运行,可能是由于电脑休眠的时候导致系统时间不一致。
查看电脑系统时区,date -R,发现确实与当前时间不一致
解决办法:重启vagrant
很多时候会登录一台陌生的服务器;
当需要调整环境的时候;
那真是起步啥都没有;装备全靠打;
两眼一抹黑到处找配置项;
还好我这记的有一份笔记;
近期评论