Skip to content

Instantly share code, notes, and snippets.

View jwthanh's full-sized avatar

Thanh Vu jwthanh

View GitHub Profile
@jwthanh
jwthanh / GitCommitEmoji.md
Created March 4, 2022 02:31 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@jwthanh
jwthanh / kubernetes_add_service_account_kubeconfig.sh
Created March 21, 2021 09:12 — forked from xtavras/kubernetes_add_service_account_kubeconfig.sh
create kubernetes service account and corresponding kubeconfig
#!/usr/bin/env bash
# script was taken from https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708 and adjusted with "apply_rbac" function and colorized output
set -e
set -o pipefail
# Colors
RED="\e[01;31m"
@jwthanh
jwthanh / install.md
Created May 28, 2020 07:03 — forked from Ryanb58/install.md
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
- name: REGISTRY_HTTP_RELATIVEURLS
  value: "true"

Keybase proof

I hereby claim:

  • I am jwthanh on github.
  • I am jwthanh (https://keybase.io/jwthanh) on keybase.
  • I have a public key ASD12HVuIrd7mNWuBwqKxTt8lrWPtFabCaVp1XWQBG4BnAo

To claim this, I am signing this object:

@jwthanh
jwthanh / fix-simulator.sh
Created May 15, 2019 08:48
Fix react native could not find anyone simulator
sed -i '' 's/startsWith/includes/g' node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js
@jwthanh
jwthanh / mysql-docker.sh
Created February 8, 2019 18:18 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@jwthanh
jwthanh / CodePush.js
Created November 30, 2018 08:02
CodePush
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import codePush from 'react-native-code-push';
class CodePushStatus extends Component {
state = {};
componentDidMount() {
@jwthanh
jwthanh / android-generate-keystores.md
Created November 30, 2018 06:34 — forked from henriquemenezes/android-generate-keystores.md
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
@jwthanh
jwthanh / dns.yaml
Last active May 23, 2019 04:39
Kubernetes installation
# should apply this config if pod could not ping outside internet
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-dns
namespace: kube-system
data:
upstreamNameservers: |
["8.8.8.8", "8.8.4.4"]