Skip to content

Instantly share code, notes, and snippets.

#!/bin/python
import rbd
import rados
import multiprocessing
import os
import sys
process_count = int(os.environ.get('PROCESS_COUNT',
multiprocessing.cpu_count()))
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json
Restart=on-failure
[Install]
WantedBy=multi-user.target
@ooneko
ooneko / delete_all_docker_images.sh
Last active June 27, 2018 08:38
delete all docker images
#!/bin/bash
docker images |awk '!/none/ {if (NR>1) print ":"}'|xargs -I{} docker image rm {}
docker images |awk '/none/ {print $3}'|xargs -I{} docker image rm {}
from keystoneauth1 import session
from keystoneauth1 import loading
from swiftclient import client
import os
# Create a password auth plugin
loader = loading.get_plugin_loader('password')
auth = loader.load_from_options(auth_url=os.environ['OS_AUTH_URL'],
username=os.environ['OS_USERNAME'],
password=os.environ['OS_PASSWORD'],
import subprocess
subprocess.call(["ssh", "user@host"]);
# or execution a command
import subprocess
ret = subprocess.call(["ssh", "user@host", "program"]);
# or, with stderr:
prog = subprocess.Popen(["ssh", "user@host", "program"], stderr=subprocess.PIPE)
errdata = prog.communicate()[1]
from keystoneauth1.identity import v3
from keystoneauth1 import session
from keystoneclient.v3 import client
auth = v3.Password(auth_url='https://my.keystone.com:5000/v3',
username='myuser',
password='mypassword',
project_name='proj',
user_domain_id='default',
project_domain_id='default')
@ooneko
ooneko / About.md
Created November 12, 2017 13:24 — forked from jtaleric/About.md
CNCF : The road to 2000 : OpenShift on OpenStack

CNCF : OpenShift on OpenStack

Deployment

We will be attempting to use TripleO to deploy both the OpenStack enviornment and the Baremetal OpenShift enviornment.

OpenStack Deployment

We will deploy with 3 Controllers + 2 Neutron Networker nodes, this will allow us to distribute the control plane load across additional nodes -- additionally the L3 traffic.

Note: We have never deployed in this fashion within the PerfScale DFG - this is new to Newton.