Home » 2021

How to Prompt for User Input in Bash/Shell Scripts

Bash Prompt For Input

This short tutorial will teach you to prompt the user for typed input from your Bash/Shell scripts. It’s easy to learn, easy to do, so read on! The read Command To read user input in shell scripts, use the aptly named read command. It has the following syntax: read OPTIONS VARIABLES Note that: The read command will read a line from standard input and split that input into fields Usually, standard input is the terminal with input from your keyboard, but you can also pipe or redirect input to the read command From the users perspective, they will … Read more

Home » 2021

How to Run a Program or Command On Login in Linux

How to Run a Program or Command On Login in Linux

This article will show you how to set up a command to run automatically each time you (or any user) log in on the Linux operating system. Several tasks may be useful to run on login – perhaps you want to connect to a network share or mount a USB drive each time you log in. You might even want to write a script that emails someone to let them know you’ve arrived at work safely and have it sent automatically when you log in. … Read more

Home » 2021

How to Run a Script/Command on Startup on Linux/Ubuntu

How to Run a Script/Command on Startup or Login on Linux/Ubuntu

Want to run a program, command, or script when you start or log into your Linux OS? This article will show you how. Running Scripts on Startup with Crontab The best way to run a command whenever your system starts is using crontab. cron is the job scheduler used by Linux to schedule the execution of tasks. The crontab is the text file where those tasks are defined. There is a system-wide crontab file, and each user also has their own individual crontab file for scheduling their own tasks. Adding a System-Wide Startup … Read more

Home » 2021

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

Home » 2021

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

Home » 2021

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

Home » 2021

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

Home » 2021

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

Home » 2021

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

Home » 2021

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