Skip to content

Instantly share code, notes, and snippets.

View lordofthejars's full-sized avatar
🏠
Working from home

Alex Soto lordofthejars

🏠
Working from home
View GitHub Profile
import javax.ejb.Stateless;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@Stateless
@Path("/sample")
public class SampleController {
@GET
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
connectionpool=50
url=jdbc:h2:~/test
oc run cockroachdb -it --image=cockroachdb/cockroach --rm --restart=Never -- sql --insecure --host=cockroachdb-public
CREATE USER myuser;
CREATE DATABASE customers;
GRANT ALL ON DATABASE customers TO myuser;
operator-sdk add api --api-version=hello.lordofthejars.com/v1alpha1 --kind=Hello
apiVersion: apps/v1
kind: Deployment
metadata:
name: registry-deployment
spec:
replicas: 1
selector:
matchLabels:
app: registry-demo
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea-deployment
spec:
replicas: 1
selector:
matchLabels:
app: gitea-demo
template:
oc login https://api.starter-us-east-1.openshift.com --token=xxxxxxx
oc new-project villains
oc new-app lordofthejars/crimes:1.0 --name crimes
oc expose svc crimes --name=crimeswelcome
oc import-image crimes:1.1 --from=lordofthejars/crimes:1.1
oc patch dc/crimes -p '{"spec": { "triggers":[ {"type": "ConfigChange", "type": "ImageChange" , "imageChangeParams": {"automatic": true, "containerNames":["crimes"],"from": {"name":"crimes:1.1"}}}]}}'
oc rollout latest dc/crimes
oc describe dc crimes
apiVersion: batch/v1
kind: Job
metadata:
name: cluster-init
labels:
app: cockroachdb
spec:
template:
spec:
containers:
@Test
public void test() {
String initialValue = System.getProperty("MY_PROPERTY");
try {
System.setProperty("MY_PROPERTY", "myNewValue");
// Test
} finally {
if (initialValue != null) {
System.setProperty("MY_PROPERTY", initialValue);
}