Skip to content

Instantly share code, notes, and snippets.

View jonico's full-sized avatar
🚀
@ home

Johannes Nicolai jonico

🚀
@ home
View GitHub Profile
#!/usr/bin/env groovy
/**
* groovy script to migrate (export) GitHub.com repositories to GitHub Enterprise
*
* Automates steps in https://github.com/blog/2171-migrate-your-repositories-using-ghe-migrator
*
* Run 'groovy MigrateRepositories.groovy' to see the list of command line options
*
* First run may take some time as required dependencies have to get downloaded, then it should be quite fast
#!/bin/bash
repoSize=`du -hsk | cut -f 1`
if [ $repoSize -gt "1500" ]; then
echo "Repository size is greater than 1500 kb : ${repoSize}"
exit 1
fi
@jonico
jonico / evaluate.groovy
Last active January 1, 2017 19:13
Evaluation script for InformatiCup2017 submissions
import java.io.File
categories = ["DEV", "HW", "OTHER", "EDU", "WEB", "DATA", "DOCS"] as Set
def readInDataSet (dataSetName, categoryToRepo, repositories) {
categories.each {
categoryToRepo[it]= [] as Set
}
count = 1;
@jonico
jonico / ggg-ideas-for-constellation.md
Created August 28, 2017 12:14
GGG Ideas for constellations Munich
  • feedback geo-mirroring & hot patching
  • GGG requirements letter
  • conan.io
@jonico
jonico / PrintRepoAccess.groovy
Created January 15, 2017 14:59
Who can access a given repo on a GitHub Enterprise instance?
#!/usr/bin/env groovy
/**
* groovy script to show all users that can access a given repository in a GitHub Enterprise instance
*
*
* Run 'groovy PrintRepoAccess.groovy' to see the list of command line options
*
* First run may take some time as required dependencies have to get downloaded, then it should be quite fast
*
#!/usr/bin/env groovy
package org.kohsuke.github
@Grab(group='org.kohsuke', module='github-api', version='1.75')
import org.kohsuke.github.GitHub
class ListUsersInOrganizations extends GitHub {
static void main(args) {
#!/usr/bin/env groovy
package org.kohsuke.github
@Grab(group='org.kohsuke', module='github-api', version='1.75')
import org.kohsuke.github.GitHub
class ListUsersInOrg extends GitHub {
static void main(args) {
#!/usr/bin/env groovy
// run with groovy ListReposInOrg -t <personal access token> <org name>
package org.kohsuke.github
@Grab(group='org.kohsuke', module='github-api', version='1.75')
import org.kohsuke.github.GitHub
class ListReposInOrg extends GitHub {
@jonico
jonico / diff-branches-client.sh
Last active September 4, 2018 08:03
Example how to compute diffs of more than 300 files between branches/commits/tags server side using a pre-receive hook in GitHub Enterprise
#!/usr/bin/env bash
# Client side script to trigger pre-receive hook and scan its output
# usage: diff-branches-client.sh <repo URL> <compare branch> [base branch] [magic trigger branch]
# Examples:
# diff-branches.client.sh https://jonico@octodemo.com/jonico/large-branch-diff-with-prereceive-hook.git compare-branch feature-branch # diffs compare-branch with feature branch
# diff-branches.client.sh https://jonico@octodemo.com/jonico/large-branch-diff-with-prereceive-hook.git compare-branch # diffs compare-branch with master
# diff-branches.client.sh https://jonico@octodemo.com/jonico/large-branch-diff-with-prereceive-hook.git f75b18abbb06 f75b18abbb06^1 # diffs commit f75b18abbb06 with its parent
# diff-branches.client.sh https://jonico@octodemo.com/jonico/large-branch-diff-with-prereceive-hook.git master master~2 # diffs latest commit on master with its grandparent
@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>