Skip to content

Instantly share code, notes, and snippets.

@ffeldhaus
ffeldhaus / oauth-authentication-powershell.ps1
Last active Oct 16, 2020
Using OAuth 2.0 with PowerShell to authenticate against Google Services
View oauth-authentication-powershell.ps1
# configuration (adapt to your setup!)
$CertFile = "$HOME/certificate.p12"
$CertPassword = "notasecret"
$Project = "myproject"
$ServiceAccountName = "service-account"
$ServiceAccount = "$ServiceAccountName@$Project.iam.gserviceaccount.com"
$Scope = "https://www.googleapis.com/auth/cloud-platform"
$ExpirationSeconds = 3600
# import certificate
@ffeldhaus
ffeldhaus / automl-tables-retrieve-batch-prediction-results.ipynb
Last active May 19, 2020
AutoML Tables retrieve batch prediction results.ipynb
View automl-tables-retrieve-batch-prediction-results.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ffeldhaus
ffeldhaus / automl-tables-retrieve-model-information.ipynb
Created May 8, 2020
AutoML Tables retrieve model information.ipynb
View automl-tables-retrieve-model-information.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ffeldhaus
ffeldhaus / Grafana-Dashboard-StorageGRID.json
Created Nov 24, 2017
Graphana Dashboard for NetApp StorageGRID
View Grafana-Dashboard-StorageGRID.json
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@ffeldhaus
ffeldhaus / ds215j_bootstrap_ng.md
Last active Feb 4, 2021
Bootstrap Synology ds215j using optware-ng
View ds215j_bootstrap_ng.md

Bootstrap the Synology DS215j with optware-ng

I tried the instructions described in the Blogpost Bootstrap DS215j to install optware for ds215j but was unsatisfied with the long outdated packages it provided. Luckily, there now is optware-ng which is a fork of optware and provides recent packages.

This is how I managed to install optware-ng on my Synology ds215j inspired by the instructions in the Gist Boostrap the Synology DS215j with optware, ipkg, and sudo:

Download & Install ipkg in a persistent manner

# become root
sudo -i
@ffeldhaus
ffeldhaus / gist:5013193
Created Feb 22, 2013
rOCCI adding a user defined mixin
View gist:5013193
scheme = 'http://myscheme#'
term = 'myterm'
title = 'mytitle'
attributes = Occi::Core::AttributeProperties.new
related = []
my_mixin = Occi::Core::Mixin.new scheme, term, title, attributes, related
# POST /-/
# Body: Rendering of the mixin
@ffeldhaus
ffeldhaus / gist:4197449
Created Dec 3, 2012
Script for measuring the duration of nova get-vnc-console
View gist:4197449
#!/bin/bash
# first parameter is the ID of a nova instance
# second parameter may be the amount of runs
count=${2:-100}
timefile=/tmp/vnctime.out
fmt="%e"
# mv out file to old
@ffeldhaus
ffeldhaus / gist:4018052
Created Nov 5, 2012
rOCCI parse text plain message
View gist:4018052
1.9.3p286 :001 > body=%Q|Category: storage;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind"
1.9.3p286 :002"> Category: storage;scheme="http://opennebula.org/occi/infrastructure#";class="mixin"
1.9.3p286 :003"> X-OCCI-Attribute: occi.core.id="e7db6669-d819-5e20-a7ee-90be46591490"
1.9.3p286 :004"> X-OCCI-Attribute: occi.core.title="debian6"
1.9.3p286 :005"> X-OCCI-Attribute: occi.core.summary="Debian6 sample image"
1.9.3p286 :006"> X-OCCI-Attribute: occi.storage.state="online"
1.9.3p286 :007"> X-OCCI-Attribute: org.opennebula.storage.id="31"
1.9.3p286 :008"> X-OCCI-Attribute: org.opennebula.storage.type="OS"
1.9.3p286 :009"> X-OCCI-Attribute: org.opennebula.storage.dev_prefix="xvd"
1.9.3p286 :010"> X-OCCI-Attribute: org.opennebula.storage.bus="ide"
@ffeldhaus
ffeldhaus / gist:3861740
Created Oct 9, 2012
rOCCI awesomeness
View gist:3861740
irb -I lib/
1.9.3p194 :001 > require 'occi'
=> true
1.9.3p194 :002 > network=Occi::Core::Entity.new 'http://schemas.ogf.org/occi/infrastructure#network'
=> {
"kind": "http://schemas.ogf.org/occi/infrastructure#network"
}
1.9.3p194 :003 > network.class
=> Occi::Infrastructure::Network
1.9.3p194 :004 > network.class.superclass
@ffeldhaus
ffeldhaus / gist:3821245
Created Oct 2, 2012
rOCCI 3.0 alpha example
View gist:3821245
1.9.3p194 :001 > require 'occi'
=> true
1.9.3p194 :002 > compute=Occi::Core::Entity.new 'http://schemas.ogf.org/occi/infrastructure#compute'
http://schemas.ogf.org/occi/infrastructure
=> {
"kind": "http://schemas.ogf.org/occi/infrastructure#compute"
}
1.9.3p194 :003 > compute.cores=5
=> 5
1.9.3p194 :004 > compute