Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
#
# collectd - start and stop the statistics collection daemon
# http://collectd.org/
#
# Copyright (C) 2005-2006 Florian Forster <octo@verplant.org>
# Copyright (C) 2006-2009 Sebastian Harl <tokkee@debian.org>
#
### BEGIN INIT INFO
@rycuda
rycuda / unregisterbullshit.user.js
Last active September 8, 2015 07:53
It's lovely when the article fills the page. http://imgur.com/a/2kAQC demonstrates the effect
// ==UserScript==
// @name Register bullshit removal
// @version 0.3
// @homepage https://gist.github.com/rycudasakkran/8ce3c317c3f5472945bd/edit
// @description Remove bullshit from register articles
// @match http://www.theregister.co.uk/*
// ==/UserScript==
(function() {
@rycuda
rycuda / WSUS Health Check.ps1
Last active October 5, 2015 10:36
Powershell to check that all computers in AD are registered in WSUS
$WSUSServer = "server name"
$WSUSPort = 8530
Connect-PoshWSUSServer $WSUSServer -port $WSUSPort
$WSUSClients = (Get-PoshWSUSClient).fulldomainname
(Get-ADComputer -Filter *).dnshostname | ForEach-Object {if (-not ($WSUSClients -contains $_)) {$_}} | sort
@rycuda
rycuda / AD Staleness check.ps1
Created October 5, 2015 10:39
Powershell to spit out stale (enabled) users and stale computers.
Search-ADAccount -ComputersOnly -AccountInactive -timespan 30.00:00:00 | sort name | ft name,distinguishedname
Search-ADAccount -UsersOnly -AccountInactive -timespan 30.00:00:00 | Get-ADUser | Where-Object {$_.enabled} | sort name | ft name,distinguishedname
@rycuda
rycuda / ninitecheck.ps1
Created October 22, 2015 11:27
Powershell snippet to check ninite for application update status
$applications =@();
if ($true) {
$_status, $_appstatus = cmd /c .\niniteone.exe /audit /silent . ;
if (-not ($status -like 'Failed*')) {
while ($_appstatus) {
$_item, $_appstatus = $_appstatus ;
$_name, $_status = $_item.split(':');
$_application = new-object -typename psobject -prop (@{'name' = $_name; 'status' = $_status.trim()}) ;
$applications += ,$_application;
@rycuda
rycuda / recurse-ADmembership.ps1
Last active December 18, 2015 14:39
Powershell snippet to recurse AD group membership, returning a complete list of users.
function recurse-ADmembership {
param(
[parameter(ValueFromPipeline=$true)][Microsoft.ActiveDirectory.Management.ADGroup]$group,
[Alias('groups')][hashtable]$_expandedgroups=@{}
)
process{
$group | get-adgroupmember | foreach-object {
if (($_.objectclass -eq 'group') -and (-not $_expandedgroups.ContainsKey($_.DistinguishedName))) {
$_ | recurse-ADmembership -groups $_expandedgroups
$_expandedgroups.add($_.DistinguishedName,$true)
@rycuda
rycuda / beef, beer and chorizo stew.txt
Created October 30, 2015 14:01
Beef, beer and chorizo stew
550g ish of beef shin,
whole chorizo link 225g there abouts,
three large carrots,
two large parsnips,
two fist sized turnips,
one of those half swedes that s'bries and tesco do,
bag of smallish new spuds 750g (ish),
two medium-large leeks,
couple of big onions,
200g bag of kale,
@rycuda
rycuda / passgen.ps1
Created December 15, 2015 17:04
Powershell xkcdesq password generation
function Insert-Value {
param(
[parameter(ValueFromPipeline=$true)][System.Object[]]$array,
[int]$position,
$value
)
end{
$upper = ($input.GetUpperBound(0))
if ( $position -eq 0 )
{ return @($value) + $input }

Keybase proof

I hereby claim:

  • I am rycuda on github.
  • I am rycuda (https://keybase.io/rycuda) on keybase.
  • I have a public key ASBjDvrQwY6WwZvoXlEjcwUExCBIryjfvYdskUXqNMgwrAo

To claim this, I am signing this object:

Get-ChildItem HKCU:\Software\SimonTatham\PuTTY\Sessions\ | %{
Set-ItemProperty -path $_.pspath -name "Colour0" -value "131,148,150"
Set-ItemProperty -path $_.pspath -name "Colour1" -value "147,161,161"
Set-ItemProperty -path $_.pspath -name "Colour2" -value "0,43,54"
Set-ItemProperty -path $_.pspath -name "Colour3" -value "7,54,66"
Set-ItemProperty -path $_.pspath -name "Colour4" -value "0,43,54"
Set-ItemProperty -path $_.pspath -name "Colour5" -value "238,232,213"
Set-ItemProperty -path $_.pspath -name "Colour6" -value "7,54,66"
Set-ItemProperty -path $_.pspath -name "Colour7" -value "0,43,54"
Set-ItemProperty -path $_.pspath -name "Colour8" -value "220,50,47"