Skip to content

Instantly share code, notes, and snippets.

View eftakhairul's full-sized avatar
💭
writing code for spaceship :P

Md Eftakhairul Islam eftakhairul

💭
writing code for spaceship :P
View GitHub Profile
@eftakhairul
eftakhairul / LEMP-server
Last active July 10, 2017 15:47
Create lamp-server
#!/bin/sh
##################################################################################
# Bash script to install an LEMP stack plus tweaks. For Ubuntu based systems.
# Written by @eftakhairul from https://eftakahirul.com
#
#
# RUN: bash <(curl -s https://gist.githubusercontent.com/eftakhairul/74670f8ba96bcf6efcecb28f238aa3b7/raw/f43cc5deaac1bcc20657e6bd3a1455441c1795d6/LEMP-server)
###################################################################################
/**
* Account class (Parent class)
* @constructor
*/
var Account = function() {
this.amount = 0;
this.setAmount = function(amount) {
this.amount = amount;
@eftakhairul
eftakhairul / JS Inheritance Concept
Last active April 29, 2017 15:17
JS Inheritance Concept through prototype
/*
//Literal way
var car = {
color:'black',
make: 'Audi',
model: 'A5',
move: function() {
return 'It is moving';
},
@eftakhairul
eftakhairul / file_backup.sh
Last active March 6, 2019 09:58
Dump backup scripts
#!/bin/bash
DB_DIR='file-dumps'
rsync -avz DB_DIR app@ip_address:/home/app/backup
echo "Dump has been synced successfully at $(date)" >> /tmp/dump_cron_log.txt
@eftakhairul
eftakhairul / apache2_https
Last active December 19, 2016 18:53
It will work for php and html both
NameVirtualHost *:443
<VirtualHost *:443>
ServerName www.example.com
DocumentRoot /var/www
DirectoryIndex index.php
#DirectoryIndex index.html index.htm
SSLEngine on
SSLCertificateFile /home/ubuntu/.crypto/www_example_com.crt
SSLCertificateKeyFile /home/ubuntu/.crypto/www_example_com.key
<VirtualHost *:80>
ServerName example.com
Redirect 301 "/" "https://www.example.com/"
</VirtualHost>
@eftakhairul
eftakhairul / nginx_http_to_https
Last active November 30, 2016 16:32
Forcefully redirect from http to https
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;
return 301 https://$server_name$request_uri;
}
@eftakhairul
eftakhairul / ngix_html_angular_app
Last active November 30, 2016 16:37
ngix-html-angular-app
server {
server_name staging.io;
listen 80;
access_log /var/log/nginx/staging.io.access.log;
error_log /var/log/nginx/staging.io.error.log;
root /home/app/snap-ui/dist;
index index.html index.htm;
@eftakhairul
eftakhairul / apache2_php
Last active November 30, 2016 16:37
Basic apache2 server configuration for php App
<VirtualHost *:80>
ServerAdmin mail@eftakhairul.com
DocumentRoot /home/app/php-app
ServerAlias www.abc.com
ServerName abc.com
<Directory /home/app/php-app>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
@eftakhairul
eftakhairul / nginx_redirection
Last active November 30, 2016 16:37
Basic redirection by nginx
server {
server_name abc.com;
return 301 http://xyz.com;
}