Skip to content

Instantly share code, notes, and snippets.

Avatar

Waqas Ashraf sheikhwaqas

View GitHub Profile
View setup-apache-nginx-multi-php.sh
########################################################################
# Installing and Configuring Apache & Nginx with Multiple PHP Versions #
# Apache will run on port 8080 and will be behind Nginx #
# Nginx will serve as a reverse proxy for Apache Sites #
# Nginx will act as the primary web and caching server #
########################################################################
# Update Packages
sudo apt update && sudo apt upgrade -y
View keybase.md

Keybase proof

I hereby claim:

  • I am sheikhwaqas on github.
  • I am sheikhwaqas (https://keybase.io/sheikhwaqas) on keybase.
  • I have a public key ASAKmnco7goOktG8mZzZlAGmHelvaZu8joSYtU_C3Zem-go

To claim this, I am signing this object:

@sheikhwaqas
sheikhwaqas / P12toPEM.txt
Created Oct 10, 2018 — forked from shahdhiren/P12toPEM.txt
Convert P12 file for Push Notification to PEM format
View P12toPEM.txt
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@sheikhwaqas
sheikhwaqas / install-docker.sh
Created Apr 9, 2018
Install Docker & Docker-Compose on Ubuntu 16.04 LTS (Xenial). Run this file with sudo.
View install-docker.sh
# Install Pre-requisites
apt update
apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt update
# Install Docker CE
apt install docker-ce -y
@sheikhwaqas
sheikhwaqas / docker-compose.yml
Last active Nov 17, 2019
Docker Compose configuration to run MySQL 5.6 and MySQL 5.7 on one instance. Create /var/lib/mysql56-data & /var/lib/mysql57-data with root as the owner of these directories before running docker-compose up -d
View docker-compose.yml
version: '3'
services:
mysql56:
image: mysql:5.6
restart: unless-stopped
container_name: mysql56-container
ports:
- "127.0.0.1:3356:3306"
environment:
MYSQL_ROOT_PASSWORD: rootPassword
@sheikhwaqas
sheikhwaqas / setup-lemp.sh
Last active Jul 31, 2020
Install the LEMP stack on Ubuntu 16.04 LTS with Composer, Ruby, Sass & Compass
View setup-lemp.sh
###############################################################################
# Install nGinx and PHP 7 on Ubuntu 16.04 LTS
###############################################################################
# Install nGinx Server
apt install nginx
# Install PHP & and it's respective packages
apt install php-common php-fpm php-mysql php7.0-cli php7.0-common php7.0-fpm php7.0-json php7.0-mysql php7.0-opcache php7.0-readline php-bcmath php-bz2 php-calendar php-ctype php-curl php-date php-enchant php-gd php-intl php-mbstring php-mcrypt php-mongodb php-soap php-sqlite3 php-tidy php-xdebug php-xml php-xml-parser php-xml-rpc2 php-xml-serializer php-xml-svg php-xmlrpc php-zip
@sheikhwaqas
sheikhwaqas / setup-mongodb34-ubuntu16.sh
Last active Sep 17, 2020
Install mongoDB 3.4 on Ubuntu 16.04 LTS
View setup-mongodb34-ubuntu16.sh
###############################################################################
# Install mongoDB Server on Ubuntu 16.04 LTS
###############################################################################
# Import the Public Key used by the Ubuntu Package Manager
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
# Create a file list for mongoDB to fetch the current repository
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
@sheikhwaqas
sheikhwaqas / setup-mysql57-ubuntu16.sh
Created Apr 11, 2017
Install MySQL Server 5.7 on Ubuntu 16.04 LTS
View setup-mysql57-ubuntu16.sh
###############################################################################
# Install MySQL Server 5.7 on Ubuntu 16.04 LTS
###############################################################################
# Download and Install the Latest Updates for the OS
apt update && apt upgrade -y
# Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
echo "mysql-server-5.7 mysql-server/root_password password root" | sudo debconf-set-selections
echo "mysql-server-5.7 mysql-server/root_password_again password root" | sudo debconf-set-selections
@sheikhwaqas
sheikhwaqas / gist:e26cd1fec78c1af986c8a269482e0e3e
Created Jan 6, 2017 — forked from learncodeacademy/gist:ebba574fc3f438c851ae
Nginx Node Frontend / Load Balancer / Static Assets Caching
View gist:e26cd1fec78c1af986c8a269482e0e3e
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
@sheikhwaqas
sheikhwaqas / mysqlbackup-tos3.sh
Last active Apr 10, 2019
Backup Individual MySQL Databases and Upload the same to Amazon S3. Please ensure Amazon AWS CLI tools are already installed and configured on the server.
View mysqlbackup-tos3.sh
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Temporary Path where the archive will be created and stored before uploading to S3
# Example: BACKUPPATH=/mnt
BACKUPPATH=/
# Amazon S3 Bucket name
# Example: S3BUCKET=production-database-backups
S3BUCKET=