<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tella Boluwatife</title>
    <description>The latest articles on DEV Community by Tella Boluwatife (@codereaper0).</description>
    <link>https://dev.to/codereaper0</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1718016%2F895f989d-b88b-4499-be00-43b721981580.jpeg</url>
      <title>DEV Community: Tella Boluwatife</title>
      <link>https://dev.to/codereaper0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codereaper0"/>
    <language>en</language>
    <item>
      <title>Exploratory Testing: User Experience Improvements for Scrape Any Website</title>
      <dc:creator>Tella Boluwatife</dc:creator>
      <pubDate>Tue, 02 Jul 2024 21:04:39 +0000</pubDate>
      <link>https://dev.to/codereaper0/bug-hunting-on-saw-35lb</link>
      <guid>https://dev.to/codereaper0/bug-hunting-on-saw-35lb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt; Welcome to my detailed bug report for Scrape Any Website (SAW), version 1.1.15.0 for x86 architecture. In this post, I'll share the bugs and usability issues I encountered during my exploratory testing of this data extraction tool. This exercise is part of my ongoing efforts to improve web scraping tools and ensure they meet user needs effectively&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application Name and Version:&lt;/strong&gt; Scrape Any Website, Version 1.1.15.0&lt;br&gt;
&lt;strong&gt;Test Environment:&lt;/strong&gt;&lt;br&gt;
Device: Dell Latitude E7270&lt;br&gt;
Operating System: Windows 11&lt;br&gt;
SAW Version: 1.1.15.0&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links to get the application&lt;/strong&gt;&lt;br&gt;
Website - &lt;a href="https://scrapeanyweb.site/" rel="noopener noreferrer"&gt;SAW&lt;/a&gt;&lt;br&gt;
Windows Store - &lt;a href="https://apps.microsoft.com/detail/9mzxn37vw0s2" rel="noopener noreferrer"&gt;Download Page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing Methodology:&lt;/strong&gt;&lt;br&gt;
A multifaceted testing approach was employed, focusing on:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functional Testing:&lt;/strong&gt; Evaluating core functionalities like website scraping, data extraction, and output formatting.&lt;br&gt;
&lt;strong&gt;Usability Testing:&lt;/strong&gt; Assessing the application's ease of use, intuitiveness of the interface, and overall user-friendliness.&lt;br&gt;
&lt;strong&gt;Performance Testing:&lt;/strong&gt; Observing general responsiveness and scraping speeds during exploration.&lt;br&gt;
&lt;strong&gt;Edge Case Testing:&lt;/strong&gt; Pushing the boundaries of expected use scenarios to uncover potential bugs or limitations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Findings:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My testing efforts revealed several areas for improvement in SAW. A detailed report outlining these findings, including specific bug reports is available in the attached spreadsheet: Full Report Excel &lt;a href="https://docs.google.com/spreadsheets/d/1vmXSYHIZO-Eepjt9ylzefQrsQVww0iTyJ0LIz5TcLYw/edit?usp=sharing" rel="noopener noreferrer"&gt;Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt; The exploratory testing of Scrape Any Website revealed several bugs and usability issues. Addressing these issues will significantly improve the user experience and reliability of the application.&lt;/p&gt;

</description>
      <category>bug</category>
      <category>scrapping</category>
      <category>programming</category>
    </item>
    <item>
      <title>Automating Linux User Creation with Bash Script</title>
      <dc:creator>Tella Boluwatife</dc:creator>
      <pubDate>Tue, 02 Jul 2024 14:03:07 +0000</pubDate>
      <link>https://dev.to/codereaper0/automating-linux-user-creation-with-bash-script-3p3</link>
      <guid>https://dev.to/codereaper0/automating-linux-user-creation-with-bash-script-3p3</guid>
      <description>&lt;p&gt;Managing users and groups on a Linux system can be a complex and time-consuming task, especially in environments with frequent changes. Automation can significantly simplify this process, ensuring consistency and saving valuable time. In this article, we will walk through the implementation of a Bash script that automates the creation of users and groups, sets up home directories, generates secure random passwords, and logs all actions for auditing purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Script Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Bash script create_users.sh reads a list of usernames and groups from a text file, creates the specified users and groups, sets up home directories with appropriate permissions, generates random passwords for the users, and logs all actions. The script also securely stores the generated passwords in a dedicated file.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Script Breakdown&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here is the complete create_users.sh script, followed by a detailed explanation of each section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

# Ensure the script is run with root privileges
if [ "$EUID" -ne 0 ]; then
  echo "Please run as root"
  exit 1
fi

# Log file path
LOG_FILE="/var/log/user_management.log"
# Password storage file path
PASSWORD_FILE="/var/secure/user_passwords.csv"

# Create secure directory for passwords if it doesn't exist
mkdir -p /var/secure
chmod 700 /var/secure

# Function to create groups
create_groups() {
  local groups="$1"
  IFS=',' read -r -a group_array &amp;lt;&amp;lt;&amp;lt; "$groups"
  for group in "${group_array[@]}"; do
    group=$(echo "$group" | xargs) # Remove leading/trailing whitespace
    if [ ! -z "$group" ]; then
      if ! getent group "$group" &amp;gt; /dev/null; then
        groupadd "$group"
        echo "Group '$group' created." | tee -a "$LOG_FILE"
      fi
    fi
  done
}

# Function to create user and group
create_user() {
  local username="$1"
  local groups="$2"

  # Create user group if it doesn't exist
  if ! getent group "$username" &amp;gt; /dev/null; then
    groupadd "$username"
    echo "Group '$username' created." | tee -a "$LOG_FILE"
  fi

  # Create the additional groups
  create_groups "$groups"

  # Create user with personal group and home directory if user doesn't exist
  if ! id "$username" &amp;gt; /dev/null 2&amp;gt;&amp;amp;1; then
    useradd -m -g "$username" -G "$groups" "$username"
    echo "User '$username' created with groups '$groups'." | tee -a "$LOG_FILE"

    # Set home directory permissions
    chmod 700 "/home/$username"
    chown "$username:$username" "/home/$username"

    # Generate random password
    password=$(openssl rand -base64 12)
    echo "$username:$password" | chpasswd
    echo "$username,$password" &amp;gt;&amp;gt; "$PASSWORD_FILE"
  else
    echo "User '$username' already exists." | tee -a "$LOG_FILE"
  fi
}

# Read the input file
input_file="$1"
if [ -z "$input_file" ]; then
  echo "Usage: $0 &amp;lt;name-of-text-file&amp;gt;"
  exit 1
fi

# Ensure the input file exists
if [ ! -f "$input_file" ]; then
  echo "File '$input_file' not found!"
  exit 1
fi

# Process each line of the input file
while IFS=';' read -r user groups; do
  user=$(echo "$user" | xargs) # Remove leading/trailing whitespace
  groups=$(echo "$groups" | xargs) # Remove leading/trailing whitespace
  if [ ! -z "$user" ]; then
    create_user "$user" "$groups"
  fi
done &amp;lt; "$input_file"

# Set permissions for password file
chmod 600 "$PASSWORD_FILE"
echo "User creation process completed." | tee -a "$LOG_FILE"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Detailed Explanation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ensuring Root Privileges&lt;/strong&gt;&lt;br&gt;
The script starts by checking if it is being run with root privileges, as creating users and modifying system files require administrative rights.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if [ "$EUID" -ne 0 ]; then
  echo "Please run as root"
  exit 1
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**Setting Up Log and Password Files&lt;br&gt;
The script defines paths for the log file and the password storage file. It then creates a secure directory for storing passwords and ensures it has the correct permissions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LOG_FILE="/var/log/user_management.log"
PASSWORD_FILE="/var/secure/user_passwords.csv"
mkdir -p /var/secure
chmod 700 /var/secure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**Function to Create Groups&lt;br&gt;
The create_groups function takes a comma-separated list of groups and creates each group if it does not already exist. It also logs the creation of each group.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create_groups() {
  local groups="$1"
  IFS=',' read -r -a group_array &amp;lt;&amp;lt;&amp;lt; "$groups"
  for group in "${group_array[@]}"; do
    group=$(echo "$group" | xargs)
    if [ ! -z "$group" ]; then
      if ! getent group "$group" &amp;gt; /dev/null; then
        groupadd "$group"
        echo "Group '$group' created." | tee -a "$LOG_FILE"
      fi
    fi
  done
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**Function to Create Users and Groups&lt;br&gt;
The create_user function handles the creation of the user and their primary group, as well as any additional groups. It sets up the user's home directory, assigns appropriate permissions, and generates a random password for the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create_user() {
  local username="$1"
  local groups="$2"

  if ! getent group "$username" &amp;gt; /dev/null; then
    groupadd "$username"
    echo "Group '$username' created." | tee -a "$LOG_FILE"
  fi

  create_groups "$groups"

  if ! id "$username" &amp;gt; /dev/null 2&amp;gt;&amp;amp;1; then
    useradd -m -g "$username" -G "$groups" "$username"
    echo "User '$username' created with groups '$groups'." | tee -a "$LOG_FILE"

    chmod 700 "/home/$username"
    chown "$username:$username" "/home/$username"

    password=$(openssl rand -base64 12)
    echo "$username:$password" | chpasswd
    echo "$username,$password" &amp;gt;&amp;gt; "$PASSWORD_FILE"
  else
    echo "User '$username' already exists." | tee -a "$LOG_FILE"
  fi
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**Processing the Input File&lt;br&gt;
The script reads the input file provided as a command-line argument. Each line of the file is expected to contain a username and a list of groups separated by a semicolon. The script processes each line, removing any leading or trailing whitespace, and calls the create_user function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;input_file="$1"
if [ -z "$input_file" ]; then
  echo "Usage: $0 &amp;lt;name-of-text-file&amp;gt;"
  exit 1
fi

if [ ! -f "$input_file" ]; then
  echo "File '$input_file' not found!"
  exit 1
fi

while IFS=';' read -r user groups; do
  user=$(echo "$user" | xargs)
  groups=$(echo "$groups" | xargs)
  if [ ! -z "$user" ]; then
    create_user "$user" "$groups"
  fi
done &amp;lt; "$input_file"

## 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finalizing Permissions&lt;br&gt;
Finally, the script ensures that the password file has the correct permissions, making it readable only by the root user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 600 "$PASSWORD_FILE"
echo "User creation process completed." | tee -a "$LOG_FILE"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running the Script
&lt;/h2&gt;

&lt;p&gt;To run the create_users.sh script, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;**Create the Input File: **Prepare a text file with usernames and groups. Each line should contain a username followed by a semicolon and a comma-separated list of groups. For example:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   tella;admins,developers
   boluwatife;users,admins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Make the Script Executable:&lt;/strong&gt; Ensure the script has executable permissions.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   chmod +x create_users.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run the Script with Root Privileges:&lt;/strong&gt; Execute the script, passing the path to the input file as an argument.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   sudo ./create_users.sh /path/to/input_file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This script provides a robust solution for automating user and group management on a Linux system. It ensures that all actions are logged for auditing purposes and that generated passwords are stored securely. By following the steps outlined in this article, you can customize and extend the script to meet your specific needs, improving efficiency and consistency in user management tasks &lt;br&gt;
&lt;a href="https://github.com/codeReaper0/hng11-devops-stage1"&gt;Link to Github repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're curious about the &lt;a href="https://hng.tech/internship"&gt;HNG Internship&lt;/a&gt;, check out their website. And if you're looking to hire developers, head over to &lt;a href="https://hng.tech/hire"&gt;HNG Hire&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
