Skip to content

Instantly share code, notes, and snippets.

View memory's full-sized avatar

memory

View GitHub Profile
@memory
memory / python-uschedule.py
Created January 29, 2012 22:14 — forked from ajdiaz/python-uschedule.py
python snippet to handle uschedule jobs
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Python uschedule handler
------------------------
This module provide a methods to handle uschedule_ scheduler by Uwe Ohse,
which is similar to cron, but safer. Here is an usage example::
@memory
memory / python-supervise.py
Created January 29, 2012 22:17 — forked from ajdiaz/python-supervise.py
python snippet to handle runit/daemontools services
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Python supervise
----------------
This module provide a methods to handle runit [1]_ or daemontools [2]_ based
supervised services, using the control file provided. Here are a small
example::
@memory
memory / screen_reattach.bash
Created March 2, 2012 22:18
automatic screen creation/reconnection from .bash_profile
# a quick and dirty little hack: never get screwed by the fact that you forgot to
# run "screen" on a remote host ever again!
#
# put this into your .bash_profile at the very end, or in a separate file and source
# it (again as the last action) from .bash_profile.
if [ "$TERM" != "screen" ]; then
output=$(screen -ls | grep ached)
screens=($(echo "$output" | awk '{print $1}'|xargs))
@memory
memory / gist:2711504
Created May 16, 2012 15:50
git-plugin test failures
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Jenkins GIT plugin
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [hpi:validate {execution: default-validate}]
[INFO] [enforcer:display-info {execution: default}]
[INFO] Maven Version: 2.2.1
[INFO] JDK Version: 1.6.0_31 normalized as: 1.6.0-31
[INFO] OS Info: Arch: amd64 Family: unix Name: linux Version: 2.6.32-344-ec2
#!/bin/bash -e
# just in case (some parts of the ruby build will honor this...)
unset DESTDIR
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin
export INSTALLPREFIX=/export/disk0/wb/bin/ruby-env
export ENVNAME=$1
@memory
memory / s3.py
Created October 8, 2013 20:24
S3 transport for debian apt, using only python, boto and evil
#!/usr/bin/env python -u
#
# The S3 Acquire Method
#
# Author: Nathan Mehl <n@climate.com>
# Date: 2013-10-07
# License: GPLv2
#
# Copyright (c) 1999--2012 Red Hat, Inc.
# Copyright (c) 2013 The Climate Corporation
FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install -yy build-essential ruby-dev
RUN mkdir -p /tmp/gems
RUN gem install --no-ri --no-rdoc --install-dir /tmp/gems fpm -v 1.8.0
RUN gem install --no-ri --no-rdoc --local --force /tmp/gems/cache/*.gem
RUN find /tmp/gems -name \*.gem | xargs -rn1 /usr/local/bin/fpm --deb-no-default-config-files -d ruby --prefix `gem environment gemdir` -s gem -t deb
---
kind: ConfigMap
apiVersion: v1
metadata:
name: gethello
data:
gethello.sh: |
while true; do
echo checking http://hello-0.hello.default.svc.cluster.local/
curl -o /dev/null -s -w "%{http_code}\n" http://hello-0.hello.default.svc.cluster.local/
@memory
memory / mcp9600.h
Created January 17, 2021 15:20
Sparkfun ESP32 Thing Plus + Sparkfun MCP9600 temperature sensor configuration for esphome
#include "esphome.h"
#include "SparkFun_MCP9600.h"
using namespace esphome;
class SFMCP9600 : public PollingComponent {
public:
MCP9600 myself;
Sensor *thermocouple_sensor = new Sensor();
Sensor *ambient_sensor = new Sensor();