Skip to content

Instantly share code, notes, and snippets.

View hieunba's full-sized avatar
💭
I may be slow to respond.

Hieu hieunba

💭
I may be slow to respond.
View GitHub Profile
@hieunba
hieunba / oxihardening.sh
Last active July 5, 2018 08:28
Oxi Hardening
#!/bin/bash
# check root
if [[ `id -u` -ne 0 ]] ; then
echo "Please run this under root."
echo 1
fi
# Hardening SSH
harden-ssh() {
# backup
@hieunba
hieunba / gist:93bc11d19e00b449d7df798753d79227
Created May 3, 2018 21:41
LetsEncrypt SSL options for Apache
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.
SSLEngine on
# Intermediate configuration, tweak to your needs
SSLProtocol all -SSLv2 -SSLv3
@hieunba
hieunba / haproxy.cfg
Created April 6, 2018 14:56 — forked from GABeech/haproxy.cfg
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@hieunba
hieunba / gist:740f4be11b9059683ef19f48e9f67238
Created March 4, 2018 12:22
Enable Windows Firewall ping request rule
Set-NetFirewallRule -DisplayName "File and Sharing Printer (Echo Request - ICMPv4-In)" -Enabled True
@hieunba
hieunba / gist:53a09df10491290d9b16f7c5f4c380a4
Last active January 12, 2018 11:48
Elastic Beanstalk configuration file to setup DNS Name with comments
Parameters:
DomainName:
Description: Beanstalk Domain Name of the Application
Type: String
Default: example.com
ConstraintDescription: Must be a valid Domain Name
DomainZoneId:
Description: Domain Name Hosted Zone ID
Type: String
Default: Z2JEFNTHDAMUTJ
@hieunba
hieunba / gist:4d2b306baab3b1acc3b912f85ebc127a
Created January 11, 2018 09:38
Elastic Beanstalk extension to configure Domain Name
Parameters:
DomainName:
Description: Beanstalk Domain Name of the Application
Type: String
Default: example.com
ConstraintDescription: Must be a valid Domain Name
DomainZoneId:
Description: Domain Name Hosted Zone ID
Type: String
Default: Z2JEFNTHDAMUTJ
@hieunba
hieunba / gist:1d05e556d228c358c8e46bbdd7c37783
Created July 13, 2017 01:30
Python.h not found while compiling from pip
# Python.h: No such file or directory
When using pip to get or upgrade a binary, you get error
> root/Desktop/pyodbc-3.0.3/src/pyodbc.h:41:20: error: Python.h: No such file or directory
### Root cause
There might be two reasons:
- Python headers were not fully installed yet
### What to check
Check python versions in your system
@hieunba
hieunba / gist:e9614dcb6dccbd30a1c3c16ba132dff8
Created July 12, 2017 10:47
Mount remote filesystem over SSH with sshfs - Mac OSX
Steps to have remote filesystem mounted locally
Requires:
brew
Mac OS X
Tested:
Mac OSX Sierra
Steps
Gearman is a generic application framework for farming out work to multiple machines or processes. It allows applications to complete tasks in parallel, to load balance processing, and to call functions between languages. The framework can be used in a variety of applications, from high-availability web sites to the transport of database replication events.
This notes how to install gearman php extension using apt package management. If you want to use PECL, please goes here: http://php.net/manual/en/gearman.installation.php
Ubuntu 14.04
this comes with PHP 5.6.x
To get gearman, just install php5-gearman package:
$ sudo apt-get install php5-gearman
Ubuntu 16.04