Skip to content

Instantly share code, notes, and snippets.

View xemoe's full-sized avatar
🏠
Working from home

Teerapong Ladlee xemoe

🏠
Working from home
  • Bangkok, Thailand
View GitHub Profile
@xemoe
xemoe / lighttpd_proxy.conf
Last active October 25, 2024 12:05
Lighttpd mod proxy (with subdirectory)
$HTTP["url"] =~ "^/grafana" {
proxy.server = ( "" =>
(( "host" => "127.0.0.1", "port" => 3001 ))
)
proxy.debug = 1
}
$SERVER["socket"] == ":3001" {
url.rewrite-once = ( "^/grafana/(.*)$" => "/$1" )
proxy.server = ( "" => ( "" => ( "host" => "127.0.0.1", "port" => 3000 )))
@xemoe
xemoe / base26.js
Created May 8, 2016 12:44
Base 26 convert
'use strict';
const bigInt = require("big-integer");
function s26toi(s) {
const base = 26;
let ret = 0;
let numl = String(s).length;
@xemoe
xemoe / draft_1_1_0.md
Last active April 11, 2016 18:07
Draft update xemoe/php 1.1.0

Draft

Definitions of Env and Configurations properties.

  1. Configuration properties is REPLACED magic values used inside classes.
  2. Env properties is arguments for any configurations properties, E.g. app_path().

Abstracts

  • Xemoe/Contracts/EnvLoaderContract
@xemoe
xemoe / milestone-branching.md
Last active March 25, 2016 00:12
Git milestone branching

Git milestone branching

Bitbucket major branch

  • 1.x
  • 2.x

Bitbucket minor branch

  • 1.9-dev (latest 1.x develop branch)
@xemoe
xemoe / bridge-configure.sh
Last active March 14, 2016 15:51
Network configure
#!/bin/bash
#
# Configure network interfaces scripts
# Ansible managed: /vagrant/005-application/roles/sran.network-interfaces/templates/configure-network-interfaces.sh.j2 modified on 2016-03-14 22:42:44 by vagrant on ubuntu
#
####################################################################################################
# Configure bridge interfaces #
###############################
@xemoe
xemoe / influxdb_retention_pol.md
Last active October 3, 2019 11:58
Modify influxdb 0.9 retention policy

Modify influxdb 0.9 retention policy on localhost:8083

ALTER RETENTION POLICY default ON collectd DURATION 3d DEFAULT

Show retention policy

@xemoe
xemoe / d3_map.js
Last active February 6, 2016 12:13
Load countries map with D3
(function() {
//
// Initial variables
//
var w,h,div,tooltip,_w,_h;
var sizes = d3.scale.linear()
.range([4, 400]);
@xemoe
xemoe / IANA-IPPM-METRICS-REGISTRY-MIB
Last active January 6, 2016 19:24
snmpd / snmptrap testing
IANA-IPPM-METRICS-REGISTRY-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-IDENTITY, MODULE-IDENTITY, mib-2
FROM SNMPv2-SMI;
ianaIppmMetricsRegistry MODULE-IDENTITY
LAST-UPDATED "201508140000Z" -- August 14, 2015
ORGANIZATION "IANA"
@xemoe
xemoe / ftp_sync.sh
Last active December 27, 2015 14:50
sync scripts
#!/bin/bash
type realpath &>/dev/null
if [ $? -eq 1 ]; then
sudo apt-get -qq update && sudo apt-get -qq install realpath -y
fi
type lftp &>/dev/null
if [ $? -eq 1 ]; then
sudo apt-get -qq update && sudo apt-get -qq install lftp -y
@xemoe
xemoe / tshark.md
Created December 19, 2015 12:28
Tshark commands
sudo tshark -i em0 -f "tcp port 514"