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
def create_counter(): | |
scope={'i':0} | |
def increment(): | |
scope['i'] +=1 | |
print scope['i'] | |
return increment | |
count = create_counter() |
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 arrow | |
import flickr_api | |
tag='timeshift' | |
hours=-10 | |
flickr_authfile = 'flickr.auth' | |
flickr_username = 'bergerx' | |
flickr_api.set_auth_handler(flickr_authfile) | |
#user = flickr_api.Person.findByUserName(flickr_username) |
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
ap-southeast-1a d2.8xlarge ecpu:116 vcpu:36 monthly:85.3193883495 max:1090.728 price_count:824 --> 0.73551196853$/month/ecpu | |
us-east-2b c4.xlarge ecpu:16 vcpu:4 monthly:17.229996 max:19.008 price_count:1000 --> 1.07687475$/month/ecpu | |
us-east-2c c4.xlarge ecpu:16 vcpu:4 monthly:17.247312 max:18.72 price_count:1000 --> 1.077957$/month/ecpu | |
us-east-2c c4.large ecpu:8 vcpu:2 monthly:8.981424 max:10.656 price_count:1000 --> 1.122678$/month/ecpu | |
us-east-2a c4.xlarge ecpu:16 vcpu:4 monthly:18.167256 max:18.864 price_count:1000 --> 1.1354535$/month/ecpu | |
us-east-2b c4.2xlarge ecpu:31 vcpu:8 monthly:35.26795008 max:39.59136 price_count:1000 --> 1.13767580903$/month/ecpu | |
eu-west-2b c4.xlarge ecpu:16 vcpu:4 monthly:18.251064 max:27.864 price_count:1000 --> 1.1406915$/month/ecpu | |
us-east-2b c4.large ecpu:8 vcpu:2 monthly:9.128448 max:10.656 price_count:1000 --> 1.141056$/month/ecpu | |
us-east-2c c4.2xlarge ecpu:31 vcpu:8 monthly:35.5776192 max:40.176 price_count:1000 --> 1.14766513548$/month/ecpu | |
us-east-2a c4.large ecpu:8 vc |
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
ubuntu@ubuntu1:~$ sudo mkdir /etc/mesos-slave/attributes | |
ubuntu@ubuntu1:~$ echo attribute-value-here | sudo tee /etc/mesos-slave/attributes/attribute-name-here | |
ubuntu@ubuntu1:~$ sudo service mesos-slave restart | |
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: Failed to perform recovery: Incompatible slave info detected. | |
... | |
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: ------------------------------------------------------------ | |
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: To remedy this do as follows: | |
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: Step 1: rm -f /tmp/mesos/meta/slaves/latest | |
Jun 26 08:53:47 ubuntu1 mesos-slave[789]: This ensures slave doesn't recover old live executors. |
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
{ | |
"cpus": 0.1, | |
"mem": 102, | |
"id": "mesos-dns", | |
"instances": 1, | |
"constraints": [["hostname", "CLUSTER", "192.168.0.23"]], | |
"env": { | |
"MESOS_DOCKER_ZK": "zk://192.168.0.23:2181,192.168.0.26:2181,192.168.0.27:2181/mesos", | |
"MESOS_DNS_MASTERS": "192.168.0.23:5050,192.168.0.26:5050,192.168.0.27:5050", | |
"MESOS_DNS_RESOLVERS": "8.8.8.8", |
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
TODO: not complete, not even close | |
# These would be needed to implement this | |
# * zk - for a zookeeper connection | |
# * marathon - this services entry in marathon, for getting information about service, peer instances and peers' health check | |
# init() and join() is application specific functions. | |
# init() is for initializing the app cluster and will also be the | |
# very first node in the cluster. | |
# join() will be called for adding the new instance (maybe replicas) to existing cluster, |
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
ubuntu@ubuntu1:~$ mkdir python-memory | |
ubuntu@ubuntu1:~$ cd python-memory/ | |
ubuntu@ubuntu1:~/python-memory$ bash | |
ubuntu@ubuntu1:~$ sudo mkdir /sys/fs/cgroup/memory/hede | |
ubuntu@ubuntu1:~/python-memory$ cat /sys/fs/cgroup/memory/hede/memory.limit_in_bytes | |
18446744073709551615 | |
ubuntu@ubuntu1:~/python-memory$ sudo tee /sys/fs/cgroup/memory/hede/memory.limit_in_bytes | |
50000000 | |
50000000 | |
ubuntu@ubuntu1:~/python-memory$ cat /sys/fs/cgroup/memory/hede/memory.limit_in_bytes |
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 | |
# http://www.tautvidas.com/blog/2012/01/free-airport-wifi/ | |
sudo ifconfig wlan0 down | |
/usr/bin/nmcli nm wifi off | |
sudo macchanger -r wlan0 | |
/usr/bin/nmcli nm wifi on | |
while ! nmcli nm | grep ' connected'; do sleep 1; done | |
/home/local/ANT/bekir/bin/Firefox/firefox -P default --private-window hede.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
sudo pip install awscli | |
mkdir ~/.aws | |
cat <<EOF > credentials | |
[default] | |
aws_access_key_id = AKIA*** | |
aws_secret_access_key = *** | |
EOF | |
cat <<EOF > bin/update-ev-bdgn-net |
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
- name: prepare calico-node upstart service file | |
template: src=roles/docker/templates/upstart-docker-instance.j2.j2 dest="/etc/init/{{ item.service_name }}.conf" | |
tags: | |
- service | |
- calico | |
with_items: | |
- service_name: calico-node | |
docker_name: calico-node | |
docker_run: > | |
/usr/bin/docker run --rm \ |
OlderNewer