Skip to content

Instantly share code, notes, and snippets.

View hoangddt's full-sized avatar

Hoang Truong hoangddt

View GitHub Profile
@hoangddt
hoangddt / main.go
Created January 8, 2018 02:50 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@hoangddt
hoangddt / fibo.py
Created January 5, 2018 04:33
Fibonacci implementation in python as Genarator
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 October 13, 2017 07:58 — forked from joelio/ubuntu-installer-remote.ipxe
Ubuntu 16.04 netboot installer via 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 November 18, 2017 15:30
Install HTS HTK
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 August 14, 2017 18:49 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

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 07:21
Great, funny quote
Join the Navy; sail to far-off exotic lands, meet exciting interesting people,and kill them.
/*
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)
@hoangddt
hoangddt / fix.sh
Last active September 18, 2016 13:20
fix python 3 pyconfig.h: No such file or directory #include "pyconfig.h"
sudo apt-get install python3-dev
# libgcrypt11
# https://launchpadlibrarian.net/201289896/libgcrypt11_1.5.3-2ubuntu4.2_amd64.deb
@hoangddt
hoangddt / README.md
Created April 26, 2016 17:44 — forked from mpj/README.md
REALLY quick and dirty static file dev server

Usage

node dirtyserve.js

The point your browser to

http://localhost:3000/myfile.xxx

and the server will try to serve that file from the local server.

@hoangddt
hoangddt / install.sh
Created April 26, 2016 13:44
Install 32-bit versions of the C and C++ libraries a 64-bit machine. Fix error not found C and C++ standard library
# Ubuntu
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib
# source: http://web.cecs.pdx.edu/~kstew2/cs333/blitz-guide.md