Skip to content

Instantly share code, notes, and snippets.

Wong Liang Zan liangzan

Block or report user

Report or block liangzan

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
View request.xml
<?xml version="1.0" encoding="UTF-8"?>
<p:DCTRequest xmlns:p="" xmlns:p1="" xmlns:p2="" xmlns:xsi="" xsi:schemaLocation=" DCT-req.xsd ">
View response.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
xmlns:xsi='' xsi:schemaLocation= ' DCT-Response.xsd'>
View compiler-error
toResponse :: IO (Response BL.ByteString) -> BL.ByteString
toResponse i = view responseBody i
-- compiler error
Couldn't match type ‘IO (Response BL.ByteString)’
with ‘Response BL.ByteString’
arising from a functional dependency between:
constraint ‘mtl-2.2.1:Control.Monad.Reader.Class.MonadReader
(Response BL.ByteString) ((->) (IO (Response BL.ByteString)))’
arising from a use of ‘view’
#!/usr/bin/env bash
# leaves 5 copies of the standalone app
total_files=$(find -name '*.jar' -type f -print0 | xargs -0 ls -t | wc -l)
file_num_to_remove=`expr $total_files - 5`
find -name '*.jar' -type f -print0 | xargs -0 ls -t | tail -n $file_num_to_remove | xargs rm
View courex-xml-sample.php
* Sample to use Courex XML Technical Guide
* How to use:
* Search for "//input" and fill in the data accordingly
* @author Tao Yueling <>
* @copyright 2014 Courex Pte Ltd
* @version 1.0.0
View OneDrive.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Keys (oneDriveKey)
import Network.OAuth.OAuth2
import Control.Monad (liftM)
import Data.Aeson (FromJSON)
liangzan /
Last active Jan 2, 2016
Configuration for fail2ban

First install Fail2ban.

sudo apt-get install fail2ban

Then edit the configuration file at /etc/fail2ban/jail.conf

We are only showing the changed sections.


Internal Server Error

The server has either erred or is incapable of performing the requested operation.

Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 1529, in __call__
    rv = self.router.dispatch(request, response)
liangzan / pg_users_chef_recipe.rb
Last active Dec 15, 2015
View pg_users_chef_recipe.rb
include_recipe "postgresql::server"
node[:notifymode][:db_users].each do |user|
execute "create-database-user" do
exists = <<-EOH
sudo -u postgres psql -U postgres -c "select * from pg_user where usename='#{user[:name]}'" | grep -c #{user[:name]}
command "echo \"CREATE ROLE #{user[:name]} with CREATEDB LOGIN PASSWORD '#{user[:password]}'\" | sudo -u postgres psql -U postgres"
not_if exists
liangzan / .tmux.conf
Created Oct 25, 2012
tmux configuration
View .tmux.conf
## term
set -g default-terminal "screen-256color"
set -g default-shell /bin/zsh
## tmux window titling for X
set -g set-titles on
set -g set-titles-string '#W [#S:#I]'
setw -g automatic-rename on
## msgs
You can’t perform that action at this time.