Skip to content

Instantly share code, notes, and snippets.

Why OJO?
We’re on a mission to empower people to make better decisions through the fusion of machine and human intelligence.
We’re solving some of the biggest problems troubling the modern consumer experience. Through our unique, data-driven
AI platform, we’ve introduced a fresh approach to the way people make important decisions. As part of our team, you’d
be helping to build technologies that will significantly advance the world’s largest consumer industries, starting with
home buyers in the real estate industry.
We hope to have an opportunity to meet you, learn about your experience and introduce you to the OJO team.
We pulled a host from the pool for upgrades, and in the process seems to have gotten a virtual router in an odd state. It's showing as destroyed in the UI, but cloudmonkey says it's still expunging.
This host has been completely rebuild including completely redisked. On the management node I found:
mysql> select * from op_ha_work
-> ;
+----+-------------+-----------+--------------+-----------+----------------+---------+---------------------+-------+-------+-----------+-------------+---------+
| id | instance_id | type | vm_type | state | mgmt_server_id | host_id | created | tried | taken | step | time_to_try | updated |
+----+-------------+-----------+--------------+-----------+----------------+---------+---------------------+-------+-------+-----------+-------------+---------+
| 1 | 13 | Migration | DomainRouter | Expunging | NULL | 24 | 2016-07-01 14:34:17 | 0 | NULL | Migrating | 1433332034 | 205 |
#!/usr/bin/python
# i created a local endpoint to push webhook data to slack and use this via cron to populate notification for every job
import MySQLdb
import logging
import datetime
LOG_FILENAME = '/var/log/add_slack.log'
logging.basicConfig(filename=LOG_FILENAME,
level=logging.INFO,
)
@looprock
looprock / gist:dbbfe916b04810d06ea9
Created August 21, 2015 05:06
simple_RDS_mysql
/var/lib/rundeck/terraform/dland-rundeck-7
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
@looprock
looprock / gist:c8ad9574cbe28defc6f3
Created August 21, 2015 05:04
simple_RDS_postgresql
/var/lib/rundeck/terraform/dland-pgtest-8
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
eval `ssh-agent -s`
ssh-add ~/.ssh/id_dsa
ssh-add -L
export PATH=/opt/kubernetes/cluster:$PATH
RE: https://github.com/GoogleCloudPlatform/kubernetes/issues/7359
/opt/kubernetes/cluster/ubuntu/token-system-dns.json
{
"apiVersion": "v1beta2",
"kind": "Secret",
@looprock
looprock / gist:59ce177b6f4503076b16
Created June 9, 2015 18:10
errbot jira integration
@botcmd(split_args_with=None)
def tickets(self, mess, args):
"""list jira tickets - options: -user=[def: you], -status=[RE: Closed], -project=[RE: Operations] -search=[string]"""
options = {'server': 'https://jira.company.com'}
user = utils.get_sender_username(mess)
status = '(status = Open OR status = Reopened OR status = "In Progress")'
tmpstatus = None
#project = "Operations"
project = None
search = None
@looprock
looprock / gist:33df34b896357ecf0c45
Created May 12, 2015 19:24
wrap rundeck exec in single quotes
#!/usr/bin/env python
import re
import sys
import os
f = open(sys.argv[1])
try:
data = f.read()
finally:
f.close()
@looprock
looprock / gist:1f025e98750c771a50fd
Created May 11, 2015 20:39
salt supervisor config and error
consul:
supervisord.running:
- update: True
- restart: True
- require:
- pkg: supervisor
- watch:
- file: /etc/consul.d/agent/config.json
Result: