Skip to content

Instantly share code, notes, and snippets.

Quoc Hoang hoangddt

Block or report user

Report or block hoangddt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hoangddt
hoangddt / tif_to_python.py
Last active Jul 20, 2018
Convert image in .tif to png
View tif_to_python.py
import sys
import os
from PIL import Image
def get_filename(filepath):
filename = os.path.basename(filepath)
filename, file_extension = os.path.splitext(filename)
return filename
def convert_to_png(filepath):
View sql-mongo_comparison.md

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@hoangddt
hoangddt / mysql-docker.sh
Created Mar 28, 2018 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@hoangddt
hoangddt / main.go
Created Jan 8, 2018 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@hoangddt
hoangddt / fibo.py
Created Jan 5, 2018
Fibonacci implementation in python as Genarator
View fibo.py
def fib():
a = 0
b = 0
while True:
if b == 0:
yield 1
b = 1
continue
a, b = b, a + b
yield b
@hoangddt
hoangddt / ubuntu-installer-remote.ipxe
Created Oct 13, 2017 — forked from joelio/ubuntu-installer-remote.ipxe
Ubuntu 16.04 netboot installer via iPXE
View ubuntu-installer-remote.ipxe
#!ipxe
dhcp net0
# Figure out if client is 64-bit capable
cpuid --ext 29 && set arch x64 || set arch x86
echo Starting Ubuntu Xenial installer for ${mac}
set mirror http://archive.ubuntu.com
set release xenial
set base-url ${mirror}/ubuntu/dists/${release}/main/installer-${arch}/current/images/netboot/ubuntu-installer/${arch}
@hoangddt
hoangddt / install.sh
Last active Nov 18, 2017
Install HTS HTK
View install.sh
sudo apt-get install build-essential
sudo apt-get install libx11-dev:i386
sudo apt install g++-multilib
cd htk
cp ../HTS-2.3_for_HTK-3.4.1/HTS-2.3_for_HTK-3.4.1.patch .
sudo apt-get install libx11-dev
./configure CFLAGS="-DARCH=linux"
make all
sudo make install
@hoangddt
hoangddt / _INSTALL.md
Created Aug 14, 2017 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)
View _INSTALL.md

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@hoangddt
hoangddt / quotes.txt
Created May 16, 2017
Great, funny quote
View quotes.txt
Join the Navy; sail to far-off exotic lands, meet exciting interesting people,and kill them.
View gulpfile.js
/*
This is an EXAMPLE gulpfile.js
You'll want to change it to match your project.
Find plugins at https://npmjs.org/browse/keyword/gulpplugin
*/
var gulp = require('gulp');
var uglify = require('gulp-uglify');
gulp.task('scripts', function() {
// Minify and copy all JavaScript (except vendor scripts)
You can’t perform that action at this time.