Skip to content

Instantly share code, notes, and snippets.

---
# Source: mongodb-enterprise-operator/templates/roles.yaml
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: mongodb-enterprise-operator
rules:
- apiGroups:
---
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: my-scram-enabled-replica-set
spec:
type: ReplicaSet
members: 3
# Using a version >= 4.0 will enable SCRAM-SHA-256 authentication
@chatton
chatton / Message.java
Last active February 3, 2018 11:13
Example of how to send a get and post request that works with a Spring Boot application
package ie.gmit.sw.controllers;
/*
POJO class, just needs an empty constructor
and getters and setters.
returned as
{
"name": name,
@chatton
chatton / eliza.go
Created November 5, 2017 16:13
Sample Eliza functionality using regex in Go
package main
import (
"fmt"
"math/rand"
"regexp"
"strings"
"time"
)
@chatton
chatton / SendObjectsOverSockets.java
Created September 26, 2017 15:27
Example of how to send an Object over a Socket in Java.
import java.io.Serializable;
// must implement Serializable in order to be sent
public class Message implements Serializable{
private final String text;
public Message(String text) {
this.text = text;
}
@chatton
chatton / SendStringOverSocket.java
Last active April 16, 2024 08:10
Example of sending a String through a Socket in Java.
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
public class Client {
public static void main(String[] args) throws IOException {
// need host and port, we want to connect to the ServerSocket at port 7777
Socket socket = new Socket("localhost", 7777);
System.out.println("Connected!");