Skip to content

Instantly share code, notes, and snippets.

View ITJamie's full-sized avatar

Jamie (Bear) Murphy ITJamie

View GitHub Profile
# Powershell refuses to connect to the Netbox API on our setup without this.
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
@ITJamie
ITJamie / vagrant.rb
Created May 2, 2019 23:06
How to kill netplan in ubuntu 17.10+ 18.04 +++ in kitchen vagrant.rb and revert to ifupdown
Vagrant.configure(2) do |config|
config.vm.provision 'shell', inline: <<-SHELL
sudo apt -y install ifupdown
sudo apt -y purge netplan.io
sudo rm -vfr /usr/share/netplan /etc/netplan
echo -e "auto eth0\niface eth0 inet dhcp\npre-up sleep 2" >> /etc/network/interfaces.d/eth0
echo -e "auto lo\niface lo inet loopback \n\nsource /etc/network/interfaces.d/*" >> /etc/network/interfaces
sudo service networking restart
echo "IM GOING TO REBOOT NOW TO KILL NETPLAN FROM MEMORY"
sudo reboot now
@ITJamie
ITJamie / LogicMonitorRubySigning.rb
Last active October 10, 2023 14:42
Ruby - Logicmonitor Rest API - auth / signing
require 'rest-client' #rubygem
require 'date'
require 'openssl'
#warning. the code from below has come from a class. Ive cleaned it up but there may be some errors. This is a GIST after all
# Instance variables
@LM_accountname = 'lM_accountname'