Skip to content

Instantly share code, notes, and snippets.

View florianbeisel's full-sized avatar

Florian Beisel florianbeisel

  • INTERSPORT Deutschland eG
  • Germany
View GitHub Profile
configuration ConfigureDSCClient
{
param ($NodeId, $PullServer)
LocalConfigurationManager
{
AllowModuleOverwrite = 'True'
ConfigurationID = $NodeId
ConfigurationModeFrequencyMins = 60
ConfigurationMode = 'ApplyAndAutoCorrect'
@florianbeisel
florianbeisel / pass.cmd
Last active August 29, 2015 13:57
Rewrite of the pass password manager for Unix using powershell
@echo off
set OLDDIR=%CD%
set PASS_PATH=c:\temp\
set PASS_BIN=%PASS_PATH%\pass.ps1
cd %PASS_PATH%
Powershell.exe -executionPolicy unrestricted -File %PASS_BIN% %*
chdir /d %OLDDIR% &rem restore current directory
@florianbeisel
florianbeisel / HideWIndowsUpdatesById.vbs
Last active December 30, 2015 08:58
Lists installed Updates.
If Wscript.Arguments.Count = 0 Then
WScript.Echo "Syntax: HideWindowsUpdateById.vbs [Update ID]" & vbCRLF & _
"Examples:" & vbCRLF & _
" - Hide KB940157: HideWindowsUpdateById.vbs 2ba85467-deaf-44a1-a035-697742efab0f"
WScript.Quit 1
End If
Dim updateId
updateId = WScript.Arguments(0)
@florianbeisel
florianbeisel / setNetworkCategoryToPrivate.ps1
Created November 10, 2011 16:18
Changing the Network Category to Private
$nwcon = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")).getNetworkConnections()
$res = $nwcon | % {
$_.GetNetwork().SetCategory(1)
}
# More unreadable (but tested form)
# [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")).getNetworkConnections() | % {$_.GetNetwork().SetCategory(1)}
@florianbeisel
florianbeisel / addDistributionDatabaseToPublisher.sql
Created October 14, 2011 06:41
Distributionsdatenbank einem Publisher zuzuweisen
exec sp_adddistpublisher
@publisher = N'DEVELOPMENT',
@distribution_db = N'Distrib-PLZ74',
@security_mode = 1, -- Trusted Security
@working_directory = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\ReplData',
@trusted = N'false', -- deprecated
@thirdparty_flag = 0, -- SQL Server
@publisher_type = N'MSSQLSERVER'
@florianbeisel
florianbeisel / CreateUIProperties.sql
Created October 14, 2011 06:38
UI Properties erstellen und SnapshotFolder hinzufügen
USE [Distrib-PLZ74]
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = 'UIProperties' AND type = 'U ')
CREATE TABLE UIProperties(id INT)
IF EXISTS (SELECT * FROM ::fn_listextendedproperty('SnapshotFolder', 'user','dbo', 'table', 'UIProperties', null, null))
EXEC sp_updateextendedproperty
N'SnapshotFolder',
N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\ReplData',
'user',
@florianbeisel
florianbeisel / CreateDistributionDatabase.sql
Created October 14, 2011 06:37
Erstellen einer Distributionsdatenbank
USE master
GO
exec sp_adddistributiondb
@database = N'Distrib-PLZ74',
@data_folder = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data',
@log_folder = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data',
@data_file_size = 5,
@log_file_size = 5,
@min_distretention = 0,
@max_distretention = 24,
@florianbeisel
florianbeisel / gist:944469
Created April 27, 2011 15:26
Script for updating Pigmap - with multiworld support
#!/bin/bash
declare -a worlds=(firstworld Netherworld thirdworld)
numworlds=${#worlds[@]}
if [ "$(ps aux|egrep -v 'grep|pigmap.sh'|egrep 'python|rsync|pigmap')" ]
then
echo Running process found exiting
exit 0
else