Skip to content

Instantly share code, notes, and snippets.

View sshaaf's full-sized avatar
💭
!AlwaysOn

Syed M Shaaf sshaaf

💭
!AlwaysOn
View GitHub Profile
import java.math.BigInteger;
import java.util.concurrent.StructuredTaskScope;
public class ScopedValue21 {
private static final ScopedValue<BigInteger> multiplier = ScopedValue.newInstance();
public static void main(String[] args) throws Exception {
If you have already tried something like the following:
oc delete project dev --force --grace-period=0
#Most likely Kube is set in the finalizer which does not let the namespace to be removed. here is one way to do it.
kubectl get ns PROJECTNAME -o json > tmp.json
vi tmp.json
#Make sure finalizers are empty as follows
```
@sshaaf
sshaaf / LoadAndRun.py
Created November 30, 2021 14:38
Loads a mock json file(not array), reads line by line, and send it to server on a particular end-point
# python request json data loaded from a file
import requests
# reads 1 line at a time, this is not an array
file1 = open('MOCK_DATA.json', 'r')
Lines = file1.readlines()
header = {
'Content-Type': 'application/json'
@sshaaf
sshaaf / sugh.sh
Created September 29, 2021 13:54 — forked from erdincay/sugh.sh
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then
@sshaaf
sshaaf / GameResource.java
Created May 26, 2021 09:05
Quarkus DG8.2 Client
package org.acme.rest.json;
import io.quarkus.infinispan.client.Remote;
import io.reactivex.Observable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.infinispan.client.hotrod.RemoteCache;
import java.util.ArrayList;
import java.util.HashSet;
@sshaaf
sshaaf / CR
Last active May 21, 2021 13:33
Infinispan monitoring CR setup
apiVersion: infinispan.org/v1
kind: Infinispan
metadata:
annotations:
infinispan.org/monitoring: 'true'
infinispan.org/operatorPodTargetLabels: >-
com.redhat.component-name,com.redhat.component-type,com.redhat.component-version,com.redhat.product-name,com.redhat.product-version
selfLink: /apis/infinispan.org/v1/namespaces/atest/infinispans/example-infinispan
resourceVersion: '1195423'
name: example-infinispan
@sshaaf
sshaaf / Kafka setup erdemo
Last active April 1, 2021 19:53
Setting up Kafka and..
# starting the server
kafka_2.12-2.1.1> bin/zookeeper-server-start.sh config/zookeeper.properties
kafka_2.12-2.1.1> bin/kafka-server-start.sh config/server.properties
# Adding topics
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-mission-event
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-mission-command
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-responder-location-update
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-incident-event
#!/bin/bash
docker run -it -p 8080:8080 -v $(pwd):/app-data --entrypoint /bin/bash \
-e MASTER_URL=http://your.master.com:1111 \
-e CONSOLE_URL=http://your.console.url.com:2222 \
-e CHE_URL=http://codeready.url.com:3333 -e RHAMT_URL=http://foo -e CHE_USER_PASSWORD='password' \
-e KEYCLOAK_URL=http://keycloak.url.com:4444 \
-e ROUTE_SUBDOMAIN=apps.yoursubdomain.com \
-e CONTENT_URL_PREFIX="file:///app-data/" \
-e WORKSHOPS_URLS="file:///app-data/_cloud-native-workshop-module3.yml" \
# Created by https://www.gitignore.io/api/node,java,maven
# Edit at https://www.gitignore.io/?templates=node,java,maven
### Java ###
# Compiled class file
*.class
# Log file
*.log