Run This command
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 8443 -j ACCEPT
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 | |
# Function to handle copying and compressing | |
copy_and_compress() { | |
local source_dir="$1" | |
local destination_dir="$2" | |
local copy_list=("${@:3}") | |
# Delete existing files in the destination directory | |
rm -rf "$destination_dir" |
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
<?php | |
/** | |
* What is the difference between new self and new static? | |
* self refers to the same class in which the new keyword is actually written. | |
* | |
* static, in PHP 5.3's late static bindings, | |
* refers to whatever class in the hierarchy you called the method on. | |
* | |
* In the following example, B inherits both methods from A. | |
* The self invocation is bound to A because it's defined in A's implementation |
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
<?php | |
// take out the target element from array, $key is the target element index number , 1 means 1 element | |
$arraySpliced = array_splice($stages, $key, 1); | |
// adding the spliced element to the previous index of $key and 0 means extract or slice no element. | |
$arraySpliced = array_splice($stages, $key-1, 0, $arraySpliced); |
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
let stage='completed'; | |
this.statuses = ['open', 'in-progress', 'completed']; | |
let index = this.statuses.indexOf(stage); | |
if (direction === 'left') { | |
if (index > 0) { | |
this.statuses.splice(index, 1); | |
this.statuses.splice(index - 1, 0, stage); | |
} | |
} else if (direction === 'right') { | |
if (index < this.statuses.length - 1) { |
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 *:*> | |
ProxyPreserveHost On | |
# Servers to proxy the connection, or; | |
# List of application servers: | |
# Usage: | |
# ProxyPass / http://[IP Addr.]:[port]/ | |
# ProxyPassReverse / http://[IP Addr.]:[port]/ | |
# Example: | |
ProxyPass / http://0.0.0.0:8080/ |
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 | |
echo "Domain name eg. example.com:" | |
read domain_name | |
sudo mkdir -p /var/www/html/$domain_name | |
sudo chown -R $USER:$USER /var/www/html/$domain_name | |
cd /var/www/html/$domain_name | |
read -p 'Git Repo Full Url:' git_url |
Written with StackEdit.
/etc/apache2/sites-available/example.com.conf
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
RedirectMatch permanent ^/(.*) https://www.example.com/$1
</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
<?php | |
$url = 'http://' . $_SERVER['HTTP_HOST']; // Get the server | |
$url .= rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); // Get the current directory | |
$url .= '/public/'; // <-- Your relative path | |
header('Location: ' . $url, true, 302); | |
?> |
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 51; | |
listen [::]:51; | |
root /var/www/html; | |
index db.php; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; |
NewerOlder