Download Latest Raspbian ISO for Raspberry Pi

Here you can download the latest Raspbian ISO files: https://www.raspberrypi.org/downloads/raspbian/ You will find following ISOs: Raspbian Buster with desktop and recommended software Raspbian Buster with desktop Raspbian Buster Lite Then use Win32Disk Imager to write the ISO in the SD card: https://sourceforge.net/projects/win32diskimager/

How to Install Pi-Hole on Raspbian for Raspberry Pi

First you need to install Raspbian on your Raspberry: Download Raspbian for Raspberry Pi Then login on your Raspberry and type these commands to update the OS: sudo apt-get update sudo apt-get dist-upgradesudo apt-get update sudo apt-get dist-upgrade To start the assisted Pi-Hole installation, type these commands: wget -O pihole-install.sh https://install.pi-hole.net sudo bash pihole-install.sh sudo […]

3 Cards in a Row with Bootstrap 4.4

Example of 3 cards in a row with Bootstrap 4.4: <div class="row py-3"> <div class="col-sm-4 py-3"> <div class="card"> <div class="card-body"> <h5 class="card-title">Example Title 1</h5> <p class="card-text">With supporting text below as a natural lead-in to additional content.</p> <a href="#" class="btn btn-primary">Go somewhere</a> </div> </div> </div> <div class="col-sm-4 py-3"> <div class="card"> <div class="card-body"> <h5 class="card-title">Example Title 2</h5> […]

Debug 502 Errors in Google Cloud Load Balancer

If your Google Load Balancer shows 502 errors read below: First go to Logs Viewer: https://console.cloud.google.com/logs/viewer Then in the search filter editbox enter: httpRequest.status:502httpRequest.status:502 This will search all 502 errors in the selected Load Balancer. Click on the specific line with the 502 error and expand “jsonPayload”: jsonPayload: { @type: "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry" statusDetails: "backend_timeout" }jsonPayload: { […]

Python if-then-else in one line example

You can put if-then-else in one line in Python like this: value_when_true if condition else value_when_falsevalue_when_true if condition else value_when_false Here is a quick example: ‘Yes’ if color == ‘Blue’ else ‘No”Yes’ if color == ‘Blue’ else ‘No’ Here is an example using assignment and contrast: color = ‘Blue’ isBlue = True if color == […]

How to urlencode() an URL in Python3

To urlencode() an URL in Python3 you can use urllib.parse: import urllib.parse   print(urllib.parse.quote("http://www.sample.com/"))import urllib.parse print(urllib.parse.quote("http://www.sample.com/")) Example result: http%3A%2F%2Fwww.sample.com%2Fhttp%3A%2F%2Fwww.sample.com%2F

Install Required Fonts for Puppeteer

Install required fonts (i.e Asian fonts) for Puppeteer: apt-get -y -q install xfonts-encodings xfonts-intl-asian xfonts-utils   apt-get -y -q install fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf fonts-ubuntu-title fonts-liberation   mkfontscale && mkfontdir && fc-cacheapt-get -y -q install xfonts-encodings xfonts-intl-asian xfonts-utils apt-get -y -q install fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf fonts-ubuntu-title fonts-liberation mkfontscale && mkfontdir && fc-cache […]

Passing a boolean through HTTP GET request

All GET parameters are strings in PHP. You can use filter_var() with FILTER_VALIDATE_BOOLEAN: $myVar = filter_var($_GET[‘myVar’], FILTER_VALIDATE_BOOLEAN);$myVar = filter_var($_GET[‘myVar’], FILTER_VALIDATE_BOOLEAN); Here is description for FILTER_VALIDATE_BOOLEAN: Returns TRUE for "1", "true", "on" and "yes". Returns FALSE otherwise.   If FILTER_NULL_ON_FAILURE is set, FALSE is returned only for "0", "false", "off", "no", and "", and NULL is […]

PHP Convert Boolean to String

You can convert a PHP boolean (true/false) into a string: $test_bool = var_export(filter_var($_GET[‘test_bool’], FILTER_VALIDATE_BOOLEAN), true);$test_bool = var_export(filter_var($_GET[‘test_bool’], FILTER_VALIDATE_BOOLEAN), true);