Skip to content

Instantly share code, notes, and snippets.

View dongnguyenltqb's full-sized avatar
🏠
Working from home

Dong Nguyen dongnguyenltqb

🏠
Working from home
View GitHub Profile
@dongnguyenltqb
dongnguyenltqb / values.yaml
Created September 5, 2022 17:44 — forked from l13t/values.yaml
alertmanager alerts to slack for prometheus-operator
.......some config.....
alertmanager:
## Deploy alertmanager
##
enabled: true
## Service account for Alertmanager to use.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##
@dongnguyenltqb
dongnguyenltqb / IPtables and csf.md
Created March 10, 2022 14:41 — forked from macmladen/IPtables and csf.md
Handling firewall blocking and unblocking, iptables, csf

Local Development Techniques with Kubernetes

This talk is all live demos of tools developers can use in their inner-loop, at development time to be more productive with containers.

Start Easier

Docker Compose captures the build arguments and run arguments so we can focus on our coding.

@dongnguyenltqb
dongnguyenltqb / handle postgres json with gorm.go
Created December 27, 2021 04:03 — forked from jinzhu/main.go
handle postgres json with gorm
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
func main() {
const Ffmpeg = require(‘fluent-ffmpeg’);
const STREAM_URL = ‘http://icecast.radio24.ch/radio24-rc-96-aac';
const VOLUME_THRESHOLD = -50; // volume threshold
getMeanVolume(STREAM_URL, function(meanVolume){
if(meanVolume <= VOLUME_THRESHOLD){
console.log(“WE HAVE A PROBLEM! VOLUME IS TOO LOW!”);
}else{
console.log(‘ALL GOOD!’);
}
@dongnguyenltqb
dongnguyenltqb / index.js
Created July 4, 2021 17:04 — forked from akexorcist/index.js
Axios post method requesting with x-www-form-urlencoded content type
const axios = require('axios')
/* ... */
const params = new URLSearchParams()
params.append('name', 'Akexorcist')
params.append('age', '28')
params.append('position', 'Android Developer')
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/')
params.append('awesome', true)
@dongnguyenltqb
dongnguyenltqb / block-facebook
Created March 10, 2021 11:44 — forked from imcodingideas/block-facebook
Hosts file to block facebook
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@dongnguyenltqb
dongnguyenltqb / mongodb-ssl.sh
Created December 23, 2020 06:12 — forked from kevinadi/mongodb-ssl.sh
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com"
# Sign the server cert
@dongnguyenltqb
dongnguyenltqb / .gitlab-ci.yml
Created December 8, 2020 08:31 — forked from jlis/.gitlab-ci.yml
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services:
@dongnguyenltqb
dongnguyenltqb / curl-websocket.sh
Created April 18, 2020 07:55 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/