Skip to content

Instantly share code, notes, and snippets.

View fenneh's full-sized avatar
🔥
Hi

fen fenneh

🔥
Hi
View GitHub Profile
@fenneh
fenneh / ExchangeMMC.bat
Created November 1, 2012 16:56
Exchange MMC & Windows 8 -Fix
@echo off
set __COMPAT_LAYER=RUNASINVOKER
set COMPLUS_Version=v2.0.50727
start C:\Progra~1\Microsoft\Exchan~1\V14\Bin\Exchan~1.msc
@fenneh
fenneh / DomainUser.Ps1
Created August 13, 2012 13:23
Get All users from AD
New-PSDrive -PSProvider ActiveDirectory -Name ADUser -Root "" -Server "dc1.lolololol.com"
pushd ADUser:
Get-ADUser -Filter * | Out-File "$env:temp\hihi.txt" -Encoding Default
popd
@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 / HAProxyListenExample
Created June 11, 2012 11:41
HAProxy HTTP Check with Head & User Agent type
listen justFenWEB
bind 192.168.100.100:80
mode tcp ## Drops from Layer 7 to Layer 4 routing as defined in defaults
option tcplog
balance source ## To maintain sessions
option httpchk HEAD / HTTP/1.0\r\nHost:\ www.justfen.com\r\nUser-Agent:\ HAProxy01 ## Used for checking HTTP health of web server
rspidel ^Set-cookie:\ IP= ## Will hide internal IP
server APP01 APP01.justfen.com:80 check
server APP03 APP03.justfen.com:80 check
@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 / 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\"