-
uname -sr
-
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --disablerepo="" --enablerepo="elrepo-kernel" list available yum --enablerepo=elrepo-kernel install kernel-ml sed -i 's/GRUB_DEFAULT=(.)/GRUB_DEFAULT=0/' /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg reboot
-
uname -sr
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
import re | |
class UrlParser(object): | |
def __init__(self, url): | |
self.url = url | |
self.schem = self.zone = self.domain = self.port = self.path = self.query = self.params = None | |
def parse(self): | |
match = re.match(r"((\w*)://)?([^:/\?]*):?(\d+)?(.*)?", self.url) | |
if match: | |
self.schem = match.group(2) |
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
import argparse | |
""" | |
usage: | |
python compare_files_lines.py -a inter <file1> <file2> == comm -12 <file1> <file2> | |
python compare_files_lines.py -a union <file1> <file2> == comm <file1> <file2> | sed 's/[\t ]*//g' | |
python compare_files_lines.py -a diff <file1> <file2> == comm -23 <file1> <file2> | |
python compare_files_lines.py -a rdiff <file1> <file2> == comm -13 <file1> <file2> | |
python compare_files_lines.py -a sydiff <file1> <file2> == comm -3 <file1> <file2> | sed 's/[\t ]*//g' |
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
import argparse | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-a", "--action", dest="action", required=True, | |
choices=["inter", "union", "diff", "sydiff", "rdiff"]) | |
parser.add_argument( | |
"A", type=argparse.FileType("r"), help="the base file") | |
parser.add_argument( | |
"B", type=argparse.FileType("r") |
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
import argparse | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-a", "--action", dest="action", required=True, | |
choices=["inter", "union", "diff", "sydiff", "rdiff"]) | |
parser.add_argument( | |
"A", type=argparse.FileType("r"), help="the base file") | |
parser.add_argument( | |
"B", type=argparse.FileType("r") |
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
import pycurl | |
import select | |
URLS = ["https://www.douban.com/", "http://mail.163.com", "http://www.sina.com.cn", "http://google.com"] | |
SOCKETS = set() | |
TIMEOUT = 10 | |
epoll = select.epoll() | |
def start_timeout(msecs): |
-
uname -sr
-
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --disablerepo="" --enablerepo="elrepo-kernel" list available yum --enablerepo=elrepo-kernel install kernel-ml sed -i 's/GRUB_DEFAULT=(.)/GRUB_DEFAULT=0/' /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg reboot
-
uname -sr
-
uname -sr
-
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --disablerepo="" --enablerepo="elrepo-kernel" list available yum --enablerepo=elrepo-kernel install kernel-ml sed -i 's/GRUB_DEFAULT=(.)/GRUB_DEFAULT=0/' /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg reboot
-
uname -sr
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
function join_lines() | |
{ | |
local delim=${1:-,} | |
sed 'H;$!d;{x;s/\n/'$delim'/g;s/'$delim'//}' | |
} | |
function reverse_lines() | |
{ | |
sed '1!G;h;$!d' | |
} |
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
{ | |
"data":[ | |
{ | |
"city_code": "411800", | |
"domain": "jiyuan.gov.cn", | |
"id": 11849 | |
}, | |
{ | |
"city_code": "410500", | |
"domain": "anyang.gov.cn", |