Configuring HTTPS on CentOS

1. Getting the required software   For an SSL encrypted web server you will need a few things. Depending on your install you may or may not have OpenSSL and mod_ssl, Apache’s interface to OpenSSL. Use yum to get them if you need them. yum install mod_ssl openssl   2. Generate a self-signed certificate   Using … Read more

PHP SOAP example

In order to deploy a webservice API you need at least a server and a client. PHP Soap makes the day! First install php-soap. Let’s suppose to be on a CentOS distro, you should issue a: yum install php-soap remember to reload Apache as well, with a service httpd restart Now you are ready to … Read more

recovering root password for debian 9

If you happen to forget the root password and you don’t have sudo configured, then don’t give up just yet and think about reinstalling the operating system again. There is a way to reset the root password. First reboot your computer. You should see the GRUB menu when your computer boots as shown in the screenshot below. Select Debian GNU/Linux and press e. You should see … Read more

FreePBX admin password reset

Check for the user of the web session data su that user Log into your FreePBX server via SSH as the root user, using a tool such as PuTTY on Windows, or Terminal on Mac. Next, bring up your FreePBX web interface in a web browser. Once the page has loaded, press Ctrl + A on your … Read more

30 python best practices

1. Use Python 3 In case you missed it: Python 2 is officially not supported as of January 1, 2020. This guide has a bunch of examples that only work in Python 3. If you’re still on Python 2.7, upgrade now. 2. Check for a minimum required Python version You can check for the Python version in your code, … Read more

Javascript Reduce function

Reduce Finally, we come to .reduce(), which, admittedly, is the most confusing of the three methods. The name of the method refers to reducing multiple values to one. However, I found that it’s easier to think of it as building up rather than reducing. The method works by defining a starting point. As the method iterates … Read more

Javascript Filter function

Filter On to the .filter() method, which is used when you want to extract a subset of values from the iterable. When using .filter(), remember that we are filtering in values, not filtering out. This means that each item in the iterable that evaluates true will be included in the filter. Let’s use an example of keeping only … Read more

Map function

Map The .map() method is used when you want to 1. perform a set of statements with every value in the iterable and 2. return the (presumably) modified value. Let’s use a simple example of calculating sales tax on an array of prices. const prices = [19.99, 4.95, 25, 3.50]; let new_prices = [];for(let i=0; i < … Read more