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 / fan-speed.sh
Created November 11, 2022 16:51
set nvidia card fan speed
sh -c 'sleep 5 && /usr/bin/nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=25" -a "[fan:1]/GPUTargetFanSpeed=25"'
@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 / install-with-containerd.sh
Last active September 11, 2022 16:24
install necessary component to init a k8s control plane (ubuntu os)
#!/bin/bash
set -ex
if [[ $(whoami) != "root" ]]; then
echo "Please run as root"
exit
fi
# Install dep
apt update && apt install -y socat ebtables conntrack
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: dog-canary
namespace: default
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: dog
@dongnguyenltqb
dongnguyenltqb / port-fw.go
Last active October 11, 2022 10:55
tcp port forwarder
package main
import (
"flag"
"fmt"
"io"
"net"
)
var port int
@dongnguyenltqb
dongnguyenltqb / coc-settings.json
Created May 16, 2022 02:47
neovim configuration
{
"languageserver": {
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"]
},
"terraform": {
"command": "terraform-ls",
"args": ["serve"],
@dongnguyenltqb
dongnguyenltqb / retry.go
Last active April 10, 2022 17:21
go1.18 execute task with retry option
package util
type Result[T any] struct {
Error error
Value T
}
type WithRetry[T any] struct {
limit uint
count uint
@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
{
"languageserver": {
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"]
}
},
"tsserver.npm": "/usr/bin/npm",
"coc.preferences.formatOnSaveFiletypes": [
@dongnguyenltqb
dongnguyenltqb / rust-wokers.rs
Last active February 24, 2022 05:31
rust-wokers.rs
use std::{
sync::{
mpsc::{channel, Receiver, Sender},
Arc, Mutex,
},
thread,
time::Duration,
};
#[derive(Debug)]