Skip to content

Instantly share code, notes, and snippets.

Hoàng Xuân Phú phunehehe

Block or report user

Report or block phunehehe

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
phunehehe /
Last active Sep 25, 2019 — forked from glogiotatidis/
Git-crypt remove user.
#!/usr/bin/env bash
# Script to remove GPG key from git-crypt
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
phunehehe / check_urls
Last active Dec 23, 2018
Script to check multiple URLs in Nagios, see
View check_urls
# Split URLs by comma
urls=${1//,/ }
for url in $urls
if [[ "$url" = */* ]]
resource aws_elasticache_replication_group single {
node_type = "cache.m3.medium"
number_cache_clusters = 1
port = 6379
replication_group_description = "single-test"
replication_group_id = "single-test"
subnet_group_name = "staging"
resource aws_elasticache_replication_group cluster {
phunehehe /
Last active Mar 7, 2018
Settings for Mutt to test SES

Change the email address to the verified sender address. By default Mutt doesn't use the envelope address, resulting in the email getting rejected because of unverified address.

set from = 'Amazing Tester <>'
set smtp_pass = 'xxx'
set smtp_url = 'smtps://'
set use_envelope_from = yes
phunehehe /
Last active Jan 25, 2016
Philesight on Ubuntu

Install dependencies

sudo apt-get install libdb4.2-ruby1.8 libcairo-ruby1.8

Install Philesight

git clone
for i in $(virsh list | grep running | awk '{print $2}')
virsh autostart $i
for i in $(virsh list --all | grep 'shut off' | awk '{print $2}')
virsh autostart --disable $i
phunehehe / MyFormModel.php
Last active Dec 30, 2015
Antispam for Yii form
View MyFormModel.php
* Prevent automated POST (actually non-GET) requests by checking a form
* attribute set by JavaScript, in the hope that spammers will not execute
* JavaScript.
* Usage:
* 1. Extend MyFormModel instead of CFormModel
* class ContactForm extends MyFormModel {}
set -e
monthday="$(date +%-d)"
weekday="$(date +%w)"
if [[ "$monthday" -eq 1 ]]
phunehehe / modules
Created Nov 5, 2013
Manage Chef modules
View modules
You can’t perform that action at this time.