Skip to content

Instantly share code, notes, and snippets.

View pklaus's full-sized avatar

Philipp Klaus pklaus

  • Frankfurt, Germany
View GitHub Profile
@pklaus
pklaus / 1w.php
Created January 8, 2010 10:51
Ethersex ECMD via TCP socket communication with PHP, Python, Ruby: 1-wire communication
<html>
<!-- source: <http://www.ethersex.de/index.php/Dallas_1-wire_Bus#PHP> -->
<head>
<title>ethersex php example</title>
</head>
<body>
<?php
@pklaus
pklaus / netio230a.cpp
Created January 8, 2010 11:14
Simple Koukaam NETIO-230A automation via Raw TCP using C++, Java, PHP, Ruby, expect, Bash-TCP and wget (HTTP)
// example for a raw TCP socket connection using C++ to interface the Koukaam NETIO-230A
// resources:
// <http://www.ecst.csuchico.edu/~beej/guide/ipc/usock.html>
// <http://cs.nmu.edu/~randy/Classes/CS228/Notes/making-a-client-socket.html>
#include <iostream>
#include <string>
#include <unistd.h> // gethostbyname()
#include <sys/socket.h> // socket(), connect()
@pklaus
pklaus / fr.sh
Created January 8, 2010 11:19
NETIO230A Time Based Configuration Example using the Cron daemon an a Bash Script
#!/bin/sh
# source: <http://www.koukaam.se/koukaam/forum/viewthread.php?forum_id=18&thread_id=677#2106>
## Multiple power schedule script
## Script 2 of 2
## piping power-fr.sh output to telnet
## you have to set the correct paths from / to the script and telnet
@pklaus
pklaus / netio230a_changelog.md
Created January 8, 2010 16:50
Koukaam NETIO-230A changelog

Version 2.34 rc1

Release 11.10.2011

  • fixed http post
  • fixed cookie name issue
  • fixed stability issues
  • fixed old CGI security leak with a guest account
  • kshell allows up to 6 simultaneous connections, network and serial at once
  • CGI script format changed:
    old format: message 1. control.tgi?l=p:user:password
#!/usr/bin/env python
# coding: iso-8859-15
# -*- Python -*-
"""
Script to create dumps from mailboxes in a given imap server
Some parameters must be provided as arguments.
@pklaus
pklaus / dictcn.js
Created January 24, 2010 18:41 — forked from hzmangel/x
shadow removed (+ js markup on gist.github.com)
CmdUtils.CreateCommand({
name: ["dictcn", "dcn"],
author: {
name: "Hu Ziming",
email: "hzmangel@gmail.com"
},
contributors: ["Hu Ziming", "azuwis"],
icon : "http://dict.cn/favicon.ico",
description: "Consulting the word from <a href=\"http://dict.cn\">http://dict.cn</a>.",
help: "Consulting the word from <a href=\"http://dict.cn\">http://dict.cn</a>.",
@pklaus
pklaus / netio230a_Interact.cs
Created January 29, 2010 09:32
Example Usage of the NETIO-230A class written in C#
// example of usage of the class for the Koukaam NETIO-230A written in C#
// find it on <http://koukaam.se/koukaam/forum/viewthread.php?forum_id=33&thread_id=1569>
using System;
using CSC.Koukaam.NetIO230A.DiscoverProtocol;
using CSC.Koukaam.NetIO230A;
namespace netio230a_cs
{
@pklaus
pklaus / get_resources.sh
Created February 9, 2010 20:39
Write a Linux Server Resource Report to Log Files Automatically
#!/bin/sh
# /root/bin/get_resources.sh
echo -n "Server Resource Report at `/bin/hostname` on "
date "+%Y/%m/%d %T"
echo
echo "[dmesg Linux version]"
dmesg | grep "Linux version"
@pklaus
pklaus / 10-aiptek.fdi
Created February 20, 2010 10:13
Working Configuration File for an Aiptek HP 12000u Tablet on Ubuntu 9.10 karmic
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<!-- Philipp Klaus (c) 2010 -->
<!-- Aiptek HP 12000U - working with pressure sensitivity in GIMP (activate using Edit -> Preferences -> Input Devices -> Configure Extended Input Devices -> stylus, Mode: Screen ) -->
<!-- installation
Get the required kernel module:
sudo aptitude install xserver-xorg-input-aiptek
and copy this file into 10-aiptek.fdi:
sudo gedit /etc/hal/fdi/policy/10-aiptek.fdi
-->
<deviceinfo version="0.2">
@pklaus
pklaus / push-to-mobile.ps1
Created March 4, 2010 18:40
Time-lapse Photography Using Python S60
obexftp.exe -b 00:14:5d:5b:53:fc -B 11 --chdir /E:/Python/ --put ./time_lapse.py