Skip to content

Instantly share code, notes, and snippets.

View amotoki's full-sized avatar

Akihiro Motoki amotoki

View GitHub Profile
@amotoki
amotoki / local.conf
Created June 24, 2014 05:07
local.conf for devstack (master branch)
[[local|localrc]]
#OFFLINE=True
RECLONE=True
#disable_service mysql
#enable_service postgresql
#disable_service cinder c-sch c-api c-vol
#disable_service tempest
#disable_service horizon
Django 2.0 support
Replace django.core.urlresolves with django.urls
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was deprecated in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3
Add py35dj20 job to test Django 2.0 integration.
@amotoki
amotoki / local.conf
Last active March 22, 2018 16:46
local.conf (Mitaka) - Almost all services are enabled with Neutron
[[local|localrc]]
#OFFLINE=True
RECLONE=True
HORIZON_BRANCH=stable/mitaka
KEYSTONE_BRANCH=stable/mitaka
NOVA_BRANCH=stable/mitaka
NEUTRON_BRANCH=stable/mitaka
GLANCE_BRANCH=stable/mitaka
CINDER_BRANCH=stable/mitaka
@amotoki
amotoki / DevStack local.conf
Created February 3, 2018 23:34
DevStack local.conf (Queens release; master)
[[local|localrc]]
enable_service s-proxy s-object s-container s-account
# migrate to new neutron service configuration
disable_service q-svc
disable_service q-agt
disable_service q-dhcp
disable_service q-l3
disable_service q-meta
@amotoki
amotoki / ssh-agent-check.sh
Created December 27, 2013 04:41
Reuse an existing ssh-agent process
#!/bin/sh
USERNAME=`whoami`
NUM=`ps -ef | grep ssh-agent | grep -v grep | grep $USERNAME | wc -l`
if [ $NUM -eq 1 ]; then
ST=`ps -ef | grep ssh-agent | grep -v grep | grep $USERNAME`
AGENT_PID=$(echo $ST | awk '{print $2;}')
SOCKFILE=$(ls -l /tmp/ssh-*/agent.[0-9]* | grep $USERNAME | sed -e 's/^.*\(\/tmp\/ssh-.*\)/\1/')
echo "echo SOCKFILE=$SOCKFILE;"
@amotoki
amotoki / local.conf
Last active January 25, 2017 06:13
local.conf (minimum) for master branch (master: newton or later)
[[local|localrc]]
unset OS_CLOUD
#OFFLINE=True
RECLONE=True
#disable_service tempest
#disable_service horizon
enable_service heat h-api h-api-cfn h-api-cw h-eng
escape ^t^t
startup_message off
defscrollback 10000
# <ESCAPE> w
bind w windowlist -b
hardstatus alwayslastline "%{= rw} %H %{= wk} %L=%-w%{= bw}%30L> %n%f %t*%{= wk}%+Lw%-17< %-=%{= gk} %y/%m/%d %c"
import eventlet
import eventlet.corolocal
import time
def print_thread(prefix):
while True:
ident = eventlet.corolocal.get_ident()
print "%s (%s): %s" % (prefix, ident, time.time())
eventlet.sleep(2)
import threading
import time
import eventlet
import eventlet.corolocal
# NOTE(rpodolyaka): threading is patched here
eventlet.monkey_patch()
ESC は ESC コードをいれる
Emacs だと C-q ESC, vi だと C-v ESC
/etc/nova/nova.conf
logging_exception_prefix = %(color)s%(asctime)s.%(msecs)03d TRACE %(name)s ESC[01;35m%(instance)sESC[00m
logging_debug_format_suffix = ESC[00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)dESC[00m
logging_default_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [ESC[00;36m-%(color)s] ESC[01;35m%(instance)s%(color)s%(message)sESC[00m
logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [ESC[01;36m%(request_id)s ESC[00;36m%(user_name)s %(project_name)s%(color)s] ESC[01;35m%(instance)s%(color)s%(message)sESC[00m