Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: MQTT - Philips Hue Dimmer
description: 'Control lights with a Philips Hue Dimmer Switch.
The top "on" button will turn the lights on to the last set brightness.
Dim up/down buttons will change the brightness using predefined step and can be
pressed and hold until the brightness is satisfactory.

Keybase proof

I hereby claim:

  • I am espenfjo on github.
  • I am espenfjo (https://keybase.io/espenfjo) on keybase.
  • I have a public key whose fingerprint is 6765 3CCC C989 51C2 D431 E169 A4C9 825F 8BE2 3631

To claim this, I am signing this object:

#!/usr/bin/env bash
_scs_col="\e[0;32m";
_wrn_col='\e[1;31m';
_trn_col='\e[0;33m'
# Check that xclip is installed.
platform=$(uname)
if [[ "${platform}" == Linux ]]; then
tardown="tar cJf - --exclude-vcs --exclude=blib --exclude=spec"
elif [[ "${platform}" == Darwin ]]; then
@espenfjo
espenfjo / cuckooclient.ps1
Last active October 27, 2022 04:46
Small PS script to configure a new Windows 7 client to be a Cuckoo guest (AKA Totally not secure)
# Disable Windows Update
Set-Location "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update"
Set-ItemProperty . NoAutoUpdate 1
# Disable IPv6
Set-Location "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"
Set-ItemProperty . DisabledComponents 0
# Disable Firewall
Set-Location "HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile"
def __init__(self, alert):
text_parts = alert.split("[**]")
print text_parts
self.alarm_text = (re.compile("\[\d+:\d+:\d+\]").split(text_parts[1]))[1].strip()
space_parts = alert.split(" ")
print space_parts
self.classification = ((text_parts[2].split("["))[1]).split("]")[0]
pri = (re.compile("\s+").split((((text_parts[2].split("["))[2]).split("]")[0])))[1]
self.priority = int(pri)
self.time = space_parts[0]
def __init__(self, alert):
text_parts = alert.split("[**]")
print text_parts
self.alarm_text = (re.compile("\[\d+:\d+:\d+\]").split(text_parts[1]))[1].strip()
space_parts = alert.split(" ")
print space_parts
self.classification = ((text_parts[2].split("["))[1]).split("]")[0]
pri = (re.compile("\s+").split((((text_parts[2].split("["))[2]).split("]")[0])))[1]
self.priority = int(pri)
self.time = space_parts[0]

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.

/*
Arduino Serial Connector
Copyright 2011 Adam Outler
Licensed under the I Dont Give a **** License, Version 1.0 (the "License");
you may not use this file except in compliance with the License.
3. Send me an email if you find this helpful
If you're wondering where number 1 and 2 is, I don't give a ****.
_buildRequest: function()
{
var res = {
method: this._request.requestMethod,
url: this._buildRequestURL(this._request.url),
httpVersion: this._request.requestHttpVersion,
headers: this._request.requestHeaders,
queryString: this._buildParameters(this._request.queryParameters || []),
cookies: this._buildCookies(this._request.requestCookies || []),
headersSize: this._request.requestHeadersSize,
commit d9255c70905e437c281fa7969fbf6622ce99ec44
Author: Espen Fjellvær Olsen <espen@mrfjo.org>
Date: Sat Oct 27 17:43:49 2012 +0200
Compile fix, add missing camera dep
Change-Id: I4376d9dd78e736340cbea15839b18a2976182c79
diff --git a/exynos4/hal/libhdmi/libhdmiservice/SecHdmiClient.cpp b/exynos4/hal/libhdmi/libhdmiservice/SecHdmiClient.cpp
index 0ec5cd6..b211c48 100644