Skip to content

Instantly share code, notes, and snippets.

🐍
Taming Python

Philipp Klaus pklaus

🐍
Taming Python
Block or report user

Report or block pklaus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pklaus
pklaus / 1w.php
Created Jan 8, 2010
Ethersex ECMD via TCP socket communication with PHP, Python, Ruby: 1-wire communication
View 1w.php
<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 Jan 8, 2010
Simple Koukaam NETIO-230A automation via Raw TCP using C++, Java, PHP, Ruby, expect, Bash-TCP and wget (HTTP)
View netio230a.cpp
// 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 Jan 8, 2010
NETIO230A Time Based Configuration Example using the Cron daemon an a Bash Script
View fr.sh
#!/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 / client3.java
Created Jan 8, 2010
Small Java speed test for the ethersex platform.
View client3.java
// original script by Oliver Reimann
// <http://list.zerties.org/pipermail/ethersex-devel/attachments/20090223/36379536/client3.java>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
@pklaus
pklaus / netio230a_changelog.md
Created Jan 8, 2010
Koukaam NETIO-230A changelog
View netio230a_changelog.md

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
View MboxDump.py
#!/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.
View imapbackup.py
#!/usr/bin/env python
"""IMAP Incremental Backup Script v.1.4c (Dec 12 2009) found on http://the.taoofmac.com/space/Projects/imapbackup"""
__version__ = "1.4c"
__author__ = "Rui Carmo (http://the.taoofmac.com)"
__copyright__ = "(C) 2006 Rui Carmo. Code under BSD License.\n(C)"
__contributors__ = "Bob Ippolito, Michael Leonhard, Giuseppe Scrivano <gscrivano@gnu.org>, Ronan Sheth, Brandon Long"
# = Contributors =
# Brandon Long (Gmail team): Reminder to use BODY.PEEK instead of BODY
@pklaus
pklaus / dictcn.js
Created Jan 24, 2010 — forked from hzmangel/x
shadow removed (+ js markup on gist.github.com)
View dictcn.js
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 / handbrakeAutorip.sh
Created Jan 27, 2010
Rip a DVD in an Automated Way
View handbrakeAutorip.sh
#!/bin/bash
# found on <http://episteme.arstechnica.com/eve/forums/a/tpc/f/96509133/m/792004650041?r=798009370041#798009370041>
# Exit Codes
# 1 : vobcopy failed
# 2 : encoding failed
# 3 : lock file present
# 4 : DVD not mounted
# 5 : VIDEO_TS not present - probably not a video DVD
@pklaus
pklaus / netio230a_Interact.cs
Created Jan 29, 2010
Example Usage of the NETIO-230A class written in C#
View netio230a_Interact.cs
// 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
{
You can’t perform that action at this time.