This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pool = { | |
connectionString: `postgres://${DATABASE_USER || "kw"}:${DATABASE_PW || "1234"}@${DATABASE_URL || "localhost"}/${DATABASE_NAME || "DBNAME"}`, | |
max: 1, | |
}; | |
export var client; | |
const postgresDBConnect = () => { | |
const startedAt = new Date().getTime(); | |
client = new Client(pool); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Upgrading PostgreSQL to a major version in Archlinux | |
``` | |
# pacman -S postgresql-old-upgrade | |
# systemctl stop postgresql.service | |
``` | |
``` | |
# mv /var/lib/postgres/data /var/lib/postgres/olddata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IPT="/sbin/iptables" | |
# Set default policies for all three default chains | |
$IPT -P INPUT ACCEPT | |
$IPT -P FORWARD ACCEPT | |
$IPT -P OUTPUT ACCEPT | |
# Flush old rules, old custom tables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Typescript React Function Component": { | |
"prefix": "fc", | |
"body": [ | |
"import { FC } from 'react'", | |
"", | |
"interface ${TM_FILENAME_BASE}Props {", | |
" $1", | |
"}", | |
"", | |
"const $TM_FILENAME_BASE: FC<${TM_FILENAME_BASE}Props> = ({$2}) => {", |