Skip to content

Instantly share code, notes, and snippets.

View greatbn's full-sized avatar

Sa Pham greatbn

View GitHub Profile
@greatbn
greatbn / pglogical
Created April 26, 2023 09:50 — forked from edib/pglogical
short tutorial to setup replication using pglogical
Edit /var/lib/postgres/data/postgresql.conf:
# change IP on subscriber
listen_addresses = '*'
wal_level = logical
shared_preload_libraries = 'pglogical'
max_worker_processes = 16
max_wal_senders = 16
max_replication_slots = 16
track_commit_timestamp = on
@greatbn
greatbn / jwtRS256.sh
Created March 30, 2022 07:52 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub

Keybase proof

I hereby claim:

  • I am greatbn on github.
  • I am sapd (https://keybase.io/sapd) on keybase.
  • I have a public key ASDnfveFqHkISnT_Xc6BnknzBqaT7LdwP96mfs8lWH1vhwo

To claim this, I am signing this object:

import gmpy2
import binascii
N = 1552518092300708935148979488462502555256886017116696611139052038026050952686376886330878408828646477971459063658923221258297866648143023058142446317581796810373905913084934869211153276980011573717416472395713363686571638755823503877
e = 3
BS = 32
to_int = lambda text: int(''.join(x.encode('hex') for x in text), 16)
@greatbn
greatbn / send_message.sh
Last active February 22, 2017 14:23 — forked from anonymous/-
Pass vars to json in bash shell
#!/bin/bash
content=`cat b.text`
curl -X POST https://rest.nexmo.com/sms/json -H 'Content-type: application/json' \
-d @<(cat <<EOF
{
"api_key": "xxxxxx",
"api_secret": "xxxxx",
"to": "xxxxxxx",
"from": "NEXMO",
"text": "$content"
for (( i= 1 ; i <= 5; i++))
do
for(( j= 1; j<=5 ;j++))
do
gluster volume create manila-"$i"-"$j" replica 2 glusterfs-1:/manila/manila-"$i"/manila-"$j"/br glusterfs-2:/manila/manila-"$i"/manila-"$j"/br
gluster volume start manila-"$i"-"$j"
done
done
apt-get install xfsprogs -y
pvcreate /dev/sdb
vgcreate myVG /dev/sdb
lvcreate -L 8G -T myVG/thinpool
for ((i = 1;i<= 5; i++ ))
do
mkdir -p /manila/manila-"$i"
for (( j = 1; j<= 5; j++))
do
lvcreate -V "${i}"Gb -T myVG/thinpool -n vol-"$i"-"$j"