This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#expose console from 443 | |
oc create route reencrypt master --service kubernetes --port 443 -n default | |
#nested loops , tags count in IS | |
oc get is --template='{{range $i, $is:=.items}}{{ $total :=0 }}{{ range $index, $element :=$is.status.tags }}{{if eq $element.tag "latest"}}{{$is.metadata.name}}{{"\t"}}{{ $index }}{{end}}{{end}}{{"\n"}}{{end}}' | |
get complex labels | |
oc get nodes --template='{{ with $i := index .items 0 }}{{ index $i.metadata.labels "failure-domain.beta.kubernetes.io/region" }}{{ end }}' | |
#patchin resource limits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Red Hat AMQ Streams | |
### Red Hat AMQ Streams is a massively scalable, distributed, and high performance data streaming platform based on the Apache Kafka® project. AMQ Streams provides an event streaming backbone that allows microservices and other application components to exchange data with extremely high throughput and low latency. | |
### The core capabilities include: | |
* A pub/sub messaging model, similar to a traditional enterprise messaging system, in which application components publish and consume events to/from an ordered stream | |
* The long term, fault-tolerant storage of events | |
* The ability for a consumer to replay streams of events | |
* The ability to partition topics for horizontal scalability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE=`date +%Y-%m-%d-%H:%M` | |
NCOLORS=$(tput colors) | |
if [ $? -eq 0 ] && [ $NCOLORS -gt 0 ]; then | |
BOLD=$(tput bold) | |
RED=$(tput setaf 1) | |
YELLOW=$(tput setaf 3) | |
BLUE=$(tput setaf 6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE=$(date +%Y-%m-%d-%H:%M:%S) | |
function log(){ | |
echo "$DATE INFO $@" | |
return 0 | |
} | |
function panic(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
"strconv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Sources of randomness from the environment include inter-keyboard | |
timings, inter-interrupt timings from some interrupts, and other | |
events which are both non-deterministic and hard for an | |
outside observer to measure. Randomness from these sources are | |
added to an entropy pool, which is mixed using a CRC-like function. | |
As random bytes are mixed into the entropy pool, the routines keep | |
an estimate of how many bits of randomness have been stored into | |
the random number generator internal state. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
For this implementation I'm using third party service for getting random data. | |
*/ | |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------------------------------- | |
# Copyright (c) 2019 LINKIT, The Netherlands. All Rights Reserved. | |
# Author(s): Anthony Potappel | |
# | |
# This software may be modified and distributed under the terms of the | |
# MIT license. See the LICENSE file for details. | |
# -------------------------------------------------------------------- | |
# If you see pwd_unknown showing up, this is why. Re-calibrate your system. | |
PWD ?= pwd_unknown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##################################################################################### | |
## docker-status.sh - Bash script that checks status for docker swarm services and nodes. | |
## Functions: | |
# check_replication - Check if all stacks are running in service. | |
# check_swarm_nodes - Check if all nodes are reacheble and healthy. | |
# check_swarm_services - Check if any of the services failed. | |
##################################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/gorilla/mux" | |
"github.com/gorilla/securecookie" | |
"net/http" | |
) | |
// cookie handling |
NewerOlder