Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View xbklairith's full-sized avatar

Bird Praphan xbklairith

View GitHub Profile
@xbklairith
xbklairith / index.jsx
Created June 5, 2018 08:05 — forked from avinmathew/index.jsx
Multiple layouts with React Router v4
import React from "react"
import { Route, Switch } from "react-router-dom"
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => (
<Route {...rest} render={props => (
<Layout>
<Component {...props} />
</Layout>
)} />
)
@xbklairith
xbklairith / istio-values.yaml
Created November 14, 2018 10:21
values.yaml istio 1.0.3 setting up for https
# Common settings.
global:
# Default hub for Istio images.
# Releases are published to docker hub under 'istio' project.
# Daily builds from prow are on gcr.io, and nightly builds from circle on docker.io/istionightly
hub: docker.io/istio
# Default tag for Istio images.
tag: 1.0.3
@xbklairith
xbklairith / list_versions
Created February 12, 2019 07:12
How to show all available versions for install . pyenv install --list
$ pyenv install --list
Available versions:
2.1.3
2.2.3
2.3.7
2.4
2.4.1
2.4.2
2.4.3
2.4.4
@xbklairith
xbklairith / run.sh
Created April 1, 2019 10:42
Python debugger automatically on exception occur
python -m pdb -c continue myscript.py
@xbklairith
xbklairith / rm-docker.sh
Created April 18, 2019 09:59
Remove all none tag docker image
docker rmi $(docker images -a|grep "<none>"|awk '$1=="<none>" {print $3}')
@xbklairith
xbklairith / Install Certificates.command
Created April 24, 2019 03:55
Install Certificates.command : Install cert to python environment
#!/bin/sh
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 << "EOF"
# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.org/project/certifi/
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@xbklairith
xbklairith / python-process-spawn.py
Created December 27, 2019 06:59
Create process(s) upon the number of workers, The pool will be terminated when an exception occurs in one of the workers and Kube-pod restarting is expected
from time import sleep
from multiprocessing import Pool
from functools import partial
def _on_error(pool, e):
pool.terminate()
raise e
@xbklairith
xbklairith / install-couchbase-dev.sh
Last active July 27, 2020 16:21
Install couchbase dev in Ubuntu 20.04
sudo wget -O - https://packages.couchbase.com/clients/c/repos/deb/couchbase.key | sudo apt-key add -
echo "deb https://packages.couchbase.com/clients/c/repos/deb/ubuntu2004 focal focal/main" | sudo tee /etc/apt/sources.list.d/couchbase.list
sudo apt update
sudo apt-get install libcouchbase-dev libcouchbase3-libev build-essential
sudo apt update
sudo apt install rbenv git build-essential
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
git clone https://github.com/pyenv/pyenv.git ~/.pyenv