Skip to content

Instantly share code, notes, and snippets.

View hemantshekhawat's full-sized avatar
🎯
Focusing

Hemant Shekhawat hemantshekhawat

🎯
Focusing
View GitHub Profile
@hemantshekhawat
hemantshekhawat / install_lamp_18.sh
Last active July 17, 2020 19:12 — forked from elisei/install_lamp_18.sh
Ubuntu 18.04 - PHP development (php 7.2, MySQL 5.7, apache 2.4)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 18.04 dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
@hemantshekhawat
hemantshekhawat / aws-static-assets.md
Created June 12, 2018 16:44 — forked from ultim8k/aws-static-assets.md
Serve assets from AWS S3 + Cloudfront

Serve assets from AWS S3 + Cloudfront

Enabling CORS

S3 bucket setup

Go to your s3 bucket and go to Permissions and then CORS configuration. You can edit and paste the following snippet after replacing __PRODUCTION_DOMAIN__ and __LOCAL_DOMAIN__ with the real domains.

@hemantshekhawat
hemantshekhawat / readme.MD
Last active October 6, 2017 10:03
How to setup Gitlab CI for AngularJs App

setup Gitlab Runner on server (ubuntu):

  1. Add GitLab's official repository via apt-get or yum: Debian/Ubuntu: curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash RHEL/CentOS: curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash
  2. sudo apt-get update
  3. sudo apt-get install gitlab-ci-multi-runner

register gitlab runner

  1. sudo gitlab-ci-multi-runner register
@hemantshekhawat
hemantshekhawat / .htaccess
Created June 1, 2017 12:55 — forked from Eomerx/.htaccess
.htaccess
# Apache Server Configs v2.14.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# ######################################################################
@hemantshekhawat
hemantshekhawat / Laravel PHP7 LEMP AWS.md
Created January 3, 2017 08:03 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@hemantshekhawat
hemantshekhawat / scs-tutorial-linux-shared-hosting-server.sh
Created November 28, 2016 11:35 — forked from stewartadam/scs-tutorial-linux-shared-hosting-server.sh
CentOS 7 shared hosting server setup script based on the SCS Shared Linux Hosting Server Security tutorial at Concordia University (2016) - discussion about security principles in the context of a shared hosting server.
#!/bin/sh
#
# Usage:
# This script will establish a basic shared hosting server running DNS, Web (HTTP), DB (SQL) and e-mail (SMTP/IMAP) services.
#
# This script doesn't include usage information on adding new user accounts and setting up mail inboxes; for that, please see my
# CentOS 5 server setup tutorial: http://www.firewing1.com/howtos/servers/centos5/getting_started
#
# This configuration is very similar to my previously documented CentOS 5 server setup, but has been ported to take advantage
# of the new features in CentOS 7.
@hemantshekhawat
hemantshekhawat / onepage.phtml
Created June 16, 2016 22:55 — forked from ashsmith/onepage.phtml
Track each step of the Magento onepage checkout in Google Analytics with this simple Javascript addition to [package]/[theme]/template/checkout/onepage.phtml just add it to the bottom of that file and follow up by configuring with Google Analytics goals
<script type="text/javascript">
Checkout.prototype.gotoSection = Checkout.prototype.gotoSection.wrap(function(parentMethod, section, reloadProgressBlock) {
// Call parent method.
parentMethod(section, reloadProgressBlock);
var _gaq = _gaq || [];
try {
// push current checkout section to google analytics if available.
@hemantshekhawat
hemantshekhawat / hhvm_magento_setup.md
Created April 22, 2016 07:58 — forked from tegansnyder/hhvm_magento_setup.md
HHVM Magento Server Setup

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@hemantshekhawat
hemantshekhawat / nginx-cors.conf
Created January 9, 2016 16:27 — forked from algal/nginx-cors.conf
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@hemantshekhawat
hemantshekhawat / mysql_db_sync
Created January 7, 2016 11:51 — forked from vasiliishvakin/mysql_db_sync
Simple bash script to sync remote mysql db to local
#!/bin/bash
LOCAL_DB=""
REMOTE_DB=""
LOCAL_USER="root"
LOCAL_PASS=""
REMOTE_USER="root"
REMOTE_PASS=''