This file contains 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
from datetime import datetime, timedelta | |
import time | |
from google.oauth2.service_account import Credentials | |
from googleapiclient.discovery import build | |
import os | |
import json | |
from tenacity import RetryError, retry, stop_after_attempt, wait_fixed | |
# YouTube Data API setup | |
API_KEY = '' # put API key here |
This file contains 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
#!/bin/bash | |
# List of top 100 domains | |
domains=( | |
"google.com" | |
"youtube.com" | |
"facebook.com" | |
"baidu.com" | |
"wikipedia.org" | |
"yahoo.com" |
This file contains 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
!/bin/bash | |
echo "Flushing DNS cache, please give sudo password..." | |
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder | |
# Capture DNS traffic | |
echo "Capturing DNS traffic..." | |
sudo tcpdump -i any -s 0 -w dns_traffic.pcap port 53 & | |
TCPDUMP_PID=$! |
This file contains 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
#!/bin/bash | |
DISK=$1 | |
VG=$2 | |
VOL=$3 | |
MOUNTPOINT=$4 | |
# Wait for x disks to be available | |
while [ `ls -l $DISK | grep lun | wc -l` -lt 1 ]; do | |
echo "Waiting on disks..."; |
This file contains 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
Edit the daemon configuration file: | |
``` | |
$ vim /etc/docker/daemon.json | |
``` | |
Add the following lines to file: | |
``` | |
{ |
This file contains 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
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT | |
iptables -t nat -F | |
iptables -t mangle -F | |
iptables -F | |
iptables -X |
This file contains 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
source fixproxy.sh | |
cat <<EOF > /etc/yum.repos.d/kubernetes.repo | |
[kubernetes] | |
name=Kubernetes | |
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | |
enabled=1 | |
gpgcheck=1 | |
repo_gpgcheck=1 |
This file contains 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
export http_proxy=http://proxy.intra.bt.com:8080/ | |
export HTTP_PROXY=$http_proxy | |
export https_proxy=$http_proxy | |
export HTTPS_PROXY=$http_proxy | |
export HOST_IP=`hostname -i` | |
printf -v pool '%s,' 192.168.0.{1..253} | |
printf -v service '%s,' 10.96.0.{1..253} | |
export no_proxy="127.0.0.1,localhost,${HOST_IP,},${service%,},${pool%,},127.0.0.1"; | |
export NO_PROXY=$no_proxy |
This file contains 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
-g /data/docker -H tcp://0.0.0.0:2376 --tls=false -H unix:///var/run/docker.sock --log-opt max-size=100m --log-opt max-file=3 |
This file contains 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
$elasticsearch="https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.3.1/elasticsearch-2.3.1.zip" | |
$logstash="https://download.elastic.co/logstash/logstash/logstash-2.3.1.zip" | |
$filebeat="https://download.elastic.co/beats/filebeat/filebeat-1.2.1-windows.zip" | |
$grafana="https://grafanarel.s3.amazonaws.com/winbuilds/dist/grafana-3.0.0-beta5.windows-x64.zip" | |
$logstashconf="https://gist.githubusercontent.com/oazabir/9b9cfc8795581ae5ec07e40245a86081/raw/6a6016a3902e4f2f964a266592a5799aebe3469c/logstash.yml" | |
$logstashtemplate="https://gist.githubusercontent.com/oazabir/000bde7bc3c8567ea665a0b59c0d86ca/raw/eab8f426b70ff131a40eb4a0ca85429688721901/logstash-template.json" | |
$filebeatconf="https://gist.githubusercontent.com/oazabir/8046a3c33b61a15d0661f85fae60e245/raw/9cf520fc61c8f1318ef27703c2c24f7c2ffe2442/filebeat.yml" | |
$grafanatemplate="https://gist.githubusercontent.com/oazabir/6a3021d8a08fd60a43a48a41cf721742/raw/2806b32d6eb35093f6897c3900ff5a3365bb93ee/GrafanaWebLogTempl |
NewerOlder