Skip to content

Instantly share code, notes, and snippets.

View mendel129's full-sized avatar

mendel129

View GitHub Profile
@mendel129
mendel129 / ilo.ps1
Created September 21, 2015 18:19
HP ilo powershell interface
#enter ilo IP address here
$ilourl = "https://192.168.1.14"
$jsonpage = $ilourl + "/json/login_session"
#disable certificate check
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
@mendel129
mendel129 / PoSh_OpenSSL_AES
Last active November 25, 2019 20:01
Needed to make powershell natively talk with gibberish-aes, with random salt (and this should be openssl compatible...)
#PowerShell to create an gibberishaes(and openssl) compatible aes string with salt
#Salted__8bitsalt/aesstring
#thanks for .netcode -> http://stackoverflow.com/questions/5452422/openssl-using-only-net-classes
function OpenSSLEncrypt($passphrase, $plainText)
{
# generate salt
[byte[]] $key
[byte[]] $iv;
[byte[]] $salt = RandomByteArray
@mendel129
mendel129 / recycleapp.py
Last active October 18, 2020 22:05
python wrapper to get data from Belgium's waste pickup schedule via https://recycleapp.be
import requests
from datetime import datetime, date, timedelta
import re
CONF_CONSUMER = "recycleapp.be"
CONF_APPAPI="https://recycleapp.be/api/app/v1/"
# CONF_DAYSINFUTURE = 14
CONF_DAYSINFUTURE = 31
CONF_LANG='nl'
CONF_USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"
@mendel129
mendel129 / Manage-LocalAdmin.ps1
Last active January 12, 2021 23:30
Microsoft LAPS, https://support.microsoft.com/en-us/kb/3062591, doesn't handle user creation that well, and GPP is deprecated since ms14-025. Might get solved with startupscript (tested on win10)
#Microsoft LAPS, https://support.microsoft.com/en-us/kb/3062591, doesn't handle user creation that well, and GPP is deprecated since ms14-025
#might get solved with startupscript (tested on win10)
#get users in local administrator
$obj_group = [ADSI]"WinNT://$($env:COMPUTERNAME)/Administrators,group"
$Administrators = @($obj_group.psbase.Invoke("Members")) | foreach{([ADSI]$_).InvokeGet("Name")}
#get local users
$adsi = [ADSI]"WinNT://$($env:COMPUTERNAME)"
$Users = $adsi.psbase.children | where {$_.psbase.schemaClassName -match "user"} | select @{n="Name";e={$_.name}}