Skip to content

Instantly share code, notes, and snippets.

@HungUnicorn
HungUnicorn / one_line_port_forward.sh
Created May 14, 2020 13:24
kubectl port-forward to pod name one liner
kubectl -n istio-system port-forward \
$(kubectl -n istio-system get pod -l app=kiali -o jsonpath='{.items[0].metadata.name}') 20001:20001
@HungUnicorn
HungUnicorn / summary.txt
Created April 22, 2020 08:06
docker best practices
## Incremental build time
#### Order your steps from least to most frequently changing steps to optimize caching
#### When copying files into your image, make sure you are very specific about what you want to copy. Any changes to the files being copied will break the cache
#### You always want to update the index and install packages in the same RUN: they form together one cacheable unit. Otherwise you risk installing outdated packages.
## Reduce image size
#### Apt has the –no-install-recommends flag which ensures that dependencies that were not actually needed are not installed
@HungUnicorn
HungUnicorn / debug k8s
Created December 12, 2019 11:42
debug k8s
https://learnk8s.io/a/troubleshooting-kubernetes.pdf
@HungUnicorn
HungUnicorn / log-format
Created October 23, 2019 13:32
python log format
'%(asctime)s %(levelname)s %(filename)s %(funcName)20s: %(message)s'
@HungUnicorn
HungUnicorn / jira-tickets-done-by-me
Created October 22, 2019 15:07
Show all the jira tickets done by me
statusCategory = Done and reporter = currentUser() order by updated DESC
@HungUnicorn
HungUnicorn / all_metrics_by_label.txt
Created July 19, 2019 09:19
Show all metrics by label. Very useful if not knowing what metrics are there
{__name__=~".+",app="cp-ksql-server"}
@HungUnicorn
HungUnicorn / JsonIntoRow.java
Last active December 8, 2017 10:18
Exception in thread "main" org.apache.flink.table.api.TableException: An input of GenericTypeInfo<Row> cannot be converted to Table. Please specify the type of the input with a RowTypeInfo.
public class JsonIntoRow implements FlatMapFunction<JsonNode, Row> {
private TypeInformation<Row> typeInfo;
private static JsonRowDeserializationSchema deserializationSchema;
public JsonIntoRow(TypeInformation<Row> typeInfo){
this.typeInfo = typeInfo;
}
@Override
public void flatMap(JsonNode value, Collector<Row> out) throws Exception {
@HungUnicorn
HungUnicorn / gist:34d81851d5b731cf3da6
Last active July 22, 2019 07:57 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch