Home » 2021

Top 3 Best Linux Distro for Gaming in 2021

Best Linux Distro for Gaming

This article will take you through our top 3 picks of the best Linux distributions for gaming in 2021. Best Linux Gaming Distros There are so many Linux distributions available for a multitude of purposes, but there are not many Linux distros with gaming at the forefront. However, many distros are great for gaming. Let’s discuss the honorable mentions, each distribution has its purpose and could be a good fit for you. Pop!_OS Aside from the asinine use of punctuation, Pop!_OS is a really great Linux … Read more

Home » 2021

Read a File Line by Line in Python [3 Methods]

Line by Line in Python

This tutorial will examine several methods and best practices for reading a file line-by-line in the Python programming language. Reading a file line-by-line will be useful for parsing log files, CSV spreadsheet files, or even reading files you have generated from an application yourself. Line by Line File Reading – Examples The examples on this page will read from a text file named mytext.txt with the following content: Linux Is Very Cool Using the readlines() Function The following python code will call the built-in open() function, which … Read more

Home » 2021

PHP foreach Loop [With Examples]

PHP foreach Loop

Looping over arrays and iterating over an object’s attributes form the foundation of a lot of application logic. The foreach construct in PHP can do both and is a crucial tool for building your application logic. PHP foreach Syntax The syntax for a foreach construct in PHP is as follows: foreach (iterable_expression as $value) { # statement(s) } Or, if you also wish to access the array key as well: foreach (iterable_expression as $key => $value) { # statement(s) } Note that: iterable_expression is the variable or value to … Read more

Categories PHP

Home » 2021

PHP switch Statement [With Examples]

PHP switch Statement

As you get more confident with your PHP code, your code will get more and more complex. The PHP switch statement simplifies your PHP logic, replacing messy if statements when trying to make simple decisions based on the value of a variable. Read on to find out how to use it. PHP switch Syntax switch($v) { case $a: # Code to be executed if $v is equal to $a break; case $b: # Code to be executed if $v is equal to $b break; case $c: # Code to … Read more

Categories PHP

Home » 2021

What is the ‘#!’ in Linux Shell Scripts?

in Linux Shell Scripts

#! – Usually nicknamed shebang, shabang, hashbang, poundbang – we’ll stick with shebang for the duration of this article. It is found at the beginning of countless Linux shell scripts – but what actually is it? Let’s break it down. It Usually Looks Something Like This #!/bin/bash The #! appears at the beginning of the file, usually on the first line, followed by the path to an executable (in this case, the bash shell). It’s a Comment It starts with a #, so it’s not executed as part of the script itself – it does affect how the … Read more

Home » 2021

How To Check your MySQL (Or MariaDB) Version [Easy]

Check MySQL Version

Knowing which version of MySQL you are running is vital when making sure your code is compatible and that you are using supported features. Here’s how to find out which you are running. For example, older versions of MySQL lack features for handling JSON data and modern character sets (including emojis!), so targeting the right MySQL version or making sure your MySQL version is up to date is pretty important if you want to support these popular functions! MariaDB is a drop-in replacement for MySQL, so … Read more

Home » 2021

Setting a Static IP Address on a Raspberry Pi [With Screenshots]

Setting a Static IP Address on a Raspberry Pi

If you followed our article on how to SSH to your Raspberry Pi so that you can control it over a network, you might be tired of having to run the commands to find out what its current IP address is on your network. Most networks assign IP addresses dynamically, which means each device on the network is assigned an IP address from a pool of available IP addresses. The address for a specific device may change over time if it is rebooted or the address is automatically … Read more

Home » 2021

Python String replace Method [With Examples]

Python String replace

This article shows you how to use the string.replace() method in Python to replace elements in a string of characters and includes useful examples. Python String replace Syntax The replace() function can be called on existing string variables like so: string.replace(find, new, count) Where: string is the existing string variable find is the string your want found and replaced new is the text you want to replace the found text count is the number of instances of the found text you want to be replaced, counted from the beginning of the … Read more

Home » 2021

Raspberry Pi & Python Powered Tank

pi python powered tank

The title pretty much explains this project- it’s a tank, that can shoot BBs – powered by a Raspberry Pi and Python Code. It’s pretty awesome. This is part one of a two-parter and handles all of the hardware and wiring and a Python script for test firing the engines. Click here to see Part 2 of this project where I get a live video stream and buttons to control the tank into a web UI! As with my other projects, I’ll try to keep things simple … Read more

Home » 2021

Checking for Available Disk Space on Ubuntu [Guide]

check disk space in ubuntu

This simple guide explains how to check how much disk space is available in Ubuntu Linux. The df command tells you how much space is being used on each storage volume attached to your Linux system. To run it, simply execute the following command in your terminal: df Which outputs: Easy! But, it’s a bit difficult to read at a glance – the -h option makes everything human-readable: df -h Which outputs: However, there’s a lot of junk in there- we can ignore the /dev/loop* entries by omitting filesystems of the squashfs type: df … Read more