Skip to content

Instantly share code, notes, and snippets.

View fenneh's full-sized avatar
🔥
Hi

fen fenneh

🔥
Hi
View GitHub Profile
@fenneh
fenneh / Adsi.ps1
Created August 3, 2012 10:36
Adsi Ninite
$NiniteADSearch=new-object System.DirectoryServices.DirectorySearcher([ADSI]’LDAP://OU=The,OU=Computer,OU=Group,DC=My,DC=Domain,DC=Name’,’objectCategory=Computer’)
$NiniteADSearch.FindAll()|%{$_.Properties.name} | Out-File NiniteTargets.txt -Encoding Default
@fenneh
fenneh / gist:3164721
Created July 23, 2012 17:01 — forked from kfrancis/gist:3164709
PowerShell Method for Telling NewRelic of Deployment
if ($OctopusEnvironmentName -eq "Production") {
# in production, we need to
#Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default.
$URL = "http://api.newrelic.com/deployments.xml"
$post = "deployment[account_id]=<id here>&deployment[user]=OctopusDeploy&deployment[app_id]=<app id here>&deployment[revision]=($OctopusPackageVersion)"
$URI = New-Object System.Uri($URL,$true)
#Create a request object using the URI
$request = [System.Net.HttpWebRequest]::Create($URI)
@fenneh
fenneh / chat-wish-list.md
Created July 16, 2012 00:38 — forked from rtgibbons/chat-wish-list.md
Chat wish list

Why

I hate Skype, but it has become un-official default chat of many businesses and developers. Because it is free, secure and provides voice and video. But Skype is missing so many other features that make it annoying to use.

Existing Options

  • Skype
  • Campfire
  • HipChat
  • Grove.io
@fenneh
fenneh / PrestageVM.ps1
Created July 14, 2012 11:35
Prestaging a VMWare VM in Windows Active Directory
# Modules needed for this function to work, remember you need to be connected to vCenter aswell!
# Load VMware Module
if ((Get-PSSnapin | Where-Object { $_.Name -eq "VMware.VimAutomation.Core" }) -eq $null) { Add-PSSnapin VMware.VimAutomation.Core }
# Load AD Module... if you can't import it you need Windows RSAT http://www.microsoft.com/en-us/download/details.aspx?id=7887
if ((Get-Module | Where-Object { $_.Name -eq "ActiveDirectory" }) -eq $null) { Import-Module ActiveDirectory }
# Variables Needed
[String]$vmName = (Read-Host "Provide VM Name")
$domainName = "just.fen.co.uk"
@fenneh
fenneh / gist:2942550
Created June 16, 2012 21:32 — forked from swanson/gist:2942386
Don't ask permission to be awesome
"And have a healthy disregard for rules. There are way too many rules, and they usually have only
one effect: to slow down those who are active. If you believe your activities are in the best
interest of the company that employs you - yet you fear you have broken enough rules that you
might be fired - then you are doing well."
--Sebastian Thrun
http://www.reddit.com/r/IAmA/comments/v59z3/iam_sebastian_thrun_stanford_professor_google_x/c51gi53
@fenneh
fenneh / AutoNinite.ps1
Created June 8, 2012 22:16
Automatic Software Deployment with Ninite
## Ninite AD Deployment v0.1
## Wrote by fen www.justfen.com // twitter.com/justfen_/
## github.com/justfen fen@justfen.com
## Have to import AD module for AD manipulation
Import-Module ActiveDirectory
## Variables
$domainName = "just.fen.com"
## An example would be "OU=Laptops,OU=Computers,DC=Just,DC=fen,DC=com"
@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 / 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 / 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 / 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)
{