Skip to content

Instantly share code, notes, and snippets.

View tunguyen9889's full-sized avatar
👨‍👩‍👧‍👧

James (Anh-Tu) Nguyen tunguyen9889

👨‍👩‍👧‍👧
View GitHub Profile
@tunguyen9889
tunguyen9889 / gather_facts_from_azure_vm.yaml
Created December 7, 2023 20:51
Gather Facts from Azure VM metadata
---
- hosts: localhost
vars:
python_interpreter: /usr/bin/python3
tasks:
- name: "Get Azure VM Metadata"
uri:
url: "http://169.254.169.254/metadata/instance?api-version=2021-02-01"
return_content: true
headers:
This file has been truncated, but you can view the full file.
2021-11-16T16:19:52.008+0700 [DEBUG] Adding temp file log sink: /var/folders/kj/msnbnxnn6tbgnxkdbks9m7x00000gn/T/terraform-log825489391
2021-11-16T16:19:52.008+0700 [INFO] Terraform version: 1.0.11
2021-11-16T16:19:52.008+0700 [INFO] Go runtime version: go1.16.4
2021-11-16T16:19:52.009+0700 [INFO] CLI args: []string{"/opt/homebrew/Cellar/tfenv/2.2.2/versions/1.0.11/terraform", "apply"}
2021-11-16T16:19:52.009+0700 [DEBUG] Attempting to open CLI config file: /Users/james/.terraformrc
2021-11-16T16:19:52.009+0700 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-11-16T16:19:52.010+0700 [DEBUG] checking for credentials in "/Users/james/.terraform.d/plugins"
2021-11-16T16:19:52.010+0700 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-11-16T16:19:52.010+0700 [DEBUG] will search for provider plugins in /Users/james/.terraform.d/plugins
2021-11-16T16:19:52.012+0700 [DEBUG] ignoring non-existing provider search directory /Users/james/Library/Application Support/io.ter
@tunguyen9889
tunguyen9889 / dogstatsd-demo.yaml
Created May 13, 2021 23:09
Simple deployment to test DogStatsD metrics
---
apiVersion: v1
kind: ConfigMap
metadata:
name: custom-metrics-script
data:
custom-metrics.sh: |
#!/bin/sh
apk add netcat-openbsd
while true
@tunguyen9889
tunguyen9889 / datadog-k8s-values.yaml
Last active October 17, 2020 17:35
DataDog Chart values.yaml
clusterAgent:
clusterChecks:
enabled: true
enabled: true
metricsProvider:
enabled: true
rbac:
create: true
daemonset:
useHostPort: true
@tunguyen9889
tunguyen9889 / spark_docker_build_with_irsa_patch.sh
Last active August 14, 2020 18:22
Script to build Spark 2.4.4 Docker image with IRSA patch
#!/bin/bash
docker login -u ${USER} -p ${PASSWORD}
set -e
SPARK_VERSION=2.4.4
HADOOP_PROFILE=2.7
HADOOP_VERSION=2.7.3
KUBERNETES_VERSION=4.4.2
@tunguyen9889
tunguyen9889 / spark-2.4.4-irsa.patch
Created August 14, 2020 18:04
Patch file to support IRSA for Spark 2.4.4
diff --git a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala
index c7338a7215..fcafdc93e3 100644
--- a/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala
+++ b/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala
@@ -61,10 +61,9 @@ private[spark] object Config extends Logging {
.stringConf
.createOptional
- val KUBERNETES_AUTH_DRIVER_CONF_PREFIX =
- "spark.kubernetes.authenticate.driver"
@tunguyen9889
tunguyen9889 / spark_docker_build.sh
Last active September 5, 2019 21:05
Script to build Docker image for Spark
#!/bin/bash
docker login -u ${USER} -p ${PASSWORD}
set -e
SPARK_VERSION=2.4.4
HADOOP_PROFILE=2.7
HADOOP_VERSION=2.7.3
KUBERNETES_VERSION=4.4.2
@tunguyen9889
tunguyen9889 / .vimrc
Last active August 19, 2022 19:19
My .vimrc configuration
" Preference links:
" https://unknwon.io/setup-vim-for-go-development/
" https://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
set nocompatible
filetype off
" Vundle plugin
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'