Skip to content

Instantly share code, notes, and snippets.

🔥
Hi

fen fenneh

🔥
Hi
  • London
View GitHub Profile
@fenneh
fenneh / gist:2568373
Created May 1, 2012
Win 2008 R2 IIS 7.5 PCI Cipher & Protocol Powershell Functions
View gist:2568373
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
View emailfunction.ps1
$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
Using PortQry to test Firewall Rules
View PortQueryFWTest.ps1
# 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
AVG Automatic Removal
View gist:2589971
## 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
Installing VMWare tools Ubunutu Server 12.04
View gist:2635307
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
Install & Patch IIS7.5 Basic
View IIS75.ps1
# 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
Sample of Auto VM
View AutoVM.ps1
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
Run a powershell script from UNC path
View PSBypass.bat
Powershell.exe -ExecutionPolicy Bypass -file \\my.domain.share\netlogon\Scripts\InstallPonies.ps1
@fenneh
fenneh / CreateVM.ps1
Created May 30, 2012
Script to Automagically create VMs
View CreateVM.ps1
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 Jun 6, 2012
Syncing Sublime Text 2 Settings with Google Drive
View SubSyncgDrive.bat
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\"
You can’t perform that action at this time.