Skip to content

Instantly share code, notes, and snippets.

View mizansyed's full-sized avatar

Mizan Syed mizansyed

  • Cabinet Office and Brill Labs
  • United Kingdom
  • X @mizansyed
View GitHub Profile
@mizansyed
mizansyed / laravel setup.sh
Created October 3, 2021 23:35 — forked from rolandstarke/laravel setup.sh
Server setup bash script for Laravel
# Ubuntu 18.04 LTS Server Setup for Laravel
# Login as root user
sudo su -
# Update list of available packages
apt update
@mizansyed
mizansyed / nginx.conf
Created May 28, 2021 12:35 — forked from rummykhan/nginx.conf
Nginx + Supervisor conf for Octane
server {
listen 80;
server_name app.rehanmanzoor.me;
charset utf-8;
client_max_body_size 1M;
location / {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
@mizansyed
mizansyed / letsencrypt_2020.md
Created December 31, 2020 01:07 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@mizansyed
mizansyed / laravel_horizon.md
Created December 30, 2020 21:27 — forked from ankurk91/laravel_horizon.md
Laravel Horizon, redis-server, supervisord on Ubuntu 20 server

Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel 8.x, Horizon 5.x, Redis 6.x

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now it should show status as inactive on dashbaord

Install redis-server

@mizansyed
mizansyed / google-analytics-event-tracking.js
Created August 23, 2019 11:09
Google Analytics Event Tracking Javascript [OUTDATED]
/**!
* Google Analytics Event Tracking
* Note: Assuming that tracking code already exists on the page
* Require jQuery 1.x or 2.x
* Supports: Classic and Universal Google Analytics
* @version 2.1.0
* @license MIT
* @author ankur
*/
@mizansyed
mizansyed / .htaccess
Created May 7, 2019 18:55 — forked from seoagentur-hamburg/.htaccess
UPDATE 2019: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://andreas-hecht.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@mizansyed
mizansyed / nginxproxy.md
Created June 13, 2018 14:43 — 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

@mizansyed
mizansyed / values_pointers.go
Created May 30, 2018 13:44 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@mizansyed
mizansyed / deployUser.md
Created December 29, 2016 13:57 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@mizansyed
mizansyed / README.md
Created December 29, 2016 01:50 — forked from dominikwilkowski/README.md
Ubuntu 16.04 setup with NGINX http/2 and letsencrypt

Intro

This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.

Basics

After creating the server (droplet on DigitalOcean) log in with