Skip to content

Instantly share code, notes, and snippets.

View jxstanford's full-sized avatar

John Stanford jxstanford

  • Seattle
  • 16:33 (UTC -07:00)
View GitHub Profile
"""Group cyclical permutations"""
INPUT = [
"Tokyo",
"London",
"Rome",
"Donlon",
"Kyoto",
"Paris",
"Isapr",
### Keybase proof
I hereby claim:
* I am jxstanford on github.
* I am jxstanford (https://keybase.io/jxstanford) on keybase.
* I have a public key ASBSDCm16B7oxRoKTb5ZdMPVIWetgZFIGqbipImA6ZCIdQo
To claim this, I am signing this object:
@jxstanford
jxstanford / init_dev_env.out
Created August 31, 2015 18:26
successful run of init_dev_env.sh
(goldstone-server)[~/devel/goldstone-server]$ bin/init_dev_env.sh
Waiting for VM "RDO-kilo" to power on...
VM "RDO-kilo" has been successfully started.
Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
Cleaning out old docker images and containers
6afa47a33730
2903326f753a
35aadf6f6ead
ebbbc5a9cf05
(goldstone)[root@goldstone goldstone]# fab -H 172.24.4.100 configure_stack
[172.24.4.100] Executing task 'configure_stack'
This utility will modify configuration fileson the hosts
supplied via the -H parameter, and optionally restart
OpenStack and syslog services.
Do you want to continue (yes/no)? [no] yes
Goldstone server's hostname or IP accessible to OpenStack hosts? [10.0.3.15] 172.24.4.10
Restart OpenStack and syslog services after configuration changes(yes/no)? [no] yes
[root@goldstone ~]# cd /opt/goldstone
[root@goldstone goldstone]# . bin/activate
(goldstone)[root@goldstone goldstone]# fab install
Installing logstash and elasticsearch repos.
[localhost] local: rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch
Configuring PostgreSQL.
Initializing database ... OK
[root@goldstone ~]# yum localinstall -y goldstone-server-0.7.0-9.gf80b334.el7.centos.x86_64.rpm
Loaded plugins: fastestmirror
Examining goldstone-server-0.7.0-9.gf80b334.el7.centos.x86_64.rpm: 1438215933:goldstone-server-0.7.0-9.gf80b334.el7.centos.x86_64
Marking goldstone-server-0.7.0-9.gf80b334.el7.centos.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package goldstone-server.x86_64 1438215933:0.7.0-9.gf80b334.el7.centos will be installed
--> Processing Dependency: epel-release for package: 1438215933:goldstone-server-0.7.0-9.gf80b334.el7.centos.x86_64
Loading mirror speeds from cached hostfile
* base: mirrors.chkhosting.com
@jxstanford
jxstanford / es_event_types_agg
Created June 11, 2015 22:48
event type aggregation query
curl -XPOST -d \
'{
"aggs": {
"types": {
"terms": {
"field": "_type"
}
},
"events_by_date": {
"aggs": {
@jxstanford
jxstanford / postdeactivate
Last active August 29, 2015 14:22
goldstone-server dev virtualenv postdeactivate
#!/bin/zsh
# This hook is run after this virtualenv is deactivated.
# echo "shutting down celery"
pkill -f celery
pkill -f flower
# echo "cleaning up celery log files"
rm /tmp/goldstone-server-celery.log
rm /tmp/goldstone-server-flower.log
@jxstanford
jxstanford / postactivate
Last active September 22, 2015 01:41
goldstone-server dev virtualenv postactivate
#!/bin/zsh
# This hook is run after this virtualenv is activated.
# openstack dev cloud
export OS_USERNAME="admin"
export OS_TENANT_NAME="admin"
export OS_PASSWORD="solinea"
export OS_AUTH_URL="http://172.24.4.100:5000/v2.0/"
export DJANGO_SETTINGS_MODULE=goldstone.settings.docker_dev
<!DOCTYPE html>
<meta charset="utf-8">
<link href="http://nickqizhu.github.io/dc.js/css/dc.css" rel="stylesheet" media="screen"/>
<style>
#chart g.stack._0 > rect.bar {
stroke: none;
fill: red;
}
#chart g.stack._1 > rect.bar {