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_laravel5_rewrite.md
Created November 30, 2015 16:50
Lighttpd laravel 5 rewrite
alias.url = ("/netcleaner" => "/home/nontawatt/workspaces/net_cleaner/src/www/public/")
url.rewrite-once = (
        "^/netcleaner/compiled/(.*)" => "/netcleaner/compiled/$1",
        "^/netcleaner/(favicon\.ico|robots\.txt|sitemap\.xml)$" => "/netcleaner/$1",
        "^/netcleaner/[^\?]*(\?.*)?$" => "/netcleaner/index.php/$1"
)

$HTTP["url"] =~ "^/netcleaner" {
 url.redirect = ()
@xemoe
xemoe / htpass.md
Last active November 23, 2016 11:54
Create htpasswd basic authentication

Install package

sudo apt-get install apache2-utils

Generate htpasswd file

sudo htpasswd -c /var/www/yourweb/.htpasswd yourname
@xemoe
xemoe / tshark.md
Created December 19, 2015 12:28
Tshark commands
sudo tshark -i em0 -f "tcp port 514"
@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 / 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 / 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 / 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 / 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 / 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 / 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