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
package main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"math/rand" | |
"sort" | |
"time" | |
) |
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 | |
#ONE LINE | |
#sudo wget -Nnv 'https://gist.githubusercontent.com/nsherron90/5afd897f881257cc282f4b35c622e826/raw/2072030410ea3d7956823e199ae4ef25b87079f9/elk.sh' && bash elk.sh && rm -f elk.sh | |
# Checking whether user has enough permission to run this script | |
sudo -n true | |
if [ $? -ne 0 ] | |
then | |
echo "This script requires user to have passwordless sudo access" |
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
ps aux | grep crawl | cut -d " " -f2 | awk '{print "kill", $0}' > tmp && bash tmp && rm tmp |
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
#start_proxy=$(echo "http://103.251.36.41:80") | |
start_proxy=$1 | |
curl -s "ipinfo.io/json" -x "$start_proxy" --write-out ">\n \"remote_ip\": \"%{remote_ip}:%{local_port}\",\n | |
\"speed_download\":\"%{speed_download}\",\n \"size_download\": \"%{size_download}\",\n \ | |
\"http_code\": \"%{http_code}\",\n \"time_total\": \"%{time_total}\",\n | |
\"time_connect\": \"%{time_connect}\",\n \"time_appconnect\": \"%{time_appconnect}\",\n \"time_starttransfer\": \"%{time_starttransfer}\"" | \ | |
sed -e "s|}>| \"start_proxy\": \"$start_proxy\",|g" | awk '{print $0} END {printf "}\n"}' | grep -v '"org":' | jq . -c |
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
echo alias docker-compose="'"'docker run --rm \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v "$PWD:/rootfs/$PWD" \ | |
-w="/rootfs/$PWD" \ | |
docker/compose:1.13.0'"'" >> ~/.bashrc |
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
# Install Docker CE | |
## Set up the repository: | |
### Update the apt package index | |
apt-get update | |
### Install packages to allow apt to use a repository over HTTPS | |
apt-get update && apt-get install apt-transport-https ca-certificates curl software-properties-common | |
### Add Docker’s official GPG key |
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
echo alias docker-compose="'"'sudo docker run --rm \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v "$PWD:/rootfs/$PWD" \ | |
-w="/rootfs/$PWD" \ | |
docker/compose:1.24.0'"'" >> ~/.bashrc |
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
sudo apt-get update && sudo apt-get install -y apt-transport-https | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list | |
sudo apt-get update | |
sudo apt-get install -y kubectl |
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
#!/usr/bin/env python | |
import time | |
import subprocess | |
import select | |
filename = '/home/ubuntu/log/rel_stash.log' | |
f = subprocess.Popen(['tail','-n 20',filename],\ | |
stdout=subprocess.PIPE,stderr=subprocess.PIPE) |
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
#sudo su | |
#!/bin/sh | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X |