Count connections
select
client_addr,
application_name,
count(pid)
from pg_stat_activity
group by client_addr, application_name
order by count(pid) desc;
Count connections
select
client_addr,
application_name,
count(pid)
from pg_stat_activity
group by client_addr, application_name
order by count(pid) desc;
#!/bin/bash | |
CHAT_ID=<chat_id> | |
BOT_TOKEN=<bot_token> | |
# this 3 checks (if) are not necessary but should be convenient | |
if [ "$1" == "-h" ]; then | |
echo "Usage: `basename $0` \"text message\"" | |
exit 0 | |
fi |
# /etc/netplan/00-installer-config.yaml | |
network: | |
version: 2 | |
renderer: networkd | |
ethernets: | |
eno1: | |
dhcp4: false | |
dhcp6: false | |
addresses: |
__author__ = 'Khiem Doan' | |
__github__ = 'https://github.com/khiemdoan' | |
__email__ = '[email protected]' | |
from datetime import datetime, timedelta | |
from typing import Self | |
from aredis_om import EmbeddedJsonModel as RedisEmbeddedJsonModel | |
from aredis_om import HashModel as RedisHashModel |
Restore postgres database
pg_restore --verbose --clean --no-acl --no-owner --host=localhost --dbname=db_name --username=username latest.dump
Download and use Meslo LG M Regular Nerd Font
"terminal.integrated.fontFamily": "'MesloLGM Nerd Font', 'MesloLGM NF', monospace"
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS | |
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxARElVO | |
U1JHQlxOU0NvbG9yU3BhY2VWJGNsYXNzTxAoMC4wMzkzODA3MzY2NSAwLjE2MDExNjQ2 | |
MzkgMC4xOTgzMzI3NTY4ABABgALSFBUWF1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29s |