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, […]

Categories
Linux Useful

View the file size of a directory in LINUX – Folders and Subfolders

If we want to see what is the size occupied by folders or subfolders in linux, we can use the du command, that is a command line utility for reporting file system disk space usage. It can be used to find out disk usage for files or folders and to show what is taking up […]

Categories
Linux Servers Useful

How long a process has been running on linux server ? by PID or Name

If you want to see how long a process has been running on linux, all you have to do is find on its PID and use the following command: @ ps -o etime= -p “530” 9-18:53:38 but if you want the result in seconds, not in D-H:M:S / timestamp format, use the command like this: […]