Skip to content

Instantly share code, notes, and snippets.

View dwdraju's full-sized avatar

Raju Dawadi dwdraju

View GitHub Profile
@dwdraju
dwdraju / 0_reuse_code.js
Created December 14, 2016 07:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dwdraju
dwdraju / nginxproxy.md
Created December 16, 2016 10:51 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@dwdraju
dwdraju / nginx-vhost.conf
Last active March 1, 2017 09:50 — forked from tjstein/nginx-vhost.conf
nginx vhost config PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
@dwdraju
dwdraju / godaddy.md
Last active June 5, 2022 04:50
Letsencrypt nginx & apache generation and renewal

Create CSR

openssl req -new -newkey rsa:2048 -nodes -keyout pvdemo.key -out pvdemo.csr

Concatenate CRT

crt + bundle (pem not required)

version: 0.1
phases:
install:
commands:
- git clone https://github.com/younginnovations/UN-Transparency-Portal
pre_build:
commands:
- cd UN-Transparency-Portal && bash install_deps
build:
commands:
@dwdraju
dwdraju / git-file-permission-reject.md
Last active June 27, 2018 08:28
Git Reject File Permission Change

Ignore file permission changes

git config core.fileMode false

See ignored files

git status --ignored
@dwdraju
dwdraju / gcrgc.sh
Created November 20, 2017 18:03 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@dwdraju
dwdraju / myfile
Created November 29, 2017 15:20
test
test
@dwdraju
dwdraju / cron_supervisord.ini
Created December 15, 2017 11:29 — forked from martinrusev/cron_supervisord.ini
Cron supervisord
[supervisord]
nodaemon=true
loglevel=debug
[program:amon]
command=gunicorn -c gunicorn.conf.py wsgi
directory=/amon
autostart=true
autorestart=true
redirect_stderr=true
@dwdraju
dwdraju / benchmark+go+nginx.md
Created January 6, 2018 16:10 — forked from hgfischer/benchmark+go+nginx.md
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI