This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This hack converts an Active Directory LDIF schema file to XML or JSON. | |
* Export Active Directory schema with the following command (must be run as Domain Administrator): | |
* ldifde -f SaveSchema.ldif -d CN=Schema,CN=Configuration,DC=domain,DC=local | |
* Change var $file to location of generated schema, open your browser, point to this file and append ?xml for XML output or ?json for JSON output | |
* | |
* @author Christopher Klein <ckl[at]ecw[dot]de> | |
* @url http://wap.ecw.de | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Gambio to XTC image converter - PHP pseudocode - not tested | |
// Gambio product table | |
$sql = "SELECT id, products_name FROM gambio.products_description" | |
$rows = mysql_fetch_assoc(mysql_query($sql)) | |
foreach ($rows as $row) { | |
// match string, e.g "printer (white)" | |
if (preg_match("/^(.*)\((.*)\)(.*)$", $row['products_name'], $arrMatches)) { | |
$color = $arrMatches[2]; // third element contains color | |
// do something with color, e.g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* decodes the product key and returns it as "-"-seperated string | |
* @param array of bytes | |
* @return string | |
*/ | |
function decodeProductKey($aHexSrc) | |
{ | |
// base24-encoded | |
$arrDigits = array('B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'M', 'P', 'Q', 'R', 'T', 'V', 'W', 'X', 'Y', '2', '3', '4', '6', '7', '8', '9'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domaene de.ckl.blog | |
entity Gruppe { | |
attribute id: int not-null primary-key | |
attribute name: string | |
reference has-many: BenutzerInGruppe with-alias:"BenutzerInGruppen" | |
} | |
entity BenutzerInGruppe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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='; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
OlderNewer