Skip to content

Instantly share code, notes, and snippets.

View binh-bk's full-sized avatar
🤔
One step at a time

Binh Ng. binh-bk

🤔
One step at a time
  • Former R&D researcher at PAMAir.org
  • Hanoi, Vietnam
View GitHub Profile
@binh-bk
binh-bk / script.sh
Created February 5, 2023 05:03 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@binh-bk
binh-bk / django_deploy.md
Created June 29, 2021 02:30 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@binh-bk
binh-bk / sds011
Last active August 9, 2020 06:28 — forked from kadamski/sds011
SDS011 dust sensor reading
#!/usr/bin/python2 # only works with python2.7
# coding=utf-8
'''
forked from A. Adamski's gist: https://gist.github.com/kadamski/92653913a53baf9dd1a8
"DATASHEET": http://cl.ly/ekot
Binh Nguyen, November 2018
adapted from kadamski script with additional features:
1. logging
2. calculate AQI (US)
3. publish to MQTT broker.