Skip to content

Instantly share code, notes, and snippets.

Avatar

Chirag J Patel blikenoother

View GitHub Profile
@blikenoother
blikenoother / Installing 3rd Party Nginx module with apt-get
Last active Dec 27, 2019
Install 3rd party module and build NGINX debian (.deb) package. Following is guide for nginx_upstream_check_module
View Installing 3rd Party Nginx module with apt-get
#Install dpkg-dev and package dependencies
sudo apt-get install dpkg-dev
sudo apt-get install software-properties-common
sudo apt-get install python-software-properties
sudo apt-get install init-system-helpers
#Add repository:
sudo add-apt-repository ppa:nginx/stable
#Edit /etc/apt/sources.list.d/nginx-stable-lucid.list, add dpkg-src (no need if ubuntu verson >= 12.04):
View zpanelcp.conf
# create file /etc/init/zpanelcp.conf
description "ZPanelCP by Infoglans"
author "Infoglans"
start on filesystem and started docker
stop on runlevel [!2345]
respawn
script
/usr/bin/docker start -a zpanelcp
end script
View zpanel-docker-container-service-on-ubuntu
#!/bin/bash
# system update upgrade
apt-get update && sudo apt-get -y upgrade
# install docker
wget -qO- https://get.docker.com/ | sh
# generate random password
ZPANLE_ADMIN_PASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1)
View fork and creating pull request
Fork the repo and clone
1. List the current configured remote repository for your fork: git remote -v
2. Specify a new remote upstream repository that will be synced with the fork: git remote add upstream git@github.com:[ORIGINAL_OWNER]/[REPO_NAME].git
3. Verify the new upstream repository you haveve specified for your fork: git remote -v
# origin git@github.com/YOUR_USERNAME/REPO_NAME.git (fetch)
# origin git@github.com/YOUR_USERNAME/REPO_NAME.git (push)
# upstream git@github.com/ORIGINAL_OWNER/REPO_NAME.git (fetch)
# upstream git@github.com/ORIGINAL_OWNER/REPO_NAME.git (push)
Syncing a fork
View Nginx HTTP Authentication
# package for generating .htpasswd file
sudo apt-get install apache2-utils
# create .htpasswd file
sudo htpasswd -c /etc/nginx/.htpasswd username (this will prompt you for password)
# add following 2 line in nginx config (/etc/nginx/sites-available/test.com)
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
View canvas-sequence
document.canvasSequence = function (options) {
var _fontColor = options.fontColor ? options.fontColor : "#ffffff";
var _fontFamily = options.fontFamily ? options.fontFamily : "Arial,Helvetica,sans-serif";
var _fontSize = options.fontSize ? options.fontSize : 30;
var _fontWeight = options.fontWeight ? options.fontWeight : "200";
var wrapCanvasText = function(t, canvas, maxW, maxH) {
if (typeof maxH === "undefined") {
maxH = 0;
View digital-invoice-numbers
_ _ _ _ _ _
|_ | || | ||_| _| ||_ |_
|_||_||_| | | _| | _| _|
_ _ _ _ _ _
|_ |_ | ||_|| ||_||_||_ |_|
|_| _||_| ||_||_| | _| |
_ _ _ _ _ _ _ _
_||_| || ||_ || | _| |
View nginx-brotli-docker-compose.yml
version: '3'
services:
nginx_gzip:
image: fholzer/nginx-brotli
container_name: nginx-gzip
ports:
- '8080:80'
volumes:
- '~/nginx_brotli_demo/nginx_gzip_conf/nginx.conf:/etc/nginx/nginx.conf:ro'
- '~/nginx_brotli_demo/html_static_files:/usr/share/nginx/html:ro'
View nginx-brotli-index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="mycss1.css">
<script src="myjs1.js"></script>
<!-- you can include many js, css here -->
</head>
<body>
<h1>gzip vs brotli</h1>
</body>
View nginx-brotli-gzip.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {