Skip to content

Instantly share code, notes, and snippets.

View amarao's full-sized avatar
⌨️
Pushing buttons hard enough to get paid

George Shuklin amarao

⌨️
Pushing buttons hard enough to get paid
  • Servers.com
  • Limassol, Cyprus
View GitHub Profile
@amarao
amarao / gist:1b1eb9356a3751dcf5d2977e7b6f2668
Created July 21, 2016 18:49
device tree for arm server
tree /proc/device-tree
/proc/device-tree
├── #address-cells
├── aliases
│   ├── ethernet0
│   ├── gpio0
│   ├── gpio1
│   ├── gpio2
│   ├── name
│   ├── serial0

Keybase proof

I hereby claim:

  • I am amarao on github.
  • I am amarao (https://keybase.io/amarao) on keybase.
  • I have a public key whose fingerprint is 39DD E5EB 04F5 A827 09BC BBE4 9F4F 18A9 2A04 BA8A

To claim this, I am signing this object:

#!/usr/bin/python
# See description here https://medium.com/@george.shuklin/skeleton-for-pytest-test-8caa0828f53d#.7i9r1q15s
# CC-BY-SA
import os
import inspect
import sys
import pytest
# trick to use tests directory and be able to import from '..'
ourfilename = os.path.abspath(inspect.getfile(inspect.currentframe()))
#!/usr/bin/python
import glanceclient
import keystoneclient
import os
def get_glance():
keystone_auth = keystoneclient.v2_0.Client(
auth_url=os.environ["OS_AUTH_URL"],
username=os.environ["OS_USERNAME"],
tenant_name=os.environ["OS_TENANT_NAME"],
# inside of 'module.py'
def init():
if __name__ == "__main__":
sys.exit(main())
init()
# inside of 'test_module.py'
@amarao
amarao / keystone.conf
Created January 4, 2017 11:57
apache wsgi default config for keystone.conf
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
LimitRequestBody 114688
{"services": [{"type": "dns", "address": "8.8.8.8"}],
"networks": [{"network_id": "d22a675f-f89c-44ae-ae48-bb64e4b81a3d", "type": "ipv4", "netmask": "255.255.255.224", "link": "tap7d178b79-86", "routes": [{"netmask": "0.0.0.0", "network": "0.0.0.0", "gateway": "204.74.228.65"}], "ip_address": "204.74.228.75", "id": "network0"}],
"links": [{"ethernet_mac_address": "18:66:da:5f:07:f4", "mtu": 1500, "type": "unbound", "id": "tap7d178b79-86", "vif_id": "7d178b79-86a9-4e56-824e-fe503e422960"}]}
@amarao
amarao / gist:17ecbdefd12a82325dfeaf7ac4d26887
Last active January 16, 2017 16:38
Bugfix for unbound port in ConfigDrive for baremetal instances (Ironic/Newtron/Nova)
diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py
index 5ef3394..be50787 100644
--- a/nova/virt/ironic/driver.py
+++ b/nova/virt/ironic/driver.py
@@ -25,6 +25,7 @@ import gzip
import shutil
import tempfile
import time
+import copy
@amarao
amarao / replug.py
Last active February 1, 2017 10:38
#!/usr/bin/python
import subprocess
import sys
import json
import pprint
def _exec(cmd):
print 'exec:', cmd
return subprocess.check_output(['bash', '-c', cmd])
serv = sys.argv[1]
#!/usr/bin/python
import subprocess
import json
import sys
def deugly(obj):
try:
ret = {}
for elem in obj[1]: