Postgresql enable remote access
To enable remote access to a postgresql database from a computer or server, in Ubuntu server, first we need to know the ip of the computer in question, for example 92.58.201.162. Then, from the terminal,…
To enable remote access to a postgresql database from a computer or server, in Ubuntu server, first we need to know the ip of the computer in question, for example 92.58.201.162. Then, from the terminal,…
To know your ip address just use one of the many services available online. This service is also available on dotmaui.com, free and without annoying advertising, at the address: https://dotmaui.com/my-ip/ For those who want to…
Here is a list of useful JS and CSS resources with CDN that you can include in your sites. Obviously free and with HTTPS protocol. jQuery https://cdn.dotmaui.com/libs/js/jquery-3.2.1.min.js https://code.jquery.com/jquery-3.2.1.min.js https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js jQuery UI https://code.jquery.com/ui/1.12.1/jquery-ui.min.js jQuery Mobile…
Remove script tags (or other types of tags) from a string in PHP is really easy, here’s how: <?php $html = <<<HTML <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="https://cdn.dotmaui.com/dotmaui/css/dark.css" /> <script> alert('1') </script> <script…
To process files with a .htm or .html file extension as PHP files you must add the following line to the file.htaccess (if this file does not exist, create it on the site ROOT). AddType…
Here is a small class in PHP to write log files. If the file name is not specified, it will be assigned by the script. <?php class Log { private $PATH; function __construct($file_name = null)…
To check if an item is present in the DOM using jQuery, it is sufficient to use the length property, like this: if ($(‘#myElement’).length) { // Exists } else { // Not Exists } Or…
Small piece of programming code in vb.net. How to Perform a Group By with LINQ. Dim Result = From p In Person Group p By MyGroup = New With { Key .Name = p.Name, Key…
How reverse a boolean with one line of code. VB.net MyVar = Not MyVar PHP $myvar = !$myvar; C# myvar = !myvar; Python my_var = not my_var Go MyVar = !MyVar Javascript myvar = !myvar;…
Python provides the urllib2 module that helps us in HTTP requests by defining functions and classes for redirecting, cookies, authentication and more. Here’s an example to take the content of a page and store it…