Skip to content

Instantly share code, notes, and snippets.

Avatar

Ville Rantala vjrantal

  • Microsoft
  • Finland
View GitHub Profile
@vjrantal
vjrantal / permissions-for-default-service-account.yaml
Created Aug 6, 2019
Configuration of a privileged role and role binding that allows a test application in a CI to run
View permissions-for-default-service-account.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: privileged-role
rules:
- apiGroups: [""]
resources: ["secrets", "pods", "pods/log", "services"]
verbs: ["get", "watch", "list", "create", "delete"]
- apiGroups: ["batch"]
resources: ["jobs"]
@vjrantal
vjrantal / output.sh
Created Aug 2, 2019
python3.5 command removed from python:3.7.4 image
View output.sh
$ sudo docker run -it python:3.7.3 /bin/bash
Digest: sha256:9e0b4f32487ca1863b45383420b8db77990debae748e2e875d2f86fa9510d4a5
Status: Downloaded newer image for python:3.7.3
root@b669a8b8fe51:/# python3.5
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ sudo docker run -it python:3.7.4 /bin/bash
View test.py
import os
def test_function():
if os.environ.get('SOMETHING_THAT_DOES_NOT_EXIST'):
tail = ''
if tail:
print('Not printed')
test_function()
@vjrantal
vjrantal / adx.csl
Last active May 16, 2019
Update policy sample to expand JSON arrays (note that below payload sample could also be ingested directly using multijson format - see multijson.csl)
View adx.csl
// Create staging table that holds the JSON data as it comes via the Event Hubs.
// If the staging table is not needed, a zero retention policy can be set using:
// https://docs.microsoft.com/en-us/azure/kusto/management/retention-policy#alter-retention-policy
.create table Staging (Data: dynamic)
// Create the table for the expanded messages. See here for an example what kind of input
// could be mapped to a table like this:
// https://gist.github.com/vjrantal/29cd4881a9f65ad803daadabd56c1f68#file-payload-json
.create table Messages (ApplicationUri: string, DisplayName: string, Value: real, NodeId: string, SourceTimestamp: datetime)
@vjrantal
vjrantal / function.json
Last active Aug 29, 2017
Streaming Node.js function
View function.json
{
"bindings": [
{
"type": "blobTrigger",
"name": "input",
"direction": "in",
"dataType": "stream",
"path": "test-input-node/{name}"
},
{
@vjrantal
vjrantal / output.txt
Created Mar 13, 2015
Output from a cordova-parametic run when using the wp8 platform
View output.txt
C:\Users\vjrantal\Software\cordova-paramedic>npm run test-wp8
> cordova-paramedic@0.0.8 test-wp8 C:\Users\vjrantal\Software\cordova-paramedic
> node main.js --platform wp8 --plugin ../spec/testable-plugin/
cordova-paramedic :: checking cordova version
4.3.0
cordova-paramedic :: creating temp project
Creating a new cordova project with name "HelloCordova" and id "io.cordova.hellocordova" at location "C:\Users\vjrantal\Software\cordova-paramedic\tmp"
cordova-paramedic :: installing ../spec/testable-plugin/
@vjrantal
vjrantal / plugin.xml
Last active Aug 29, 2015
Clips from a plugin.xml file
View plugin.xml
<!-- Top level plugin element omitted -->
<engines>
<engine name="cordova" version=">=3.1.0" />
<engine name="cordova-windows8" version=">=3.8.0" />
</engines>
<js-module src="www/AllJoyn.js" name="AllJoyn">
<clobbers target="AllJoyn" />
</js-module>
@vjrantal
vjrantal / npm-run-protractor
Last active Aug 29, 2015
WebDriver example run output of angular-seed tests on Windows Phone
View npm-run-protractor
$ npm run protractor
> angular-seed@0.0.0 preprotractor /Users/vjrantal/Software/angular-seed
> npm run update-webdriver
> angular-seed@0.0.0 preupdate-webdriver /Users/vjrantal/Software/angular-seed
> npm install
npm WARN package.json karma-firefox-launcher@0.1.4 No README data
@vjrantal
vjrantal / karma.conf.js
Created Feb 5, 2015
WebDriver configuration example to run angular-seed tests on Windows Phone
View karma.conf.js
diff --git a/karma.conf.js b/karma.conf.js
index 44bb29f..8d47576 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -15,11 +15,28 @@ module.exports = function(config){
frameworks: ['jasmine'],
- browsers : ['Chrome'],
+ hostname: '10.0.1.2',