Skip to content

Instantly share code, notes, and snippets.

<?php
function sendwol($addr, $mac) {
$mac=strtoupper($mac);
$addr_byte = explode(':', $mac);
$hw_addr = '';
for ($a=0; $a <6; $a++) $hw_addr .= chr(hexdec($addr_byte[$a]));
$msg = chr(255).chr(255).chr(255).chr(255).chr(255).chr(255);
for ($a = 1; $a <= 16; $a++) $msg .= $hw_addr; // 16 x macadres in msg stoppen
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); // send naar broadcast adres met UDP SOL_BROADCAST werkt niet
if ($s == false) {
@renini
renini / DisablingServicesOnServer2016wDE.ps1
Created September 9, 2017 14:50 — forked from hpaul-osi/DisablingServicesOnServer2016wDE.ps1
Disable unnecessary services that on Windows Server 2016 Desktop Experience (based on MS Security Blog recommendations)
# Disable extraneous services on Server 2016 Desktop Experience
# https://blogs.technet.microsoft.com/secguide/2017/05/29/guidance-on-disabling-system-services-on-windows-server-2016-with-desktop-experience/
Configuration DisablingServicesOnServer2016wDE
{
param(
[String]$ComputerName = "localhost",
[ValidateSet('ShouldBeDisabledOnly','ShouldBeDisabledAndDefaultOnly','OKToDisable','OKToDisablePrinter','OKToDisableDC')]
[String]$Level = 'OKToDisable'
)
@renini
renini / parse-pciids-for-ipxe.php
Created July 14, 2017 13:18
Script that parses the pci.ids database for use in ipxe
header("Content-type: text/plain"); ?>
#!ipxe
goto ${vendor}${device} || goto ${vendor} || exit
<?php
$pciids_url = "https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids";
$handle = fopen($pciids_url, "r");
// Grab pci.ids from github and outputs this in ipxe format
if ($handle) {
@renini
renini / keybase.md
Created April 20, 2015 06:26
keybase.md

Keybase proof

I hereby claim:

  • I am renini on github.
  • I am reni (https://keybase.io/reni) on keybase.
  • I have a public key whose fingerprint is E1C7 4CE1 3065 5EC5 9EEB 5F52 087C 9E37 1206 7A5E

To claim this, I am signing this object:

#Based on <http://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542>
function Test-RebootRequired
{
$result = @{
CBSRebootPending =$false
WindowsUpdateRebootRequired = $false
FileRenamePending = $false
SCCMRebootPending = $false
}