Skip to content

Instantly share code, notes, and snippets.

View rnkoaa's full-sized avatar

Richard Agyei rnkoaa

View GitHub Profile
.PHONY: generate-ssh vagrant-stretch base clean-playbooks
ENV_PROFILE ?= dev
TARGET_HOST ?= dev
NODE_PORT := $(shell vagrant port stretch --guest 22)
PRIVATE_KEY := .vagrant/machines/stretch/virtualbox/private_key
PLAYBOOKS := playbooks
ENV_FILE=.env
ENV_VARS=`cat $(ENV_FILE)`
INVENTORY := environments/${ENV_PROFILE}/hosts
# either environment variables or kubestorage
inside the container:
ip route show | awk '/default/ {print $3}'
route | awk '/^default/ { print $2 }'
This gives the default docker0 bride to the host and can be used to communicate to the host
route | awk '/^default/ { print $2 }'
vagrant ubuntu stretch (with network ip) get ip address on eth1
ip addr show eth1 | grep "inet " | cut -d: -f2 | awk '{print $2}'
@Bean
public OkHttpClient okHttpClient() {
return new OkHttpClient();
}
@Bean
public MinioClient minioClient(@Value("${minio.server.url}") String minioServerUrl,
@Value("${minio.server.access.key}") String accessKey,
@Value("${minio.server.secret.key}") String secretKey) throws InvalidPortException, InvalidEndpointException {
# Kill all ssh-agent processes
ps -ef | grep ssh-agent | awk '{print $2}' | xargs kill -9
@rnkoaa
rnkoaa / MainApplication.java
Last active August 11, 2018 21:17
Sample Caffeine Cache application.
package com.amoako;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.google.common.collect.Lists;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class MainApplication {
@rnkoaa
rnkoaa / AdditionalCamelTest.java
Last active September 9, 2020 09:40
Testing Camel Routes in Spring boot 2 with camel 2.22.0
@RunWith(CamelSpringBootRunner.class)
@SpringBootTest
@MockEndpoints
public class MyRouteTest2 {
@Autowired
private ProducerTemplate producerTemplate;
@EndpointInject(uri = "mock:file:out")
private MockEndpoint mockCamel;
@SpringBootApplication
public class FirestoreReactiveApplication {
public static void main(String[] args) {
SpringApplication.run(FirestoreReactiveApplication.class, args);
}
@Bean
public Firestore firestore() throws IOException {
movement
--------
0 - beginning of line
^ - beginning of non-whitespace
$ - end of line
9j - move down 9 lines
w - move forward by word
b - move backward by word
gg - first line
G - last line
^(https|git|ssh)(:\/\/|@)([^\/:]+)[\/:]([^\/:]+)\/(.+)(.git)?$
@rnkoaa
rnkoaa / main.go
Created April 6, 2019 21:04
Go checksum of files
package main
import (
"bytes"
"crypto/sha256"
"encoding/gob"
"fmt"
"log"
)