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
<FilesMatch "\.(php|php2|php3|php4|php5|pl|py|jsp|asp|phtm|phtml|shtml|sh|cgi)$"> | |
deny from all | |
SetHandler none | |
</FilesMatch> |
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 | |
# Check if script is being run by root | |
if [[ $EUID -ne 0 ]]; then | |
printf "This script must be run as root!\n" | |
exit 1 | |
fi | |
DIVIDER="\n***************************************\n\n" |
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 | |
// IP to check | |
$ip_check = $_SERVER['REMOTE_ADDR']; | |
// Array of allowed IPs and subnets, both IPv4 and IPv6 | |
$ips_allowed = array( | |
'192.30.252.0/22' | |
'2620:112:3000::/44' | |
'192.168.16.104' | |
); |
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
# Password Protect Directory # | |
AuthType Basic | |
AuthUserFile /srv/www/example.com/.htpasswd | |
AuthName "Enter username and password" | |
require valid-user |
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
# Operating system files | |
.DS_Store | |
Desktop.ini | |
Thumbs.db | |
# Common files and directories | |
/.htaccess | |
.npmignore | |
.project | |
.revision |
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 | |
# Check if script is being run by root | |
if [[ $EUID -ne 0 ]]; then | |
printf "This script must be run as root!\n" | |
exit 1 | |
fi | |
DIVIDER="\n***************************************\n\n" |
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 | |
// List of tags to be replaced and their replacement | |
$replace_tags = [ | |
'i' => 'em', | |
'b' => 'strong' | |
]; | |
// List of tags to be stripped. Text and children tags will be preserved. | |
$remove_tags = [ |
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
<html> | |
<head> | |
<style> | |
#my-container { | |
width: 320px; | |
position: relative; | |
height: 320px; | |
margin: auto; | |
background: black; | |
} |
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
// returns the os name, type and version, and sets body classes | |
// detects major desktop and mobile os: Windows, Windows Phone, Mac, iOS, Android, Ubuntu, Fedora, ChromeOS | |
// based on bowser: https://github.com/ded/bowser | |
// list of user agent strings: http://www.webapps-online.com/online-tools/user-agent-strings/dv | |
function getOS() { | |
var ua = navigator.userAgent, os; | |
// helper functions to deal with common regex | |
function getFirstMatch(regex) { | |
var match = ua.match(regex); |
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
// returns the browser name, type and version, and sets body classes | |
// detects major browsers: IE, Edge, Firefox, Chrome, Safari, Opera, Android | |
// based on: https://github.com/ded/bowser | |
// list of user agen strings: http://www.webapps-online.com/online-tools/user-agent-strings/dv | |
function getBrowser(){ | |
var ua = navigator.userAgent, browser; | |
// helper functions to deal with common regex | |
function getFirstMatch(regex) { | |
var match = ua.match(regex); |