Skip to content

Instantly share code, notes, and snippets.

View glennswest's full-sized avatar
🏠
Working from home

Glenn West glennswest

🏠
Working from home
View GitHub Profile
@glennswest
glennswest / wineventlog.go
Created February 16, 2019 05:24
Event Log Capture in Windows using GoLang
package main
import(
"fmt"
"syscall"
"unsafe"
"log"
"golang.org/x/sys/windows"
)
@glennswest
glennswest / setup-ip.yml
Created April 7, 2017 04:57
Ansible automatically create /etc/hosts file for all host - to give nice short names using dnsmasq
---
- hosts: all
tasks: []
- hosts: all
gather_facts: True
tasks:
- name: check connection
ping:
- name: setup
setup:
@glennswest
glennswest / setupusers.sh
Created September 23, 2022 16:58
Simple bash script to setup htpassd support, and add initial admin users - change to what you want - least secure auth model
oc delete secret htpasswd -n openshift-config
rm -r -f users
mkdir users
cd users
touch htpasswd
htpasswd -Bb htpasswd admin Admin1!
htpasswd -Bb htpasswd gwest password
oc --user=admin create secret generic htpasswd --from-file=htpasswd -n openshift-config
oc replace -f - <<API
apiVersion: config.openshift.io/v1
@glennswest
glennswest / index.js
Created April 1, 2022 23:13
Post to update data in tabulator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tabulator Example</title>
<link href="tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="tabulator.min.js"></script>
14:01:39.070 -> M5EPD initializing...OK
14:01:42.961 -> Booting
14:01:43.550 -> SD Card Ready
14:01:44.190 -> Card Size: 15634MB
14:01:45.440 -> Connecting to Wi-Fi...
14:01:45.440 -> [WiFi-event] event: 0
14:01:45.440 ->
[WiFi-event] event: 2
14:01:45.544 ->
Ready
@glennswest
glennswest / journalctl.log
Created January 16, 2020 16:28
master1 log
This file has been truncated, but you can view the full file.
-- Logs begin at Thu 2020-01-16 15:25:51 UTC, end at Thu 2020-01-16 16:23:55 UTC. --
Jan 16 15:25:51 localhost kernel: Linux version 4.18.0-80.11.2.el8_0.x86_64 (mockbuild@x86-vm-07.build.eng.bos.redhat.com) (gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)) #1 SMP Sun Sep 15 11:24:21 UTC 2019
Jan 16 15:25:51 localhost kernel: Command line: BOOT_IMAGE=/ostree/rhcos-1f8a02066bf1850bb60e814e7ffa9c7066494bd88f097eae08b37781f980cefe/vmlinuz-4.18.0-80.11.2.el8_0.x86_64 console=tty0 console=ttyS0,115200n8 rootflags=defaults,prjquota rw ignition.firstboot rd.neednet=1 ip=dhcp root=UUID=477c3d77-20c6-4ff3-8bb3-dc2543eedfbd ostree=/ostree/boot.0/rhcos/1f8a02066bf1850bb60e814e7ffa9c7066494bd88f097eae08b37781f980cefe/0 coreos.oem.id=qemu coreos.oem.id=azure ignition.platform.id=azure
Jan 16 15:25:51 localhost kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Jan 16 15:25:51 localhost kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Jan 16 15:25:51 localhost kernel: x86/fpu
-- Logs begin at Fri 2020-01-17 15:42:43 UTC, end at Fri 2020-01-17 16:14:11 UTC. --
Jan 17 15:42:43 localhost kernel: Linux version 4.18.0-80.11.2.el8_0.x86_64 (mockbuild@x86-vm-07.build.eng.bos.redhat.com) (gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)) #1 SMP Sun Sep 15 11:24:21 UTC 2019
Jan 17 15:42:43 localhost kernel: Command line: BOOT_IMAGE=/ostree/rhcos-1f8a02066bf1850bb60e814e7ffa9c7066494bd88f097eae08b37781f980cefe/vmlinuz-4.18.0-80.11.2.el8_0.x86_64 console=tty0 console=ttyS0,115200n8 rootflags=defaults,prjquota rw ignition.firstboot rd.neednet=1 ip=dhcp root=UUID=477c3d77-20c6-4ff3-8bb3-dc2543eedfbd ostree=/ostree/boot.0/rhcos/1f8a02066bf1850bb60e814e7ffa9c7066494bd88f097eae08b37781f980cefe/0 coreos.oem.id=qemu coreos.oem.id=azure ignition.platform.id=azure
Jan 17 15:42:43 localhost kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Jan 17 15:42:43 localhost kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Jan 17 15:42:43 localhost kernel: x86/fpu
ASSISTED_SERVICE_API="api.openshift.com"
export CLUSTER_ID=`cat .clusterid`
export OFFLINE_ACCESS_TOKEN=`cat .ocmapitoken.txt`
export TOKEN=`curl \
--silent \
--data-urlencode "grant_type=refresh_token" \
--data-urlencode "client_id=cloud-services" \
--data-urlencode "refresh_token=${OFFLINE_ACCESS_TOKEN}" \
https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token | \
jq -r .access_token`
This file has been truncated, but you can view the full file.
[?25lUse the ^ and v keys to change the selection.
Press 'e' to edit the selected item, or 'c' for a command prompt.
Press Escape to return to the previous menu.   Red Hat Enterprise Linux CoreOS 47.83.202103251640-0 (Ootpa) (ostree:0)       
variant: fcos
version: 1.1.0
storage:
files:
- path: /usr/local/bin/create-datastore
mode: 0755
contents:
inline: |
#!/bin/bash