Skip to content

Instantly share code, notes, and snippets.

View iamatsundere's full-sized avatar
😒
bleh-inggg

simisimi iamatsundere

😒
bleh-inggg
View GitHub Profile
@iamatsundere
iamatsundere / consul-kv-tool.py
Created March 7, 2023 02:18 — forked from vlinevych/consul-kv-tool.py
Import/export tool for consul key-value storage
#!/usr/bin/env python3
"""
Import/Export tool for Consul Key-Value storage.
If your server has ACL enabled,
be sure to export CONSUL_HTTP_TOKEN env variable or use -t to provide a token
Usage:
Export KV storage decoding values
@iamatsundere
iamatsundere / postgres_queries_and_commands.sql
Created December 5, 2022 07:18 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@iamatsundere
iamatsundere / sample.json
Last active February 2, 2022 16:22
Jerry Parser - Sample JSON input
{
"ObjectType": [
"CAR"
],
"ObjectDescription": [
"This product is a car, great"
],
"ObjectTags": [
"FOO",
"BAR"

Perform Keycloak Export and Import on Kubernetes

  • Setup Keycloak in non-HA mode (replica 1)
  • Disable UserFederation
  • You might have to increase the resource limits to avoid that pod beeing killed by memory or CPU limits

See Keycloak Documentation for more details.

Export

@iamatsundere
iamatsundere / struct.go
Created May 24, 2021 11:06 — forked from jsmouret/struct.go
Convert map[string]interface{} to a google.protobuf.Struct
package pb
import (
"fmt"
"reflect"
st "github.com/golang/protobuf/ptypes/struct"
)
// ToStruct converts a map[string]interface{} to a ptypes.Struct
@iamatsundere
iamatsundere / exercise.tour.go
Created July 6, 2016 02:37 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)