Skip to content

Instantly share code, notes, and snippets.

View schakko's full-sized avatar

Schakko schakko

View GitHub Profile
@schakko
schakko / sources.list
Created February 23, 2013 11:20
sources.list for Ubuntu Server 12.10 CD-ROM install
#############################################################
################### OFFICIAL UBUNTU REPOS ###################
#############################################################
###### Ubuntu Main Repos
deb http://de.archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
###### Ubuntu Update Repos
deb http://de.archive.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse
@schakko
schakko / check_microsoft_windows_software_raid.ps1
Last active January 31, 2025 15:56
A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart. The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32_DiskDrive, Win32_LogicalDisk or Win32_Volume for unknown reason) or using the new PowerShell API introduced with Windows 8 (wrong target system as o…
# A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart.
# The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32_DiskDrive, Win32_LogicalDisk or Win32_Volume for unknown reason)
# or using the new PowerShell API introduced with Windows 8 (wrong target system as our customer uses a Windows 7 architecture).
#
# diskpart requires administrative privileges so this script must be executed under an administrative account if it is executed standalone.
# check_mk has this privileges and therefore this script must only be copied to your check_mk/plugins directory and you are done.
#
# Christopher Klein <ckl[at]neos-it[dot]de>
# This script is distributed under the GPL v2 license.
@schakko
schakko / .zshrc
Created July 16, 2012 13:59
My .zshrc
# von http://vagubunt.wordpress.com
#
##### ENVIRONMENT
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
export EDITOR=vim
export PAGER=less
export BROWSER=links
export LESS=-cex3M
@schakko
schakko / authentication.yml
Created July 16, 2012 11:44
Enable Active Directory support for Gitorious with correct Domain format
# Gitorious config/authentication.yml with Active Directory support
# This is based on https://gitorious.org/gitorious/mainline/merge_requests/181
production:
# Disable database authentication altogether
#disable_default: true
# additional methods, an array of hashes
methods:
- adapter: Gitorious::Authentication::LDAPAuthentication
@schakko
schakko / convert_multiple_svn_to_git.sh
Created June 5, 2012 10:13
Convert multiple SVN repositories with help of svn2git
#!/bin/bash
PATH_svn2git=~/svn2git/svn-all-fast-export
# path to account mapping. Must be in format "$svn-username $git-fullname <$git-email>"
PATH_account_map=~/svn2git/account-map
# layout template
PATH_template=~svn2git/standardlayout.rules
@schakko
schakko / glibberish-aes-256-cbc-decrypt.js
Created May 7, 2012 16:11
Using AES-256-CBC with OpenSSL, node.js and PHP
// Doing AES-256-CBC (salted) decryption with node.js.
// This code is based on http://php.net/manual/de/function.openssl-decrypt.php and works with PHP sqAES.
//
// Create your encrypted data with
// echo -n 'Hello world' | openssl aes-256-cbc -a -e
var crypto = require('crypto');
var password = 'password';
var edata = 'U2FsdGVkX18M7K+pELP06c4d5gz7kLM1CcqJBbubW/Q=';
@schakko
schakko / server.js
Created May 5, 2012 16:48
DNS not working in forked processes
var cp = require('child_process'),
dns = require('dns');
/** server.js */
// *does* work
dns.resolve4('www.google.com', function(err, addresses) {
console.log("Resolved from service.js");
console.log(addresses);
});
@schakko
schakko / build.xml
Created December 23, 2011 15:13
Database migrations with Ant
<?xml version="1.0" encoding="UTF-8"?>
<project name="db-worklflow" default="update">
<property name="db.server">remote_db_server</property>
<property name="db.database"></property>
<property name="db.username">root</property>
<property name="db.password">root</property>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<target name="sql_execute_command" description="Executes exactly one SQL command and returns it output as 'latest_sql_result'">
<if>
@schakko
schakko / database_migration.xml
Created December 23, 2011 15:00
Database migration workflow sample in XML
<db-workflow>
<defaults>
<var key="server">test</var>
<var key="test">${server}_name</var>
</default>
<workflows>
<workflow name="update">
<vars>
<ask_for var="server" />
<ask_for var="user" />
@schakko
schakko / gist:1444002
Created December 7, 2011 18:31
DSL for protyping application w/integrated function point analysis
grammar de.ckl.Mydsl with org.eclipse.xtext.common.Terminals
generate mydsl "http://www.ckl.de/Mydsl
Model:
(domains+=Domain)*;
Operation:
(OperationContainer | OperationCreate | OperationList | OperationEdit | OperationDelete)
;