This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export LANG=C | |
progname=$0 | |
interface=$1 | |
status=$2 | |
case "$status" in | |
up|down|vpn-up|vpn-down) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Use sklearn to decide whether the computer is in tablet or laptop mode. | |
To play: | |
#tablet-mode-sensor.py gather # gather data in 2 csv files | |
#tablet-mode-sensor.py fit # create and store with pickle the predictor | |
#tablet-mode-sensor.py check # read the sensors and predict the laptop mode | |
To disable keyboard|touchpad get your device_ids with xinput and uncomment the | |
xinput lines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# | |
# Define machine specs | |
boxes = [ | |
{ :name => "e1" }, | |
{ :name => "e2" }, | |
] | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flask | |
import flask_sqlalchemy | |
from sqlalchemy.dialects.mysql import JSON | |
# A simple flask app connected to a db | |
app = flask.Flask('app') | |
app.config['SQLALCHEMY_DATABASE_URI']='mysql+mysqlconnector://root:secret@localhost:3306/test' | |
db = flask_sqlalchemy.SQLAlchemy(app) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User tinyproxy | |
Group tinyproxy | |
Port 8888 | |
Timeout 600 | |
DefaultErrorFile "/usr/share/tinyproxy/default.html" | |
StatFile "/usr/share/tinyproxy/stats.html" | |
LogFile "/var/log/tinyproxy/tinyproxy.log" | |
LogLevel Info | |
PidFile "/var/run/tinyproxy/tinyproxy.pid" | |
upstream 172.49.191.63:8123 "172.23.177.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A storage class provision volumes from | |
# different provisioners, eg. cinder. | |
kind: StorageClass | |
apiVersion: storage.k8s.io/v1beta1 | |
metadata: | |
name: ssd | |
annotations: | |
storageclass.beta.kubernetes.io/is-default-class: "true" | |
provisioner: kubernetes.io/cinder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openshift_loadbalancer_additional_frontends: | |
- name: openshift-api-fe-80 | |
mode: tcp | |
options: tcplog | |
binds: [ "*:80" ] | |
default_backend: openshift-api-be-80 | |
- name: openshift-api-fe-443 | |
mode: tcp | |
options: tcplog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Get ips from nova hosts. Quick and dirty. | |
""" | |
from re import findall | |
from subprocess import check_output | |
from shlex import split | |
from json import dumps | |
def sh(cmd): | |
return check_output(split(cmd)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heat_template_version: 2016-04-08 | |
description: | | |
Auto-Scaling Group for Apache servers. | |
Uses the apache-poolmember and apache templates. | |
parameters: | |
external: | |
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heat_template_version: newton | |
parameters: | |
one: | |
type: string | |
default: one | |
two: | |
type: string | |
default: two |