Skip to content

Instantly share code, notes, and snippets.

View Twwy's full-sized avatar
🎈
Focusing

Twwy Twwy

🎈
Focusing
View GitHub Profile

/Users/xxx/Library/Containers/com.microsoft.onenote.mac/Data/Library/Application Support/Microsoft User Data/OneNote/15.0

@Twwy
Twwy / async_flask.py
Created May 26, 2016 05:37 — forked from sergray/async_flask.py
Asynchronous requests in Flask with gevent
"""Asynchronous requests in Flask with gevent"""
from time import time
from flask import Flask, Response
from gevent.pywsgi import WSGIServer
from gevent import monkey
import requests

安装yum-utils,这样就可以使用yumdownloader工具。

yum -y install yum-utils

然后就可以直接进行下载,比如。

yumdownloader httpd

就会下载到当前的路径下,同样也可以选择某个源下载。

@Twwy
Twwy / shell.md
Created February 26, 2015 08:20
shell命令集合

获取脚本当前执行的路径

path=$(cd "$(dirname "$0")"; pwd)
@Twwy
Twwy / sed命令.md
Last active August 29, 2015 14:12
sed命令
sed -i 's/原有字符/被替换字符/' /xxx/xx.conf

-i 参数表示进行insert操作,也就是对文件直接操作,否则的话是修改之后打印出文件。

rpm强制卸载

rpm -e xxx --noscripts

含空格字符串转多行

awk '{for(i=1;i<=NF;i++) print $i}'

某两个字段比较

awk '{if ($3!=$4) print "ok"$0 }'

显示进程运行时长

ps -e -o pid,comm,etime

修改 ~/.ssh/config 文件

Host *
  ServerAliveInterval 10

ServerAliveCountMax 200000

默认路径

/private/etc/php.ini.default

自定义php.ini放置路径

/private/etc/php.ini