Skip to content

Instantly share code, notes, and snippets.

View gitstua's full-sized avatar
:octocat:
:octocat: 🦘

Stu Eggerton gitstua

:octocat:
:octocat: 🦘
View GitHub Profile
@gitstua
gitstua / foo.md
Created May 11, 2021 09:53
code-sample1

hello world

@gitstua
gitstua / create-gh-org.sh
Created August 14, 2022 22:22
Create GitHub Org (thanks Andrew Feller)
gh api graphql -F adminLogin="gitstua" -F billingEmail="gitstua@example.com" -F enterpriseId="MDEwMDEudEEycHHcc3Uy" -F orgLogin="gitstua1" -f query='
mutation CreateEnterpriseOrg($adminLogin: String!, $billingEmail: String!, $enterpriseId: ID!, $login: String!) {
createEnterpriseOrganization(
input: {adminLogins: [$adminLogin], billingEmail: $billingEmail, enterpriseId: $enterpriseId, login: $orgLogin, profileName: $orgLogin}
) {
organization {
id
name
url
}
#!/bin/bash
## CAUTION: provided without warranty - use at own risk
# thanks https://gist.github.com/narze/2c2e141f03daea2c23fc5795107d41d4
ORG="gitstua"
DISCUSSION_SETTING="true"
# Get repos
@gitstua
gitstua / 1-orgs-archetype.md
Created February 15, 2023 00:37 — forked from whatupfoo/1-orgs-archetype.md
Orgs and Teams Best Practices

Organization archetypes

The intention of this document is to provide some guidance and suggestions to customers who are wondering how they should structure organizations and teams in their GitHub Enterprise environment. The idea isn't to give hard and fast rules on which approach is better than the other, but to give examples of when one approach might be preferable to another depending on the use case.

1. A single organization with direct organization membership for repository access (not teams)

          ________________
          |     Org      |
          |    ______    |
          |   |      |\  |

| | Repo | \ |

@gitstua
gitstua / windows-on-mac.md
Created April 20, 2023 09:36 — forked from mislav/windows-on-mac.md
Install Windows 11 in a virtual machine on macOS with an M1 CPU

Based on https://docs.getutm.app/guides/windows/

  1. You will need:
    • A Windows 10 or Windows 11 license key;
    • UTM for Mac - the App Store version is offered as a way to support the developers, since it's paid, but has the same features as the free build.
  2. Obtain scripts that bootstrap an arm64 Windows 11 22H2 (I've chosen Windows Home edition and not Pro);
  3. brew install aria2 cabextract wimlib cdrtools minacle/chntpw/chntpw;
  4. cd into the directory extracted in step 1 and bash uup_download_macos.sh - this will produce an ISO;
  5. In the UTM app, create a new “Virtualize” machine and mount the ISO file from the previous step;
  6. Check “Install drivers and SPICE tools”;

Well Architected GitHub (Draft for info, no warranty with this information) Mar 20, 2023 Stuart Eggerton

Target audience: GitHub Enterprise Cloud customers

Security

Protecting applications and data from threats.

General

  • Limit Enterprise Owners and Organization Owners to as few as possible. For billing access only use Enterprise Billing Manager.
  • Require 2-factor authentication

This query will display the SSO identity for users in an Org

{
  organization(login: "ORGNAME") {
    samlIdentityProvider {
      ssoUrl
      externalIdentities(first: 100) {
        edges {
 node {

Some useful resources for those using GitHub Actions Runner Controller (ARC)

Containers

It's worth noting that since ARC runs on Kubernetes you should have strong skills in the Kubernetes plaform. GitHub aren't able to offer support for Kubernetes because there are so many permutations of this. If you are need to connect/deploy to your private network and resources such as those below are required then you should consider GitHub Hosted Runners to simplify your management

History of Actions Runner Controller

  • The V1 ARC was started as an aweso
@gitstua
gitstua / readme.md
Created August 22, 2023 12:41 — forked from inchoate/readme.md
Open clicked URLs into a particular Google Chrome profile

Problem

When I click on links from Slack or Outlook on MacOS they open in seemingly random browser windows/profiles. This is annoying.

Solution

Open links in a particular google chrome profile window. Be less annoyed.

  1. In Chrome, visit chrome://version and find the desired profile name. Mine was Default. Copy that profile's directory name, like Profile 2 or Default, not the profile's vanity name you see when you click on your profile icon in the browser.
  2. Install Finicky: brew install finicky. After install it should be running and you should see the icon in the upper toolbar.
  3. From the Finicky Toolbar Item, click > Config > Create New
  4. Edit the new file ~/.finicky and make it look something like this, filling in your profile name:

Purpose

This is a quick runthrough of some major considerations when you create an EMU enterprise. The ⚠️ symbol denotes the more critical questions to consider.

Identity

  1. Do you have more than one Enterprise Admin? ⚠️
  2. Have you setup billing managers? ⚠️
  3. Are you syncronizing IdP groups which you can link to GitHub Teams?

Policies

Repos