This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) | |
################################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Account class (Parent class) | |
* @constructor | |
*/ | |
var Account = function() { | |
this.amount = 0; | |
this.setAmount = function(amount) { | |
this.amount = amount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
//Literal way | |
var car = { | |
color:'black', | |
make: 'Audi', | |
model: 'A5', | |
move: function() { | |
return 'It is moving'; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName example.com | |
Redirect 301 "/" "https://www.example.com/" | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name example.com; | |
return 301 https://$server_name$request_uri; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name abc.com; | |
return 301 http://xyz.com; | |
} | |