Skip to content

Instantly share code, notes, and snippets.

@gsemet
gsemet / marathon_jupyter_config.json
Last active Jun 8, 2017
Jupyter Test Deployment Configuration on Marathon
View marathon_jupyter_config.json
{
"id": "/jupyter",
"cmd": "start-notebook.sh --NotebookApp.token=''",
"cpus": 25,
"mem": 70000,
"disk": 1000,
"instances": 1,
"acceptedResourceRoles": [
"*"
],
@gsemet
gsemet / etc_nut_notifycmd
Last active May 31, 2017
NUT notification to PushOver
View etc_nut_notifycmd
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
from pushover import init
from pushover import Client
USER_KEY = "xxxxxxxxxxxxxxxx"
We couldn’t find that file to show.
View renderable_example1.py
def command(self):
# not the same signature than the renderable, but same name.
# it has the self so can change the state of the step directly even if it is not advises.
# it can add logs
...
a = self.getProperty('aproperty')
self.addLogStdio("I can describe what I will do since I have self").
self.some_variable = some_value
...
return the_actual_commands_to_add
View renderable_example1.py
# renderables ('Agreation' solution)
@any_kind_of_decorator_to_declare_a_renderable_pre_init
def commandRenderable1(prop):
# A renderable cannot access to the self of a step, since it is evaluated before the actual initialization. So it cannot change the "self" state, and cannot add step logs
...
a = prop.getProperty('aproperty')
...
return the_actual_commands_to_add
View sample_simple_trigger_step.py
class TriggerSample(SimpleTriggerStep):
descriptionSkipped = "nothing configured"
def addRuntimeSchedulerNames(self):
a_list = ...
autoemr = ['triggerable-{}-mergerequest'.format(a) for a in a_list]
return autoemr
def postExecute(self, res):
View simple_trigger_step.py
import logging
import os
from twisted.internet import defer
from buildbot.schedulers.triggerable import Triggerable
from buildbot.status.results import EXCEPTION
from buildbot.status.results import FAILURE
from buildbot.status.results import SKIPPED
from buildbot.status.results import SUCCESS
@gsemet
gsemet / gist:7000717
Last active Dec 25, 2015 — forked from wcargen/gist:7000672
Schema Lab Problem 3
View gist:7000717
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: http://ondras.zarovi.cz/sql/demo/ -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
<type label="INT" length="0" sql="INT" quote=""/>