Vertically align Facebook and Twitter share buttons

HTML code to vertically align Facebook and Twitter share buttons: <div class="d-inline"> <style>.fb_iframe_widget span { vertical-align: baseline !important; }</style> <div class="fb-like" data-href="http://www.yourwebsite.com/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="true"></div> <a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-show-count="false">Tweet</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> </div><div class="d-inline"> <style>.fb_iframe_widget span { vertical-align: baseline !important; }</style> <div class="fb-like" data-href="http://www.yourwebsite.com/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="true"></div> <a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-show-count="false">Tweet</a><script […]

Download Windows 10 ISO without Media Creation Tool

You can download the official Windows 10 ISO file without Media Creation Tool from the Microsoft.com website. Just follow these simple steps: 1) On your browser install an add-on to change the user agent Download User Agent Switcher for Mozilla Firefox Download User Agent Switcher for Google Chrome 2) Change the user agent to Apple […]

Firefox add-ons cannot be verified and have been disabled

On May 4 2019 the web browser Mozilla Firefox started to show a warning message “One or more installed add-ons cannot be verified and have been disabled” and all installed browser extensions were all disabled. This created some panic within Firefox users and myself too, as I found all my Firefox extensions disabled without an […]

Python Socket IPv6 (AF_INET6) Listen

Listen on an IPv6 address and port in Python with socket(): ADDR = (HOST, PORT) serversock = socket.socket(family=socket.AF_INET6) serversock.bind(ADDR) serversock.listen(0)ADDR = (HOST, PORT) serversock = socket.socket(family=socket.AF_INET6) serversock.bind(ADDR) serversock.listen(0) Change HOST and PORT as needed.

Allow User to Run Sudo Command without Password

You can edit /etc/sudoers file and add a line like this: carlo ALL=(ALL) NOPASSWD: /usr/bin/programcarlo ALL=(ALL) NOPASSWD: /usr/bin/program So when user carlo runs “sudo /usr/bin/program” he’ll not need to enter the password. Useful to allow an user to run specific programs with sudo without password.

Fix Nginx 400 Bad Request: The SSL certificate error

I have a website where I am using Nginx + SSL by Lets Encrypt and some users reported continuous “400 Bad Request” errors. I digged the event and looks like this trick fixed the issue: Add this to your Nginx vhost config file inside server {} section: error_page 497 https://$host$request_uri;error_page 497 https://$host$request_uri; Reference: https://stackoverflow.com/a/55029648 https://stackoverflow.com/a/14241127

How to Downgrade WordPress to an Older Version

Today I installed WordPress 5.1.1 and it was a total mess. I had issues when publishing new posts, it was slower than v4.9.8, etc. So I decided to downgrade to v4.9.8 and to do this I installed: WP Downgrade | Specific Core Version It is a plugin that can help you downgrade to any previous […]

nginx: [warn] the “ssl” directive is deprecated

Today I upgraded Nginx to v1.16.0 stable and I noticed this: nginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directivenginx: [warn] the "ssl" directive is deprecated, use the "listen … ssl" directive To fix this just delete “ssl on;” from your vhost config file. For example, change this: server { listen […]

PHP GetHostByAddr() Slow? Make it Faster

A quick workaround to make gethostbyaddr() faster in PHP is: // Set timeout and retries to 1 to have a max execution time of 1 second for the DNS lookup putenv(‘RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1’);   // Now call gethostbyaddr() function $ip = @gethostbyaddr("1.2.3.4");// Set timeout and retries to 1 to have a max execution time […]

How to Match Newline with Strpos() in PHP

Match newline with strpos() in PHP: $string = "Hello World Testing New Line";   $findme = "Hello World\r\nTesting";   if(strpos($string, $findme) !== false) { echo "String found"; } else { echo "String not found"; }$string = "Hello World Testing New Line"; $findme = "Hello World\r\nTesting"; if(strpos($string, $findme) !== false) { echo "String found"; } else […]