Welcome to LinuxScrew

A site for Linux lovers worldwide. For newbies, system engineers, administrators, and everybody in between. We cover all things Linux, plus various programming languages, including Python, Javascript, and PHP.

View our featured tutorials and projects in the slider below or scroll down to see all recent articles.

How to Convert a USB Printer to Wireless with a Raspberry Pi
How to Use a Raspberry Pi for Digital Signage
The Worst Things You’ll Probably Google As a Programmer on Linux
How to Build a Raspberry Pi Internet Kiosk
Browsing the Internet on a 1989 Macintosh II with a Web Rendering Proxy
previous arrow
next arrow
Slider

JavaScript onclick() Events – Tutorial, With Examples

JavaScript onclick() Tutorial

JavaScript adds interactivity to web pages. This article shows you how to trigger JavaScript functions when an HTML element is clicked using onclick() events and attributes. Code examples included. JavaScript Events An event in JavaScript simply means that something has happened. The mouse has moved, or a key has been pressed, and JavaScript has been notified by the raising of an event. onclick Event When the user clicks on something, the onclick event is raised, allowing you to trigger some JavaScript code when an element is clicked. … Read more

JavaScript vs Java – What’s the Difference Which to Use in 2021?

JavaScript vs Java

Here’s a clear article on what makes Java and JavaScript different – and some information to help you make the choice on which to learn and use for your projects in 2021. First up, it’s important to clarify that JavaScript and Java are not the same things! They just have similar names. It’s stupid, and they should have called JavaScript something else (and tried to re-badge it ECMA Script, which is also a terrible name), but the JavaScript name stuck. Now we’re all stuck with two different programming languages … Read more

Delete Files Older Than X Days/Hours in Bash [Examples]

Bash Deleting Files Older Than X

This article will show you how to delete files older than a given number of days (or hours/minutes) manually or automatically via a Bash script. Examples included. Removing files older than a certain number of days (or minutes, or hours) makes use of two Linux commands – rm and find. Deleting Files with rm First up, the rm command. The rm command is used to remove files and directories in Linux. Here’s a whole article about how it’s used: rm Command in Linux [With Examples] Passing a Filtered List of Files to rm The next … Read more

Bash Aliases – What They Are and How To Use Them

Bash Aliases

If you live in the Linux Shell/Terminal, aliases are a massive timesaver. Here’s how to create your own Bash aliases, with examples. What is an Alias in Bash/Linux Shell? An alias is a shortcut to a longer command. It’s similar to a keyboard shortcut – like the CTRL + C key combination is a shortcut to the copy command in many graphical operating systems (saving the time in dragging your mouse across the screen and clicking multiple menus to reach the command), aliases are shortcuts to longer terminal commands (saving time typing out the full … Read more

OpenWrt: Set up a Basic Network Including WiFi Bridge, IP Address, DHCP

OpenWrt Network Setup

This article will show you how to configure a basic network with WiFi Bridging, DHCP on a fresh install of OpenWrt – with explanations and screenshots. This guide follows on from LinuxScrew’s guide to setting up OpenWrt on a BT HomeHub 5 – but you can follow along on any device (including a Raspberry Pi!). This article assumes you have an OpenWrt device you wish to start using. We’ll start by connecting it to your home WiFi network to get it online and then setting it … Read more

OpenWRT: Secure DNS over TLS with LuCI [No Command Line]

OpenWrt Secure DNS TLS Tutorial

This article will show you a quick and clean way of getting secure DNS over TLS running on OpenWRT – without resorting to the command line. If follows on from our other OpenWrt Articles. We’ll be using stubby – a local DNS resolver that will encrypt local DNS queries and forward them to an external secure DNS resolver Provided by Cloudflare. Why Cloudflare? Because it’s the default secure DNS resolver in the default stubby configuration, that means we don’t have to edit the config files, and Cloudflare’s servers … Read more

Segregating Devices and Networks in OpenWrt [Tutorial]

OpenWrt Segregated Wifi

This article will show you how to keep your devices separate on your OpenWRT managed network and follows the steps taken to set up a basic WiFi network covered here. Why would you want to keep your devices from talking to each other on a local network? I repair other people’s computers – other people who may not be too careful about what websites they visit. If I need to connect one of these computers to my home network, I want to make sure that they … Read more

Python Matrix (2D Array, NumPy), With Examples

Python Matrix

This article will explain what a matrix is and how to use them in the Python Programming Language with the NumPy library. What is a Matrix In mathematics and computer programming, a matrix is a two-dimensional array of values. It is a grid of columns and rows, with each position in the grid holding one of these values. It is an array because it’s a collection of elements with multiple elements, and it’s two-dimensional because the values exist at two coordinates (i.e., rows and columns). … Read more

Remove/Delete Files/Directories in Linux with rm

Linux rm Remove File Directory

This article will outline how to delete files and directories in Linux with the rm command and give example usage. The rm Command in Linux Files and directories can be deleted from the shell/command line in Linux using the rm command. rm Command Syntax rm OPTIONS FILES Note that: OPTIONS is a list of options from the below table FILES is a list of files or directories (if the -r option is specified) to be removed Multiple files or directories can be specified, separated by spaces Options Here are the most commonly used options for … Read more

Copy a Table in MySQL/MariaDB – How To, With Examples

Mysql MariaDB Copy Table

This article will show you the BEST way to copy a table, with or without the data in it, in MySQL and MariaDB. Copying the Table with All Data in MySql The following code will copy a table including all data using the CREATE TABLE LIKE statement: CREATE TABLE new_table_name LIKE database_name.old_table_name; INSERT new_table_name SELECT * FROM database_name.old_table_name; There are other methods, some single line, but this is probably the best and simplest one. Why did I choose this method? Because it copies the table … Read more