<?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: Margret Mary</title>
    <description>The latest articles on DEV Community by Margret Mary (@marg4cf3553b4099).</description>
    <link>https://dev.to/marg4cf3553b4099</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%2F1709463%2F151c38e1-f45c-4137-83ae-4f9f2ef23a54.png</url>
      <title>DEV Community: Margret Mary</title>
      <link>https://dev.to/marg4cf3553b4099</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marg4cf3553b4099"/>
    <language>en</language>
    <item>
      <title>Technical Article for Creating and Managing Users with a Bash Script</title>
      <dc:creator>Margret Mary</dc:creator>
      <pubDate>Tue, 02 Jul 2024 17:25:43 +0000</pubDate>
      <link>https://dev.to/marg4cf3553b4099/technical-article-for-creating-and-managing-users-with-a-bash-script-5gl7</link>
      <guid>https://dev.to/marg4cf3553b4099/technical-article-for-creating-and-managing-users-with-a-bash-script-5gl7</guid>
      <description>&lt;p&gt;This article describes a &lt;a href="https://github.com/MegCyber/HNGTask2.git"&gt;Bash script&lt;/a&gt;, create_users.sh,  designed to automate the creation of user accounts and group assignments based on a text file containing user data. This script streamlines the user onboarding process for system administrators, improving efficiency and reducing the risk of errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Script Functionality:
&lt;/h2&gt;

&lt;p&gt;The script takes a text file as input, where each line represents a user with the following format:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;username;groups&lt;/code&gt;&lt;br&gt;
&lt;code&gt;username&lt;/code&gt;: The desired username for the new account.&lt;br&gt;
&lt;code&gt;groups&lt;/code&gt;: A comma-separated list of groups the user should belong to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here's a breakdown of the script's functionality:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reads User List:&lt;/strong&gt; The script iterates through each line of the provided text file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Processes User and Groups:&lt;/strong&gt; It extracts the username and groups (if any) from each line.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Creates User and Primary Group:&lt;/strong&gt; The script creates a primary group with the same name as the username and adds the user to it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Handling:&lt;/strong&gt; It checks if the user already exists. If so, it logs a warning message and skips to the next user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generates Random Password:&lt;/strong&gt; A secure, random password is generated for each user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Creates Home Directory:&lt;/strong&gt; The script creates a home directory for the new user and sets appropriate ownership and permissions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sets User Password:&lt;/strong&gt; The script securely sets the generated password for the user account.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Adds User to Additional Groups:&lt;/strong&gt; If additional groups are specified in the input file, the script adds the user to those groups.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Logs Activity:&lt;/strong&gt; All actions (user creation, group assignment, etc.) are logged to a dedicated log file for audit purposes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stores Passwords Securely:&lt;/strong&gt; Passwords are not stored directly in the script or logs. Instead, they are saved in a separate file with restricted permissions (accessible only by the script user).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Details:
&lt;/h2&gt;

&lt;p&gt;The script utilizes various Linux commands to achieve its functionalities. Here's a brief overview of some key commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;useradd&lt;/code&gt;: Creates a new user account.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;groupadd&lt;/code&gt;: Creates a new group.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;chpasswd&lt;/code&gt;: Sets or modifies a user's password.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/dev/urandom&lt;/code&gt;: Generates random data from the system's random number generator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tr&lt;/code&gt;: Transforms characters (used for filtering random data to alphanumeric characters).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;usermod&lt;/code&gt;: Modifies an existing user account.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits of Script Automation:
&lt;/h2&gt;

&lt;p&gt;Using a script to automate user creation offers several benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: It significantly reduces the time and effort required to create multiple user accounts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Accuracy&lt;/strong&gt;: Automating the process minimizes the risk of typos or errors that can occur during manual user creation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: The script ensures that all user accounts are created with the same settings and permissions, promoting consistency across the system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Auditability&lt;/strong&gt;: The logging mechanism provides a clear record of all user creation activities, useful for security purposes and troubleshooting.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;By following these steps, we can automate the user creation process, ensuring consistency and saving time. This approach can be easily extended or modified to fit specific requirements.&lt;/p&gt;

&lt;p&gt;For more information on our internship program, visit &lt;a href="https://hng.tech/internship"&gt;HNG Internship&lt;/a&gt; and Start your journey to becoming a world-class developer today, check out &lt;a href="https://hng.tech/hire"&gt;HNG&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Unearthing Efficiency: My Experience Bug Hunting with SAW</title>
      <dc:creator>Margret Mary</dc:creator>
      <pubDate>Tue, 02 Jul 2024 14:13:56 +0000</pubDate>
      <link>https://dev.to/marg4cf3553b4099/unearthing-efficiency-my-experience-bug-hunting-with-saw-4h37</link>
      <guid>https://dev.to/marg4cf3553b4099/unearthing-efficiency-my-experience-bug-hunting-with-saw-4h37</guid>
      <description>&lt;p&gt;Scrape Any Website (SAW) promises to be a powerful tool for web data extraction. But as with any software, a keen eye can uncover areas for improvement. This blog post details my exploration of SAW, highlighting the bugs I encountered and suggesting potential solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploratory Testing: Delving into SAW's Functionalities
&lt;/h2&gt;

&lt;p&gt;My journey began with downloading SAW from the official Windows Store download page &lt;a href="https://apps.microsoft.com/detail/9mzxn37vw0s2?hl=en-gb&amp;amp;gl=GB"&gt;SAW - Windows Store&lt;/a&gt;. Launching the application, I familiarized myself with the interface, focusing on testing various features and pushing the app to its limits. My goal was to identify not just bugs, but also areas where usability could be enhanced.&lt;br&gt;
Bug Report: Unveiling the Cracks in the Facade&lt;/p&gt;

&lt;p&gt;My exploration yielded several noteworthy bugs. Here are a few of the most critical ones:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing Selectivity:&lt;/strong&gt; Let's say you only want to scrape data from a specific web page. Unfortunately, the current version of SAW doesn't allow you to select individual URLs for scraping. Instead, it scrapes all URLs associated with a website. This can be a major roadblock if you're only interested in a specific data set.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unresponsive UI Elements :&lt;/strong&gt;  Hovering over the some options resulted in no visual change, unlike other interactive elements. This inconsistency can lead to user confusion, making it unclear if the option is functional. Implementing consistent hover effects would improve the user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inoperable Settings:&lt;/strong&gt;  The settings menu within SAW offered configuration options for browsers, but lacked a crucial "Save" button. Without this functionality, any adjustments made are lost upon closing the application.  A prominent "Save" button is essential to ensure user-defined settings persist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dashboard Disconnect:&lt;/strong&gt; The main dashboard seems to be grappling with a communication gap. Jobs and URLs added to scrape jobs don't always reflect on the dashboard, leaving you uncertain about the progress or presence of your data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Information Blackout&lt;/strong&gt;: Obtaining basic information about the software itself, like the version number, proved to be a challenge. Additionally, there's no built-in help section or FAQ to guide users through potential issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond Bug Hunting:  Suggestions for Improvement
&lt;/h2&gt;

&lt;p&gt;While bug fixing is vital, I believe SAW has the potential to be even more user-friendly. Here are some additional suggestions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Informative Dashboard:&lt;/strong&gt; The main dashboard currently displays limited information. Highlighting the number of URLs added, scrape status, and extracted data would provide valuable insights at a glance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessibility Features:&lt;/strong&gt;  Integrating features like software version information and a dedicated Help section with FAQs would empower users to troubleshoot independently and stay informed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Granular URL Selection:&lt;/strong&gt; The ability to choose specific URLs within a scrape job would empower users to target their data collection precisely.&lt;br&gt;
Enhanced User Interface: Incorporating hover highlights and other visual cues can significantly improve the application's user-friendliness and intuitiveness.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-Time Dashboard Updates:&lt;/strong&gt; A dynamic and responsive dashboard that reflects changes made within the application would provide valuable feedback to users and eliminate confusion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:  A Work in Progress
&lt;/h2&gt;

&lt;p&gt;SAW presents a promising solution for web data extraction. By addressing the identified bugs and incorporating the suggested improvements, SAW can evolve into a powerful and user-friendly tool. This experience has solidified the importance of thorough testing in software development.  For a detailed exploration of the bugs I encountered, you can access my comprehensive bug report &lt;a href="https://1drv.ms/x/s!Ajr0qU-KpaKWvWLdIokc8WhBk8T3?e=Luuim7"&gt;SAW BUG Report.xlsx&lt;/a&gt;. Additionally, to download SAW and embark on your own data scraping adventures, visit the official &lt;a href="https://scrapeanyweb.site/"&gt;Scrape Any Website&lt;/a&gt; or the &lt;a href="https://apps.microsoft.com/detail/9mzxn37vw0s2?hl=en-gb&amp;amp;gl=GB"&gt;Windows Store&lt;/a&gt;.&lt;/p&gt;

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