Skip to content

Instantly share code, notes, and snippets.

@udomsak
udomsak / terraform.debug.log
Created Sep 13, 2020
TF_VAR does not pass environment variable to terraform-digitalocean-provider
View terraform.debug.log
2020/09/13 14:24:05 [INFO] Terraform version: 0.13.2
2020/09/13 14:24:05 [INFO] Go runtime version: go1.14.7
2020/09/13 14:24:05 [INFO] CLI args: []string{"C:\\ProgramData\\chocolatey\\lib\\terraform\\tools\\terraform.exe", "apply", "-state=_test.state", "_test_"}
2020/09/13 14:24:05 [DEBUG] Attempting to open CLI config file: C:\Users\Admin\AppData\Roaming\terraform.rc
2020/09/13 14:24:05 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/09/13 14:24:05 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/09/13 14:24:05 [DEBUG] ignoring non-existing provider search directory C:\Users\Admin\AppData\Roaming\terraform.d\plugins
2020/09/13 14:24:05 [DEBUG] ignoring non-existing provider search directory C:\Users\Admin\AppData\Roaming\HashiCorp\Terraform\plugins
2020/09/13 14:24:05 [INFO] CLI command args: []string{"apply", "-state=_test.state", "_test_"}
2020/09/13 14:24:05 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
@udomsak
udomsak / sample_binance.py
Created Aug 23, 2020
การเชื่อมต่อ กับ binance โดยใช้ WS ( WebSocket ) connect เพื่อการเชื่อมต่อแบบ Realtime
View sample_binance.py
"""
Quest: https://www.facebook.com/groups/admin.py.dev/permalink/1437718479746684/
"""
from binance.client import Client
from binance.websockets import BinanceSocketManager
"""
เวลาทำงานกับ WSS ( Web Socket ให้ทำงานกับ API ตัวนี้ )
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md
@udomsak
udomsak / python_thailand.ipynb
Last active Aug 2, 2020
community answer | Python Thailand
View python_thailand.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@udomsak
udomsak / bulk_remove_fork.py
Last active Apr 11, 2019
Bulk remove folks repositories
View bulk_remove_fork.py
#!/usr/bin/env python
from github import Github
#https://github.com/settings/tokens
g = Github("4a3d3c5ba12e402015dcdcf55c312e0614xxxxx888s")
folks_repo = [ repo for repo in g.get_user().get_repos() if repo.fork == True]
for repo in folks_repo:
repo.delete()
@udomsak
udomsak / runner.js
Created Dec 25, 2018
fastify-validation not work.
View runner.js
// Require the framework and instantiate it
const fastify = require('fastify')({
logger: true
})
const post_schema = {
method: 'GET',
schema: {
body: {
type: 'object',
@udomsak
udomsak / postman_fc29_install.sh
Created Dec 24, 2018
Install postman on Fedora core 29 - Dec 2018
View postman_fc29_install.sh
#!/bin/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman-linux-x64.tar.gz
sudo tar xvzf postman-linux-x64.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat << EOF > ~/.local/share/applications/postman2.desktop
[Desktop Entry]
Name=Postman
GenericName=API Client
@udomsak
udomsak / command.sh
Created Dec 20, 2018
kubectl apply rbac rules to microk8s
View command.sh
# Restart API server
systemctl restart snap.microk8s.daemon-apiserverd
# Apply rules
kubectl apply -f rbac-microk8s.yml
# Check running
kubectl get clusterroles cluster-admin
@udomsak
udomsak / Dockerfile
Created Dec 19, 2018
Dockerfile kyoto-tycoon ( kt-server ) by @narate
View Dockerfile
FROM alpine:3.7
MAINTAINER Narate Ketram <rate@dome.cloud>
RUN apk update && apk add git build-base lua5.1-dev lzo-dev zlib-dev
RUN cd /tmp && \
git clone https://github.com/narate/kyoto.git && \
cd kyoto && \
make && \
make install && \
make clean && \
@udomsak
udomsak / kyoto-tycoon.fedora.29.sh
Created Dec 19, 2018
kyoto-tycoon compile on fedora-core 29
View kyoto-tycoon.fedora.29.sh
git clone git@github.com:cloudflare/kyototycoon.git
sudo dnf install openssl-devel kyotocabinet-devel
./configure 
make 
sudo make install 
echo /usr/local/lib > /etc/ld.so.conf.d/kyoto-tycoon.conf
sudo ldconfig
@udomsak
udomsak / message-with-pic.json
Last active Oct 24, 2018
Navy Line messaging payload format
View message-with-pic.json
{
"events": [
{
"type": "message",
"replyToken": "e772d6f6b3ce4f198f58a0671889ac55",
"source": {
"userId": "U55aa364949999f07b2f7b6b9de0ef07",
"type": "user"
},
"timestamp": 1540374281107,
You can’t perform that action at this time.