Home » 2021 » February

How To Fix Broken Packages in Ubuntu [Tutorial]

How To Fix Broken Packages in Ubuntu

Package managers like apt are one of the big selling points of Linux operating systems and Ubuntu – a vast curated collection of software that can do just about anything, available with a few keypresses. A vetted and (usually) reliable source of great software to meet any task. However, when something can go wrong, eventually it will go wrong. A package may only partially install or conflict with something else in your system environment. Maybe an update is pushed out that breaks an installation. When this happens, Ubuntu has a few … Read more

Home » 2021 » February

Setting up a LAMP Stack on Ubuntu 20.04 (And Raspberry Pi)

LAMP Stack on Ubuntu

This tutorial covers setting up a full LAMP (Linux, Apache, MySQL, PHP) web stack, including HTTP server, MySQL database, and PHP for app logic. This is commonly called a LAMP server – Linux, Apache, MySQL, PHP. Linux rules the web server world – the operating system powers the vast majority of web servers worldwide. Apache is a popular web server – the software with which web browsers connect to receive content. MySQL is a popular database server – it stores information in rows and columns inside tables. There is also a drop-in replacement … Read more

Home » 2021 » February

touch Command in Linux and Bash [with Examples]

touch Command in Linux

The touch command in Linux updates the timestamps on a file or creates the file if it doesn’t exist. See some examples and use cases below. It sounds useless, but it’s actually useful. For example, if you want to create an empty file called my_file.txt, you can just run: touch my_file.txt Easy! Updating the timestamps of a file is also useful. Say you have a file called favorite_tv.txt, which you use to keep the name of your current favorite TV show. Your favorite show 10 years ago was … Read more

Home » 2021 » February

What Does “./” (Dot Slash) Mean in Linux?

What Does Dot Slash Mean in Linux

In Linux, *./ (dot slash) represents the relative path to the current working directory. This article lays out exactly what it means and how to use it. . (dot) and .. (double-dot) . (single dot) and .. (double dot) are special directory names in Linux (And other *nix operating systems). . represents the current directory. .. represents the parent directory (of the current directory). ./ (dot slash) So, the . in ./ represents the *current& directory – and the slash is the path delimiter so that what follows will refer to the contents of the current directory. Example To edit … Read more

Home » 2021 » February

How to Install & Use Bash (Linux Shell) on Windows 10 [Tutorial]

bash for windows

Here’s how to set up and use the Linux shell on Windows – using the Windows Subsystem for Linux (WSL). This tutorial is intended for up-to-date versions of Windows 10 from 2020 onwards. I’m not going to cover how to use WSL on older versions of Windows 10 or other methods for Windows 8/7/XP/3.1 because you shouldn’t be using outdated software. If you must use Windows, use a version that still receives security patches! WSL is a great tool and allows you to pretty much run Linux software on windows … Read more

Home » 2021 » February

PHP strtotime() Function – Converting Text to Timestamp [With Examples]

PHP strtotime

The PHP strtotime() function takes a string containing text and converts it to a Unix Timestamp. Find out how to use this function in this guide. A Unix timestamp is a number representing the number of seconds since 00:00:00 UTC on 1 January 1970. From it, you can build more complex Date/Time objects which can readily provide Dates/Minutes/Hours/Seconds or other information about the supplied time. strtotime Syntax strtotime ($datetime , $baseTimestamp) Note that: $datetime is your supplied text string (possibly) containing a date strtotime() supports the English language only See … Read more

Categories PHP

Home » 2021 » February

Raspberry Pi & Python Powered Tank – Part II

Raspberry Pi Python Powered Tank Part II

This is part 2 of the Raspberry Pi and Python powered tank project. In this article, we attempt to display a live video stream and buttons to control the tank in a web UI. In the Last Episode In part 1, I gutted a toy tank and wired in a Raspberry Pi, and wrote some Python to make it move around. Now, to write a remote control interface that runs in a web browser, with a live video stream and buttons to control the motors. … Read more

Home » 2021 » February

Concatenating (Joining) Strings in JavaScript [3 Methods]

javascript string concatenation

Being able to concatenate (join) two or more strings together is pretty useful – you may be combining user input for storage in a single database column or doing the reverse – combining data from multiple database columns into a single string for display or output. There are several ways to concatenate strings in Javascript, and we’ll cover these methods below, along with some useful examples. The string.concat() Method The string.concat() method will join any number of strings to a given initial string. Syntax string.concat(string1, string2, string3…) Note that: string is … Read more

Home » 2021 » February

Javascript String includes() Method – Check if a String Contains Another String

Javascript String includes

Here’s a guide on checking whether a string contains another string in the JavaScript programming language using the includes() method. includes() Syntax string.includes(search, start) Note that: string should be a string value or variable search should be the string you are checking for start is the index (position) you want to start searching at. It’s optional Indexes start counting at 0 – The first character of the string is at index 0 returns bool Examples var string = “Linux all over the world”; var result = string.includes(“over”); // Will … Read more

Home » 2021 » February

Python isinstance Function, With Example [Guide]

Python isinstance Function

The Python isinstance() function determines the type or class of a variable. Read on to find out exactly how isinstance works, with an example below. What are Types? The type of a variable determines what it can or can’t do. It determines what value the variable may take and what can be done with that value. isinstance Syntax isinstance(OBJECT, CLASS) Note that: OBJECT is the variable or value to check the type or class of CLASS is the type or class we want to see if the variable type matches The function returns a boolean value (True/False) Types in Python Generally, … Read more