Skip to content

Instantly share code, notes, and snippets.

View lucasjellema's full-sized avatar

Lucas Jellema lucasjellema

View GitHub Profile
@lucasjellema
lucasjellema / ociCommandsForCreatingResourcesForOKE.sh
Created October 20, 2018 09:11
This gist provides all OCI CLI calls to prepare the network resources in an OCI compartment that will then allow an OKE Cluster instance to be instantiated
Export the OCID of the root compartment:
export ROOT_COMPARTMENT_ID=ocid1.tenancy.oc1..aaaaaaaaot
Create a new OKE policy in the root compartment of your tenancy:
oci iam policy create --name oke-service --compartment-id $ROOT_COMPARTMENT_ID --statements '[ "allow service OKE to manage all-resources in tenancy"]' --description 'policy for granting rights on OKE to manage cluster resources'
List all policies, to verify the success of the creation:
oci iam policy list --compartment-id $ROOT_COMPARTMENT_ID --all
Now create a special compartment for all OKE resources
#!/bin/bash
# in order to run, first install jq with: sudo apt-get install jq
oci() { docker run --rm --mount type=bind,source=$HOME/.oci,target=/root/.oci stephenpearson/oci-cli:latest "$@"; }
# set global variable OKE_COMPARTMENT_ID with the OCID for the compartment with name passed in $1
set_oke_compartment()
{
echo set_oke_compartments for $1
compartments=$(oci iam compartment list --compartment-id $ROOT_COMPARTMENT_ID --all)
# echo "Compartments: $compartments"
@lucasjellema
lucasjellema / docker-compose.yml
Created May 22, 2018 04:57
Docker Compose file for Apache Kafka, the Confluent Platform (4.1.0) - with Kafka Connect, Kafka Manager, Schema Registry and KSQL (1.0) - assuming a Docker Host accessible at 192.168.188.102
version: '2'
services:
zookeeper:
image: "confluentinc/cp-zookeeper:4.1.0"
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
@lucasjellema
lucasjellema / Vagrantfile
Last active May 26, 2022 05:23
Vagrantfile for creating and running an Ubuntu VM with large disk, preconfigured IP address, provisioned Docker and Docker Compose
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
@lucasjellema
lucasjellema / app.js
Created August 20, 2017 06:42
Oracle JET - Table Filtering with multiselect filter and search field filter (with Node REST API)
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');
@lucasjellema
lucasjellema / oow2017-api-call.js
Created August 10, 2017 06:11
Scraping for Oracle OpenWorld 2017 Session Catalog (well, actually just calling the REST API)
var request = require("request");
var fs = require("fs");
// this options object is constructed based on the network calls the web application at https://events.rainfocus.com/catalog/oracle/oow17/catalogoow17 is making to its backend API
var options = {
method: 'POST',
url: 'https://events.rainfocus.com/api/search',
headers:
{
'cache-control': 'no-cache',
'content-type': 'application/x-www-form-urlencoded'
@lucasjellema
lucasjellema / SourceSelection.vue
Last active December 19, 2018 21:57
Vu2.js 2: Using HTML5 Input plus Data List for auto-suggest entry field. Based on blog article https://medium.com/codingthesmartway-com-blog/vue-js-2-vue-resource-real-world-vue-application-with-external-api-access-c3de83f25c00 that creates simple Vue.js 2 application with content from news api
<template>
<div class="sourceselection">
<div>
<div class="jumbotron">
<h2><span class="glyphicon glyphicon-list-alt"></span>&nbsp;News List</h2>
<h4>Select News Source</h4>
<input v-model="source" list="newssources-list" v-on:input="sourceChanged"
name="source-selection" id="source-selection" class="form-control"
placeholder="Please specify news source ..."/>
<datalist id="newssources-list">