Skip to content

Instantly share code, notes, and snippets.

@quangthe
quangthe / backup-tienluong-db.py
Created March 21, 2019 07:01
Backup tienluong postgres db app
#! /usr/bin/python
import boto3
import subprocess
import datetime
import os
now = datetime.datetime.now()
bucket = "dtcorpbackup"
filename = "dump_{}-{:0>2}-{:0>2}_{:0>2}:{:0>2}:{:0>2}.sql".format(now.year, now.month, now.day, now.hour, now.minute, now.second)
@quangthe
quangthe / backup-db-and-odoo-files.py
Last active March 22, 2019 03:33
Backup db and odoo files. Odoo 11. Docker
#! /usr/bin/python
import boto3
import subprocess
import datetime
import os
import zipfile
import humanize
WORKING_DIR = "/tmp"
You can ssh into the VM by finding the IP (from kubectl config view) and using username "docker" password "tcuser":
ssh [email protected]
@quangthe
quangthe / introrx.md
Created April 16, 2018 02:45 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'