Skip to content

Instantly share code, notes, and snippets.

View zdk's full-sized avatar
:octocat:

Di Warachet S. zdk

:octocat:
  • Thailand
  • 16:23 (UTC +07:00)
View GitHub Profile
@zdk
zdk / haproxy.md
Created January 11, 2024 13:16 — forked from guycalledseven/haproxy.md
haproxy conditions

Haproxy conditions

Since I keep forgetting them I've put them here.

To form a condition, you can use the following syntax after the rule that it applies to:

<HAProxy action statement> if|unless [!]acl1 <AND|OR|or|'||'> [!]acl2 ...

  • if - the condition is TRUE if the result of the ACLs is TRUE.
@zdk
zdk / th-address.json
Created November 20, 2023 10:50 — forked from mennwebs/th-address.json
Thai Address from Postal Code - JSON
This file has been truncated, but you can view the full file.
[
{
"zipCode": "10100",
"subDistrictList": [
{
"subDistrictId": "100801",
"districtId": "1008",
"provinceId": "10",
"subDistrictName": "ป้อมปราบ"
},
@zdk
zdk / disable-ipv6.sh
Created March 30, 2017 12:49 — forked from kwilczynski/disable-ipv6.sh
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
@zdk
zdk / WIP.md
Created July 12, 2016 05:27 — forked from till/WIP.md
OpsWorks + DigitalOcean = ❤️

Register a droplet in AWS OpsWorks

AWS Requirements

  • create a new IAM user and attach the AWS OpsWorks Register Policy
  • for testing: create a new stack on AWS OpsWorks and fetch its ID
  • customize all variables prefixed with YOUR_ from the cloud-config.yml

DigitalOcean

@zdk
zdk / install_monit.sh
Last active October 6, 2019 09:18 — forked from tanaka-takayoshi/install_monit.sh
install monit 5.14 on Amazon Linux
yum -y install flex bison openssl-devel rpm-build gcc pam-devel
wget http://mmonit.com/monit/dist/monit-5.14.tar.gz
tar zxvf monit-5.14.tar.gz
mkdir -p /usr/src/rpm/SOURCES/
cp monit-5.14.tar.gz /usr/src/rpm/SOURCES/monit-5.14.tar.gz
cd monit-5.14
rpmbuild -bb --clean system/packages/redhat/monit.spec
rpm -ivh /usr/src/rpm/RPMS/x86_64/monit-5.14-1.x86_64.rpm
@zdk
zdk / test.rb
Last active August 29, 2015 14:04 — forked from frankie-loves-jesus/test.rb
require 'json'
require 'rash'
@response = <<END
{
"productHeader": {
"totalHits": 147
},
"products": [{
"name": "Morgan Sport",

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"