Skip to content

Instantly share code, notes, and snippets.

View meitinger's full-sized avatar

Manuel Meitinger meitinger

View GitHub Profile
@meitinger
meitinger / powerexercise.ps1
Last active December 17, 2015 08:49
It's go time! Inspired by a recent study [http://bit.ly/16tbFvW], this PowerShell script will help you exercise without any chance of slacking off between sets. (All that's missing is a Mandelbaum [http://bit.ly/10Xq3Vi] TTS voice :)
# init
Add-Type -AssemblyName System.Speech
$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$synth.SetOutputToDefaultAudioDevice()
$exercises = New-Object System.Collections.Specialized.OrderedDictionary
# seconds of rest between exercises
$rest = 10
# duration in seconds of each exercise
@meitinger
meitinger / hostelstatistics.sql
Created June 10, 2013 11:33
Query for internal use.
SELECT
IF (
Verkaufsbeleg_Pos.Artikelnummer LIKE '1_e' OR Verkaufsbeleg_Pos.Artikelnummer LIKE '1_e-%',
IF (
Verkaufsbeleg_Kopf.KassePrefix IN ('R','E'),
Verkaufsbeleg_Pos.Menge,
IF (
Verkaufsbeleg_Kopf.KassePrefix IN ('G','A'),
-Verkaufsbeleg_Pos.Menge,
0
@meitinger
meitinger / ServiceApplication.cs
Last active July 3, 2018 17:17
Replacement of System.ServiceProcess.ServiceBase with quite a bunch of improvements and better (proper) service fault handling.
/* Copyright (C) 2012-2014, Manuel Meitinger
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@meitinger
meitinger / updateusers.aspx
Last active December 22, 2015 09:18
Updates title, department, job title, email and sip address of WSS users (and groups). Usage: Place this file under "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS" and access it via "http://<your-site-name>/_layouts/updateusers.aspx".
<%@ Page Language="C#" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Assembly Name="System.DirectoryServices.AccountManagement, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" %>
<%@ Import Namespace="System.DirectoryServices.AccountManagement" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html xmlns="http://www.w3.org/1999/xhtml">
@meitinger
meitinger / ProcessSecurity.cs
Created September 12, 2013 09:35
Same as System.Security.AccessControl.FileSecurity but for processes. Also extends System.Diagnostics.Process with GetAccessControl and SetAccessControl.
/* Copyright (C) 2012, Manuel Meitinger
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@meitinger
meitinger / Radius.cs
Created September 14, 2013 21:35
Implementation of an easy-to-expand, type-safe RADIUS packet class.
/* Copyright (C) 2012-2013, Manuel Meitinger
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@meitinger
meitinger / AsteriskClient.cs
Last active January 3, 2016 20:19
A client for the Asterisk Manager Interface over HTTP.
/* Copyright (C) 2013-2015, Manuel Meitinger
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@meitinger
meitinger / DataGridViewExtensions.cs
Last active June 18, 2017 20:24
[abandoned] Draft for data grid controls for all input types.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Design;
using System.Linq.Expressions;
using System.Reflection;
using System.Windows.Forms;
@meitinger
meitinger / outlook-profile.ps1
Created July 31, 2014 16:02
Checks if a Outlook profile file (*.prf) matches the current profile and re-creates it if necessary.
param([Parameter(Mandatory=$true)]$profileIni,[switch]$cleanPSTs)
# registry value mappings
$accountGuids = @{
IMAP = '{ed475412-b0d6-11d2-8c3b-00104b2a6676}'
POP3 = '{ed475411-b0d6-11d2-8c3b-00104b2a6676}'
HTTP = '{4db5cbf0-3b77-4852-bc8e-bb81908861f3}'
}
$mappings = @{
PT_STRING8 = @{
@meitinger
meitinger / extensions.conf
Last active November 6, 2015 00:38
Asterisk Dialplan (obsolete, see https://github.com/meitinger/asterisk)
; Copyright (C) 2007-2012, Manuel Meitinger
; This program is free software, distributed under the terms of
; the GNU General Public License Version 2. See the LICENSE file
; at the top of the source tree.
; (1) Alle Benutzer und Administratoren haben Voicemail und einen - mit einer Faxdurchwahl übereinstimmenden - Account-Code.
; (2) Alle Benutzer, und nur Benutzer kommen in den from-user Kontext.
; (3) Alle Administratoren, und nur Administratoren kommen in den from-admin Kontext.
; (4) Alle Geräte, und nur Geräte kommen in den from-device Kontext.
; (5) Kein Gerät hat Voicemail.