Skip to content

Instantly share code, notes, and snippets.

View greeneg's full-sized avatar

Gary Greene greeneg

  • Dearborn, Michigan
  • 17:15 (UTC -04:00)
View GitHub Profile
@greeneg
greeneg / RegexHandler.go
Created May 9, 2022 02:12 — forked from iamphill/RegexHandler.go
Very basic golang HTTP server
package main
import (
"net/http"
"Regexp"
)
type route struct {
pattern *regexp.Regexp
handler http.Handler
@greeneg
greeneg / polkit-authority.pl
Created April 18, 2021 18:32 — forked from giterlizzi/polkit-authority.pl
PolicyKit - Accessing the Authority via D-Bus in Perl (port of Python script https://www.freedesktop.org/software/polkit/docs/0.105/polkit-apps.html)
#!/usr/bin/perl
use strict;
use warnings;
use Net::DBus;
my $system_bus = Net::DBus->system;
sub PolKitAuthority {
$HTTP["url"] =~ "/shorewall" {
proxy.server = (
"/" => (
"/" => ( "host" => "127.0.0.1", "port" => 5000 )
)
)
}
@greeneg
greeneg / ssh_key.tf
Created December 11, 2018 20:56 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@greeneg
greeneg / sierra-virtualbox-install.md
Created August 25, 2017 14:06 — forked from arobb/sierra-virtualbox-install.md
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
@greeneg
greeneg / LSI_Blueprint_Specification.md
Last active May 3, 2018 22:41
LSI Blueprint Specification

The LSI Package Blueprint Specification

Introduction

The LSI Blueprint (.blueprint) file specification follows. This file format is used by LSI to build an arbitrary number of binary packages out of source code releases for AltimatOS and other UNIX-like operating systems.

Initially, LSI packages started as a wrapper over shell code for trying to formally build from-source software into a build root. This unfortunately, has limitations with regards to tracking, verifying, and managing installed dependencies. To help create a package format that can be used for managing software on the systems, it has become clear that a defined grammar for the blueprint (the package's specification and build scripts) should be created to ensure correctness of the build.

The specification below is a pseudo BNF format and should not be considered proper ABNF, BNF, or EBNF syntax.

Keybase proof

I hereby claim:

  • I am greeneg on github.
  • I am greeneg (https://keybase.io/greeneg) on keybase.
  • I have a public key whose fingerprint is AF83 F5FA 478C F72F F518 0BB8 E3E9 FD62 EFCF 76D8

To claim this, I am signing this object: