Skip to content

Instantly share code, notes, and snippets.

@issacg
issacg / README.md
Created August 15, 2023 10:22
Bootsrapping run:ai on private GKE cluster...

run:ai bootstrap for GKE

A few notes: This should be run with a user with admin privileges to GKE and to the cluster (kubectl)

I use certmanager to allow LetsEncrypt to manage the HTTPS keypair

  • Make a note of when you use production and when you use staging LetsEncrypt (letsencrypt.yaml line 90)
  • I use a small placeholder HTTPS service (apple service - letsencrypt.yaml line 48) as a placeholder to make cert-manager request the certificate and store it in the kubernetes secret before installing run:ai. You can remove it if not needed
@issacg
issacg / logs.txt
Last active June 12, 2023 12:23
runai-logs
[LOG] initializing Kubernetes client...
[LOG] successfully initialized Kubernetes client
cleaning up previous deployment if it exists...
waiting for all resources to be deleted...
all resources were successfully deleted
deploying runai diagnostics tool...
[TEST] running external cluster tests...
--------------------------------------------------
/*
Copyright 2018 Issac Goldstand
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@issacg
issacg / example-api-gateway-swagger.json
Created November 8, 2017 12:35
Reference code for unsealing a Vault instance using Authy OneTouch push notifications
{
"swagger": "2.0",
"info": {
"version": "2017-11-05T23:36:16Z",
"title": "Vault Unseal API"
},
"host": "myproject.execute-api.us-east-1.amazonaws.com",
"basePath": "/v1",
"schemes": [
"https"
@issacg
issacg / main.go
Created July 3, 2017 14:16
redshift vault driver wip
package main
import (
"github.com/hashicorp/vault/plugins"
)
func main() {
plugins.Serve(New().(*RedShift), nil)
}
@issacg
issacg / binding.gyp
Last active December 13, 2016 16:30
nodejs c++/cli bug
{
"targets": [{
"target_name": "clrtest",
"sources": ["main.cc"],
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
"msvs_settings": {
"VCCLCompilerTool": {
"RuntimeTypeInfo": "true"
C:\Users\issacg\vlt-test2>vault mount -path ca pki
Successfully mounted 'pki' at 'ca'!
C:\Users\issacg\vlt-test2>vault mount -path int pki
Successfully mounted 'pki' at 'int'!
C:\Users\issacg\vlt-test2>vault write ca/root/generate/internal common_name=ca ttl=24h
Key Value
lease_id ca/root/generate/internal/207e3f59-c007-92a5-1c19-a4bdc207142b
lease_duration 86399
@issacg
issacg / vlt-aws2consul.js
Last active February 25, 2016 21:48
Script to replicate vault storage from S3 to consul. Expects consul-agent on localhost:8500 and for AWS credentials to be set via environment/credential file/EC2 role
var _ = require('lodash'),
Promise = require('bluebird'),
consul = require('consul'),
logger = require('log4js').getDefaultLogger(),
AWS = require('aws-sdk');
var bucket = 'my.vault.main',
prefix = '',
region = 'us-west-2',
@issacg
issacg / MyArguments.cs
Last active December 31, 2015 18:09
Override ToString() to allow a custom arguments class created for the CommandLine C# library (http://github.com/gsscoder/commandline) to "reverse" itself back into an argument string. Based on code written at https://github.com/gsscoder/commandline/issues/114 by @issacg and modified to be LINQ-based by @allonhadaya
using System;
using System.Linq;
using CommandLine;
class MyArguments {
// Add some [Option]s here for CommandLine to use
public override string ToString()
{
return string.Concat(this
@issacg
issacg / update-geoip.js
Created November 5, 2013 08:30
Example to update GeoIP (node.js geoip-lite) from commercial DB
// fetches and converts maxmind lite databases
'use strict';
var cp = require('child_process');
var fs = require('fs');
var http = require('http');
var path = require('path');
var url = require('url');
var zlib = require('zlib');