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
local function countItem(item) | |
local c | |
for bag=0,NUM_BAG_SLOTS do | |
for slot=1,GetContainerNumSlots(bag) do | |
if item == GetContainerItemID(bag,slot) then | |
c=c+(select(2,GetContainerItemInfo(bag,slot))) | |
end | |
end | |
end | |
return c |
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
RewriteEngine On | |
# handle modern favicons | |
RewriteRule ^(browserconfig.xml|manifest.json|safari-pinned-tab.svg|(android-chrome|favicon|mstile)-[0-9]+x[0-9]+.png|apple-touch-icon(-precompressed.png|-[0-9]+x[0-9]+.png|.png)|manifest.json)$ /favicon/$1 [L] | |
# exclude editor path | |
RewriteRule ^app\/ - [L] | |
# handle all seo files | |
RewriteRule ^(epndomain.txt|LiveSearchSiteAuth.xml|google[A-Za-z0-9]+.xml|[A-Za-z0-9]+.txt|(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})[A-Za-z0-9]+.html|robots.txt|sitemap.xml)$ display.php?seo=$1 [NC,L] |
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 | |
# source folder as mount path on linux | |
WINPATH="/mnt/d/bash" | |
# destination root folder | |
LINPATH="/home/nodejs" | |
# check if <project> param received | |
if [ $# -ne 1 ]; then |
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 | |
include('wp-config.php'); | |
$user_id = 1; // Default admin user id. (usually the first user entered into the database) | |
$remember = 1; // Remember Session (14 days approx) | |
$secure = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') ? 0 : 1; // Use SSL | |
// Force authorization as the above user without password | |
wp_set_auth_cookie( $user_id, $remember, $secure ); |
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 | |
#mode=$1; shift | |
find "$@" -type f -exec chmod "0644" {} + | |
find "$@" -type d -exec chmod "0755" {} + |
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 | |
$details = getRawSecureWebsite('www.google.com'); | |
echo '<textarea>' . $details['raw'] . '</details>'; | |
function getRawSecureWebsite( $domain ) { | |
$raw = ''; | |
$headers = ''; |
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 | |
INSTRUCTIONS=" | |
<html> | |
<head> | |
</head> | |
<body> | |
<h3>Installation Instructions</h3> | |
<b>Step 1</b> | |
<p>Login to your cPanel account and look for the following icon and click it</p> |
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 | |
# if no local config for dovecot exists, make one | |
if[ ! -e /var/cpanel/templates/dovecot2.2/main.local ]; then | |
cp /var/cpanel/templates/dovecot2.2/main.default /var/cpanel/templates/dovecot2.2/main.local | |
fi | |
# check if ssl_dh_parameters exists already. if it doesn't exist, insert it | |
if [ -z "$(grep "ssl_dh_parameters_length" /var/cpanel/templates/dovecot2.2/main.local)" ]; then | |
sed -i '/ssl = \[% ssl %\]/,/\[%- ELSE %\]/ {/\[%- ELSE %\]/i ssl_dh_parameters_length = 2048}' /var/cpanel/templates/dovecot2.2/main.local |
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
# Enable stapling. This should only be enabled ONCE and is server-wide. | |
SSLUseStapling on | |
SSLStaplingCache "shmcb:logs/stapling_cache(128000)" | |
# Enable strict transport | |
<IfModule mod_headers.c> | |
Header Always set Strict-Transport-Security "max-age=15638400; preload" env=HTTPS | |
#Header Always set Strict-Transport-Security "max-age=15638400; includeSubdomains; preload" env=HTTPS | |
</IfModule> |