Home » 2021

Snowflake/Muon: the Best GUI SSH Connection Manager on Linux

Muon Snowflake SSH Connection Manager

Secure, powerful remote access is one of the cornerstones of Linux’s functionality. The SSH protocol powers this, and Snowflake/Muon is an excellent tool for managing SSH connections. The flexibility and security of SSH are part of why Linux is so popular as a server OS. This article is part-introduction to SSH and part-review of the Snowflake (now known as Muon, but still referred to as Snowflake in many places). I’ve been using it for a while, and the project deserves attention! What is SSH? SSH is a secure network protocol. … Read more

Home » 2021

Converting Object to an Array Recursively in JavaScript

JavaScript Recursive Object to Array

The Object.entries() method in JavaScript can be used to convert an object to an array – but it doesn’t work recursively. So here’s a function to accomplish that. I can’t think of a reason why you’d want to do this, but it came up while putting together an article on using Object.entries() – so here it is! Recursive Function for Converting Objects to Arrays I’ll let the comments do the talking as to what’s going on. The gist of it is that (for whatever reason) you want to convert an … Read more

Home » 2021

JavaScript: Remove the First/Last Character from a String [Examples]

How to Remove First/Last Characters from String in JavaScript

This tutorial will explain a few ways to remove the first or last character (or both!) from a string in the JavaScript programming language. This can be useful if you need to capitalize names or sentences or remove punctuation. Remove First/Last Character Using The substring() Method The JavaScript substring() method can be used to remove the first or last character from a string. You can find out more about the substring() and similar substr() methods here. The below code example shows how to remove the first, last, and both the first … Read more

Home » 2021

PHP_SELF – What It Is, and Why It’s Too Dangerous to Use [WARNING]

PHP_SELF

This article outlines the PHP_SELF attribute of the $_SERVER system information variable and why you should never, ever use it. What is _$SERVER? Check out our full article on $_SERVER here – but in short, it’s a variable containing an array with information about your PHP environment – including server and request details that are quite sensitive and shouldn’t be publicly accessible. What is $_SERVER[‘PHP_SELF’] ? $_SERVER[‘PHP_SELF’] contains the full path to the PHP script being executed, including any query parameters. This allows the party making the request to include arbitrary data. Displaying data … Read more

Categories PHP

Home » 2021

JavaScript substr() and substring() – What’s the Difference?

JavaScript substring/substr Difference

JavaScript has two similar-looking methods for extracting substrings from strings – substr() and substring(). This article explains the difference. These two functions perform almost the same function and have almost the same name, and at a glance, even seem to have the same syntax – but they’re different! Here is the syntax for each function – side by side so that you can see the difference. A Quick Reminder about Indexes An index is the integer number representing the position of an item in a series. Indexes start counting at 0 – so the … Read more

Home » 2021

What is the $_SERVER Superglobal Variable in PHP?

PHP _SERVER

This article will explain what the $_SERVER superglobal variable is in the PHP programming language. What is a ‘Superglobal’ Variable? A superglobal variable is a variable that is available to all scripts in all scopes in PHP. It is available from within any file, class, or function. What is the $_SERVER Superglobal Variable? The $_SERVER superglobal contains information about the server and execution environment PHP is running in/on. It contains information on the request made to the web server, file paths, and other information. It will provide little to no info … Read more

Categories PHP

Home » 2021

How to Update/Upgrade Python in Linux [Ubuntu/RedHat]

Update/Upgrade Python in Linux

This article will show you how to update Python to the latest version on your Linux Operating system. Python is updated yearly with new features and big upgrades – these are called major updates. In addition to this, monthly updates are released which fix small issues and improve security – these are called minor updates. Major updates change how Python works a bit and may break compatibility with some code as features are added or removed, whereas minor updates are solely there to fix problems without altering any functionality. Updating From Python 2 … Read more

Home » 2021

XOR (Exclusive Or) in Python

Python XOR Exclusive Or

This article explains XOR (Exclusive Or) – what it is, why it’s used, and how to implement it in the Python programming language. What is XOR / Exclusive OR XOR – Exclusive Or – is a logical operation commonly used in computer programming. Logically, an XOR condition is true only if the supplied arguments differ. XOR compares two inputs and outputs, true or false, only if they are different. Those inputs are usually true/false boolean values or the result of a logical operation that returns a boolean value. For example, XOR on two values – 1 and 1 is false – they do not differ. XOR on two values … Read more

Home » 2021

Calculating the Absolute Value in JavaScript with Math.abs()

JavaScript Absolute Value abs()

This article will explain what absolute values are, how they are used, and how the JavaScript Math.abs() function can be used to calculate the absolute value of a number. What is the ‘Absolute Value’ of a Number? The absolute value of a number is that number’s value – without any regard to its sign. A numbers sign determines whether it is positive or negative – it’s the – symbol before a negative number. So, the absolute value of a number is never negative. Consider the absolute value of a number that numbers distance from 0. The absolute value of … Read more

Home » 2021

A Trick for Validating JSON in PHP

PHP Validate JSON

Here’s a quick trick for validating JSON in PHP – with a reusable function, you can copy and paste it into your own project. JSON has pretty much become the standard format for transferring data between applications on the internet. So if you’re building an API to be consumed by others or just building a backend for your app, you’ll be sending and receiving a lot of JSON data. But, you can never trust the request – the data coming into your application. Users enter bad data. Hackers deliberately enter bad … Read more

Categories PHP