Skip to content

Instantly share code, notes, and snippets.

View malash's full-sized avatar
:octocat:
Open-source

Malash malash

:octocat:
Open-source
View GitHub Profile
@malash
malash / php7.sh
Created August 8, 2015 14:52
PHP 7 Compile Shell
apt-get update
apt-get install -y apt apt-transport-https bash binutils ca-certificates coreutils cpio dpkg \
dpkg-dev e2fslibs e2fsprogs gnupg gpgv libapt-pkg4.12 libc-bin libc-dev-bin \
libc6 libc6-dev libcgmanager0 libcomerr2 libcurl3-gnutls libdbus-1-3 \
libdpkg-perl libdrm2 libgcrypt11 libgnutls26 libgssapi-krb5-2 libjson-c2 \
libjson0 libk5crypto3 libkrb5-3 libkrb5support0 libldap-2.4-2 libss2 \
libssl1.0.0 libtasn1-6 linux-libc-dev multiarch-support openssl patch \
pkg-create-dbgsym tzdata libdb-dev libedit-dev libt1-dev libgmp-dev \
autoconf libpq-dev apache2-dev systemtap-sdt-dev libxml2-dev libbz2-dev \
libcurl4-openssl-dev libenchant-dev icu-devtools libicu-dev freetds-dev libsasl2-dev \
// project moved to https://github.com/malash/opentsdb-escape
@malash
malash / disable-sip.sh
Last active November 17, 2015 05:33
Disable Mac OS X EI Capitan SIP
#!/bin/sh
# Command + R when boot
# open term
csrutil disable
@malash
malash / ordered-json.js
Created October 10, 2015 10:48
实现了有序的JSON格式化的AngularJS过滤器,排序使用字典序
'use strict';
angular.module('metrics').filter('orderedJson', [
function () {
return function (data) {
function _json(d) {
var ret = '';
var k;
var value;
if (!angular.isObject(d) && !angular.isArray(d)) {
@malash
malash / nvm.sh
Last active October 15, 2015 16:16
NVM in GFW
git clone https://github.com/creationix/nvm.git ~/.nvm
cd ~/.nvm
git checkout `git describe --abbrev=0 --tags`
sed -i '/nvm/d' ~/.bashrc
echo ". ~/.nvm/nvm.sh" >> ~/.bashrc
source ~/.bashrc
export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
@malash
malash / str-to-regex.js
Created October 29, 2015 09:29
将字符串形式保存的正则表达式转为RegExp
var regexStr = rule.regex,
start = regexStr.indexOf('/'),
end = regexStr.lastIndexOf('/'),
source = regexStr.substring(start + 1, end),
flags = regexStr.substring(end + 1, regexStr.length);
if (source.length !== 0) {
var newRegex = new RegExp(source, flags);
}
@malash
malash / rtcwake.sh
Created March 18, 2016 16:42
Linux rtcwake
rtcwake -m mem -u -t `date +%s -d '04:00'`
@malash
malash / fxxking-alipay-chrome-https-issue.sh
Last active April 11, 2018 06:26
修复Chrome在macOS Seirra下因支付宝造成HTTPS失败的问题
# 官方:https://bugs.chromium.org/p/chromium/issues/detail?id=649253
# 相关1:http://gold.xitu.io/entry/5800318e7db2a200597bff78
# 相关2:https://twiceyuan.com/2016/09/26/sierra-chrome-bug/
# 相关3:https://www.v2ex.com/t/307911
sudo launchctl remove com.alipay.DispatcherService
sudo rm -rf /Library/Application\ Support/Alipay && \
sudo rm -rf /Library/LaunchDaemons/com.alipay.DispatcherService.plist && \
sudo rm -rf ~/Library/LaunchAgents/com.alipay.adaptor.plist && \
sudo rm -rf ~/Library/LaunchAgents/com.alipay.refresher.plist && \
@malash
malash / bash.md
Last active May 15, 2017 03:59
Bugs on Bash on Ubuntu on Windows

NginX

NginX pwritev

NginX错误日志:

pwritev() "/var/lib/nginx/proxy/6/00/0000000006" failed (38: Function not implemented) while reading upstream