Skip to content

Instantly share code, notes, and snippets.

View binhqd's full-sized avatar

Binh Quan binhqd

  • MyNavi Techtus Vietnam
  • 12:35 (UTC +07:00)
View GitHub Profile
@binhqd
binhqd / ubuntu.sh
Last active November 1, 2017 08:39
Enable OS max connections and ports
# Check number of CPUs
grep ^processor /proc/cpuinfo | wc -l
# set maximum number of open files (current session)
ulimit -u 10000
ulimit -n 10000
# Modify number open files
vi /etc/security/limits.conf
# * soft nofile 64000
@binhqd
binhqd / gist:03d4473ca2d5f164ed57586db6dff9d8
Created November 1, 2017 07:23
Install Certbot and SSL
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y python-certbot-nginx
# centos
sudo apt-get install -y build-essential zlib1g-dev libpcre3 libpcre3-dev unzip
NPS_VERSION=1.12.34.2-stable
cd
wget https://github.com/pagespeed/ngx_pagespeed/archive/v${NPS_VERSION}.zip
unzip v${NPS_VERSION}.zip
cd ngx_pagespeed-${NPS_VERSION}/
NPS_RELEASE_NUMBER=${NPS_VERSION/beta/}
NPS_RELEASE_NUMBER=${NPS_VERSION/stable/}
psol_url=https://dl.google.com/dl/page-speed/psol/${NPS_RELEASE_NUMBER}.tar.gz
8.2.3. HTTP log format
----------------------
The HTTP format is the most complete and the best suited for HTTP proxies. It
is enabled by when "option httplog" is specified in the frontend. It provides
the same level of information as the TCP format with additional features which
are specific to the HTTP protocol. Just like the TCP format, the log is usually
emitted at the end of the session, unless "option logasap" is specified, which
generally only makes sense for download sites. A session which matches the
"monitor" rules will never logged. It is also possible not to log sessions for
const InvitationHelper = require('../InvitationHelpers');
self.customCreate = (data, fn) => {
return findUser()
.then(InvitationHelpers.checkParams)
.then(InvitationHelpers.checkIsInSP)
.then(InvitationHelpers.checkIsInvited)
.then(InvitationHelpers.createInvitation)
.then(InvitationHelpers.queueEmail)
@binhqd
binhqd / homepage-spec.js
Last active June 20, 2016 08:47
Sample BDD test preparation
//var screenshot = require('./../screenshot');
describe('Test Login page', function() {
beforeEach(function() {
// doing something here
});
var width = 1600;
var height = 2400;
browser.driver.manage().window().setSize(width, height);