Skip to content

Instantly share code, notes, and snippets.

View jfach's full-sized avatar

Jordan Facibene jfach

View GitHub Profile
db_name = _config.get('db_name')
connection_string = "mysql://{0}:{1}@{2}/{3}".format(username,
password,
server,
db_name)
engine = sqlalchemy.create_engine(connection_string, listeners=listeners)
engine.execute("CREATE DATABASE IF NOT EXISTS {0} ".format(db_name))
import minimalmodbus
import sys
SERIAL_PORT = '/'
DEVICE_ADDRESS = 1
DECIMAL_COUNT = 1
def modbus_RTU():
try:
#!/usr/bin/env bats
@test "RTC present" {
run timedatectl status
[ "$status" -ne 127]
}
@test "NTP enabled" {
result="$(timedatectl status | grep "Network time on:")"
#! /bin/bash
if [ -e /tmp/ping-test.pid ]
then
echo "script already running"
exit 1;
fi
PID=$$
HOST=$1
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=10.0.2.15 latency=64 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:19 memory:f0000000-f001ffff ioport:d010(size=8)
@jfach
jfach / table.md
Last active January 9, 2017 22:28
a table of possible values for github prs
INVENTORY DEVICES INVENTORY GROUPS HOST VARS GROUP VARS
branch name inventory-J5J00m0g inventory-8dXcznrc host_vars-wwIkxD9o group_vars-rRe9IBeN
commit message Added 3 devices to inventory Removed 2 groups from inventory Add data with x operation Performed a merge on group_vars
pull title Update inventory Update inventory Update host vars Update group vars
pull body
@jfach
jfach / token.py
Last active June 10, 2016 20:05
generate PAT for github
GITHUB_API = 'https://api.github.com'
import requests
import getpass
import json
from urlparse import urljoin
def main():
#
@jfach
jfach / test.py
Created November 5, 2015 00:57
nueral-storyteller example
import generate
z = generate.load_all()
generate.story(z, './images/ex1.jpg')

AUTH

Parameter Description/Value Required