Skip to content

Instantly share code, notes, and snippets.

View fenneh's full-sized avatar
🔥
Hi

fen fenneh

🔥
Hi
View GitHub Profile
@fenneh
fenneh / gist:2568373
Created May 1, 2012 14:37
Win 2008 R2 IIS 7.5 PCI Cipher & Protocol Powershell Functions
function Set-IISSecurityProtocols {
$protopath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols"
& reg.exe add "$protopath\PCT 1.0\Server" /v Enabled /t REG_DWORD /d 00000000 /f
& reg.exe add "$protopath\SSL 2.0\Server" /v Enabled /t REG_DWORD /d 00000000 /f
& reg.exe add "$protopath\SSL 3.0\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.0\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.1\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.1\Server" /v DisabledByDefault /t REG_DWORD /d 00000000 /f
& reg.exe add "$protopath\TLS 1.2\Server" /v Enabled /t REG_DWORD /d 00000001 /f
& reg.exe add "$protopath\TLS 1.2\Server" /v DisabledByDefault /t REG_DWORD /d 00000000 /f
@fenneh
fenneh / emailfunction.ps1
Created May 1, 2012 14:49
Powershell E-Mail
$smtp = "nice.smtp.server.brok"
$from = "Test@Testing.com"
$to = "Self@DismantleRepair.me"
$subject = "Interesting subject~!"
$body = "Nice Curves!"
Send-Mailmessage -SmtpServer $smtp -From $from -To $to -Subject $subject -Body $body
@fenneh
fenneh / PortQueryFWTest.ps1
Created May 3, 2012 22:16
Using PortQry to test Firewall Rules
# Grab some user input
$Server = Read-Host "Enter the Server's name or IP"
$Port = Read-Host "Enter the Port Number"
# Be careful of this path~!
$K = C:\PortQryV2\PortQry.exe -n $Server -e $Port -p TCP
$L = $K -Match "LIS?"
If($L -ne $null)
{
@fenneh
fenneh / gist:2589971
Created May 3, 2012 22:22
AVG Automatic Removal
## For 32bit (x86) machines;
PSEXEC \\Computername "C:\Program Files\AVG\AVG2012\avgmfapx.exe" /Appmode=Setup /uninstall /uilevel=Silent /dontrestart
## For 64bit (x64) machines;
PSEXEC \\Computername "C:\Program Files (x86)\AVG\AVG2012\avgmfapx.exe" /Appmode=Setup /uninstall /uilevel=Silent /dontrestart
@fenneh
fenneh / gist:2635307
Created May 8, 2012 14:01
Installing VMWare tools Ubunutu Server 12.04
sudo apt-get update
sudo apt-get upgrade
sudo mkdir -p /media/cdrom
sudo mount /dev/cdrom /media/cdrom
cd /media/cdrom
sudo cp VM*.tar.gz /tmp
sudo apt-get install linux-headers-server build-essential
cd /tmp
sudo umount /media/cdrom
sudo tar xzvf VM*.tar.gz
@fenneh
fenneh / IIS75.ps1
Created May 24, 2012 14:02
Install & Patch IIS7.5 Basic
# Script to configure web application servers
### Supporting functions ###############################################################
function Install-Features($RolesToInstall) {
$args = @("/Online")
$args += "/Enable-Feature"
foreach ($role in $RolesToInstall) {
$args += "/FeatureName:$role"
}
& $env:windir\system32\dism $args
@fenneh
fenneh / AutoVM.ps1
Created May 24, 2012 16:44
Sample of Auto VM
param (
[string]$vmName = (Read-Host "Provide VM Name"),
[string]$Template = (Read-Host "What Template do you want Vanilla/Web/Gravis?")
[string]$Template = (Read-Host "Disk size 40/80?")
)
# Import Configuration
. (Join-Path -Path (Split-Path -parent $MyInvocation.MyCommand.Definition) -ChildPath "configuration.ps1")
# Load VMware Module
if ((Get-PSSnapin | Where-Object { $_.Name -eq "VMware.VimAutomation.Core" }) -eq $null) { Add-PSSnapin VMware.VimAutomation.Core }
@fenneh
fenneh / PSBypass.bat
Created May 28, 2012 11:15
Run a powershell script from UNC path
Powershell.exe -ExecutionPolicy Bypass -file \\my.domain.share\netlogon\Scripts\InstallPonies.ps1
@fenneh
fenneh / CreateVM.ps1
Created May 30, 2012 14:00
Script to Automagically create VMs
param (
[string]$vmName = (Read-Host "Provide VM Name"),
[string]$vmFlavour = (Read-Host "What flavour of server do you want? Web/Gravis/Vanilla"),
[string]$vmSize = (Read-Host "Instance Size? Small/Medium/Large")
)
# Import Configuration
. (Join-Path -Path (Split-Path -parent $MyInvocation.MyCommand.Definition) -ChildPath "configuration.ps1")
# Load VMware Module
if ((Get-PSSnapin | Where-Object { $_.Name -eq "VMware.VimAutomation.Core" }) -eq $null) { Add-PSSnapin VMware.VimAutomation.Core }
@fenneh
fenneh / SubSyncgDrive.bat
Created June 6, 2012 21:04
Syncing Sublime Text 2 Settings with Google Drive
Rem Just an example of how to sync your Sublime Text 2 settings with googledrive. Only works on Windows Vista+
Rem Uses mklink to create links to your google drive http://technet.microsoft.com/en-us/library/cc753194(v=ws.10).aspx
Rem http://www.justfen.com/post/24560405011/syncing-sublime-text-2-with-google-drive
cd %APPDATA%\Sublime Text 2\
mklink /d "Backup" "C:\Users\fen\Google Drive\Sublime\Backup"
mklink /d "Installed Packages" "C:\Users\fen\Google Drive\Sublime\Installed Packages"
mklink /d "Packages" "C:\Users\fen\Google Drive\Sublime\Packages"
mklink /d "Pristine Packages" "C:\Users\fen\Google Drive\Sublime\Pristine Packages"
mklink /d "Settings" "C:\Users\fen\Google Drive\Sublime\Settings\"