Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
@grenade
grenade / install-mq-explorer.sh
Created September 9, 2013 15:36
InstallAnywhere can fail on bash environments where any environment variable contains a backslash character (\), resulting in the cryptic error: "Malformed \uxxxx encoding". To work around this, run the installer in a variable free shell using "env -i" as shown in this gist.
mkdir -p /tmp/mq
cd /tmp/mq
tar -zxvf /tmp/ms0t_mqexplorer_7502_linux_x86_64.tar.gz
sed -i.bak -e 's#LICENSE_ACCEPTED=FALSE#LICENSE_ACCEPTED=TRUE#g' /tmp/mq/silent_install.resp
env -i /tmp/mq/Setup.bin -f /tmp/mq/silent_install.resp
@grenade
grenade / enable-sshd.sh
Created September 13, 2013 12:15
Enable the ssh daemon on Fedora Core 19 and start accepting connections.
# Turn off SELinux at boot
sudo sed -i.bak -e 's#SELINUX=enforcing#SELINUX=permissive#g' /etc/selinux/config
# Turn off SELinux now
sudo setenforce Permissive
# Make sshd start at boot
sudo chkconfig sshd on
# Start sshd now
This Gist has moved to: https://gist.github.com/grenade/aaee942da0363fa31e12
current scripts overview:
vagrantfile
bootstrap.sh
shared.sh
installation functions
configuration functions
fcdldoa.sh
fcdlmyml.sh: osb, oepe, wl
fcdlsl3m.sh
fcdlsfdc.sh
@grenade
grenade / DownloadNuGet.ps1
Created November 25, 2013 09:19
Grab the NuGet command line client off the internets...
Function WebGet {
Param($url, $file)
$webClient = New-Object System.Net.WebClient
$webClient.Proxy = [System.Net.WebRequest]::GetSystemWebProxy()
$webClient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$webClient.DownloadFile($url, $file)
}
WebGet "https://nuget.org/nuget.exe" "C:\Test\lib\nuget.exe"
@grenade
grenade / EnablePowerShellNet4.ps1
Last active December 29, 2015 07:58
Adds support for .Net runtime 4 in PowerShell by creating a powershell.exe.config file.
$windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$windowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($windowsIdentity)
$adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator
if (!($windowsPrincipal.IsInRole($adminRole))) {
$psi = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
$psi.Arguments = $myInvocation.MyCommand.Definition;
$psi.Verb = "runas";
[System.Diagnostics.Process]::Start($psi);
exit
}
@grenade
grenade / uninstall-msmq.ps1
Created November 27, 2013 11:42
Uninstall MSMQ and all components
Import-Module ServerManager
Get-WindowsFeature MSMQ-* | Remove-WindowsFeature
@grenade
grenade / NServiceBusServiceDeployConfig.ps1
Last active December 29, 2015 13:28
Install an NServiceBus dependent Windows Service using PowerShell DSC Note that this is an untested work in progress. It wont work out of the box. ...yet.
Configuration NServiceBusServiceDeployConfig {
param (
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string[]] $targetNodes,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string] $serviceDeployPath,
$AllNodes = @(
@{
NodeName = "*";
RecurseValue = $true
},
@{
NodeName = "WebServer101";
Role = "Web";
RolesToBePresent = "Web-Server";
SourceRoot = "\\Server106\source\web";
# http://msdn.microsoft.com/en-us/library/jj980508(v=winembedded.81).aspx
# http://wiki.splunk.com/Deploy:HOWTO_Enable_WMI_Access_for_Non-Admin_Domain_Users
# http://blogs.technet.com/b/ashleymcglone/archive/2011/04/18/powershell-remoting-exposed-how-to-command-your-minions.aspx
# disable Remote UAC:
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
# enable the Remote Administration exception:
netsh advfirewall set service RemoteAdmin enable
# enable WMI traffic at a command prompt by using a WMI rule:
netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes