This file contains hidden or 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 | |
function add_user_and_key() { | |
USER=$1 | |
KEY=$2 | |
useradd $USER | |
mkdir -p /home/${USER}/.ssh/ | |
cp {~/.bashrc,~/.bash_profile} /home/${USER} | |
sh -c "echo ${KEY} >> /home/${USER}/.ssh/authorized_keys" | |
chown ${USER}:${USER} -R /home/${USER} | |
chmod -R 700 /home/${USER} |
This file contains hidden or 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
PATH=$PATH:"C:\Python27:C:\Python27\Scripts:C:\apache-maven-3.3.9\bin:C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\bin:C:\Program Files (x86)\scala\bin" | |
export PATH | |
export MAVEN_OPTS="-Xmx512m -Xms128m -Xss2m" | |
SSH_ENV=$HOME/.ssh/environment | |
# start the ssh-agent | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
# spawn ssh-agent |
This file contains hidden or 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
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"vmName": { | |
"value": "bdpclust3stg" | |
}, | |
"masterVmSize": { | |
"value": "Standard_DS13" | |
}, |
This file contains hidden or 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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"vmName": { | |
"type": "string", | |
"metadata": { | |
"description": "Name for the virtual machine." | |
} | |
}, |
This file contains hidden or 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/python2 | |
import subprocess, re | |
import sys | |
from collections import Counter | |
urls = [] | |
with open('hosts.txt', 'r') as f: | |
for line in f: | |
urls.append('%s.blob.core.windows.net' % line.strip()) |
This file contains hidden or 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 | |
NODE_TYPE=$1 | |
etc_configs() { | |
echo -e "root soft nofile 32768\nroot hard nofile 32768" >> /etc/security/limits.conf | |
echo -e "session required pam_limits.so" >> /etc/pam.d/common-session | |
echo -e "session required pam_limits.so" >> /etc/pam.d/common-session-noninteractive | |
sed -i 's/%admin ALL=(ALL) ALL/%admin ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers | |
cp /etc/fstab ~/ | |
cp /etc/fstab /etc/fstab.original |
This file contains hidden or 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 | |
NODE_TYPE=$1 | |
HDD=() | |
SSD=() | |
i=0 | |
j=0 | |
etc_configs() { | |
cp /etc/fstab ~/ | |
cp /etc/fstab /etc/fstab.original |
This file contains hidden or 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 | |
# format + mount disks | |
(echo c; echo u; echo n; echo p; echo 1; echo ; echo ; echo p; echo w;) | fdisk /dev/sdc | |
mkfs.ext4 /dev/sdc1 | |
mkdir -p /media/pd0 | |
mount /dev/sdc1 /media/pd0 | |
cp /etc/fstab ~/ | |
cp /etc/fstab /etc/fstab.original | |
uuid=$(blkid | grep '/dev/sdc1' | grep -oP '[-a-z0-9]{36}') | |
echo "UUID=${uuid} /media/pd0 ext4 defaults 0 0" >> ~/fstab |
This file contains hidden or 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/python | |
import sys | |
import requests | |
import json | |
import subprocess | |
def evaluate_ips(): | |
r = requests.get('http://ipinfo.io') | |
current_ip = json.loads(r.text)['ip'] | |
f = open('/root/last_ip.txt', 'r+') |
This file contains hidden or 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 | |
# increase max open files | |
echo -e "root soft nofile 32768\nroot hard nofile 32768" >> /etc/security/limits.conf | |
echo -e "session required pam_limits.so" >> /etc/pam.d/common-session | |
echo -e "session required pam_limits.so" >> /etc/pam.d/common-session-noninteractive | |
# format + mount disks | |
DISKS=(/dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp /dev/sdq) | |
i=0 | |
cp /etc/fstab ~/ | |
cp /etc/fstab /etc/fstab.original |