Skip to content

Instantly share code, notes, and snippets.

Avatar

Samúel Jón Gunnarsson samueljon

View GitHub Profile
View ansible_vmware_payload.yml
---
# tasks file for xrd-ansible-onboard
- name: Ansible onboarding
vmware_vm_shell:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
datacenter: "{{ datacenter }}"
folder: "{{ vcenter_folder }}"
View ansible_vmware_clone.yml
---
- name: Clone a virtual machine from Linux template
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
resource_pool: ansible-resource-pool
validate_certs: no
datacenter: "{{ datacenter }}"
state: poweredon
View ansible_onboarding.sh
#!/bin/bash
#########################################################
# Script Name : ansible_onboarding.sh
# Description : Adds Ansible user and sudo permissions.
# Args : none
# Author : Samúel Jón Gunnarsson
# Email : samuel@ok.is
# Version : 20200923-01
########################################################
@samueljon
samueljon / force-mcp-ocp-update
Created Aug 21, 2021 — forked from ikurni/force-mcp-ocp-update
How to force openshift MCP to update machine config
View force-mcp-ocp-update
### Create file called machine-config-daemon-force in /run ###
ssh core@hostname.local sudo touch /run/machine-config-daemon-force
### Edit node annotations ###
oc edit node <node-name>
### Check Annotations, change like below sample ###
machineconfiguration.openshift.io/currentConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456
machineconfiguration.openshift.io/desiredConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456
machineconfiguration.openshift.io/reason: ""
@samueljon
samueljon / configuration.yaml
Last active Nov 29, 2020
Sensor sem sækir gengi frá M5 og birtir í Home Assistant sem m5_is_rate_GJALDMIDILL
View configuration.yaml
#####################
# Sensors
#####################
sensor:
- platform: rest
name: apis_currency_m5
resource: https://apis.is/currency/m5
scan_interval: 60
json_attributes:
- results
@samueljon
samueljon / altibox_my_6rd_prefix.sh
Created May 24, 2018
This command returns the 6rd prefix for altibox ipv6 implimentation
View altibox_my_6rd_prefix.sh
#!/usr/bin/env bash
ipv6calc --action 6rd_local_prefix --6rd_prefix 2a01:79c::/30 --6rd_relay_prefix 213.167.115.92/0 $(curl icanhazip.com)
@samueljon
samueljon / aruba-setvlan.py
Created Apr 12, 2018
Script to set a VLAN via Aruba's REST Interface.
View aruba-setvlan.py
#!/usr/bin/python
#
import sys, json
import httplib, urllib
# Check arguments
numargs = len(sys.argv)
if numargs != 6:
print "Usage: aruba-setvlan.py [ip address] [username] [password] [port] [vlan]"
@samueljon
samueljon / aruba.py
Last active Apr 12, 2018
Accessing aruba switch via python
View aruba.py
#!/usr/bin/python
#
import sys, json
import httplib, urllib
# Check arguments
numargs = len(sys.argv)
if numargs != 6:
print "Usage: aruba-setvlan.py [ip address] [username] [password] [port] [vlan]"
@samueljon
samueljon / ldap_debug_2.php
Created Mar 14, 2017
For debugging ldap connectivity issues in php
View ldap_debug_2.php
<?php
$ldap="host.domain.tld";
$usr="user@domain.tld";
$pwd = 'userpassword';
$debug = true;
// Set debugging
if ($debug) {
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
@samueljon
samueljon / ldap_debug_1.php
Created Mar 14, 2017
For debugging Ldap connectivity issues in php
View ldap_debug_1.php
<?php
// Set the ldap server
$ldapurl = "host.domain.tld";
$ldapuser = "user@domain.tld";
$ldappass = 'userpassword';
// Set the debug flag
$debug = true;
// Set debugging