Home Blog Page 17

Bash Alias: How It Works and Why You Need One

hands typing on a laptop

hands typing on a laptop

The bash shell incorporates some of the best features of the C and Korn shells, such as job control, directory manipulation, and aliases. 

Aliases are very helpful to users who often type long commands or search their bash histories for a command they typed earlier. 

A bash alias is a shortcut mapped to a command that circumvents the need to remember or type it repeatedly. You can quickly set short and memorable aliases for the long commands you use every day quickly. 

This article explains how bash aliases work, why you should consider using them, and how to create them in a bash environment using specific files. We also discuss how to incorporate bash functions to make aliases more flexible and programmatic.

Bash Alias: What Is It and How It Works

A bash alias facilitates the aggregation of several functions into one command. This way, an alias makes using a long command easy. 

So, bash aliases are maps of typically short commands that point to long commands that may involve different functions. These sets of long commands have a specific syntax and are stored in either .bashrc or .bash_profile. 

What’s nice about aliases is that you have the flexibility to combine the aliases you set with bash syntax and semantics to modify their functions further.

How It Works

The aliases you define in ~/.bashrc or ~/.bash_profile are loaded in the shell environment. So, all the commands listed mapped by the aliases are also loaded in the shell environment and can be executed at any time. 

Put simply, aliases work closely with the bash configuration to replace long commands with a string you set, called the alias keyword. You can use any and all aliases after they have been loaded into the shell. 

The interpreter replaces an alias with the corresponding command(s) mapped to it.

How To Create Aliases

Before you begin, ensure you have sudo privileges on your Linux machine.

To create an alias in bash, you must enter three things:

  1. The “alias” keyword
  1. The string you want to use as an alias
  1. The commands that must run when the alias runs

So, the syntax looks like this:

alias string=”sets of commands/functions”

Like any other Linux command, you can use options with this command. You can put the options right after the alias keyword in the syntax. 

However, there is only one flag that you can use with this option, which is the -p flag. We discuss this flag and also the unalias command at the end of this guide.

The idea of an alias is that bash must be able to run the commands you write inside them. 

You can create a temporary alias by running the alias command, like so:

alias c=’clear’

The alias above points to the clear command. So, the clear command will run when you run “c” in your shell. 

Interestingly, you also can create aliases that run scripts. All you need to do is provide the path to the script as the value of the alias. Here is what this looks like:

alias renameScript=’Example/Test/file_rename.sh’

So, if you run the renameScript alias in your shell after running the above statement, bash will run the file_rename script.

However, once you close the shell or launch another shell, both the aliases discussed above won’t work. 

Here are the steps to creating aliases that work permanently, even after rebooting the machine.

Step #1: Create the bash_profile or bashrc File

You must begin by creating a file called bashrc or bash_profile. You must put this file in the root directory and ensure it is hidden and secure, so it is never mishandled.

You will create an alias in this file along with the commands you choose to map to it. 

To navigate to your root directory on macOS or Linux, launch a terminal and run the following command:

cd ~

You can use the command in PowerShell on Windows for the same effect. The command will also work on a git bash terminal.

Now, you must create the necessary file in the root directory. To do this on any operating system, you can run the following command:

echo >> .bashrc

Or 

echo >> .bash_profile

If the file already exists and you run this command, it won’t have any effect. However, the file will be created if there is no existing file.

You can choose to create the file in any other directory on your machine and move it to your root directory. To create the file without changing  your current directory, you can run the following command: 

echo >> ~/.bash_profile

Bear in mind that the file you need to create depends on the shell you are using.  If you are using the zsh shell, you must create the zshrc file. On the other hand, if you are using a fish shell, you must create the config/fish/config.fish file.

Step #2: Open the File

Now that you’ve created the file, you can create an independent function in it and link it to an alias keyword. 

Begin by launching a text editor on your terminal. Below, we are using the nano text editor in the bash shell.

sudo nano ~/.bashrc

Running this command will output a huge list. Scroll down and find the section listing the default system aliases. It’s best practice to create a separate section with descriptive comments before adding your aliases using the alias command.

Step #3: Write a Function with the Command(s) in It

Here is the straightforward syntax of creating a function in bash:

function exampleFunction()

{

   # statements

}

You can also define functions directly, like so:

exampleFunction()

{

    # statements

}

As you would expect, you can create functions that accept parameters using this syntax. All you need to do is write the logic.

For instance, let’s write a function that creates a directory and navigate to this newly created directory.

Here is what the logic inside the function block would look like:

function exampleFunction()

{

   mkdir $1

   cd $1

}

The mkdir command makes the directory, and the cd command navigates inside the directory. The “$1” you see after the commands is a positional parameter. 

It accepts arguments from the command line before passing them to a function in the form of a variable. These arguments make the alias more dynamic and allow easier user input.

Step #4: Set Your Alias

After adding all the new aliases to the file, hit Ctrl+X and then Y. Finally, hit the Enter key to save the changes you’ve made.

If you want to begin using the aliases,  you can load the configuration file like so:

source ~/.bashrc

Close the terminal session. The aliases will load automatically from the next terminal session. 

Setting an Alias: Examples

Let’s go back to the example we discussed earlier. Let’s say we need an alias that creates a directory and moves into it. Again, we will need to run two commands, cd and mkdir.

To create this alias with the name “newDirectory,” you can run: 

alias newDirectory=’exampleFunction(){ mkdir “$1”; cd “$1”; }; exampleFunction’

The statement would make more sense if it were spread over several lines. However, if you look closely, you will see that we have named the alias “newDirectory.” Further, this alias is mapped to the function “exampleFunction.”

This function creates a directory named after the value passed to the “newDirectory” command before navigating into it. Note how exampleFunction is called in the end to keep the statement straightforward.

As mentioned earlier,  you can spread the same command over several lines, like so:

alias newDirectory=’exampleFunction’

exampleFunction(){ 

mkdir $1

cd $1 

}

You can further customize the aliases you create by adding conditions, loops, and other programming approaches into the mix. You have full flexibility to make your alias as readable and powerful as you please.

Setting a Command with Flags as an Alias

The ls command is one of the most popular Linux commands,  and many users use it with the -la flags. These lines indicate to the command that all the files and directories must be printed, including the hidden ones, as a long list. 

Let’s create a bash alias to use this command with the -la flags. Here is a simple way to do this:

alias ll=”ls -la”

After running this in your shell, you will get the same output as using the ls command with the -la flags whenever you run “ll.”

As you can guess, this alias is temporary and won’t work when you launch the terminal the next time. However, you can make this alias persistent by adding it to the bashrc or bash_profile  file in your root directory. 

Here’s a quick look through the steps:

  1. Open the file in your root directory using a text editor like nano:
nano ~/.bashrc
  1. Type in your alias, like so:
alias ll=”ls -la”

Note that you can put a comment indicating the function of the alias by placing your comment text between a pair of “#” signs. This can help you keep track of the functions of your aliases. 

Save the file and close it. You can begin using the aliases from the next terminal launch. You can also make them available in your current terminal session by running the command below:

source ~/.bashrc

Single and Double Quote Alias Statements

An alias statement may have single or double quotes associated with it, each of which must be used to meet specific requirements.  

You can use double quotes to increase the value of a bash variable by parsing the value of the variable name. On the other hand, if you use single quotes, you won’t see the variable’s value. Just the variable name will be parsed as it is. 

Let’s see how this works in action:

#!/bin/usr/env bash

t=531

echo “The value of t is $t”

echo ‘The value of t is $t’

The output of the first echo statement with the double quotes will show be: 

The value of t is $t

However, you will see that the echo statement using single quotes will print the text in it as is. 

Bear in mind that you will also need to use double quotes to increase a variable’s value when you work with an alias in the bash_profile or bashrc file.

Other Ways to Use the alias Command in Linux

There are a few other things you can do with the alias command in Linux. For one, you can use it to display all the aliases that are currently set and active. 

To do this, all you have to do is run the alias command without any parameters or options.

To display the output of this command, which is a list of aliases, in a format that  you can input into the shell,  you can use the -p  flag like so: 

alias -p

It is also possible to delete an alias with the unalias command. Its syntax is:

unalias [name]

For instance, if you want to remove the newDirectory alias we set earlier in this tutorial,  you do not need to navigate to your root directory and remove it from the file. You can simply run the command below and it will be done:

unalias newDirectory

You can also remove all the aliases that you have set by using the -a flag like so:

unalias -a

Conclusion

With this tutorial handy, you now know how to use the alias command to create aliases. We have also covered how to manage aliases on your Linux machine. The command will help you streamline your workload and make quick work of large tasks.

Best VPNs for Linux with and without GUI

vpn for linux

The Linux operating system takes up a tiny portion of the market because it appears daunting to the average person. It’s commonly known as the hacker-preferred OS controlled primarily through the command line. Meanwhile, the typical Windows and Mac user probably doesn’t even know what a terminal is.

It might be easier to persuade people to switch to Linux if more services had a familiar GUI (Graphical User Interface). At the same time, they should support the beloved command line to appeal to die-hard Linux enthusiasts.

Let’s begin with VPN (Virtual Private Network) services including Express VPN download, as these tools are essential cybersecurity and online anonymity tools. We compiled a short list of three providers that offer both GUI and command line options for Linux

What is a VPN?

First, let’s introduce VPN services to the uninitiated. Virtual private networks act as intermediaries between you and the world wide web. These services offer thousands of servers worldwide, allowing you to connect to them and thus change your location. Furthermore, your online activities will be encrypted and undecipherable to unwelcome onlookers. 

These perks provide a fair number of benefits. For starters, connecting to a remote VPN server hides your IP address and makes it appear you’re located elsewhere. This significantly improves your online anonymity and makes you harder to track.

Spoofing your location will also unlock geographically restricted content. These foreign goods include movies, TV shows, video games, online publications, and countless other resources. 

Besides entertainment, a VPN is vital for online security. To be precise, the encrypted tunnel makes your activities unreadable to your ISP (Internet Service Provider), web administrators, and nefarious hackers on the same network. Not only that, you’re protected against unwelcome intrusions, such as man-in-the-middle and DDoS (Distributed Denial-of-Service) attacks.

As you can see, a VPN is a critical security tool regardless of your preferred OS. However, it won’t protect you on all digital fronts. Therefore, you should learn more about the intricacies of cybersecurity and its importance. You can do so on the Cool Tech Zone website and its vast library of informative articles.

Should you use a VPN with a GUI or command line?

You may think that picking between a VPN with or without a GUI is a matter of personal preference. However, that’s not necessarily the case if you’re after the most feature-rich tool.

For starters, minimalism is one of the main appeals of command line interfaces (CLIs). The applications have meager system requirements and use a sliver of resources to run in the background. At the same time, you’re missing out on useful bonus features, such as ad blocking and a kill switch.

On the flip side, GUI apps hog more resources but also grant a more substantial feature arsenal. For example, you can access specialized servers, easily switch between tunneling protocols, and customize various settings. Naturally, the extent of customization depends on your chosen VPN provider

And so allow us to present you with three worthwhile VPNs that support both GUI and CLI approaches

Top 3 VPNs with and without a GUI

Before we continue, it’s important to note that the most trustworthy and effective VPN services require a premium subscription. You may find worthwhile free options, too, but don’t expect stellar results. And with that out of the way, behold the best VPNs for Linux.

  1. Surfshark VPN

Surfshark VPN offers the best price-to-performance ratio to Linux fans and other OS users. The service is affordable, ultra-secure, and grants ludicrous speeds with the open-source WireGuard protocol. The Linux GUI app will be recognizable to anyone switching from mainstream operating systems. Naturally, it’s also easy to use and packed with the best features Surfshark has to offer.

One Surfshark account supports unlimited device connections, making it an ideal choice for securing every device in your household. This is further supported by its abundance of dedicated apps for various platforms and devices. Plus, it has a 30-day money-back guarantee and a 7-day trial on the most popular mobile app stores for care-free testing.

  1. Proton VPN

Consider Proton VPN if you’re looking for an all-in-one cybersecurity solution for your daily needs. Besides an excellent VPN, the provider offers encrypted email, cloud storage, and calendar services. Most importantly, these tools are available for free if you’re completely broke and don’t mind a few drawbacks. 

Proton VPN grants top-notch anonymity because it operates from privacy-respecting Switzerland. Additionally, the underlying infrastructure was independently audited by experts, while the software is open-source for further public scrutiny. This makes the provider exceptionally reliable and trustworthy.

  1. Mullvad

Go with Mullvad if absolute online anonymity is a priority for you. The Sweden-based provider supports confidential payment methods like cryptocurrencies and cash. Furthermore, sharing any personally-identifiable information is unnecessary when creating an account. Plus, the provider’s adherence to customer privacy is confirmed through multiple third-party audits. 

Connection performance will be stellar, thanks to the modern and effective WireGuard protocol. Naturally, you also gain an impressive selection of bonus security and privacy tools for masking your online activities. Finally, Mullvad stands out with its unchanging price tag of €5/month, regardless of your subscription duration.

Conclusion

The Linux OS has a small but dedicated user base that usually prefers controlling everything through the command line. However, services with a GUI can appeal to newcomers looking for more approachable and familiar tools. 

We picked three VPN services that adequately serve die-hard and fresh Linux users on the cybersecurity front. However, let me remind you that a virtual private network isn’t the only thing you need for online protection. Therefore, don’t forget to check out the Cool Tech Zone website for in-depth information about the ever-changing digital security industry.

How to hire a cyber security developer to protect your business [2023]

cyber security

In today’s digital age, cyber security is of the utmost importance for businesses of all sizes. However, finding and hiring a skilled cybersecurity software developer can be daunting.

It’s not just about posting a job opening and interviewing candidates — companies must ensure a well-structured hiring process is in place, including onboarding, training, and ongoing software development.

In this article, we’ll provide tips on how to find the right cybersecurity software developer and why it’s important to secure Linux servers for your business.

Why do businesses need to secure their Linux servers?

Linux servers are known for their robust security features, but that doesn’t mean businesses should neglect their security needs. Cybercriminals constantly evolve tactics to exploit Linux vulnerabilities, meaning your servers can still fall victim to attacks.

Data breaches can lead to financial losses, reputation damage, and legal issues. Businesses must secure Linux servers to avoid such consequences.

Hiring a cybersecurity developer specializing in Linux servers can provide the expertise and knowledge necessary to protect against potential threats.

Additionally, businesses should implement best practices for how to secure a Linux server, such as regular updates, access control, and data encryption.

They can safeguard their data and operations by taking these measures, giving them peace of mind in the ever-evolving threat landscape.

How to hire a cyber security developer

To secure sensitive data and systems, you need a skilled cybersecurity software developer who understands your assignment. Follow these tips to hire the right person for the role.

Create the job description.

Before hiring, create a description that outlines your requirements, including Linux cybersecurity expertise, network security, and data encryption. Additionally, Include project details and the required cybersecurity coding language in the description.

For example, you may want to mention tasks such as conducting regular penetration testing to ensure the security of your systems, or managing the implementation of security measures across your organization. 

Choose the cooperation model

When it comes to building your IT team, there are a few different options to consider. One option is to hire freelancers, while another is to partner with an IT Staff Augmentation agency like https://doit.software.

Freelancers can offer flexibility and are often available for short-term projects or specific tasks. They can be a cost-effective solution and can help you quickly scale your team up or down as required.

However, they don’t provide the same level of accountability as full-time staff, and their availability may be limited if they are working on multiple projects simultaneously.

On the other hand, hiring a full-time specialist gives the company a dedicated expert who can focus on unique security challenges.

Interview the candidates and evaluate the test task

The next step is the interview process, where recruiters, HR specialists, and CTOs should evaluate the candidate’s technical skills, qualifications, and certifications. This includes knowledge of security frameworks such as NIST and ISO 27001.

Questions should also focus on their experience working with the tools and languages outlined in the job description. Additionally, candidates should possess cybersecurity engineer skills and soft skills such as problem-solving and effective communication to help them work collaboratively with others.

Onboard the newcomers

During the onboarding of new cybersecurity developers, it is essential to ensure they understand the company’s security protocols and procedures. Companies should provide new hires access to security resources, such as documentation and training materials.

Also, pairing new employees with a mentor or supervisor, who can help guide them through the process, accelerates the onboarding process. 

Conclusion

The need for cybersecurity professionals has never been more critical. As businesses increasingly rely on technology, the risk of cyber-attacks grows exponentially. It is vital for companies to have a well-structured hiring process to identify and hire the right cybersecurity software developer who can mitigate risks and safeguard their valuable data and operations. 

FAQs

How do I hire a cybersecurity expert?

Define the requirements for the role you’re hiring for, pick a cooperation model, interview candidates, choose the ideal one, and onboard them.

Why is Linux security important?

Linux security is important because it is one of the most widely used operating systems in the world. It powers everything from servers to mobile devices, meaning it’s a prime target for cybercriminals seeking to exploit vulnerabilities in the system.

What are 3 soft skills that are important to have in cybersecurity roles?

Communication, collaboration, and problem-solving.

What You Need to Become a Linux Programmer

linux programmer

Are you looking to become a Linux programmer? The open-source operating system is a popular choice among developers and is widely used in the tech industry.

Programming is a challenging and rewarding field, and Linux programming is no exception. To become a Linux programmer, you’ll need to have a strong understanding of coding fundamentals and be able to work with the Linux operating system.

We’ll go over 14 skills that are essential for any Linux programmer, paying close attention to the programming languages, tools, and other important elements required to make the most out of your experience. With the right knowledge, resources, and dedication, you can become a successful Linux programmer in no time.

Let’s dive in!

1) A Solid Understanding of the Command Line

The command line provides the ability to do tasks quickly and effectively without needing a graphical user interface. Knowing how to use the command line will allow you to execute various commands, navigate directories, and easily change your system’s settings.

The two main programs you will use for the command line are bash (Bourne Again Shell) and zsh (Z shell). Bash is the default shell on most Linux systems and is the most commonly used command-line utility. Zsh is a newer, more powerful shell that offers advanced features such as autocompletion and syntax highlighting.

To learn the command line, start reading the basics and experimenting with simple commands.

2) Scripting Language

Scripting languages are an essential tool for any Linux programmer. You can use these languages to automate tasks and make systems easier to manage. Several popular scripting languages, including Bash, Python, and Ruby, are available.

With a good understanding of one or more of these languages, you can automate tedious tasks and create powerful applications to make your job easier.

3) Regular Expressions

Regular expressions are powerful tools for searching and manipulating text-based data. They allow you to match patterns in strings, validate input, and perform operations such as substitutions. You can use them to search log files, parse web pages, and filter out data.

Fortunately, they are relatively easy to learn, and the syntax is well documented. The best way to learn is by getting hands-on experience and reading tutorials.

Once you understand the basic syntax, you can quickly create complex patterns for searching and manipulating data.

4) Debugger

Identifying and fixing code errors can save time, effort, and frustration. Debuggers help programmers to identify the source of bugs in their code by allowing them to step through the code line-by-line and investigate variables and values.

Using a debugger can help you quickly identify the cause of an issue and make changes to your code to correct it.

5) System Calls

System calls are special commands used to request services from the kernel or low-level software that manages resources and communicates with the hardware. System calls allow user-space applications to interact with the operating system and other resources.

6) Version Control

Version control is essential to any software development workflow. It allows developers to track changes to their codebase, easily switch between versions, and collaborate with other developers.

Knowing how to use version control systems such as Git, Mercurial, or Subversion is important for a Linux programmer. You should be able to create repositories, commit changes, merge branches, and revert changes.

Version control makes your code more maintainable and reduces the chance of conflicts when multiple developers work on the same project.

7) Writing Good Documentation

Good documentation will help users and other developers understand the code and make collaborating easier. It should be clear and concise so that others can quickly get up to speed on your code.

Documentation should include detailed comments throughout the code as well as an overall structure of the project. It should also include instructions for how to use the software. Taking the time to write thorough documentation will save a lot of time for anyone who will work with your code in the future.

8) A Good Text Editor

Choosing the right text editor can be challenging, as many options are available. When selecting a text editor, consider the user interface, speed, features, and support.

Popular editors such as Vim, Emacs, Atom, and Visual Studio Code each offer unique features and advantages. But ultimately, the decision comes down to personal preference and what best fits the task at hand.

Whichever editor you choose, be sure to get familiar with it to maximize its potential.

9) Understanding of Hardware

Knowing how the computer components work together, including how to configure and troubleshoot them, will make programming on Linux much easier.

Also, it’s important to understand different types of hardware and their limitations so you can write code that works optimally with the hardware it is meant for. Finally, diagnosing and solving hardware problems is invaluable for Linux programmers, as it allows you to fix any issues that might arise quickly.

10) Shell Scripting

Shell scripting is a programming language used to create and manage shell programs that you can use to automate processes and carry out complex tasks. To become proficient in shell scripting, you should learn the basic syntax, become familiar with shell commands and functions, and practice using them to create scripts.

Additionally, you should understand how shell scripts interact with the Linux operating system and how to debug your scripts if something goes wrong. With the right knowledge and dedication, shell scripting can become second nature for any Linux programmer.

11) Good Reference Guide

Whether you’re just getting started or an experienced programmer, having a reference guide that covers the basics and advanced topics can be invaluable when coding in Linux.

Make sure to choose a reference guide that covers the version of Linux you are using, as each version may have slight differences. A good reference guide can also help you troubleshoot problems and learn how to use certain commands more effectively.

12) A Passion for Learning

Becoming a successful Linux programmer requires a strong desire to learn. While you don’t need to be an expert in every aspect of programming, having the curiosity and enthusiasm to explore new ideas and technologies is essential.

As the landscape of technology is constantly changing, it’s necessary to stay up to date with the latest trends and practices. Additionally, learning from more experienced programmers is an excellent way to stay ahead of the curve. If you want to ask someone to teach you something, you can get their contact information on Nuwber. There are also plenty of communities for developers such as Women Who Code, Hashnode, Freecodecamp, HackerNews, etc.

With a passion for learning, you will have the foundation to become a successful Linux programmer.

13) A Willingness to Experiment

Becoming a successful Linux programmer requires more than just technical know-how – a willingness to experiment is necessary. Even experienced programmers must try new coding approaches and techniques.

Be willing to step outside of your comfort zone and try new things. With practice and persistence, you’ll find that the results can be quite rewarding. Not only will you develop your programming skills, but you’ll also gain insight into how computers work and how you can use them to solve complex problems.

14) A Good Support Network

Having a support network when it comes to programming is invaluable. Finding mentors and peers who understand Linux and can help you work through any issues or difficult topics is crucial.

It could be anything from receiving advice to joining an online community of Linux users. A good support network can give you the knowledge and confidence to become a successful Linux programmer.

The Dawn of Artificial Intelligence: The Many Benefits of AI for Small Businesses

ai for linux

It goes without saying that running a small business can be an overwhelming endeavor for even the most experienced company owners. In addition, small businesses are often vulnerable to changes in the industry, and most new entrepreneurs have to deal with business decisions that could potentially tank the startup if they aren’t careful.

As such, using modern tech solutions to your advantage is practically mandatory. Utilizing artificial intelligence consulting help is one of the most common methods due to how easy it is to integrate machine learning algorithms into business processes. Here are just some of the many benefits of AI for small businesses.

  1. AI tends to learn quickly, pushing for automation with annotated data

One of the most amazing things about AI is its ability to consolidate data and help further company goals. Of course, such a thing depends on the machine learning algorithm your business uses, but annotated data is necessary no matter the scenario. Data annotation involves taking messy, unstructured data and adding context, such as metadata, to help contextualize and make it easier for machine learning algorithms to understand. With the necessary context, these data sets can be used to develop more accurate and efficient AI, serving to train machine learning models to accomplish set tasks. Of course, there are reliable experts in data annotation you can use to help develop competent and efficient AI, and you can click here for more information.

Overall, AI can learn very quickly, and provided you know what you want out of machine learning, you can utilize AI to climb the ranks and outpace the competition.

  1. AI can help enhance the customer experience in various ways

You’ve likely already experienced AI chatbots at one point, especially concerning customer service. Many businesses use AI to help with troubleshooting, as AI can be extremely effective at handling the most common issues customers might have with a company’s products and services. Aside from virtual chatbots, AI can also improve the customer experience through different pricing models.

What better way to make a customer feel more at ease than to develop effective pricing models based on their preferences? It sounds like a lot of work, and for a time, it absolutely was. However, with the addition of AI models, it’s easier than ever before to develop accurate rating and pricing engines that can provide a fantastic customer experience.

  1. AI can help small businesses outpace the competition

Depending on the AI model, you can automate various tasks to help develop more efficient business processes. It’s a good idea to start slow, especially if you’ve never used artificial intelligence for your startup. Starting slow involves automating simple tasks before graduating to more complex models. Focusing on AI early on allows your small business to compete with the best in the industry without the effort. It showcases the overall usefulness of AI, but it’s only the tip of the iceberg as far as the potential goes.

Conclusion

There’s no denying that AI can help businesses thrive. It is especially useful for new company owners that haven’t had a chance to make their mark on the industry.

Follow the link for additional details

How Does Linux Protect Its Users’ Privacy Online?

linux protecting users privacy

Internet users are more aware than ever before about the value of their data and how many companies want to collect and use it. That’s why online privacy is so highly sought after. That’s why it’s refreshing to see Linux take a number of steps to protect users’ privacy, starting from the moment you first use the operating system…

No account is needed

A Microsoft account is a must if you want to use Windows 11. Similarly, accounts with Google and Apple are required to get the most out of Chromebooks and MacBooks, respectively. While you can use them as a guest, you miss out on core features like the App Store, for example.

In contrast, Linux allows you to use your computer without the need to create an account – or even the prompt to do so. From the very start, that means you can install apps, download updates and simply use your operating system, without giving access to all of that activity to any company.

Open source software

That freedom of use continues when it comes to apps available through Linux. Because most software is open-source, tracking code can be easily detected and reported – or the software redistributed with tracking code removed.

In contrast, other operating systems act as commercial platforms. Apps are created with the aim of harvesting data, which then allows them to show you relevant ads and, ultimately, make money.

On top of that, Linux makes it easy to remove pre-installed programs. Also known as bloatware, these programs are a big issue on Windows in particular, where devices come with numerous third-party installations which simply aren’t necessary. The software itself might track users, or ask them to make an account which will then track them.

On the flipside, Linux preinstalled software – as above – is mostly open-source, and it’s refreshingly easy to remove.

Hard drive encryption

As the home of all your computer’s permanent data, the hard drive is central to any user’s privacy. But on most operating systems, encryption is highly challenging. As such, other companies actually offer encryption services as an additional expense – that could be a pre-encrypted hard drive or encryption software.

Instead, Linux gives you the option to encrypt your hard drive when installing the operating system. It’s also easy to encrypt other media – just look for ‘Password Protect Volume (LUKS)’ when using the most common partition editor for Linux, GNOME Disks.

Security updates

Last but not least is security, which is an important component of maintaining user privacy. After all, data isn’t private if hackers can access it!

The problem with Microsoft, Apple and Google is that support is finite. With Microsoft, it’s tied to a certain version of windows, while Apple and Google tie it to your specific device.

With Linux, you can continue to access updates as long as your computer can run your Linux distribution. So, that’s one more thing users don’t need to worry about when it comes to privacy on Linux.

What else can I do to protect my online privacy?

Aside from using Linux, there are a number of other steps you can take to protect your privacy online.

  • Make sure you’re using a Virtual Private Network (VPN). VPNs hide your real IP address, making your online usage private and protected.
  • Keep your social media accounts set to private. This stops people from snooping on your profile, which can help to prevent identity theft and stalking, among other issues.
  • Opt out of online data brokers. Data brokers collect and sell your information to third-parties, or use it for their own purposes. This is done for profit – and most often, without your informed consent. The more your data is spread among third-parties, the more your security is put at risk.

Using Pmap to Report Memory Map of a Process (With Examples)

hands typing on a computer

hands typing on a computer

Taking measure of a process’s RAM usage on Windows has always been straightforward. 

You launch the Task Manager and browse through the processes to find their corresponding CPU, memory, and disk usage, among other usage metrics. 

But Linux distros don’t offer such conveniences, especially if you want to take measure of shared memory. You will need to work with the pmap command to find process metrics. 

Here’s a complete guide to using the pmap utility on Linux distros.

The Fundamentals of Memory Mapping

Contemporary OSs allocate memory regions to every process on the machine. Fittingly, these regions are referred to as “allocation spaces.”

Under the hood, modern OSs don’t map allocation spaces to physical hardware addresses. Instead, the OSs generate virtual memory spaces to keep account of every process. 

These virtual memory spaces form a vital layer of abstraction of the physical memory. Each process has a translation table associated with it, and the OS’s kernel maintains these tables. 

The CPU accesses these tables via the kernel. The kernel inevitably assigns all processes to the CPU core and updates their translation tables while it’s at it. This way, the kernel facilitates interactions between the processes and the CPU’s cores. 

The Rewards of Abstraction

When we use any modern OS, we interact with processes in the kernel from outside the kernel in a conceptual space called the “userland.” 

The userland allows the operating system – specifically the kernel – to remain secure and stable when applications misbehave. 

The use of virtual memory spaces limits access and visibility of the physical memory in the userland. Processes can only access memory as virtual memory addresses assigned by the OS. 

Also, processes cannot detect or access the virtual memory addresses assigned to other processes. The only exception to this is when processes are sharing memory.  

This abstraction of the physical memory gives the kernel the flexibility to modify the physical address of any virtual memory space. 

Virtual memory spaces are sometimes moved to the machine’s disk by changing the physical address a virtual memory space points to. 

Modern kernels are designed to avoid providing details of the physical memory address to processes until required, which is rarely the case. 

Processes request writing and reading memory, and the kernels grant them access to the virtual memory. However, kernels continually juggle the mapping table to optimize the operating system’s efficiency.

Basics of Shared Memory 

The concept of “RAM on demand” coupled with mapping tables opened the doors to sharing memory between processes. 

Kernels prioritize not loading a process into physical memory more than once. For instance, you could load a shared library into the memory once, and many processes that need the library can access and use it as necessary.

Every process is assigned a unique virtual memory space for the shared library. However, in our shared library example, each one of these virtual spaces points to the same physical memory space.

If a shared memory space is writable, processes may attempt to write to the physical memory. Kernels use the copy-on-write scheme, which assigns every process a copy of the shared memory to which it is trying to write. 

This way, none of the processes access each other’s copies of the shared memory, and the shared memory associated with the original process remains untouched.

The copy-on-write scheme is only one example of any modern Linux distro’s several sophisticated memory handling mechanisms. 

Basics of the pmap Utility

The details of how your Linux machine’s kernel works with your machine’s RAM are stored in two pseudo-files in the “/proc” pseudo-filesystem.

Every process has two files associated with it. These files are named after the processes’ Process IDs. The two files are “/proc/maps” and “proc//smaps.” 

You don’t have to interact with the pseudo-filesystem to access information about the processes. 

The pmap utility can read the information from these files and display it on your terminal. You will need to find the PID of the process you want to check. 

Let’s create a process to track. Here’s a brief block of C code that prints a message on the terminal and exits when the user hits Enter: 

#include <stdio.h>

int main(int argc, char *argv[])

{

  printf(“Test program”);

  getc(stdin);

You can copy the program and compile it with the gcc compiler with this command:

gcc -o pm pm.c

Run this command to create an executable named “pm” for the above program. You can run the executable like so:

./pm

You will see the expected output “Test program,” and the program won’t terminate till you hit Enter.

Use the ps command to search the PID of this process as it continues to run. The -e flag will show all processes on your machine. It’s a good idea to pipe the output and use grep to find the processes with a “pm” in their name.

ps -e | grep pm

You can also choose to run the pidof command to find the PID of a process having the name you supply, like so:

pidof pm

Bear in mind that the pidof command only works when you know the precise name of the process. If you only know a part of the name, using the ps command to find the right PID is better.

How to Use pmap to Report Memory Map of a Process

Let’s say the PID you found for the pm process is “40278.” You can now use the pmap command to see the memory mapping for the process like so:

pmap 40278

You will see an output with four columns indicating the mapped memory addresses, the memory at the addresses in kilobytes, virtual memory permissions, and the source of the mapping. 

This last piece of information may be a library, process, or system name, such as a stack.

The virtual memory permissions define how a process can interact with the mapped memory.

Valid permissions that you will see when you use the pmap utility include:

  • R: The mapped memory has no reservation for swap space.
  • r: The process may read the mapped memory. The process can read the mapped memory.
  • s: Indicates that the virtual memory is shared and all processes can see the changes made to the memory. 
  • w: The process may write to the mapped memory.
  • x: The process may execute instructions present in the mapped memory.

Flags You Can Use with pmap

#1 The Extended Display Flag

Let’s say you run pmap with the -x flag and the example PID we used above, like so: 

pmap -x 40278

You will see a familiar table with columns of information about the memory, but it’ll have two additional columns. These additional columns are called the “RSS” and “Dirty” columns.

The RSS column indicates the “resident set size” of the mapped memory address. This value indicates the amount of memory available in the RAM rather than the swapped-out memory.

The Dirty column indicates the amount of memory that was changed since the inception of the memory mapping. 

#2 The “Show Me Everything” Command

You can see virtually all the details about a process if you use pmap with the -X flag. Besides the -X flag, pmap also works with an -XX option, which displays everything the pmap utility can fetch from the kernel. 

Interestingly, the -X flag is a subset of the -XX flag. Let’s take a look at how the -XX flag works.

pmap -XX 40278

As you’d expect, the output of this command will be notably long, and the text will wrap around your terminal in an indecipherable way. The best way to go through this output is to copy and paste the output text into any text document. 

You will find that the columns hold a lot of basic information about the supplied PID, including:

  • Address: It indicates the start address of the memory mapping. 
  • Perm: Indicates the memory’s permissions.
  • Offset: It indicates the mapping offset of file-based memories.
  • Device: You will find your Linux machine’s number in this column in the form of major and minor numbers. If you want to see the device numbers on your machine outside of the pmap command, you can run the lsblk command. 
  • Inode: In this column, you will find the file’s inode with which the memory mapping is associated. 
  • Size: Indicates the size of the memory-mapped region. 
  • KernelPageSize: Indicates the page size the kernel is using. 
  • MMUPageSize: Indicates the page size the memory management unit is using.
  • Rss: This column indicates the amount of memory available in the RAM. This value is referred to as the resident set size. 
  • Pss: This column indicates the sum of the private shared size and the value resulting from dividing the shared size by the number of shares. The resultant value is known as the proportional share size.
  • Shared_Clean: The memory value in this column indicates the shared memory that has not been modified since the mapping’s creation. This memory may be shareable, but it’s still classified as private memory even if it’s not.
  • Shared_Dirty: The memory value in this column indicates the shared memory that has been modified since the mapping’s creation.
  • Private_Clean: The memory value here indicates the private memory that has remained untouched since the mapping’s creation.
  • Private_Dirty: This memory value indicates the amount of modified memory after the mapping’s creation
  • Referenced: This is the memory that is currently being accessed or referenced.
  • Anonymous: This is the memory that does not have a device to swap out to. Meaning it isn’t file-backed.
  • LazyFree: This column indicates the pages flagged as MADV_FREE. These pages can be reclaimed though they may have unwritten changes in them. The MADV_FREE flag is removed from the pages if any changes are made to them after initial flagging. The pages remain unclaimed until the changes are written.
  • AnonHugePages: These are pages larger than 4 KB that are not file-backed. 
  • ShmemPmdMapped: This column indicates the shared memory used by the huge pages that AnonHugePages counts. Filesystems may also use this memory.
  • FilePmdMapped: The “Pmd” in the term stands for Page Middle Directory. It is one of the kernel’s paging schemes, and this value indicates the number of file-backed pages that PMD entries are pointing to.
  • Shared_Hugetlb: All huge memory pages have Translation Lookaside Tables associated with them, which are memory caches that speed up the process of accessing userspace memory locations. This value indicates the amount of RAM consumed by the TLBs associated with the huge memory pages. 
  • Private_Hugetlb: It indicates the RAM consumed by the TLBs associated with private huge memory pages.
  • Swap: The amount of swap being used.
  • SwapPss: The “Pss” is short for proportional share size. So, this value indicates the volume of swap occupied by swapped private memory pages added to the shared size divided by the number of shares.
  • Locked: You can lock a memory mapping to prevent the OS from paging out off-heap or heap memory.
  • THPeligible: This flag indicates if a memory mapping can allocate transparent huge pages. If the flag value is one, the memory mapping is allowed to allocate the pages. If the flag value is zero, it cannot. Transparent huge pages reduce the overhead of TLB page lookups on machines with a lot of RAM. 
  • VmFlags: There are several virtual memory flags that you can set. We have covered these below.
  • Mapping: This value indicates the mapping’s source. It may be a system name, library name, or process name.

Here is a list of all the available virtual memory flags:

VmFlag Meaning
ac Area is accountable
ar Architecture-specific fla
bt ARM64 bias temperature instability guarded page
dc Do not copy this memory region if the process is forked.
dd Do not include this memory region in core dumps
de Do not expand this memory region on remapping.
dw Disabled write to the mapped file
ex Executable
gd Stack segment grows down
hg Huge page advise flag
ht Area uses huge TLB pages
io Memory-mapped I/O area
lo Pages are locked in memory
me May execute
mg Mergeable advise flag
mm Mixed map area
mr May read
ms May share
mt ARM64 Memory tagging extension tags are enabled
mw May write
nh No huge page advise flag
nr Swap space is not reserved for the area
pf Pure page frame number range. Page frame numbers are a list of the physical memory pages.
rd Readable
rr Random read advise provided.
sd Soft dirty flag
sf Synchronous page fault
sh Shared
sr Sequential read advise provided (by the madvise() function.)
um Userfaultfd missing tracking
uw Userfaultfd wr-protect tracking
wf Wipe this memory region if the process is forked
wr Writeable

 

How To Check An MD5 Checksum on Linux (Fast And Easy)

computer

computer

A checksum value is a short data block derived from a larger one. MD5 (Message Digest 5) checksum values are used to verify the integrity of files in Linux. 

MD5 checksums are 128-bit strings derived by running the MD5 algorithm on a file. Besides the checksum, the MD5 algorithm is also known for its hash function. The function generates a 128-bit message or “hash value.” 

The value is always the same for a file, regardless of which machine generates it or how many times it’s generated.

Two distinct files rarely have the same hash value, so the MD5 checksum is used to check the integrity of a file. 

It helps when you’ve downloaded a file from the internet and want to ensure it’s a perfect copy and data wasn’t lost or damaged during the download. 

When damaged files are installed, they can corrupt your machine. Therefore, it is considered best practice to generate a software or operating system ISO file’s MD5 hash and compare it with the original hash, which is typically found on the site of the tool/OS. 

Linux distros typically feature the GNU Core Utilities package, so there’s a good chance the md5sum program is already installed on your Linux machine. 

Here’s how you can use it to check the MD5 hash values of a file:

md5sum [OPTION] [FILE PATH]

Let’s say you want the hash value of a “test.cpp” file. You would run:

md5sum /home/TestLinux/test/test.cpp

The output would look something like this:

5f6681de7bb943a5eeeb1cf81f6bbef9 /home/TestLinux/test/test.cpp

The command can be paired with the following flags:

Option What It Does
-b Read in binary mode
-c Generate MD5 for files and compare them
–tag Generate a BSD-style checksum

Some flags you might find helpful when verifying a file’s checksum include:

Option What It Does
–ignore-missing Stops printing report status for missing files
–quiet Stops printing OK when files are verified
–status Stops supplying output, status code shows success
–strict Exits non-zero for improperly formatted checksum files
-w Warns about improperly formatted checksum files

 

Using the md5sum Command

To generate an MD5 checksum and store it in a file, you can run:

# md5sum /home/TestLinux/test/test.cpp > exampleMD5.md5

This command stores the generated MD5 in the “exampleMD5.md5” file:

To verify the contents of the MD5 stored in this file, you can run: 

# md5sum -c exampleMD5.md5

Its output should look like this:

/home/TextLinux/test/test.cpp: OK

Try changing the contents of the exampleMD5 file. When you verify the file again, you will see:

/home/TestLinux/test/test.cpp: FAILED

md5sum: WARNING: 1 computed checksum did NOT match

Now, let’s look at how the –quiet option works. If you use the option when verifying the checksum, the command won’t print “OK” if the MD5 value is correct. 

So, let’s revert to the original exampleMD5 file – the one that has the correct MD5 checksum – and run the command:

#  md5sum -c –quiet  exampleMD5.md5

You won’t see any output, which means this file has the correct MD5.

But if it doesn’t, you will see a warning like this:

# md5sum -c –quiet  exampleMD5.md5

/home/TestLinux/test/test.cpp: FAILED

md5sum: WARNING: 1 computed checksum did NOT match

 

Ways to Enhance the Security of Your Linux Server

linux servers

Security has always been the cornerstone of any Linux software. Since Linux is open-source software, people can audit code to find and patch any vulnerabilities, making it more secure than closed software. Due to its increased security and strong default permissions structure, most companies rely on Linux software for their server security.

Like any other operating system, Linux isn’t completely immune to security breaches. As such, any undetected vulnerability in the operating system can jeopardize your company’s valuable information. The first step to strengthening your server’s security is finding a reliable Security Program Management (SPM) and Governance platform to assess your program’s security and mitigate potential risks. Besides utilizing Security Program Management, here are a few best practices you must adopt to maintain your Linux servers running safely:

1. Update Your Software Regularly or Automatically

Old, unpatched packages can introduce vulnerabilities to the system, making your server an easy target for cybercriminals to exploit. You can prevent this problem by regularly updating your Linux server software. Updating your software allows you to apply security patches for combating emerging vulnerabilities.

Linux has all the tools you need to update your system and allows seamless upgrades between versions. Review all software updates and apply them as soon as possible. You can use apt-get to manually install security updates or enable automatic updates.

2. Configure 2FA Authentication

Another effective way to improve the security of your Linux server is by configuring two-factor authentication (2FA). Besides a password, 2FA authentication requires users to enter a secret code to gain access to the server. This makes it nearly impossible for cybercriminals to use brute force attacks to access your server.

You can run Pluggable Authentication Modules to enable your Linux system to work with a software authentication device like Google Authenticator. This allows you to add multi-factor authentication to your system that generates a secret token for enhanced user access security. You can also use multi-factor authentication with SSH (Secure Shell) to require a second credential from users before logging into your server. This protects your server from unauthorized access and boosts cloud safety for your business.

3. Run Server-side antivirus software

No system is 100 percent immune to cyberattacks; any machine can fall victim to malicious programs. While Linux is considered more resistant to malware, viruses, and other malicious programs than other operating systems, Linux endpoints, including users’ desktops, are often susceptible to these attacks. Running the best Linux antivirus protection on all your Linux endpoints can significantly boost your server’s defensive capabilities.

You can run Avast’s Linux server antivirus that supports 32-bit and 64-bit hardware and comes with on-demand scanning triggered over a CLI. Other effective Linux server security tools include chkrootkit and rkhunter, which you can install and initiate into your system using simple commands. These tools scan your system for rootkits that could give hackers access to your server.

Endnote

These are only a few of the many proven ways to improve your Linux servers’ security and protect valuable information and data from cybercriminals. Don’t forget that maintaining your Linux server security is an ongoing process that involves installing security updates regularly, enabling access controls, and running intrusion detection programs for added protection. You must also regularly perform security audits to keep cybercriminals at bay.

How To Unrar a File: Unix and Linux

two computers

two computers

Applications, images, documents, and other files of all sorts are most commonly shared across the internet in the RAR format. It is a compressed archive format, and you need to unpack or “unrar” the archives to access the files within them. 

Linux and FreeBSD operating systems do not have the “unrar” command preinstalled. Most UNIX-like systems also do not come with the command preinstalled. 

The unrar command is necessary to unpack these compressed files. Here’s a quick guide to installing and using the unrar command.

Installing the unrar Command

You can use the apt or apt-get command to install the unrar command on Ubuntu and Debian:

$ sudo apt install unrar

OR

$ sudo apt-get install unrar

 

On Fedora Linux, you can use the dnf command to install unrar, like so:

$ sudp dnf install unrar

 

On OpenBSD Unix, run this command to install unrar:

# pkg_add -v unrar

 

The yum command comes in handy if you’re using RHEL or CentOS:

# yum install unrar

 

You can use the pkg command this way to install unrar on FreeBSD:

# pkg install unrar

 

If you’re using a macOS Unix or a Homebrew machine, you can use the brew command to install unrar. Bear in mind that on macOS, you will first need to install Homebrew before you can use the “brew” command to install unrar.

Once you’ve installed Homebrew, run: 

$ brew install unrar

 

If none of these methods work, visit the rarlab website and download the binary package.

Here are the steps to download the package on 32- and 64-bit Linux and install the unrar command:

  1. First, navigate to the /tmp directory
$ cd /tmp

 

2. If you’re running 32-bit Linux, run the following:

$ wget https://www.rarlab.com/rar/rarlinux-5.5.0.tar.gz

 

3. If you’re running 64-bit Linux, run the following:

$ wget http://www.rarlab.com/rar/rarlinux-x64-5.3.b4.tar.gz

 

4. Next, untar the downloaded file:

$ tar -zxvf rarlinux-*.tar.gz

 

5. You will find the unrar and rar commands in the rar sub-directory. Navigate to the rar directory and type:

$ cd rar

$ ./unrar

 

6. Next, copy the unrar and rar files to the following directory:

$ sudo cp rar unrar /usr/local/bin

 

Using the unrar Command

Let’s say you want to unpack a file named “exampleFile.rar.” 

You can run this command to check the contents of a rar archive before extracting it: 

$ unrar l exampleFile.rar

 

You can then extract the file by running the command this way:

$ unrar e exampleFile.rar

How To Install Ubuntu 21.04 With A Virtual Machine

computer codes

computer codes

Ubuntu 21.04, nicknamed “Hirsute Hippo” was released in April 2021. The Ubuntu family of operating systems is renowned for its stability and ease of use, and Hirsute Hippo is no exception. 

But it’s always better to test it on your existing operating system before installing it as a primary or secondary operating system. 

There’s even a more recent version of Ubuntu for you to consider installing – the 22.10 version that will continue being updated till July 2023. 

The installation requirements for 21.04 and 22.10 are the same, and it’s always better to stick to a newer version.

In this brief guide, we will walk you through testing either of these operating systems using VirtualBox, which is a virtualization software. It enables running more than one operating system, or “virtual machine,” on one physical machine.

Creating a Ubuntu 21.04 or 22.10 virtual machine, or a VM of any other Linux distro involves the same steps.

Step #1: Launch VirtualBox 

Installing VirtualBox is quite straightforward on any operating system. You can visit the downloads page on the official site and get the installation files you need to run.

On Linux, you can run the following commands to install the software on your machine:

$ sudo apt update

$ sudo apt install virtualbox virtualbox-ext-pack


If you’re running Ubuntu, you can install the newest version of VirtualBox via the Oracle VirtualBox repository. Let’s say you’re running Ubuntu 20.04. You must run the wget command, like so:

$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add –

$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add –


Remember that you can find builds for specific operating systems on the official download page.

The command should give you the “OK” output, indicating that the machine has imported the keys. Next, you must add the VirtualBox APT repository to your machine like so:

$ sudo add-apt-repository “deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib”


If you see an “add-apt-repository” error that says it couldn’t find the command, you must install the software-properties-common package to proceed.

When the repository is finally enabled on your machine, installing VirtualBox is as straightforward as installing any other application. You can run:

$ sudo apt update

$ sudo apt install virtualbox-6.0


All that’s left to do is to install the VirtualBox Extension pack, and you can begin testing whichever Linux distro you choose on your machine. Installing this pack is essential since it offers a laundry list of helpful functions for virtual machines. 

With this pack, you can connect USB devices directly to the virtual machine – bypassing your operating system. It also offers RDP support and several other helpful features. 

Install the pack on your machine with the following command:

$ wget https://download.virtualbox.org/virtualbox/6.0.0/Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack


Remember to match the extension pack version with the version of VirtualBox you installed. Run the following to import the extension pack:

$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack


After running this command, you will need to accept the terms of the Oracle license. You will see the following prompt and must enter “y”:

Do you agree to these license terms and conditions (y/n)?


The terminal will show you the installation progress before indicating that the extension pack has been installed.

Step #2: Download the Required ISO 

You can find the ISO file of all Ubuntu versions, including the Hirsute Hippo OS, on the Ubuntu website. On Linux, you can also run the following command to grab the ISO:

wget https://releases.ubuntu.com/21.04/ubuntu-21.04-desktop-amd64.iso

Step #3: Create a Virtual Machine

Launch the VirtualBox app, hit “New,” and assign a name to the virtual machine you want to create. It’s best to name the virtual machine after the operating system you are adding.

Proceed, and you will see a slider that assigns RAM to the VM you create. Use it to assign four gigabytes of RAM to the VM. You must assign at least one gigabyte for the VM to work.

Next, you must create a virtual hard disk. The process begins by choosing the type of hard drive you want to make. We choose the default VDI hard drive in this guide. 

Choose the “dynamically allocated” hard disk scheme, which is the default scheme. Finally, choose the volume of space you want to assign to this virtual machine. 

Step #4: Use the ISO File

Select the VM you just created and hit Ctrl+S. The settings wizard will appear, where you must right-click the VM and choose “Settings.”

Next, click the Folder and then “Add.” Choose the Ubuntu 21.04 ISO file from the window that appears and hit the “Choose” button. 

Finally, start the VM, and hit the Enter button on your keyboard to start booting the OS.

Bear in mind that the minimum system requirements for Ubuntu 21.04 and 22.10 are:

2 GHz dual-core processor
25 GB of hard-drive space
4 GiB RAM (system memory)
CD/DVD drive or a USB port for the installer media
Internet access is required but not mandatory for installation
VGA capable of 1024×768 screen resolution

 

Step #4: Install the Distro

If you’re following along with the tutorial and installing Ubuntu 21.04, at this stage, you will see an installation wizard. To proceed, you must hit the “Install Ubuntu” button and follow the wizard. You will need to set up things such as your keyboard layout, the language of the OS, and the time zone. 

After some basic setup, you must choose between the minimal and normal installation. If you want to use the open-source office suite, games, and other apps on the machine, choose the normal or full installation. 

The minimal installation will not install any of these apps and will only give you the operating system to work with.

Next, you must pick a virtual hard disk to install the operating system on. Since you’re using VirtualBox, you will see only one of these disks. Choose the default option and hit “Install Now.”

The OS will finally be installed on the VM, and you can test its stability and functionality. 

PaperTyper.net – Set of Tools for Generation and Edition

Every student has encountered academic writing problems just once in their life. You may have no time or not understand the task. It may be too long or too difficult. You may experience personal or health issues. Whatever the reason is, you will need help.

If you start searching for support on the Internet, you will see a lot of fee-paying options. But you are a student who may not be able to afford to pay. So, what to do? Read this review.

We have compiled a detailed description of PaperTyper.net after trying it and are sure that it is helpful. You will learn about the benefits of the platform and what it can offer. So, let’s start.

How Can PaperTyper Help Students in Academic Writing?

Juli Sheller created this platform to help students deal with academic writing difficulties. The site has been on the market for about a decade and has gained a lot of appreciation from the students who used it or continue using it for their academic purposes. They usually leave a lot of positive reviews and comments on such independent platforms as Trustpilot or SiteJabber. It means that we recommend this AI-powered free essay writing service, which provides high-quality material and saves a lot of time.

Now consider how this platform can help you. You may usually require assistance for the following reasons:

  • lack of experience;
  • improper guidance and too complex guidelines;
  • lack of academic writing knowledge and poor understanding of formatting styles;
  • time constraints related to a lot of academic responsibilities like attending classes, studying for exams, or participating in extracurricular activities;
  • language barriers experienced by ESL students;
  • need for more detailed feedback from instructors;
  • confidence issues and lack of motivation.

If you are experiencing just one of these, you can use Essay Typer, Grammar Checker, Plagiarism Checker, and Citation Generator here on the site in one pack and for free. You can generate and edit any type of paper. If you are worried whether the platform can cope with complex academic papers, like research work or dissertations, you don’t need to worry.

The Essay Typer tool has recently been updated and uses improved AI. It will allow the generator to create the draft for the most complicated assignments. If you see that the tool can’t generate your sophisticated paper in the usual mode, you have the option to try this upgraded version. The only thing is that you will have to register and log in to the site.

If you feel that machine-generated and edited paper may not be enough for you, you can always hire a real-time academic author on this website. You will receive a customized paper, of course, but you will have to pay for it as on all other similar sites.

There is one more amazing option we would like to draw your attention to. It is Knowledge Bank. This information repository is truly valuable, so let’s consider it in more detail.

How Can Knowledge Bank Be Useful for You?

The Knowledge Bank page here is an extended library of all the materials needed for your academic writing improvement. Its clear and straightforward interface will allow you to find exactly what you need in several minutes and always be informed about all official changes in academic writing requirements and rules.

So, how can Knowledge Bank help you boost your academic writing? You can consider the following:

  1. You will get all the necessary learning resources that include writing guides and educational materials on various aspects of writing, like, for example, grammar and style guidelines or structuring an academic paper.
  2. You will access professional examples and templates for different types of papers that can serve you as models to understand the required format, style, and paper organization.
  3. You will learn writing tips and advice tailored to specific disciplines and topics and guidance on conducting research, improving coherence and clarity, or developing arguments.
  4. You will even learn research methodology, using academic databases, and data analyzing techniques, as well as explanations on how to find relevant sources, evaluate the information’s credibility, or conduct literature reviews.
  5. You will get citation and referencing guides on different citation styles, which include an explanation of the specific rules and formats for APA, MLA, and other widely used academic styles.
  6. You will get answers to a variety of academic writing-related questions that may emerge in the process of paper creation from scratch or generation with the help of these tools.

We can say that this part of the site is especially among students because it provides endless opportunities for writing improvement.

However, there are other useful things you can gain from this site without spending too much time and, of course, for free. Plagiarism Checker is one of them.

How Can Plagiarism Checker Help You?

Apart from the amazingly powerful Essay Typer that provides drafts of any complexity, the platform has integrated Plagiarism Checker with algorithms that allow getting access to a wide variety of the most reputable and relevant academic databases online to detect any slightest signs of plagiarism.

If you are worried about the uniqueness of your draft, the tool will provide you with the following benefits:

  • checking originality;
  • identifying any unintentional similarities with existing sources;
  • ensuring academic integrity and ethical writing practices;
  • highlighting the sections that need proper citation or paraphrasing by giving credit to the original authors;
  • refining any type of writing by identifying any instances of potential plagiarism and providing ways to produce high-quality content;
  • peace of mind for submitting their assignments with confidence.

We have tested the effectiveness of this tool by using other plagiarism checkers. They proved a 100% result.

Final Thoughts

We can responsibly recommend PaperTyper to you if you need urgent help with your academic writing. You can generate and edit your paper within about half an hour and for free. Isn’t it the best benefit of this amazing set of AI-powered paper-generating and editing tools?

The only thing we would like to add is about using these tools responsibly and accurately. Remember that all the texts generated here can serve you as a draft and an excellent source of ideas. You need to consider the options of submitting the draft as it is if you are pressed for time or adding something on your part. You can always use Grammar Checker and Plagiarism Checker to edit the pieces of writing created on your own.

Read the article

Risks to Consider When Using Linux

risk management using linux

Linux is a free and open-source operating system that’s popular among developers, businesses, and individuals. The flexibility and customizability of Linux make it an excellent choice for those looking for more control over their computer systems. However, like any other operating system, using Linux comes with some risks. This article will discuss the risks associated with using Linux and how to create a Linux risk register for managing the risks you face when using Linux. 

Why Does Risk Management Matter for Linux? 

Risk management is crucial for any technology, including Linux. It involves identifying potential risks, assessing their likelihood and impact, and taking measures to mitigate or avoid them. 

The risks of using Linux include compatibility issues, application stack vulnerabilities, exposed and unprotected APIs, and security gaps. These risks can have adverse effects on individuals and organizations. For instance, a data breach can lead to you incurring as much as $4.82 million in cyber costs. 

Given the adverse effects of risks occurring, it is important that Linux users implement effective risk management strategies to protect against different types of risk. One such strategy is to build a risk register. 

How to Create a Linux Risk Register 

A risk register is a document that lists all the potential risks associated with an activity or technology, their likelihood, impact, and the measures taken to mitigate them. Creating a Linux risk register is essential in managing the risks of using Linux. Here are the steps for creating a Linux risk register. 

Identify Risks 

The first step in creating a risk register is identifying potential risks that may impact your Linux system. Risks can come in many forms, such as security threats, software or hardware failures, natural disasters, or human error. You can identify risks by brainstorming with your team or reviewing past incidents. 

By identifying potential risks, you can proactively plan and implement measures to manage those risks. This step helps you understand the potential threats to your Linux system, and it helps you prioritize the risks based on their severity and impact. 

Describe the Risks 

Once you have identified potential risks, the next step is to describe each risk in detail. This includes the nature of the risk, its potential impact, and how it might occur. For example, a security threat may come in the form of a malicious software attack, which could compromise sensitive data, resulting in financial losses or reputational damage. 

Describing the risks in detail helps you better understand each risk’s nature and scope. In addition, doing this helps you communicate the risks to other stakeholders, such as management or technical teams, and it helps you define the appropriate response to each risk. 

Estimate the Likelihood and Impact of Risks 

After describing the risks, you need to estimate the likelihood of each risk occurring and its impact on your system. The likelihood and impact of each risk can be estimated using a risk matrix, which assigns a value to each risk based on its likelihood and impact. The matrix helps you prioritize risks and decide which ones require immediate attention. 

Estimating the likelihood and impact of each risk helps you prioritize the risks based on their severity and likelihood of occurrence. This step also helps you allocate resources and prioritize implementing risk management measures. By estimating the likelihood and impact of each risk, you can identify the most critical risks and develop effective strategies to manage those risks. 

Create a Risk Response Plan 

Once you have identified and assessed the risks, the next step is to create a risk response plan. This plan outlines the steps you will take to manage the risks and reduce their impact. The response plan should include preventive controls, detective controls, corrective controls, and contingency plans. 

Creating a risk response plan helps you proactively manage the identified risks. It also helps you minimize the impact of any potential risks and develop effective controls to prevent future incidents. 

Prioritize Risks 

After creating a risk response plan, the next step is to prioritize the risks. Prioritization should be based on the likelihood and impact of each risk. High-likelihood and high-impact risks should be given the highest priority. 

Prioritizing risks helps you allocate resources and implement risk management measures based on the severity and likelihood of occurrence. Identify the most critical risks and prioritize the implementation of risk management measures. This way, you will be able to mitigate the risks that can affect you most first and deal with other risks later on. 

Assign Risk Owners 

Finally, each risk should be assigned an owner who will be responsible for managing and monitoring the risk. A risk owner should be someone with the necessary expertise and authority to take action when needed. 

Wrapping Up 

Creating a risk register is essential to managing the risks of using a Linux system. By following the steps outlined above, you can identify, assess, and manage risks effectively, reducing the likelihood of potential harm. Remember to regularly review and update your risk register to ensure it remains relevant and effective.

Unlocking The Path To Academic Success with Essaynow.net

Students encounter several challenges in today’s fast-paced academic environment that can obstruct their path to success. It is OK to struggle since, otherwise, the results won’t be as valued. Moreover, the process of learning requires some difficulties until you learn how to overcome those. Still, sometimes students require assistance.

The ever-increasing workload and demands of essay writing tasks are one such option when help is needed. However, EssayNow.net, the best essay writing service, has emerged as a reliable resource for students in need of professional aid. This review delves into website’s features, peculiarities, and services, focusing on how it may reduce the stress of academic writing and empower students to thrive in their studies without overpaying.

Services

This “write my essay for me” service offers a standard yet convenient list of general services. The list includes:

Overall, the service offers the following general services:

  • academic writing;
  • editing;
  • proofreading;

It is clear what the first three options entail, but what about the last one? Calculating services mean that you can expect your math assignment to be done. The service doesn’t just do the math; it extends its services to any subject that needs calculating.

Still, the most popular options students require is academic writing services. Here are just a few examples of works that you can order:

  • Case study.
  • Admission essay.
  • Book review.
  • Business plan.
  • Term paper.
  • Corse work.
  • Business letter.
  • PowerPoint presentation.

This isn’t the full list. Overall, you can order any academic writing assignment that you require.

Main Features

First things first, it is clearly easy to use the website. However, this section describes the general features of the service provided. Here are some of the most important ones:

  • The company recognizes the need of clients to keep their identities discreet from their professors. Thus, clients don’t have to worry about information being leaked.
  • The company offers refunds if the paper is of bad quality or doesn’t meet requirements.
  • Formatting styles. EssayNow has clients worldwide, so the writers are fluent in such styles as Harvard, Chicago/Turabian, MLA and APA.

Moreover, the website features discounts for future orders.

Customization And Original Works

Every academic paper completed by service writers is custom-written to meet the specific needs of each student since different universities and colleges have different expectations. The service stresses individuality and uniqueness, ensuring that the final result accurately reflects the student’s voice and style.

Customers can contact their assigned writers directly, enabling collaboration and crucial suggestions during the writing process. Still, it is a feature that requires additional payment, but it is worth it. This individualized approach gives students control over their work while benefiting from the knowledge and assistance of experienced professionals.

Moreover, the paper writing website is dedicated to preserving the greatest academic integrity standards, and it isn’t just about the formatting styles. All papers are subjected to a comprehensive plagiarism-checking process to assure uniqueness. Moreover, the service recommends using these essays only as inspiration for your own work.

Meeting The Deadline And Efficiency

EssayNow offers promptness and effectiveness when it comes to deadlines. It can meet students’ needs whether they need an essay in a few days or in a few hours (although you should have reasonable expectations, considering numerous reviews).

The platform is available 24/7 through email. This allows students to seek support whenever they need it. This adaptability and accessibility ensure that urgent tasks may be done without sacrificing quality.

Benefits

The platform offers affordable and transparent pricing to make its services available to a wide range of students (and their budgets). The cost of each assignment is decided by parameters such as academic level, deadline, page number, and task complexity. This is just one of the main benefits, here are other advantages:

  • Refunds and bonuses.
  • No plagiarsm and originality.
  • Ease of usage.
  • Different formatting styles.
  • Positive reviews and good ratings.

Overall, this service is all you could dream about!

Conclusion

EssayNow has established itself as a trustworthy academic partner for students. It has some of the best reviews in the market, and they are left by satisfied clients who order more than one or two papers.

Students can concentrate on their studies, knowing that their papers are in experienced hands. The website stands out as a vital resource for students seeking experts for a reasonable price.

5 Most Common Cyber Attacks In 2023

linux security

Building a company and keeping it afloat amidst financial turmoil is challenging, and it isn’t made any easier by the number of hackers who are taking aim at thousands of companies every day.

Across the world, as many as 30,000 websites are hacked daily, with 64% of companies having experienced at least one cyber attack in their lifetime.

If you own or are building a business, it is essential that you know what to look out for and understand the threats that could harm your operations.

As mentioned previously, 2023 is going to be a challenging year for many businesses, especially with the threat of inflation looming in countries like the UK, the US, and Canada.

By 2025, it is reported that cybercrime could cost the world $10.5 trillion yearly, so it is a serious issue which should be at the forefront of your mind at all times.

With this being said, here are five of the most common cyber attacks which will likely be utilised in 2023:

Malware Attacks

For many years, malware attacks have been the most typical form of cyber breaches. A malware attack comes in the form of a “trojan virus”, which is disguised as trustworthy software.

Once downloaded, the malware takes control of the network, cracks passwords and disrupts the operations of the business itself.

The best way to avoid this is by investing in efficient antivirus software or utilising firewalls.

Phishing Attacks

Emails are still highly utilised by companies across the world. For b2b organisations, for instance, they are one of the most effective b2b marketing channels, which is why your company should know the difference between legitimate emails and fake emails.

Phishing attacks are when an attacker impersonates a contact and sends a malicious – yet seemingly legitimate – email to the victim. When the victim opens this email, the attacker gains access to their information and accounts, which also allows them to install malware.

The best way to avoid this is by staying focused on what makes a real or fake email, as well as making use of an anti-phishing toolbar.

Denial Of Service Attacks

This is one of the most dangerous threats for companies in 2023. It works by the hackers flooding a system with traffic to exhaust their resources.

After this is done, the servers will eventually give in, and the website shuts down, leaving it vulnerable.

To fight this, it is important that your company runs a traffic analysis tool that can spot the warning signs and take immediate steps to defend itself against the attack.

Watering Hole Attacks

A watering hole attack is not as well known as malware or phishing, but it is just as damaging if it happens to your company. The hacker achieves this attack by targeting websites frequented by an organisation and infecting them with malware – which subsequently affects the victim’s systems.

This then gives the attacker control of the user’s personal information, with the possibility of also taking access to the computer itself.

Constantly updating your software and using sufficient watering hole security tools can help to avoid this, keeping your company safe by detecting any suspicious activity.

Password Attacks

Lastly, this is one of the most simple attacking strategies, but it still takes many organisations by surprise. If your passwords are basic and without special characters – or alphanumeric characters – then an attacker can use tools to crack them.

To avoid this, you need to remember the basics and ensure your passwords are strong and well-built to prevent attacks.

You should also ensure you are using multiple passwords and regularly updating them to limit exposure. This message – as well as messages on preventing every other attack – should also be communicated to the team to keep operations running smoothly and securely across the board.

How To Use the Touch Command in Linux: A Simple Guide

codes

codes

Many Linux users, especially newbies, confuse the touch command for being the one that creates files. While it can do this, the command can do much more. 

For example, if you use VPS hosting on your Linux machine, you can use the command to alter the timestamps of folders and files. In this brief post, we’ll explore the various options the command supplies and all the ways you can use it. 

The Syntax of the Touch Command

If you intend to follow along with this tutorial, remember to connect to your VPS using an SSH client of your choice before using the command. 

Here’s what the touch command’s syntax is:

touch [options] [Name of the file]

 

It’s quite straightforward – it’s the options that give you all the flexibility. Let’s have a look at all the available options. 

The Touch Command’s Options 

Option What It Does
-a Alters the access time
-c Prohibits the creation of a new file
-d=<string> Alters the timestamp according to the date string
-h Alters the timestamp for symbolic links
–help Shows the help menu
-m Alters the modification time
-r=<file> Alters the timestamp based on the reference file
-t <stamp> Alters the timestamp according to the “<stamp>” value, which has the date-time format
-v or –version Shows the touch command version

 

Having a general idea of what flags work with the touch command won’t do the trick. You must also learn what timestamps are. In every Linux-based OS, folders and files are assigned a timestamp by default. This timestamp keeps track of when the folder or file was last modified. 

You might be familiar with what a timestamp is, but chances are, you don’t know about the three kinds of timestamps:

  1. Access time (atime): This timestamp indicates when the file was last read.
  2. Changed time (ctime): It indicates when the file’s metadata was last changed. 
  3. Modification time (mtime): It indicates when the file’s content was last modified. 

In addition to creating files and modifying file and folder timestamps, the touch command can also alter filer and folder access. The only exception is that the command cannot alter ctime, since there is no way to change ctime directly. 

However, the atime and mtime of a file are both parts of the file’s metadata, and changing both of them also changes the ctime. When both those timestamps are modified, ctime is automatically set to the current time. 

Real-life Examples of Using the Touch Command

#1 Creating a File

Run the touch command with just a filename and no options, and it will create a new file for you with the name and the format you specify. Here’s what that looks like:

touch fileName.txt

 

If you specify the name of a file that exists, the file will be left untouched, but the access and mtime will be updated.  

#2 Creating Several Files

The touch command can create several files in one go – all you need to do is write all the file names. Of course, you’ll need to put a space between the names. 

touch firstFile secondFile

 

#3 Altering Access Time

The “-a” flag will change the atime of the file whose name you mention. Here’s how that would work:

touch -a fileName

 

To check the new atime of a file, you can run:

ls -lu filename

 

#4 Altering Modification Time

The “-m” flag will change the mtime of the file whose name you mention. 

#5 Altering Both Access and Modification Time

Doing this is as simple as using both the a and m flags in one command, like so:

touch -am fileName

 

#6 Altering Access Time without Creating a New File

To modify the atime and mtime and make them the current time without creating a new file, you can use the c flag:

touch -c newFile

 

#7 Setting Specific atime and mtime Values

To set specific atime and mtime values, use the t flag, and then pass the date and time in YYYYMMDDhhmm.ss format. Of course, you’ll also need to mention the filename: 

touch -t 20232001547.30 fileName

 

#8 Altering Timestamp Using a Symbolic Link

Using the touch command on a symbolically linked file name changes the timestamp of the original file that the linked file pointed to. 

But if you want to alter the atime and mtime to the current time for a linked file, you can use the h option like so:

touch -h SymbLinkedFile

 

#9 Setting Timestamp Using a Reference File

The touch command makes it possible for you to set one file’s atime and mtime to another, essentially copying that information. 

You can do this using the r option, and you will also need to write both the files’ names. Here’s how:

touch -r referenceFile fileName

 

#10 Setting the Date and Time with a String

You can set the timestamp to a string you pass using the d option. If you mention just a date, the time will be set to 00:00. Here’s an example of that:

touch -d ‘9 Apr’ filename

 

You can also pass just the time, and the date will be set to today’s date. Here’s what the command would look like:

touch -d ’16:20′ filename

 

Conclusion

Changing timestamps and access is something every Linux user will need to do at some point. The touch command makes accomplishing these things a breeze. 

We’ve covered all the most helpful options of the command in this post. Plus, with the examples of use cases, you will have no problem using the command without issues. 

Reading & Parsing JSON Data with Python: A Simple Tutorial

codes

codes

JavaScript Object Notation is a standard format mostly used by APIs and websites to store data objects using text. In simple words, JSON supports data structures that can represent objects as text. Also used in contemporary databases such as PostgreSQL, JSON is derived from JavaScript, as you might have already guessed.

Though XML and YAML serve the same purpose as JSON, JSON is simpler but not as powerful. Regardless, many developers hold the opinion that JSON made XML and YAML obsolete. 

While this is debatable, what’s interesting is that most programming languages, Python included, support JSON. This is mainly because it is so easy to use. 

If you’re ready to equip yourself with JSON skills to supplement your Python programming, here’s a brief guide demonstrating how you can read and parse JSON data with Python. 

Simple JSON Example

JSON is most notably used for transferring data objects over APIs. Let’s take a look at a simple JSON string:

{

  “name”: “France”,

  “population”: 65640482,

  “capital”: “Paris”,

  “languages”: [

    “French”

  ]

}

 

Look familiar? The example above looks just like a Python dictionary, right? 

That’s because JSON holds data just like a Python dictionary does – in key-value pairs. That said, JSON is a lot more flexible. JSON can hold numbers, strings, Boolean values, and even lists.  

You might have also noticed how lightweight JSON is. Unlike a similar language like XML, JSON has no markup involved. It simply holds the data that needs to be transferred. This characteristic of JSON is what makes it so popular. 

JSON in Python

Languages such as C, C++, C#, Ruby, Java, and Python, among many others, support JSON natively. So, in Python, you won’t need to install dependencies or anything else to use it. 

Python offers the ability to write customer encoders and decoders via the json module in its standard library. The module handles converting data from the JSON format to their Python equivalent objects, which include lists and dictionaries. Additionally, the module can convert Python objects to the JSON format. 

What You Need to Do Before Parsing JSON Data

JSON data is typically stored in strings, and you’re bound to store JSON data in string variables when working with APIs. Storing them this way is how they can be parsed.

Though JSON can do other things, it’s most frequently used to parse strings into Python dictionaries. The json module handles this task easily. As with using any other module in the Python standard library, you must begin by importing json. It comprises two very helpful methods: load and loads. 

Though the latter method looks like the plural form of the former, this is not the case. The “s” at the end of “loads” stands for “string.” This method enables the parsing of JSON data from strings.

In contrast, the load method is used to parse data that is in the byte format. Let’s see how loads() works first. 

Though you can use Python’s triple quote convention to store multi-line strings, it’s possible to remove the line breaks for better readability. Here’s how you’d create a JSON string in Python:

country = ‘{“name”: “France”, “population”: 65640482}’

print(type(country))

 

The second statement will print the variable we created like so:

<class ‘str’>

 

This output confirms that the output is a JSON string. Now, we can use loads() to supply the string as an argument:

import json

country = ‘{“name”: “France”, “population”: 65640482}’

country_dict = json.loads(country)

print(type(country))

print(type(country_dict))

 

The output of the final statement in the code above is “<class ‘dict’>” confirming that the JSON string in “country” has been converted into a dictionary. You can now use the dictionary like any other Python dictionary. 

Before you begin json.loads() in your code, note that the method doesn’t always return dictionaries. The data type it returns is determined by an input string. 

Let’s look at an example where the JSON string returns a list:

countries = ‘[“France”, “Ghana”]’

countries_list= json.loads(countries)

print(type(countries_list))

# This outputs <class ‘list’>

 

It is also possible for the JSON string to transform into a Boolean value if it has the right data. So, “true” in JSON converts to the Boolean “True.” Let’s see this in action:

import json

 

bool_string = ‘true’

bool_type = json.loads(bool_string)

print(bool_type)

# This outputs True

 

Here’s a table indicating JSON objects and their corresponding Python data types, so you don’t have to rely on writing your own examples to figure it out:

JSON Python
array list
false False
null None
number (integer) int
number (real) float
object dict
string str
true True

 

Parsing JSON Files in Python

So far, we’ve dealt with parsing JSON data in Python. Parsing JSON files into Python data involves a similar process and is equally simple. That said, parsing JSON files deamnds that you use the open() method besides JSON to do this. Additionally, you must now resort to using load() to read JSON data stored in files.  

The method accepts a JSON file object and returns a Python object. And to get the file object from its location, the open() method is used. Let’s see how this works – begin by storing the following JSON script in a file named “france.json”:

{

  “name”: “France”,

  “population”: 65640482,

  “capital”: “Paris”,

  “languages”: [

    “French”

  ]

}

 

Now, create another text file and put this Python script in it:

import json

with open(‘france.json’) as f:

  data = json.load(f)

print(type(data))

 

The open() method above returns a file handle which is then handed to the load method. The “data” variable holds the JSON data as a dictionary. Here’s what you can run to check the dictionary keys:

print(data.keys())

# The output of this code is dict_keys([‘name’, ‘population’, ‘capital’, ‘languages’])

 

Now that you have this information, you can print specific values like so:

data[‘population’]

# This outputs 65640482

 

JSON Encoding

JSON encoding, which is also called serialization, refers to the process of converting Python objects to JSON objects. It is done using the dumps() method. Here’s an example to explore how it works – save the following Python script as a new file:

import json

languages = [“French”]

country = {

    “name”: “France”,

    “population”: 65640482,

    “languages”: languages,

    “president”: Emmanuel Macron,

}

country_string = json.dumps(country)

print(country_string)

 

Run the code, and you’ll see the following output:

{“name”: “France”, “population”: 65640482, “languages”: [“French”],

 “president”: Emmanuel Macron}

 

As you can see, we’ve converted the Python object into a JSON object. Parsing a Python object into JSON data is surprisingly easy!

Bear in mind that we’ve used a dictionary object in this example, which is why it converted into a JSON object. As you might have guessed, you can also convert lists into JSON. Here’s how:

import json

languages = [“French”]

languages_string = json.dumps(languages)

print(languages_string)

# This outputs [“French”]

 

Of course, converting Python to JSON is not limited to dictionaries and lists. You can also convert strings, integers, Boolean values, and floating point numbers to JSON. 

Here’s a table to refer to when converting Python objects to JSON:

Python JSON
dict object
False false
int, float, int number
list, tuple array
None null
str string
True true

 

Writing Python Objects to JSON Files

You’ll need to rely on the dump() method to write Python objects to JSON files. It works similarly to dumps(), with the difference being that dump() can write to files while dumps() returns strings. 

In the example below, we open the file in writing mode and write JSON data to it:

import json

# Tuple is encoded to JSON array.

languages = (“French”)

# Dictionary is encoded to JSON object

country = {

    “name”: “France”,

    “population”: 65640482,

    “languages”: languages,

    “president”: Emmanuel Macron,

}

with open(‘countries_exported.json’, ‘w’) as f:

    json.dump(country, f)

 

Save the script to a new file and run it. The .json file mentioned in the penultimate line will be created or overwritten. The contents of this new file will be JSON. 

But when you open this new file, you will see that the JSON will be in one line. If you’re interested in enhancing readability, you can pass an additional parameter to dump() like so: 

json.dump(country, f, indent=4)

 

If you add this parameter to the file you saved and run it, you will see that the .json file will now be formatted neatly like this:

{

    “languages”: [

        “French”

    ], 

    “president”: “Emmanuel Macron”

    “name”: “France”

    “population”: 65640482

}

 

As you can see, everything is indented four spaces. It’s interesting to note that the indent argument is also available for dumps(). 

Difference Between Loading and Dumping in the json Module

The json module isn’t very complicated – it has only four primary methods. We’ve covered loads() and load() in this post. 

There are two more methods, dump() and dumps(), that allow you to work with JSON in Python. These functions allow you to write data to files and strings, respectively. Just like the “s” in the “loads” method stands for “string,” the “s” in “dumps” also stands for string. 

Remembering the meaning of the “s” is a great way to remember which method can be used for which task. 

Conclusion

So, with this guide handy, you’ve learned how to read and parse JSON data in Python. Learning to work with JSON using Python is essential if you work with websites since it’s used to transfer data virtually everywhere. Besides databases and APIs, JSON is used in web scrapers as well.

If you’re working on a dynamic website, chances are you might be trying to implement web scraping. With your knowledge of JSON, you’re ready to script pages with infinite scroll.

Read the article

The Best Video Conferencing and Collaboration Platforms for Linux

video conferencing

In the age of remote work, video conferencing and collaboration tools have become essential for staying connected to colleagues, clients, and team members. Fortunately, there are a number of terrific Linux apps that can help you do just that. Let’s take a look at some of the best options available for video conferences and collaborations.

Digital Samba

Digital Samba is the best video conferencing and collaboration platform available for Linux users. It is a powerful, open-source platform that offers robust features and capabilities that are perfect for businesses looking to collaborate with remote teams. With its many advantages, Digital Samba provides an excellent solution for Linux users who need a reliable, easy-to-use video conferencing and collaboration tool. Let’s take a closer look at why Digital Samba is the ideal choice for Linux users.

Intuitive User Interface

Digital Samba has an intuitive user interface that makes it easy to set up and use. From the main dashboard, you can easily access all of the features and tools available on the platform. With just a few clicks of the mouse, you can start or join meetings, send messages, share files, and more. This user-friendly design makes Digital Samba one of the most efficient collaboration platforms available for Linux users.

Secure Communication

Security is always an important consideration when choosing a collaboration platform or video conferencing tool. Fortunately, Digital Samba takes security seriously with its secure communication protocols. All data transferred over Digital Samba is encrypted using TLS/SSL technology so that sensitive information remains safe from prying eyes. Additionally, Digital Samba also uses multi-factor authentication to ensure only authorized users can access your account.

High Quality Audio & Video

When it comes to audio and video quality during meetings or conferences, Digital Samba does not disappoint. The platform supports high definition (HD) audio and video so that everyone in your meeting will be able to hear each other clearly without any lag or interruption in service. Plus, with multi-party support up to 1000 participants at once, you can rest assured that no matter how complex or large your meetings may be, everyone will be able to see and hear each other without issue.

Zoom Meetings

Zoom Meetings is one of the most popular video conferencing platforms on the market today, and it works great with Linux. Zoom Meetings offers high-quality audio and video connections as well as screen sharing capabilities. Plus, with its intuitive interface, you’ll be able to quickly jump into calls without any hassle. And if you need a larger meeting size than Zoom’s free plan allows (100 participants), you can upgrade to a paid plan that supports up to 1,000 participants.

Jitsi Meet

Jitsi Meet is an open source platform designed specifically for in-browser or mobile video conferences. The app is incredibly easy to use—just visit jitsi.org to create your own conference room in under 30 seconds! Jitsi also has encryption enabled by default so you can rest assured that your conversations are safe from prying eyes. Plus, it offers features like recording, streaming, and more advanced features like whiteboarding and breakout rooms if needed.

Skype for Business

If you’re looking for a more traditional solution for video conferencing and collaboration on Linux then Skype for Business might be the perfect fit. It offers all the features that you would expect from a modern day messaging platform including audio/video calling, instant messaging, file sharing capabilities and even support for text chat over multiple devices at once! And with its integration with Office 365 products like Word &amp; Excel, Skype makes it easy to share documents or collaborate on projects in real time no matter where you are located!

Conclusion

No matter what type of collaboration needs your team has or how many people need to participate in calls – there is likely a great Linux app out there that can meet your needs! Whether it’s Jitsi Meet’s ease-of-use or Digital Samba’ integration with its intuitive user interface, secure communication protocols, and high quality audio & video capabilities – these apps make it easier than ever before to stay connected while working remotely! So don’t hesitate – check out these great options today!