Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lequi on github.
  • I am lequi (https://keybase.io/lequi) on keybase.
  • I have a public key ASClK5U82g-42JHp_iT_wGIBN6y3JUFuKgI3TEps_S2fjwo

To claim this, I am signing this object:

@lequi
lequi / security.conf
Created July 6, 2019 08:05 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
@lequi
lequi / README.md
Created April 1, 2019 17:03 — forked from superseb/README.md
Deploy kubernetes-dashboard on Rancher 2.0 cluster exposed using NodePort

Deploy kubernetes-dashboard on Rancher 2.0 cluster exposed using NodePort

Requirements

Step 1: Generate kubeconfig from the UI

Generate the kubeconfig file for your cluster using the Kubeconfig File button in the Cluster view of your cluster. Save the generated file as $HOME/.kube/config and run kubectl get nodes to verify it works.

@lequi
lequi / php_apache_homebrew.md
Created October 21, 2017 07:13 — forked from DragonBe/php_apache_homebrew.md
Installation of Apache 2.4 and PHP 7.1 with Homebrew

I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.

The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.

I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.

Apache and PHP with homebrew

I’ve made this according to the installation instructions given on GetGrav.

{
"ref_id": "8888",
"title": "Váy chống nắng chống tia UV cao cấp Nhật Bản ",
"price": "295000",
"body_html": "<p><strong>M&atilde; sản phẩm</strong>&nbsp;: UVJ</p>\n\n<p><strong>M&agrave;u</strong>&nbsp;: xanh l&aacute; c&acirc;y , xanh biển, hồng, xanh ngọc</p>\n\n<p><strong>Chất liệu</strong>&nbsp;: si&ecirc;u mềm mịn, si&ecirc;u tho&aacute;ng m&aacute;t, si&ecirc;u mỏng nhẹ, h&uacute;t ẩm, kh&aacute;ng khuẩn</p>\n\n<p>+ Được sản xuất theo d&acirc;y chuyền v&agrave; c&ocirc;ng nghệ dệt vải ti&ecirc;n tiến của Nhật Bản</p>\n\n<p>+ Th&agrave;nh phần ch&iacute;nh được dệt từ sợi polyester gi&uacute;p bảo vệ l&agrave;n da khỏi t&aacute;c hại của tia tử ngoại đến 98%</p>\n\n<p><strong>C&ocirc;ng dụng</strong>&nbsp;:</p>\n\n<p>+ Lu&ocirc;n tạo cảm gi&aacute;c m&aacute;t mẻ kh&ocirc; r&aacute;o ngay cả trong những ng&agrave;y nắng n&oacute;ng hay khi hoạt động thể thao ngo&agrave;i trời</p>\n\n<p>+ Gi&uacute;p da kh&ocirc;ng bị bắt nắng , kh&ocirc;ng bị r&aacute;m, sạm đen v&agrave; lu&ocirc;n kh&ocirc; r
@lequi
lequi / nginx.conf
Created July 10, 2017 03:57 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@lequi
lequi / .Title
Created September 24, 2016 08:15 — forked from congjf/.Title
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@lequi
lequi / vn_detect_mobile_phone_number.js
Last active September 13, 2019 04:06
Hàm detect số điện thoại di động ở Việt Nam (bao gồm cả đầu số di động mới)
function is_mobilephone_number(phoneNumber) {
    phoneNumber = phoneNumber.replace(/\D/g, '').replace(/^(\+|)84/g, '0');
    return /^(01[2689]|09|08[12345689]|07[06789]|03[23456789]|05[2689])[0-9]{7,8}$/g.test(phoneNumber);
}