Skip to content

Instantly share code, notes, and snippets.

View nhthai2005's full-sized avatar

Thai H. NGUYEN (Bob) nhthai2005

View GitHub Profile
@nhthai2005
nhthai2005 / postgres-cheatsheet.md
Created June 5, 2021 03:46 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@nhthai2005
nhthai2005 / sublimetext_useful_shortcuts_pc.md
Created July 10, 2021 11:34 — forked from twalker/sublimetext_useful_shortcuts_pc.md
A fork of useful sublime text keyboard shortcuts. Using markdown and making more readable from github.

Sublime Text - Useful Shortcuts (linux)

Sublime Text 3 documentation
= Right Mouse Button
= Left Mouse Button
= Shift
= Delete
= Enter
←↑→↓ = Arrow keys

Editing

@nhthai2005
nhthai2005 / README.md
Created August 10, 2021 05:01 — forked from ptflp/README.md
docker tun device into container

Docker tun device into container install openvpn or other soft, which uses tun devices

@nhthai2005
nhthai2005 / kafka-generate-ssl3.sh
Created January 4, 2022 03:43 — forked from anoopl/kafka-generate-ssl3.sh
Create Kafka JKS Keys
#!/bin/bash
#Step 1
#Generate server keystore and client keystore
keytool -keystore kafka.server.keystore.jks -alias localhost -validity 365 -genkey
keytool -keystore kafka.client.keystore.jks -alias localhost -validity 365 -genkey
#Step 2
#Create CA
openssl req -new -x509 -keyout ca-key -out ca-cert -days 365
#Add generated CA to the trust store
keytool -keystore kafka.server.truststore.jks -alias CARoot -import -file ca-cert
@nhthai2005
nhthai2005 / send-an-email-with-curl
Created April 15, 2022 10:24 — forked from rohan-molloy/send-an-email-with-curl
How to use cURL to send an email
curl \
--silent \
--ssl smtp://$SERVER \
--mail-from $FROM \
--mail-rcpt $TO \
--upload-file /dev/stdin \
--user $USER:$PASSWORD
@nhthai2005
nhthai2005 / curl-smtp-email.sh
Last active April 16, 2022 10:08 — forked from james2doyle/curl-smtp-email.sh
Send SMTP email using cURL
curl --connect-timeout 15 -v --insecure "smtp://smtp.example.com:25" -u "username:password" \
--mail-from "[email protected]" --mail-rcpt "[email protected]" \
-T email-contents.txt --ssl