Skip to content

Instantly share code, notes, and snippets.

View thuvh's full-sized avatar
😀
hello world

Hoai-Thu Vuong thuvh

😀
hello world
View GitHub Profile
@thuvh
thuvh / letsencrypt_2020.md
Created April 16, 2021 03:50 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@thuvh
thuvh / postman.desktop
Created April 9, 2021 07:36 — forked from hauthorn/postman.desktop
Postman desktop entry
[Desktop Entry]
Categories=Development;
Comment=Supercharge your API workflow
Exec="/home/hauthorn/Programs/Postman/Postman"
Icon=/home/hauthorn/Programs/Postman/app/resources/app/assets/icon.png
Name=Postman
Terminal=false
Type=Application
Version=1.0
@thuvh
thuvh / telegramdesktop.desktop
Created April 9, 2021 02:55 — forked from bobby1030/telegramdesktop.desktop
Telegram Desktop Entry
[Desktop Entry]
Version=1.0
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
TryExec=/opt/Telegram/Telegram
Exec=/opt/Telegram/Telegram -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
thuvh ALL=(ALL) NOPASSWD: ALL
@thuvh
thuvh / SSL-certs-OSX.md
Created August 10, 2019 09:59 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@thuvh
thuvh / hive_druid_integration.md
Last active July 4, 2019 10:45 — forked from rajkrrsingh/hive_druid_integration.md
hive druid integration : quick test to create druid table from hive table
generate data for hive table
echo "generating sample data for hive table"
echo {-1..-181451}hours | xargs -n1 date +"%Y-%m-%d %H:%M:%S" -d >> /tmp/dates.data
echo {-1..-18145}minutes | xargs -n1 date +"%Y-%m-%d %H:%M:%S" -d >> /tmp/dates.data
echo {-1..-1825}days | xargs -n1 date +"%Y-%m-%d %H:%M:%S" -d >> /tmp/dates.data
cat /tmp/dates.data | while read LINE ; do echo $LINE,"user"$((1 + RANDOM % 10000)),$((1 + RANDOM % 1000)) >> /tmp/hive_user_table.data; done

create hive table

@thuvh
thuvh / kubernetes_commands.md
Created May 23, 2019 14:04 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@thuvh
thuvh / quandum.py
Created October 29, 2018 02:10
python-vnoi-quandum
from sys import stdin, stdout
from math import floor
def main():
global n,m,a
n,m=[int(x) for x in stdin.readline().split()]
a=[]
for i in range(m):
a.append([int(x) for x in stdin.readline().split()])
g=[]
G=[]
@thuvh
thuvh / test1.cpp
Created October 24, 2018 17:12
cpp pointer
#include <iostream>
using namespace std;
int main(){
int a = 3;
int *p, *q;
p = &a;
q = p;
@thuvh
thuvh / sample.cpp
Created September 20, 2018 16:23
insertnodeattail
/*
* For your reference:
*
* SinglyLinkedListNode {
* int data;
* SinglyLinkedListNode* next;
* };
*
*/
SinglyLinkedListNode* insertNodeAtTail(SinglyLinkedListNode* head, int data) {