This file contains hidden or 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 | |
# Creates database backups using mysqldump. It uses bzip2 for compression, and | |
# the filename of the dump is DB- and the current timestamp. The dumps are stored | |
# in ARCHIVE_DIR and bzip2 is called with nice to make it softer on the server. | |
ARCHIVE_DIR=~/backup | |
FILENAME=$(date '+%Y-%m-%d_%H:%M:%S') | |
USER=root | |
PASS=your_db_password |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 [email protected] | |
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 |