Calling javascript in javascript works for some but not all scripts [migrated]

I have the following code in a script.js file that I call in my html file:

function loadScript(url) {         var head = document.getElementsByTagName('head')[0];     var script = document.createElement('script');     script.type = 'text/javascript';     script.src = url;     script.async = false;     head.appendChild(script); }  loadScript('') loadScript('') loadScript('')  hljs.initHighlightingOnLoad(); 

I use this code because I want to call only one .js file in my html instead of multiple .js files.

The first two scripts that I load to call MathJax work fine. The third script to call highlight.js however does not run.

When I paste all the code from the file ‘highlight.min.js’ into the my script.js file, the javascript does run normally when I open the html.

I don’t understand why loading the ‘highlight.min.js’ file with the loadScript() does not work, or what I can do to get it to work. Any help is appreciated.

Can switching from .com TLD to non .com TLD affect emails even if MX records migrated correctly

I have a high-level question about a customer that switched from a .com TLD to a .fun TLD. They didn’t switch hosting, only their TLD. They’re now having issues with their emails, personal and campaign based, being blocked.

Before I dig in to the technical stuff, I wanted to know if anyone had a similar issue. Before I dig in to MX records and such, I didn’t know if there were known TLD issues with ones like .fun, etc. Sorry if this is a vague question. And I promise I’ve been googling and asking first!

Securly uploading videos in PHP [migrated]

This question is about letting a potentially malicious user upload videos to your site – specifically, handling the file itself.

With images, one one simple thing you do (after every other thing is validated) is

    if( $  uploaded_type == 'image/jpeg' ) {         $  img = imagecreatefromjpeg( $  uploaded_tmp );         imagejpeg( $  img, $  temp_file, $  imageQualityPercentage);     }     elseif( $  uploaded_type == 'image/png') {         $  img = imagecreatefrompng( $  uploaded_tmp );         imagesavealpha($  img, TRUE);         imagepng( $  img, $  temp_file, 9*(1-$  imageQualityPercentage/100));     } 

Which basically re-creates the image from user input.

Is there an equivalent in PHP for videos? I’d very much like if mp4/oog/webm ones existed (and supported most codecs), but anyone knows any open source libraries that do this for at least any format/codec?

How to verify PGP signature with signing key using Enigmail in Thunderbird [migrated]

I received an email like this above:

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1  Because anyone can claim to be me. There's no validation of the user name or email address when someone posts a comment. While I do try to remove imposters, some may slip through. By signing my comments using this technique, anyone can independently verify that I was the author of the message by validating the signature. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32)  iD8DBQFFxqRFCMEe9B/8oqERAqA2AJ91Tx4RziVzY4eR4Ms4MFsKAMqOoQCgg7y6 e5AJIRuLUIUikjNWQIW63QE= =aAhr -----END PGP SIGNATURE----- 

And another email with the public key. How can I verify if the signature is valid using the Enigmail in Thunderbird?

OpenVPN works on Ubuntu but not Android – Name Resolution [migrated]

Server1 – Primary DNS/Plesk
Server2 – Secondary DNS
Server3 – OpenVPN

On by local computer running Ubuntu 20.04 I can successfully connect to the OpenVPN server and browse any website. My public IP Address shows as the SERVER3 IP Address.

On my Android, I can successfully connect to the OpenVPN server but I can only browse websites hosted on Server1. All other websites get the DNS_PROBE_FINISHED_BAD_CONFIG error message. In the OpenVPN app it shows a successful connection and the correct IP Addresses.

I am using the exact same configuration file for both devices. Note, different certificates are used for the connection.

Looking at the syslog on Server1, I see:

client @0x7f79480ea2b0 ANDROID-PUBLIC-IP-ADDRESS#50743 ( query (cache) '' denied 

I don’t get these errors when browsing on the Ubuntu box.

My ovpn file:

dev tun proto tcp remote SERVER3 IP 443 resolv-retry infinite nobind user nobody group nogroup persist-key persist-tun remote-cert-tls server cipher AES-256-GCM auth SHA256 verb 3 key-direction 1 <certificates are here> 

My OpenVPN Config file:

management 5555 dev tun ca ca.crt cert server.crt key server.key  # This file should be kept secret dh none server ifconfig-pool-persist /var/log/openvpn/ipp.txt push "dhcp-option DNS SERVER1 IP" push "dhcp-option DNS SERVER2 IP" keepalive 10 120 tls-crypt ta.key cipher AES-256-GCM auth SHA256 user nobody group nogroup persist-key persist-tun status /var/log/openvpn/openvpn-status.log log         /var/log/openvpn/openvpn.log log-append  /var/log/openvpn/openvpn.log verb 3 explicit-exit-notify 0