Categories
Useful

jQuery On Load and Ready not firing for dynamically loaded content ?

Trying to distribute the resources loaded on a page through a function that loads the JavaScript as dynamic files and not all at once, I ran into a problem: None of the following function calls was useful for dynamic scripts: .on (“load”, handler) .on (“ready”, handler) $ (document) .ready (handler) $ (window) .load (handler) window.onload […]

Categories
Linux Servers Useful

Reload new entry in fstab – fast and easy way – Linux

A fast and easy way to reload new entries in /etc/fstab is to use the linux mount command: @ sudo mount -a or with verbose mode: @ sudo mount -av / : ignored /boot : already mounted /boot/efi : already mounted //srv/TOSHIBA-3T-V300 : already mounted //srv/WD-2T-USB : already mounted //srv/TOSHIBA-3T-ENTERPRISE: already mounted //srv/SAMSUNG-850-PRO : already […]

Categories
Tools Useful

How to listen Youtube only Audio-Mode, without Video !

Youtube only Audio-Mode – For those who want to listen only audio on youtube, without video: Music Mode for YouTube™ (chrome) : https://chrome.google.com/webstore/… Audio Only for YouTube™ (chrome) : https://chrome.google.com/webstore/… Audio Only for YouTube™ by Sevina (firefox) : https://addons.mozilla.org/en-US/firefox… Youtube Audio by Animesh Kundu (firefox) : https://addons.mozilla.org/en-US/firefox… This extensions it is very useful and beneficial when the available bandwidth is too […]

Categories
Security Useful

HTTP Security Headers Which Should be Used by all Webmasters

The most important HTTP Security Headers which should be used by all webmasters: Content-Security-Policy is an effective measure to protect your site from XSS attacks. By whitelisting sources of approved content, you can prevent the browser from loading malicious assets. Directives include upgrade-insecure-requests; , default-src, script-src, style-src, img-src, object-src, plugin-types to specify permitted sources for scripts, CSS stylesheets, and images. A basic […]

Categories
PHP Useful

Get HTTP Status Code – PHP Functions

Below are some useful solutions (php functions) for HTTP Status Codes returned in the required page header by servers when loading a web page. global $http_status_code; $http_status_code = [ // ~~~ officially known https codes 100 => ‘Continue’, 101 => ‘Switching Protocols’, 102 => ‘Processing’, // WebDAV; RFC 2518 103 => ‘Early Hints’, // RFC 8297 […]

Categories
PHP Useful

Convert String Array Associative to Array Type – Eval and array index as variable

Recently I encountered a small problem with a library downloaded from github or sourceforge (I don’t remember exactly), but quite old, with many functions used on the old style, many of them already deprecated. Another problem encountered was the evaluation of a string and its transformation into an array, the internal representation being of a […]

Categories
PHP Useful

Gets the current working directory in PHP

using getcwd() – gets the current working directory – php function echo getcwd(); using dirname() php function echo dirname(__FILE__); echo dirname($_SERVER[PHP_SELF]); using basename() php function  – (PHP5+) echo basename(__DIR__) so if you want to use a file with require_once, include or require, the usage syntax can be the following: require_once dirname(__FILE__) . ‘/folder/script.php’;

Categories
PHP Useful

Get HTTP Status Code from Header – PHP

1. First of all we have to: deactivate the SSL verification because there are cases in which the site is redirected from a domain where the SSL has expired! limit the number of redirects, so as not to enter an endless loop initialize User-Agent with a real value , otherwise there is the possibility that […]

Categories
Broken Internet Useful

WW Copyright Trolls – Images, Movies, Music

Media Copyright Trolls (Youtube, Music & Video): Agora Aggregator Cartoon Network Digital Minds Entertainment EMI Freeplay Music Gamer.nl GoDigital Media Group IMG Media UK, INgroove, Kontor New Media LCJ Editions Productions Major Record Labels (Sony, EMI, WMG) Music Publishing Rights Collecting Society, MPRCS Netcom Partners Persona Recording Industry Association of America (RIAA) Righthaven SBSi Sanoma […]

Categories
PHP Useful

Get last URL after following HTTP redirections in PHP – get_headers

1st. step: Disable https/ssl verify & set some headers … $context = stream_context_create( [ ‘ssl’ => [ ‘verify_peer’ => false, ‘verify_peer_name’ => false, ], ‘http’=>array( ‘max_redirects’=>10, ‘ignore_errors’=>0, ‘method’=>”GET”, ‘header’=>”Accept-language: en\r\n” . “Cookie: \r\n” . “User-Agent: Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19\r\n” ) ]); default method is GET, […]