Skip to content

Instantly share code, notes, and snippets.

View nutzhub's full-sized avatar
🎯
Focusing

Pradit Rattanapongchinda nutzhub

🎯
Focusing
  • Omise
  • Bangkok Thailand
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="fb83630e-6cdb-4018-8e10-6d4aad0c89f7" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/datavault/kafkastream/src/main/java/com/omise/bi/datavault/kafkastream/processor/impl/SatPaymentBackendTrackingProcessor.java" beforeDir="false" afterPath="$PROJECT_DIR$/datavault/kafkastream/src/main/java/com/omise/bi/datavault/kafkastream/processor/impl/SatPaymentBackendTrackingProcessor.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/dv_stream_processor_gen.py" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/dv_stream_processor_gen.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/requirements.txt" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/requirements.txt" afterDir="false" />
@nutzhub
nutzhub / values.yaml
Created February 3, 2020 08:43 — forked from l13t/values.yaml
alertmanager alerts to slack for prometheus-operator
.......some config.....
alertmanager:
## Deploy alertmanager
##
enabled: true
## Service account for Alertmanager to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
# https://gist.github.com/prwhite/8168133
# colour vars
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
help: ## This help dialog.
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \
# HELP jmx_config_reload_failure_total Number of times configuration have failed to be reloaded.
# TYPE jmx_config_reload_failure_total counter
jmx_config_reload_failure_total 0.0
# HELP metrics_jvm_threads_new_count_value Attribute exposed for management (metrics<name=jvm.threads.new.count><>Value)
# TYPE metrics_jvm_threads_new_count_value untyped
metrics_jvm_threads_new_count_value 0.0
# HELP metrics_sdc_pipeline_cscdsmdccdcstagec3161e2a_52f0_49a9_8d89_c33465672f69_0_stage_kafkaproducer_01_errorrecords_histogramm5_99thpercentile Attribute exposed for management (metrics<name=sdc.pipeline.cscdsmdccdcstagec3161e2a-52f0-49a9-8d89-c33465672f69.0.stage.KafkaProducer_01.errorRecords.histogramM5><>99thPercentile)
# TYPE metrics_sdc_pipeline_cscdsmdccdcstagec3161e2a_52f0_49a9_8d89_c33465672f69_0_stage_kafkaproducer_01_errorrecords_histogramm5_99thpercentile untyped
metrics_sdc_pipeline_cscdsmdccdcstagec3161e2a_52f0_49a9_8d89_c33465672f69_0_stage_kafkaproducer_01_errorrecords_histogramm5_99thpercentile 0.0
FROM python:3.6-alpine3.6
RUN apk update
RUN apk upgrade
RUN apk add --no-cache git openssh curl
ENV WORK_ENV=DEV
COPY . /api
WORKDIR /api
ADD run.py .
ADD requirements.txt .
@nutzhub
nutzhub / clean-up-boot-partition-ubuntu.md
Created February 12, 2019 14:18 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@nutzhub
nutzhub / boto3-sts
Last active January 16, 2019 08:08
snippet to use sts (temporary credential) to call boto3 api in your machine
#!/usr/bin/env python
import gzip
import io
import boto3
import json
from botocore.exceptions import ClientError
class STS(object):
"""
kstream-demo-66469f7cd5-s85k4 kstream + '[' x = xtrue ']'
kstream-demo-66469f7cd5-s85k4 kstream + exec /docker-java-home/bin/java -Xmx256M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -javaagent:/java/datadog/dd-java-agent.jar -Ddd.service.name=ingressevent-stream -Ddd.agent.host= -Ddd.agent.port= -cp /java/kafka/kafka-streams-demo-1.0-SNAPSHOT-jar-with-dependencies.jar -Dloggly.api_tokens=xxxxxx com.wowbox.datalake.kafka.streams.IngressEventApp --bootstrapServers kafka-0.kafka-headless:9092,kafka-1.kafka-headless:9092,kafka-2.kafka-headless:9092 --topic wowbox-event-test --schemaRegistryUrl http://ignorance-host:8080
kstream-demo-66469f7cd5-s85k4 kstream Exception in thread "main" java.lang.reflect.InvocationTargetException
kstream-demo-66469f7cd5-s85k4 kstream at sun.reflect.NativeMethodAcces
{"0":{"topic":"wowbox","partition":0,"message":{"key":1495090367172,"value":"{\"event\":\"client:card:click\",\"properties\":{\"properties_networkStatus\":\"OFFLINE\",\"properties_page\":\"index\",\"properties_google_play_services\":\"available\",\"organization_id\":4,\"device_device_id\":\"f9ca7c01f92b9b4f\",\"device_device_model\":\"Samsung SM-G532F\",\"device_android_version\":\"6.0.1\",\"client_version\":20602,\"client_api_version\":4,\"client_android_version\":\"6.0.1\",\"client_name\":\"Android\",\"experiments_0_name\":\"default\",\"experiments_0_scenarios_0_name\":\"default\",\"experiments_0_scenarios_0_percentage\":100,\"batch_id\":\"2017/05/18/06-52-07.ip-10-87-3-56.txt\",\"card_id\":19458,\"card_name\":\"Aquarius and Libra Compatibility!: Horoscope\",\"card_type\":\"Lifestyle\",\"card_organization_id\":4,\"card_available_from\":\"2017-05-12T05:40:48.000Z\",\"card_available_to\":\"2017-05-19T05:40:00.000Z\",\"card_priority\":4421,\"card_api_version\":1,\"card_subcategory\":\"Horoscope\",\"card_tokens
#!/bin/bash
# Error handling
function OwnError()
{
echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)"
exit $2
}
# Repository for rethinkdb