Skip to content

Instantly share code, notes, and snippets.

yang wzyuliyang

Block or report user

Report or block wzyuliyang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wzyuliyang
wzyuliyang / upload_5T_object.py
Created Dec 20, 2016
使用分块上传上传5T大文件
View upload_5T_object.py
# -*- coding: UTF-8 -*-
import requests
import xmltodict
from xmltodict import OrderedDict
from awsauth import S3Auth
from multiprocessing.dummy import Pool as ThreadPool
host = '192.168.10.201:7480'
access_key = 'user1'
secret_key = 'user1'
View gist:4e376b026bb99ff64b3cf15f61789129
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:
View progressbar.sh
echo -ne '##### (33%)\r'
sleep 1
echo -ne '############# (66%)\r'
sleep 1
echo -ne '####################### (100%)\r'
echo -ne '\n'
View install-instance.sh
# script instance
echo 172.23.113.5 vod-rpm >> /etc/hosts
sed -i 's/name=/enabled=0\nname=/g' /etc/yum.repos.d/*.repo
#add repo
cat << EOF > /etc/yum.repos.d/vod-centos6.repo
[VodCentos6-Repository]
name=Vod Centos6 - Local
baseurl=http://vod-rpm/centos6/Packages
@wzyuliyang
wzyuliyang / github_repo.py
Created Nov 7, 2016 — forked from toast38coza/github_repo.py
An Ansible module for managing github repos
View github_repo.py
#!/usr/bin/python
DOCUMENTATION = '''
---
module: github_repo
short_description: Manage your repos on Github
'''
EXAMPLES = '''
- name: Create a github Repo
View swift-python-ceph.py
# # coding=utf-8
# import requests
# from requests_toolbelt.utils import dump
# host = '10.254.3.68:7480'
# cmd = '/auth/1.0'
# url = 'http://%s%s' % (host,cmd)
# user = 'yuliyang:yuliyang'
# key = 'OssHz2Ga1rrb49sYTAS5bih8VKWnZhxQlJDC2m48'
# user = 'testuser:testuser'
# key = 'NxPBANyfYVYwvQXQHfRrsi8lBn81dRHAm3S9C3Nj'
View swift-python-delete-bucket.py
# coding=utf-8
import requests
from requests_toolbelt.utils import dump
host = '192.168.10.147:8081'
cmd = '/auth/1.0'
url = 'http://%s%s' % (host,cmd)
user = 'yuliyang:swift'
key = '65axGyxsx9kQPLiUlUb6hax7D7uEA90tTm1yaCmi'
headers = {'x-auth-key':key,'x-auth-user':user}
response = requests.get(url,headers=headers)
View swift-python-create-bucket.py
# coding=utf-8
import requests
from requests_toolbelt.utils import dump
host = '192.168.10.147:8081'
cmd = '/auth/1.0'
url = 'http://%s%s' % (host,cmd)
user = 'yuliyang:swift'
key = '65axGyxsx9kQPLiUlUb6hax7D7uEA90tTm1yaCmi'
headers = {'x-auth-key':key,'x-auth-user':user}
response = requests.get(url,headers=headers)
View swift-python-request-demo.py
import requests
from requests_toolbelt.utils import dump
host = '10.254.3.68:7480'
cmd = '/auth/1.0'
url = 'http://%s%s' % (host,cmd)
user = 'yuliyang:yuliyang'
key = 'OssHz2Ga1rrb49sYTAS5bih8VKWnZhxQlJDC2m48'
user = 'testuser:testuser'
key = 'NxPBANyfYVYwvQXQHfRrsi8lBn81dRHAm3S9C3Nj'
@wzyuliyang
wzyuliyang / git-export
Created Oct 28, 2016 — forked from kristofferh/git-export
"Export" a git repository to zip file
View git-export
git archive --format zip --output /full/path/to/zipfile.zip master
You can’t perform that action at this time.