Skip to content

Instantly share code, notes, and snippets.

udomsak udomsak

Block or report user

Report or block udomsak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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,
@udomsak
udomsak / linearRegression.ipynb
Last active Oct 21, 2018
บันทึก ไฟล์ examsample LinearRegression ระหว่างสอน วันที่ 20-10-2018
View linearRegression.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@udomsak
udomsak / docker-compose.yml
Created Oct 11, 2018
verdaccio docker-compose
View docker-compose.yml
version: "2"
services:
verdaccio:
image: verdaccio/verdaccio
hostname: npm-registry
ports:
- 4873:4873
# volumes:
# - /etc/verdaccio/conf:/verdaccio/conf
# - /var/cache/verdaccio/storage:/verdaccio/storage
View chai-test-file-upload-actionhero.js
//Define variable before init ActionHero SpecHelper
api.config.upload_config.storage_path = 'c:\\tmp'
// Run API
let {fileUpLoad} = await api.specHelper.runAction('SuperFileUpload')
// Run Async/Awaith Test API
await chai.request('http://localhost:' + api.config.servers.web.port)
// API end point
/* res.body return JSON object from an API
* define object or key-value you want to check ( property and value )
You can’t perform that action at this time.