
One of my absolute favorite online games…
While instance properties can be determined at launch, some of them can be updated after the instance has been created. Specifically, an instance’s memory, disk space, and the number of its CPUs are exposed via daemon settings: local..(cpus|disk|memory).
Documentation
Cleaning up some personal projects and performing some maintenance on some personal deployments.
Here’s a list of common commands along with their descriptions and usage examples:
ls
– List Directory Contents
ls [options] [directory]
ls -l /home
(lists all files in /home with detailed information)cd
– Change Directory
cd [directory]
cd /home/user/Documents
(changes the current directory to /home/user/Documents)pwd
– Print Working Directory
pwd
pwd
(displays the path of the current directory)cat
– Concatenate and Display Files
cat [options] [file]
cat file.txt
(displays the content of file.txt)cp
– Copy Files and Directories
cp [options] source destination
cp file1.txt file2.txt
(copies file1.txt to file2.txt)mv
– Move or Rename Files and Directories
mv [options] source destination
mv file1.txt /home/user/Documents
(moves file1.txt to /home/user/Documents)rm
– Remove Files or Directories
rm [options] file
rm file.txt
(removes file.txt)mkdir
– Create a New Directory
mkdir [options] directory
mkdir new_folder
(creates a new directory named new_folder)rmdir
– Remove Empty Directories
rmdir [options] directory
rmdir old_folder
(removes the directory old_folder if it’s empty)grep
– Search Text Using Patterns
grep [options] pattern [file]
grep "hello" file.txt
(searches for the word “hello” in file.txt)find
– Search for Files in a Directory Hierarchy
find [path] [options] [expression]
find /home -name "file.txt"
(finds all files named “file.txt” in /home)chmod
– Change File Modes or Access Control Lists
chmod [options] mode file
chmod 755 script.sh
(sets the permission of script.sh to 755)chown
– Change File Owner and Group
chown [options] owner[:group] file
chown user:group file.txt
(changes the owner of file.txt to ‘user’ and the group to ‘group’)tail
– Output the Last Part of Files
tail [options] [file]
tail -n 5 file.txt
(displays the last 5 lines of file.txt)head
– Output the First Part of Files
head [options] [file]
head -n 5 file.txt
(displays the first 5 lines of file.txt)man
– Interface to the System Reference Manuals
man [command]
man ls
(displays the manual page for the ls command)This is just a basic set of commands, and there are many more commands and options in Linux. For detailed information and more commands, you can always use the man
command followed by the command name to read the manual pages.
String concatenation and string interpolation are both methods used in programming to create a new string from existing strings. However, they differ in syntax and ease of use. Below, I’ll explain each with examples:
String concatenation is the process of appending one string to the end of another string. This is typically done using the +
operator.
let firstName = "John";
let lastName = "Doe";
let age = 30;
// Concatenating strings
let greeting = "Hello, my name is " + firstName + " " + lastName + " and I am " + age + " years old.";
console.log(greeting);
// Output: "Hello, my name is John Doe and I am 30 years old."
In this example, the +
operator is used to join strings and variables. While this method is straightforward, it can become cumbersome and less readable, especially with longer strings or multiple variables.
String interpolation, also known as template literals (or template strings) in JavaScript, allows embedding expressions within string literals. This is achieved using backticks (`
) rather than quotes, and expressions are inserted using ${expression}
syntax.
let firstName = "John";
let lastName = "Doe";
let age = 30;
// Using string interpolation
let greeting = `Hello, my name is ${firstName} ${lastName} and I am ${age} years old.`;
console.log(greeting);
// Output: "Hello, my name is John Doe and I am 30 years old."
In this example, the string is much easier to read and write. The ${}
syntax is used to insert variables directly into the string. This method is particularly useful when dealing with dynamic content or variables, as it reduces the likelihood of errors and improves readability.
+
operator, while interpolation uses backticks and ${}
.${firstName.toUpperCase()}
would work seamlessly within a template literal.In modern JavaScript development, string interpolation is generally preferred due to its readability and ease of use, especially when dealing with complex strings or multiple variables. However, understanding both methods is valuable, as concatenation is still widely used and has universal support.
A warm thank you to my dear friends, Oscar and Jessica, for this Christmas gift.
There are reasons why I don’t like using these free 3rd party services.