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

Office Software for Linux/Ubuntu – What are the Options?

Office For Linux

This article will cover some options for office productivity software for Linux. Microsoft Office dominates the office productivity space – it’s the industry standard. If you’re in business, other businesses probably expect to be able to send you an Excel or Word file and for you to be able to view or edit it. Microsoft Office, of course, does not run on Linux (unless you want to run an ancient version under emulation). It’s also not open-source or free. Here are some of the best alternatives … Read more

Python 2 vs Python 3 – Which Should I Be Using?

Python 2 vs Python 3

There are still many tutorials and resources online that are written for Python 2 rather than the newer Python 3 – So, which should you be using? The short answer is below: Python 3. Why You Should Use Python 3 Python 3 is better in every way. It is a major revision that was released almost a decade after Python 2. The smart people who build programming languages probably learned a lot of lessons in that time. The syntax in Python 3 is more consistent … Read more

10 Fun Python Projects for Beginners – Kids and Adults

Python Projects For Beginners

Here are 10 projects to get you started learning the Python programming language. Not a newbie? Check them out anyway for some Saturday afternoon project ideas. If you’re trying to learn something new, making it fun can be a big help. Being engaged in a project means you remember why you did something the way you did and helps to make you more confident when using the same tools again. Bonus if you get creative and start adding your own touches – it’s the best way to … Read more

How to Create and Use Enums in JavaScript (Not TypeScript)

JavaScript Enum

This article will show you how to create and consume Enums in JavaScript. Unfortunately, javaScript does not include native support for Enums, but you can add comparable functionality yourself. Note that TypeScript, a language that builds on JavaScript, does include support for Enums natively. So we’re only looking at plain JavaScript here – not TypeScript. What is an Enum? An Enum (Enumerated Type) is a data structure containing multiple values. Each value is assigned to an identifier – and can be accessed by that identifier. Enums contain pre-defined constants … Read more

Generate Random Numbers and Strings in JavaScript [Examples]

Javascript Random String Number

This guide will show you how to quickly and easily generate random numbers and strings in the JavaScript programming language. Generating random values is a common and important task when programming almost any kind of application of moderate complexity. Random strings and numbers are used to generate unique identifiers (e.g., for the short URLs in URL shortening services), for identifying unique records in a database, and (most importantly) are frequently used to determine the behavior of gameplay elements in video games (for example, simulating a … Read more

JavaScript String split() Method, With Examples

JavaScript Split Method

Want to split a string up into several smaller strings using JavaScript? This is the article for you. The JavaScript string.split() method will split up a string and return an array of strings. The string will be split at the position noted by a specified character. Here’s how to use it. JavaScript string.split() Syntax A method is a function or procedure available to run from an object or variable which will be run using the value from that variable. The split() method is available on any string typed variable. Here’s the … Read more

How to Use the Ternary Operator in JavaScript, With Examples

JavaScript Ternary Operator

This short article will explain what the ternary operator is in JavaScript and how to use it. The ternary operator is a short-hand if statement for quickly executing code based on whether a condition is met. It simplifies your code and reduces visual clutter. Here’s how to use it. JavaScript Ternary Operator Syntax The syntax for using the ternary operator is as follows: CONDITION ? TRUE_EXPRESSION : FALSE_EXPRESSION Note that: CONDITION should be a value or expression which can be evaluated as truthy or not truthy TRUE_EXPRESSION is the expression that will be … Read more

What is ‘undefined’ in JavaScript?

JavaScript Undefined

This short article will explain what ‘undefined’ means in JavaScript – as both a type and a variable value. Creating a Variable with an undefined value To create a variable with an undefined value, it simply needs to be declared with no assigned value, for example: var myVariable; console.log(myVariable); If the above code is executed, undefined is logged as the value of myVariable as no value was assigned. undefined is a Type of Variable undefined is one of the primitive variable types in JavaScript. A variable type describes what a variable can be used for (for … Read more

Encode Strings with PHP urlencode/rawurlencode [Examples]

PHP urlencode()

One way to pass data to a web page is via the URL query string. The data must be properly encoded – urlencode() and rawurlencode() in PHP do this. The PHP urlencode() function URL encodes strings in PHP and is widely used, but it is not the best tool for the job.  rawurlencode() is the modern replacement for urlencode() – though you may need to use the older urlencode() for compatibility if you’re working on older code. urlencode() Syntax urlencode($string) Note that: urlencode() will return a string variable containing … Read more

Categories PHP

How To Run Commands in the Background [Linux/Ubuntu]

Linux Ubuntu Run Command in Background

This article will show you how to run commands in the Linux (including Ubuntu) shell background. This is useful when working remotely via SSH. Say you’re connected remotely via SSH to a remote computer, and you want to execute a lengthy task. While the task is running, usually, you’d have to keep the connection open, with the terminal window open. However, this can be a hassle if you need to close the window to perform another task or if you have a spotty internet connection … Read more