Skip to content

Instantly share code, notes, and snippets.

View jonico's full-sized avatar
🪐
@ home

Johannes Nicolai jonico

🪐
@ home
View GitHub Profile
@jonico
jonico / dashboard.xml
Created September 20, 2016 15:04
Splunk Dashboard for GitHub Enterprise
<dashboard>
<label>Octodemo performance stats</label>
<row>
<panel>
<chart>
<title>Top fetched repos</title>
<search>
<query>index="octodemo" upload-pack user| top repo</query>
<earliest>@w0</earliest>
<latest>now</latest>
@jonico
jonico / github_basic_auth_retrieve_emails.go
Created January 5, 2019 00:17
Example of a basic GitHub OAuth app tha retrieves all emails (including private) of a GitHub user in Go
// Simple OAuth server retrieving the email adresses of a GitHub user
package main
import (
"context"
"encoding/json"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
"log"
"net/http"
@jonico
jonico / github-saml-with-auth0.md
Created February 21, 2019 18:06
How to setup GitHub SAML authentication with Auth0

When setting up Auth0 as a SAML IdP for GitHub, you most likely created an Application in Auth0 representing GitHub and enabled the SAML WebApp addon, as explained here. In order to ensure that the proper SAML response is sent to GitHub, make sure to configure the audience value in the JSON settings for the SAML Web App addon, replacing "acme" with your org name in GitHub:

image

@jonico
jonico / list-business-account-members-and-their-orgs.graphql
Last active March 14, 2019 17:31
GraphQL Examples with GitHub business account
query getOrgsInBusiness($slug: String!) {
business(slug: $slug) {
... on Business {
name
resourcePath
avatarUrl
members(first: 100) {
edges {
organizations(first: 100) {
@jonico
jonico / .gitconfig
Created August 9, 2016 09:38
My .gitconfig
[alias]
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
s = status -s
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
@jonico
jonico / evaluierungsfragen.md
Last active December 6, 2019 08:51
Evaluierungsfragen/kriterien bei der Auswahl einer Versionskontrollverwaltungs- / Social Coding-Plattform

Business Coding Platform Evaluierungskriterien / Fragen

  • Wie lange dauert es, einen neuen Entwickler in die Plattform einzuarbeiten? Welcher Trainingsaufwand ist erforderlich, bis der erste Commit in Produktion gehen kann?

  • Wie unterstützt die gewählte Plattform das Aufbauen eines unternehmensweiten Entwickler-Profils, aus dem die Entwicklungsaktivität, Popularität, Programmiersprachen und Tätigkeitsschwerpunkt (welche Repositories) eines Entwicklers oder Entwicklerteams hervorgeht?

  • Wie können Entwickler und Designer schnell und unproblematisch Quellcode-Snippets, Design-Überlegungen, Interview-Fragen und andere Markdown-Dokumente miteinander teilen? Besteht die Möglichkeit, diese Dokumente zu durchsuchen, insofern sie nicht geheim angelegt worden?

  • Wie können Nicht-Entwickler (Ingenieure, Fachabteilung, Projektleiter, Marketing, Legal), Änderungen an Design-Dokumenten und Dokumentation ohne Kommandozeilenwissen oder Desktop-Applikationen vorschlagen? Erlaubt die Web-Oberfläche das Hinzufügen, Lö

@jonico
jonico / azure-pipelines.yml
Last active September 14, 2020 04:17
Build and push a docker image into GitHub Package registry and create a tag in GitHub using Azure Pipelines (AZP) yaml files (azure-pipelines.yaml)
resources:
- repo: self
trigger:
- master
steps:
- script: ./cleanup.sh
displayName: Clean Up
@jonico
jonico / deps-with-licenses.graphql
Last active October 2, 2020 21:07
Retrieve dependency graph including licenses
{
repository(owner: "rails", name: "rails") {
nameWithOwner
description
dependencyGraphManifests(withDependencies: true) {
nodes {
filename
dependenciesCount
exceedsMaxSize
parseable
@jonico
jonico / docker-build-publish.yaml
Created August 19, 2019 07:22
Build docker image and push to GPR with GitHub Actions
name: Build and publish Jekyll Docker image for Octocat Generator
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: clean up, docker login && docker build && docker push
@jonico
jonico / search-for-pattern-in-all-repos.sh
Last active March 3, 2021 22:43
Search through all reachable commits in all branches and tags in all repos on GitHub Enterprise Server for a pattern (run it on a backup system)
# Replace the string "Hyrule" with your search pattern - only run on backup system - will take a LOOOONG time to run through
ghe-console -y <<'ENDSCRIPT'
Repository.find_each do |repository|
if repository.active && !repository.empty? then
host,path = GitHub::Routing.lookup_route(repository.nwo)
puts "Processing repo #{repository.nwo} ..."
refs=`git --git-dir=#{path} rev-list --branches --tags | sort | uniq`
refs.each_line do |ref|
if system("git --git-dir=#{path} grep 'Hyrule' #{ref}")
puts "Found pattern in ref #{ref} in repo #{repository.nwo}: "