cat /etc/redhat-release
sudo rpm -Uvh http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
yum repolist
| 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 |
| 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 |
| # -*- coding: utf-8 -*- | |
| ''' | |
| Returns state event data for state.sls and state.highstate execution only using a tcp socket, this method of | |
| returning data can be used for Splunk or ELK. | |
| Each event sent represents a single state executed. | |
| It is strongly recommended to use the ``event_return_whitelist`` so not all | |
| events call this returner, for example: |
I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api
Rails.application.routes.draw do
constraints subdomain: "api" do
scope module: "api" do