#Anubhav Sinha ####Bangalore, India
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 sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list" && wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - && sudo apt-get update && sudo apt-get install virtualbox-4.3 dkms | |
# There are a few extra features, such as USB support, which are closed-source and distributed in separate extension packs. | |
wget http://download.virtualbox.org/virtualbox/4.3.10/Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack | |
sudo VBoxManage list extpacks | |
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.10-93012.vbox-extpack | |
sudo VBoxManage list extpacks | |
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
import platform | |
if platform.system()=='Darwin': | |
print 'Mac' |
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 iptables -t nat -A PREROUTING -p tcp --dport 3000 -j DNAT --to-destination 172.17.20.158:3000 |
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
var AWS = require('aws-sdk'); // credentials can be loaded through IAM role | |
var dynamodb = new AWS.DynamoDB(); | |
var item = { | |
"Color":{"S":"white"}, | |
"Name":{"S":"fancy vase"}, | |
"Weight":{"N":"2"}, | |
"LastName":{"S":"Kumar"} | |
} | |
// To put an item to DynamoDB |
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
#function to remove duplicates from a Python list | |
#using append/add is O(1) for both list and set | |
#but using in/not in/remove in list is O(n) vs O(1) in case of set | |
def remove_dupes(some_list): | |
seen = set() | |
items = [] | |
for each in some_list: | |
if each not in seen: | |
seen.add(each) |
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 yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional |
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
ansible all -m ping -i inventory_file --user=ec2-user --private-key=../k8s.pem |
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 vi /etc/ssh/ssh_config | |
# keep ssh sessions fresh | |
Host * | |
ServerAliveInterval 60 |
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
# Add the mesosphere repository | |
sudo rpm -Uvh http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm | |
sudo yum update -y | |
# For mesos-master-zookeeper-metaframework nodes - start 3 of these for a HA setup | |
sudo yum install mesos marathon chronos mesosphere-zookeeper | |
# For mesos-slave | |
sudo yum install mesos |