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 / 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) {

Best Practices for Azure Redis

Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.

Configuration and Concepts

  1. Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
  2. Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
  3. Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load
@thuvh
thuvh / rabbitmq.conf
Created July 16, 2018 09:14
rabbitmq configuration demo
%% -*- mode: erlang -*-
%% ----------------------------------------------------------------------------
%% RabbitMQ Sample Configuration File.
%%
%% Related doc guide: http://www.rabbitmq.com/configure.html. See
%% http://rabbitmq.com/documentation.html for documentation ToC.
%% ----------------------------------------------------------------------------
[
{rabbit,
[%%