Skip to content

Instantly share code, notes, and snippets.

View making's full-sized avatar

Toshiaki Maki making

View GitHub Profile
variable "subscription_id" {}
variable "tenant_id" {}
variable "client_id" {}
variable "client_secret" {}
variable "location" {}
#!/bin/bash
cat <<EOF > /tmp/gcp-service-account.json
${SERVICE_ACCOUNT}
EOF
gcloud auth activate-service-account --key-file=/tmp/gcp-service-account.json
gcloud config set project ${PROJECT_ID}
gcloud config set compute/region ${REGION}
gcloud config set compute/zone ${ZONE}
params:
tfstate: &tfstate
TF_VAR_region: ((aws_region))
TF_VAR_access_key: ((aws_access_key_id))
TF_VAR_secret_key: ((aws_secret_access_key))
TF_VAR_availability_zones: ((availability_zones))
TF_VAR_env_name: ((env_name))
TF_VAR_dns_suffix: ((dns_suffix))
TF_VAR_rds_instance_count: ((rds_instance_count))
TF_VAR_rds_instance_class: ((rds_instance_class))
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.messaging.rsocket.RSocketRequester;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.net.URI;
mkdir -p src/hello

cat <<EOF > src/hello/HelloHttp.java
package hello;

import com.sun.net.httpserver.HttpServer;

import java.io.OutputStream;
import java.net.InetSocketAddress;
This file has been truncated, but you can view the full file.
package com.example;
import java.util.function.IntSupplier;
// https://openjdk.java.net/jeps/325
public enum DayOfWeek {
MONDAY(6, () -> 0), //
TUESDAY(7, () -> 1), //
WEDNESDAY(9), //
THURSDAY(8), //
@making
making / install-pks-on-azure.md
Last active December 23, 2019 12:04
Install PKS on Azure

Istall PKS on Azure (CLI only)

brew tap starkandwayne/cf
brew install om
brew tap genevieve/tap
brew install az-automation
brew install pivotal/tap/pivnet-cli

git init
package com.example.demorsocketrpc;
@javax.annotation.Generated(
value = "by RSocket RPC proto compiler",
comments = "Source: simple.proto")
@io.rsocket.rpc.annotations.internal.Generated(
type = io.rsocket.rpc.annotations.internal.ResourceType.CLIENT,
idlClass = SimpleService.class)
public final class SimpleServiceClient implements SimpleService {
private final io.rsocket.RSocket rSocket;
#!/bin/bash
set -e
cf login -a ${CF_API} -u ${CF_USERNAME} -p ${CF_PASSWORD} -o ${CF_ORGANIZATION} -s ${CF_SPACE}
set +e
cf rename ${APP_NAME} ${APP_NAME}-venerable
set -e
mv nexus/*.jar ${APP_NAME}.jar
cf push -p ${APP_NAME}.jar -f repo/manifest.yml
cat repo/manifest.yml | ruby -ryaml -e 'app = YAML.load(ARGF)["applications"][0]; app["network_policies"].each { |x| if x["source"] == nil then puts "cf add-network-policy " + app["name"] + " --destination-app " + x["destination"] + " --protocol " + x["protocol"] + " --port " + x["port"].to_s else puts "cf add-network-policy " + x["source"] + " --destination-app " + app["name"] + + " --protocol " + x["protocol"] + " --port " + x["port"].to_s end }' > add-network-policies.sh
bash add-network-policies.sh