Skip to content

Instantly share code, notes, and snippets.

View NewFuture's full-sized avatar
🖥️
:octocat:

New Future NewFuture

🖥️
:octocat:
View GitHub Profile
set number
@NewFuture
NewFuture / newuser.md
Last active April 24, 2016 07:31
linux-add-user
adduser newuser
passwd newuser
groupadd admin
@NewFuture
NewFuture / centos6
Last active July 20, 2016 15:08
yyf enviroment
#!/bin/bash
#tools
# sudo yum install wget
# sudo yum install net-tools
# sudo yum install vim
#update source
# sudo yum install -y wget
#!/bin/sh
# Remove Postfix
systemctl stop postfix
systemctl disable postfix
yum remove -y postfix
# Remove Linux headers
yum -y remove *firmware avahi-autoipd avahi-libs avahi bluez-utils kudzu alsa-lib fxload rdma man-db microcode_ctl NetworkManager-team
yum clean all
@NewFuture
NewFuture / yaf.ini
Last active August 18, 2016 11:41
yaf
application.directory=APP_PATH "/app/"
application.ext="php"
application.view.ext="phtml"
application.modules="index"
application.library.directory = APP_PATH "/library"
application.library.namespace=""
application.bootstrap=APP_PATH "/library/Bootstrap"
application.baseUri=""
application.dispatcher.defaultRoute=""
application.dispatcher.throwException=1
<?php
// Initial Configuration
global $aHash;
$i = 0;
$tmp = '';
while($i < 100) {
$tmp .= 'a';
++$i;
}
@NewFuture
NewFuture / php_env.bash
Last active August 24, 2016 02:39
get php env in bash (command line)
PHP_PATH=${PHP_PATH:=php}
#get php version
#获取 php 版本
PHP_VERSION=$("$PHP_PATH" -v|grep --only-matching --perl-regexp "\d\.\d+\.\d+"|head -1);
php -v|grep -oP "(?<=^PHP\W)\d\.\d\.\d+"
#get php.ini path
#获取 php.in 位置
PHP_INI=$("$PHP_PATH" --ini|grep --only-matching --perl-regexp "/.*php.ini$"|head -1)
#php.ini for all
PHP_INI=$("$PHP_PATH" --ini|grep --only-matching --perl-regexp "/.*php.ini$"|head -1|sed -r -e 's/cli/*/')
curl -so /dev/null -w 'DNS:%{time_namelookup}\tConnect:%{time_connect}\tStart:%{time_starttransfer}\tTotal:%{time_total}\tSpeed:%{speed_download} byte/s\n' https://mirrors6.tuna.tsinghua.edu.cn/ubuntu/
curl -so /dev/null -w 'DNS:%{time_namelookup}\tConnect:%{time_connect}\tStart:%{time_starttransfer}\tTotal:%{time_total}\tSpeed:%{speed_download} byte/s\n' https://ipv6.mirrors.ustc.edu.cn/ubuntu/
@NewFuture
NewFuture / gitdeploy_config
Created September 17, 2016 04:27
gitdeploy_config for yyf
{
"repositories": [
{
"url": "https://github.com/YunYinORG/YYF.git",
"path": "/var/www/YYF",
"cmd": "git pull && service httpd restart",
"branch": "master"
},
{
"url": "https://github.com/YunYinORG/YYF.git",
var YYF_CONSOLE = {
_console: function(method) {
return function() {
setTimeout(console[method].bind.apply(console[method], [console].concat(Array.prototype.slice.call(arguments))));
}
}
};
['assert','clear','count','debug','dir','dirxml','error','group','groupCollapsed','groupEnd','info','log','profile','profileEnd','time','timeEnd','timeStamp','warn'].forEach(function(method) {
YYF_CONSOLE[method] = YYF_CONSOLE._console(method);