Skip to content

Instantly share code, notes, and snippets.

Avatar

Friedrich "Fred" Clausen ftclausen

View GitHub Profile
@ftclausen
ftclausen / jenkins-pipeline-mocks.groovy
Last active Feb 25, 2020
Jenkins pipeline very simple mock steps to test things in a standalone script
View jenkins-pipeline-mocks.groovy
# For a more realistic simulation see https://stackoverflow.com/questions/50165079/mocking-jenkins-pipeline-steps
def readFile( Map args ) {
def file = args.file
def encoding = args.file ?: 'UTF-8'
return new File( file ).text
}
def sh( String command ) {
View list_restic_files.sh
# List all files in all restic snapshots
repo="sftp:example.com:/path/to_repo"
passwd_file="/tmp/pw"
restic -r $repo --password-file $passwd_file snapshots -c | awk '/^[0-9a-f]{8}/ {print $1}' | while read -r snap; do
restic -r $repo --password-file $passwd ls $snap
done
@ftclausen
ftclausen / restic_wrapper.sh
Last active Jun 11, 2019
restic_wrapper.sh
View restic_wrapper.sh
#!/usr/bin/env bash
# Friedrich "Fred" Clausen - ftclausen@gmail.com
source_directories=("/var/tmp/inc_test" "/var/tmp/inc test 2")
remote="sftp:md:tmp/inc_test"
passwd="/tmp/pw"
report_location="/tmp"
log="$(mktemp -t backup_report_)"
sftp_log="$(mktemp)"
@ftclausen
ftclausen / Jenkinsfile
Created Apr 13, 2017
Jenkins pipeline - An approach to get all commits since the last successful build.
View Jenkinsfile
// -*- mode: groovy -*-
// vim: set filetype=groovy :
node( 'some_node' ) {
stage( "Phase 1" ) {
sshagent( credentials: [ 'some_creds' ] ) {
checkout scm
def lastSuccessfulCommit = getLastSuccessfulCommit()
def currentCommit = commitHashForBuild( currentBuild.rawBuild )
if (lastSuccessfulCommit) {
View keybase.md

Keybase proof

I hereby claim:

  • I am ftclausen on github.
  • I am ftclausen (https://keybase.io/ftclausen) on keybase.
  • I have a public key ASAe4Q4yjdm6jeLJIgcWfY6K0pxqWk8vSLROpSyh25g5Vgo

To claim this, I am signing this object:

@ftclausen
ftclausen / khan_academy_recursion_project_l_systems.js
Last active Sep 2, 2016
Attempt at generating an L-System based pythagoras-like tree
View khan_academy_recursion_project_l_systems.js
var maxIterations = 3;
var currentIteration = 0;
var pythagorasTree = function(string, subIteration) {
// Because processing JS does not seem to like default parameters
if (!subIteration) {
currentIteration += 1;
}
if (currentIteration > maxIterations) {
println("Reached max iterations");
View ka_recursion_homework.js
// KA recursion homework assignment. Does a poor man's tunnel animation.
// Also at https://gist.github.com/ftclausen/9d42b2511a82f6d59085e70d204cf5b7
// drawShape() will draw a series of circles, each one
// smaller than the last until we hit a radius of 7 or less
var drawShape = function(x, y, radius) {
// The base case - quit when we have a radius of 7
if (radius <= 7) {
return;
}
View jenkins-windows-slave.log
Connecting to computer.example.com
Checking if Java exists
java -version returned 1.8.0.
Installing the Jenkins slave service
Copying jenkins-slave.exe
Copying slave.jar
Copying jenkins-slave.xml
Registering the service
Starting the service
Waiting for the service to become ready
View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gradle_2.2_versus_2.3_EclipsePlugin.diff
diff --git a/subprojects/ide/src/main/groovy/org/gradle/plugins/ide/eclipse/EclipsePlugin.groovy b/subprojects/ide/src/main/groovy/org/gradle/plugins/ide/eclipse/EclipsePlugin.groovy
index e6356d3..d7eecf7 100644
--- a/subprojects/ide/src/main/groovy/org/gradle/plugins/ide/eclipse/EclipsePlugin.groovy
+++ b/subprojects/ide/src/main/groovy/org/gradle/plugins/ide/eclipse/EclipsePlugin.groovy
@@ -43,7 +43,6 @@ class EclipsePlugin extends IdePlugin {
static final String ECLIPSE_JDT_TASK_NAME = "eclipseJdt"
private final Instantiator instantiator
- EclipseModel model
You can’t perform that action at this time.