cat /etc/redhat-release
sudo rpm -Uvh http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
yum repolist
| #!/usr/bin/env python | |
| ############################################################################### | |
| ## sar_to_json.py | |
| ## | |
| ## Reformats output from sadf to json. sadf must be invoked with the -D | |
| ## switch. Timestamps are displayed in ISO6801 format (YYYY-MM-DDThh:mm:ssZ). | |
| ## Example: sadf -D -- -A | sar_to_json.py | |
| ############################################################################### | |
| import sys |
| private static readonly string[] tenHoursOfFun = | |
| { | |
| "https://www.youtube.com/watch?v=wbby9coDRCk", | |
| "https://www.youtube.com/watch?v=nb2evY0kmpQ", | |
| "https://www.youtube.com/watch?v=eh7lp9umG2I", | |
| "https://www.youtube.com/watch?v=z9Uz1icjwrM", | |
| "https://www.youtube.com/watch?v=Sagg08DrO5U", | |
| "https://www.youtube.com/watch?v=ER97mPHhgtM", | |
| "https://www.youtube.com/watch?v=jI-kpVh6e1U", | |
| "https://www.youtube.com/watch?v=jScuYd3_xdQ", |
| Use TCPDUMP to Monitor HTTP Traffic | |
| 1. To monitor HTTP traffic including request and response headers and message body: | |
| tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
| 2. To monitor HTTP traffic including request and response headers and message body from a particular source: | |
| tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
| 3. To monitor HTTP traffic including request and response headers and message body from local host to local host: |
| curl -D cookie1.txt blog.xrmplatform.org/wp-login.php | |
| # step 1 | |
| # get default cookie of blog and write cookie to cookie1.txt | |
| # step 2 | |
| # simulate browser Firefox( of course , you can use any browser agent<!--more--> what you want!) "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" | |
| # input your username and also password | |
| # write new cookie to cookie2.txt | |
| curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" -D cookie2.txt -b cookie1.txt -F log=username -F pwd=password -F testcookie=1 -F wp-submit="Log In" -F redirect_to=blog.xrmplatform.org/wp-admin -F submit=login -F rememberme=forever blog.xrmplatform.org/wp-login.php | |
| # currently cookie2.txt stored all cookie info |
| // Based on the following answer : http://codegolf.stackexchange.com/questions/20996/add-without-addition-or-any-of-the-4-basic-arithmetic-operators/21025#21025 | |
| var x = 6; | |
| var y = 6; | |
| var result = function () { | |
| var sum = 0 | |
| while (y) { | |
| sum = x^=y,y=(y&x^y)<<1 | |
| } | |
| return sum | |
| }; |
| git clone https://github.com/Lurk/ffmpeg-php > /dev/null 2>&1 ; cd ffmpeg-php ; ./configure && make && make install |
| from selenium import webdriver | |
| from selenium.webdriver import DesiredCapabilities | |
| desired_capabilities = DesiredCapabilities.PHANTOMJS.copy() | |
| desired_capabilities['phantomjs.page.customHeaders.User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) ' \ | |
| 'AppleWebKit/537.36 (KHTML, like Gecko) ' \ | |
| 'Chrome/39.0.2171.95 Safari/537.36' | |
| driver = webdriver.PhantomJS(desired_capabilities=desired_capabilities) |
| import subprocess | |
| import re | |
| regex = re.compile('([A-Z]+)=(?:"(.*?)")') | |
| parts = "NAME,KNAME,MODEL,UUID,SIZE,ROTA,TYPE,MOUNTPOINT,MAJ:MIN" | |
| def blocks(): | |
| blocks = [] | |
| output = subprocess.check_output([ | |
| "sudo", "lsblk", "-P", "-o", |
| #!/usr/bin/env python | |
| import salt.cli.caller | |
| import salt.config | |
| import argparse | |
| import sys | |
| import signal | |
| class TimeoutException(Exception): | |
| pass |