Skip to content

Instantly share code, notes, and snippets.

View sjd78's full-sized avatar

Scott Dickerson sjd78

  • Red Hat, Inc
  • Buffalo, NY, USA
  • 05:29 (UTC -04:00)
View GitHub Profile
@sjd78
sjd78 / iscsi server quick start.md
Last active August 9, 2021 18:52
iscsi server quick start.md
@sjd78
sjd78 / README.md
Last active April 28, 2023 18:46
edit a git commit (taking files out of a commit)

What? I want to edit a file or remove a file from a commit that isn't the previous one.

How?

  • Use interactive rebase to mark a commit to edit in history
  • reset to the previous commit to unstage changes
  • change the changes, remove stuff etc
  • commit the changes back to the original head
  • continue the rebase
@sjd78
sjd78 / README.md
Last active April 8, 2021 21:26
curl + jq for looking at ovirt rest output

LOGIN=admin@internal:password

Look at disk attributes for all VMs matching a name

curl -k -u"$LOGIN" -H"Accept: application/json" -H"Filter:true" \
  "https://engine-dev.ovirt:8443/ovirt-engine/api/vms/?follow=disk_attachments.disk&search=name=TS*%20sortby%20name%20asc" \
  | jq '
    .vm[] | 
    { 
@sjd78
sjd78 / 00-macvlan_with_networkd_.md
Last active May 27, 2020 23:53
Setup macvlan bridge on Raspbian

Goal

Use systemd-networkd to configure Raspbian such that it boots with a macvlan adapter bridged to eth0.

Why?

So we can add multiple discreet nics (macvlan devices) to the box. This is useful when we want to run a docker container on an ip address other than eth0. It is even more useful to run a container with a full macvlan network and assign it a static IP address. A samba container, or a plex container, or a UniFi controller container needs lots of ports open. This will allow the base Pi to still communicate with the containers and have the containers matched up to their own nics/IPs.

@sjd78
sjd78 / ovirt-compile-functions.sh
Last active April 26, 2021 16:34
this is how I build various parts of the ovirt-engine that I work on (whole thing, GWT app, branding, welcome/sso apps)
#
# Defaults for the ovirt_* functions
#
_PREFIX=$HOME/ovirt-engine
_BUILD_FLAGS="-Dgwt.compiler.localWorkers=1 -Dgwt.style=pretty -Dgwt.cssResourceStyle=pretty -Dgwt.userAgent=safari -Dgwt.runtimeLogLevel=INFO"
_BUILD_UT=1
_SKIP_CHECKS=0
_BUILD_CLEAN=1
#
@sjd78
sjd78 / EmailLoginEvent.ps1
Last active November 7, 2019 18:40
Powershell script to query "real person" login from the Security event log, convert the events to be useful and send an email with the most recent event.
##
## Use this script as a target for a scheduled tasks with a logon trigger to get an email notification
## when a user logs on to the system.
##
## Note: To run this script, you may need to change your execution policy. See:
## https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies
##
# LogonTypes ... https://eventlogxp.com/blog/logon-type-what-does-it-mean/
# VirtualAccount, ElevatedToken ... No = '%%1843', Yes = '%%1842'
@sjd78
sjd78 / README.md
Last active January 9, 2021 15:42
setup libvirt network for ovirt-engine dev

A single machine will host the ovirt-engine dev (where compile and run dev engine) AND one or more VMs that will act as hosts for the engine. The config files will use the hostname developer.

Create a new libvirt / virt-manager network:

  developer# virsh net-define virsh-network.xml
  developer# virsh net-autostart ovirt-dev
  developer# virsh net-start ovirt-dev
@sjd78
sjd78 / tooltip-position-override.js
Created February 13, 2017 17:02
Override bootstrap 3.3.7 tooltip position code so it works with SVG elements
import jQuery from 'jquery/dist/jquery'
/*
* Override the bootstrap 3.3.7 Tooltip.getPosition() function to fix
* position issues with SVG elements when the page/viewport is scrolled.
*/
;(function ($) {
// const original = $.extend(true, {}, $.fn.tooltip.Constructor.prototype)
const extension = {