Skip to content

Instantly share code, notes, and snippets.

View mildronize's full-sized avatar

Thada Wangthammang mildronize

View GitHub Profile
@mildronize
mildronize / Simple soap client and simple server via flask
Last active December 13, 2016 13:29
Objective: To get current oil price in Thailand via SOAP and response in JSON. prerequisite: Python 3.4, flask, flask-cors, suds-jurko, xmltodict
#!/usr/bin/python3
from flask import Flask
from flask import request, jsonify
from flask.ext.cors import CORS
from suds.client import Client
import xmltodict
app = Flask(__name__)
cors = CORS(app)
#Kata with Up1 - Agile Thailand 2014 @ Eng CU
#Sat 7 June 2014
class FizzBuzzFactory():
def crete(self):
rules = [FizzBuzzBangRule(), BuzzBangRule(), FizzBangRule(), FizzBuzzRule(),
BangRule, BuzzRule(),FizzRule(),NormalRule()]
return FizzBuzz(rules)
class FizzBuzz():
#!/usr/bin/env python3
# Tested on Python 3.4
# Version 1.2.0
# Original file Version 1.00 from : Thanathip Limna, Chatchai Jantaraprim
# Modified by Thada Wangthammang
# Change log 1.2.0
# - Use Environment variable for storing PSU Passport
# - Enable logout CLI (./auth-psu-1.2.0.py logout)
# Change log v1.1.2
# - Transform to OOP
@mildronize
mildronize / boot2docker-quick.sh
Last active March 6, 2016 05:14
No longer maintenance! Quick launch Boot2Docker on Windows: If the docker container is already running, skipping the step of initialized docker for quick launching
#!/bin/bash
set -e
cd "$(dirname "$BASH_SOURCE")"
echo 'Checking Is docker running...'
STATUS="$(./boot2docker.exe status)"
echo
if [ "$STATUS" = "poweroff" ]; then
echo "Docker is poweroff"
@mildronize
mildronize / mildronize-putty-sessions.reg
Created October 9, 2015 07:20
Mildronize putty sessions
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions]
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\mildronize-solarized-dark-settings]
"Present"=dword:00000001
"LogFileName"="putty.log"
"LogType"=dword:00000000
"LogFileClash"=dword:ffffffff
"LogFlush"=dword:00000001
@mildronize
mildronize / minimal-psuautosigned.sh
Created January 6, 2016 14:35 — forked from ChatchaiJ/minimal-psuautosigned.sh
Minimal PSU Autosigned Script
#!/bin/bash
USER="YOUR-PASSPORT-ID"
PASSWD="YOUR-PASSPORT-PASSWORD"
COOKIES="cookies.txt"
/usr/bin/curl \
--connect-timeout 10 \
--max-time 10 \
-s -k \
@mildronize
mildronize / hotspot.bat
Created March 6, 2016 05:16
A script for creating a hotspot wifi on Windows (Require Admin permission)
@ECHO OFF
echo Hotspot
echo .
set wirelessName=Hotspot
IF "%1"=="start" goto START
IF "%1"=="stop" goto STOP
IF "%1"=="restart" goto RESTART
IF "%1"=="stat" goto STAT

Docker Cheat Sheet


Build Image

docker build -t [REPOSITORY/IMAGE NAME] [PATH] 
@mildronize
mildronize / boot-repair.sh
Last active May 30, 2016 04:08
Boot Repair for ubuntu
#!/bin/bash
sudo add-apt-repository ppa:yannubuntu/boot-repair && \
sudo apt-get update && \
sudo apt-get install -y boot-repair && \
sudo boot-repair
@mildronize
mildronize / autotest.py
Created August 6, 2016 16:27
Auto test script ( watchdog + nose ) for TDD ( with test )
#!/usr/bin/env python
import os
import sys
import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
# STYLE="startswith_test"
# STYLE="endswith_test"