Skip to content

Instantly share code, notes, and snippets.

View a8uhnf's full-sized avatar
🎯
Focusing

Abu Hanifa a8uhnf

🎯
Focusing
View GitHub Profile
@a8uhnf
a8uhnf / postgres_queries_and_commands.sql
Created June 10, 2022 09:13 — 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%'
#!/bin/bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
#!/bin/bash
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# ipsec.conf
conn aws-to-gcp
authby=psk
auto=start
dpdaction=hold
esp=aes128-sha1-modp2048! #Phase 2 Encryption algos
forceencaps=yes
ike=aes128-sha1-modp2048!
keyexchange=ikev2
mobike=no
@a8uhnf
a8uhnf / grpc_init.sh
Created June 7, 2018 20:58
install protoc include go_grpc_gateway, go_grpc_swagger etc
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-server-conf
labels:
name: prometheus-server-conf
namespace: monitoring
data:
prometheus.yml: |-
global: