Skip to content

Instantly share code, notes, and snippets.

View rufer7's full-sized avatar

Marc Rufer rufer7

View GitHub Profile
@rufer7
rufer7 / Microsoft.PowerShell_profile.ps1
Created April 11, 2016 13:36
PowerShell profile with alias for NuGet
Write-Host "Profile: $Profile";
Set-Alias nuget C:\Software\nuget.exe;
@rufer7
rufer7 / Build.ps1
Last active September 25, 2021 02:37
Sample PowerShell build script to build C# code
Param
(
[string]$build = "Debug"
,
[switch]$test = $true
)
$msBuildPath = 'C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild';
$msTestPath = 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\';
@rufer7
rufer7 / New-GitHubRepo.ps1
Created November 14, 2015 10:39
Automated GitHub repositorycreation for d-fens GmbH
# requires -Modules biz.dfch.PS.System.Utilities
$token = '';
$username = '';
$repositoryName = '';
$repositoryDescription = '';
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$token)));
Invoke-RestMethod -Uri https://api.github.com/orgs/dfensgmbh/repos -Credential $base64AuthInfo;
# DFTODO - Get available templates from GET /gitignore/templates
@rufer7
rufer7 / CurrentUserDataHelper.cs
Created August 27, 2015 14:09
An example for impersonate a service reference call
namespace how.To.Impersonate.Service.Reference.Call
{
public static class CurrentUserDataHelper
{
public static String GetCurrentUserId()
{
var administrationService = GetServiceReferenceInstance();
var identity = (WindowsIdentity)HttpContext.Current.User.Identity;
administrationService.Credentials = CredentialCache.DefaultCredentials;
using (var impersonationContext = identity.Impersonate())
@rufer7
rufer7 / isapi_redirect.properties
Created June 27, 2015 08:49
Configuration file for the Jakarta ISAPI Redirector
# Configuration file for the Jakarta ISAPI Redirector
# The path to the ISAPI Redirector Extension, relative to the website
# This must be in a virtual directory with execute privileges
extension_uri=/jakarta/isapi_redirect.dll
# Full path to the log file for the ISAPI Redirector
log_file=c:\tomcat\logs\isapi_redirect.log
# Log level (debug, info, warn, error or trace)
@rufer7
rufer7 / worker.properties
Created June 27, 2015 08:48
worker definition
# The workers that jk should create and work with
worker.list=worker1
# Worker named worker1 and of type ajp13
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
@rufer7
rufer7 / uriworkermap.properties
Last active August 29, 2015 14:23
Mapping rules
/admin/*=worker1
/manager/*=worker1
/activiti-explorer*=worker1
/activiti-rest*=worker1
/examples/*=worker1
@rufer7
rufer7 / Sample.SetParameters
Last active August 29, 2015 14:22
Sample LightSwitchApplication SetParameters file
<?xml version="1.0" encoding="utf-8"?>
<parameters>
<setParameter name="DatabaseAdministratorConnectionString" value="Data Source=COMPUTERNAME\SQLEXPRESS;Initial Catalog=DBNAME;Integrated Security=False;User ID=USERNAME;Password=PASSWORD" />
<setParameter name="DatabaseServer" value="COMPUTERNAME" />
<setParameter name="DatabaseName" value="DBNAME" />
<setParameter name="DatabaseUserName" value="USERNAME" />
<setParameter name="DatabaseUserPassword" value="PASSWORD" />
<setParameter name="Cumulus_IisWebApplication" value="Default Web Site/APPNAME" />
<setParameter name="UtilitiesData" value="service url=https://APPNAME/api/Something.svc;is windows authentication=True;allow invalid certificate=False" />
<setParameter name="Application Administrator User Name" value="Administrator" />
@rufer7
rufer7 / ResponseWrapper.java
Last active August 29, 2015 14:22
Example representation class for Dropwizard applications
/*
* Copyright (C) 2015 Marc Rufer (m.rufer@gmx.ch)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rufer7
rufer7 / ExampleResource.java
Created June 6, 2015 15:51
Example REST resource class for a Dropwizard application
/*
* Copyright (C) 2015 Marc Rufer (m.rufer@gmx.ch)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software