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
Host 192.168.56.* | |
StrictHostKeyChecking no | |
UserKnownHostsFile=/dev/null |
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
import time | |
import eventlet | |
from eventlet import backdoor | |
def main(): | |
eventlet.monkey_patch() | |
eventlet.spawn(backdoor.backdoor_server, eventlet.listen(('localhost', 3000))) | |
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
from __future__ import print_function | |
print('foo', 'bar') | |
# output is "foo bar" |
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
import memcache | |
c = memcache.Client(['127.0.0.1:11211']) | |
print c.get('name') | |
# "Taro" will be printed |
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
import eventlet | |
from eventlet import wsgi | |
import pecan | |
from pecan import rest | |
class V1Controller(rest.RestController): | |
@pecan.expose() | |
def get(self, id): |
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 | |
sudo pvcreate /dev/sdb1 | |
sudo vgextend ubuntu-vg /dev/sdb1 | |
sudo lvextend /dev/ubuntu-vg/root -l +100%FREE | |
# sudo lvextend /dev/ubuntu-vg/root -L+50G | |
sudo resize2fs /dev/ubuntu-vg/root # only for ext2,3,4 | |
#sudo resize2fs /dev/ubuntu-vg/root 50G |
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
curl -X GET -H 'X-Auth-Token: <Token>' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'User-Agent: python-ceilometerclient' 'http://ceilometer-host:8777/v2/samples?q.field=meter&q.op=eq&q.value=switch.flow&q.field=metadata.flow.id&q.type=int&q.op=eq&q.value=0' |
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
v = { | |
'foo': 'bar' | |
} |
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
class Foo(): | |
def __init__(self): | |
self.meta = {} | |
@property | |
def name(self): | |
return self.meta.get('name', None) | |
@name.setter |
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
class Foo(): | |
def __enter__(self): | |
print 'begin transaction' | |
return self | |
def __exit__(self, type, value, traceback): | |
if value: | |
print 'An error has occured in this transaction' | |
else: |