Skip to content

Instantly share code, notes, and snippets.

@michaelfung
michaelfung / skyhm-del-acct.md
Last active September 21, 2022 04:14
Spec for delete HU account

Delete User Account API

Request

  • URL: /ext/del_account

  • Method: POST

  • Parameters:

@michaelfung
michaelfung / unhand.t
Created September 14, 2021 04:50
test case for unhandled promise warning
use Mojo::Base -strict, -async_await;
use Test::More;
use Test::Mojo;
use Mojolicious::Lite;
# this gives unhandled promise warning:
helper get_site_title => async sub {
my ($c, $url) = @_;
my $result = (await $c->ua->get_p($url))->result;
@michaelfung
michaelfung / nginx-proxy-to-alertmanager.yaml
Created July 15, 2021 08:07 — forked from Lirt/nginx-proxy-to-alertmanager.yaml
Nginx proxy for basic-auth from Loki to AlertManager
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-proxy-to-alertmanager
namespace: kube-system
labels:
app: nginx-proxy-to-alertmanager
group: monitoring
component: loki
@michaelfung
michaelfung / perl-debian-dockerfile
Last active November 14, 2020 05:48
perl container builder
# build a perlbrew enabled image
# example: docker build -t perl .
FROM debian:buster AS devel
MAINTAINER "Michael Fung <hkuser2001@gmail.com>"
ARG PERLVER="5.28.3"
ENV DEBIAN_FRONTEND noninteractive
@michaelfung
michaelfung / rebuild-perl-nothread-alpine.md
Created October 29, 2020 04:07
Build a non-thread Perl package for Alpine Linux

Requirement

Use a docker alpine image for quicker setup.

For example using alpine 3.12:

docker create --name abuilder alpine:312 /bin/sh

Then, whenever we nned to build, enter its shell by:

@michaelfung
michaelfung / gist:02c536829a3090a8a327c3bc64c28047
Created December 10, 2018 10:27
sample AOG sync response
{
"requestId": "15946482113084176451",
"payload": {
"agentUserId": "160170",
"devices": [
{
"customData": {
"version": "_UNDEFINED_",
"model": "HU2",
"key": "sample_key_ext"
@michaelfung
michaelfung / envoy-grafana-dashboard.json
Created August 31, 2018 07:22
Grafana dashboard for Envoy Proxy
{
"__inputs": [
{
"name": "DS_PROMETHEUS-U1710",
"label": "prometheus-u1710",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@michaelfung
michaelfung / envoy.yaml
Last active May 12, 2019 06:11
Envoy sample configuration
static_resources:
listeners:
- address:
socket_address:
address: 10.1.1.8
port_value: 443
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
@michaelfung
michaelfung / grafana-vmq-dashboard.json
Last active August 26, 2018 06:11
Grafana Dashboard for VerneMQ
{
"__inputs": [
{
"name": "DS_PROMETHEUS-U1710",
"label": "prometheus-u1710",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}