{"id":172,"date":"2024-07-11T15:57:52","date_gmt":"2024-07-11T12:57:52","guid":{"rendered":"https:\/\/pac-man.ocitec.us\/?page_id=172"},"modified":"2024-08-13T10:17:02","modified_gmt":"2024-08-13T07:17:02","slug":"0002_sys_tools","status":"publish","type":"page","link":"https:\/\/itgen.itbumper.com\/?page_id=172","title":{"rendered":"0002_sys_tools"},"content":{"rendered":"\n<p><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"0:4\">This<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"5:6\">script<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"12:1\">and<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"14:8\">description<\/span> will <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"23:7\">help<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"31:3\">you<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"35:10\">install<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"46:1\">and<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"48:9\">configure<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"58:3\">all<\/span> the <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"62:11\">necessary<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"74:10\">applications<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"85:3\">to<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"89:10\">manage<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"99:1\">,<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"101:11\">monitor,<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"113:1\">and<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"115:12\">maintain<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"128:6\">your<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"135:6\">Ubuntu<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"142:6\">Server<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"148:1\">.<\/span><\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Create a file, for example: <strong>sys_tools<\/strong><\/li>\n<li>Put in it a code below<\/li>\n<li>Save the file<\/li>\n<li>Give a right to exec (<strong style=\"font-size: revert;\">chmod +x sys_tools)<\/strong><\/li>\n<li>Run it (<strong style=\"font-size: revert;\">sudo .\/sys_tools<\/strong><span style=\"font-size: revert;\">)<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#!\/bin\/bash\n\n# A LOG file\nLOG_FILE=&quot;install_log&quot;\n\n# A function for installing and loggining\ninstall_package() {\n    echo &quot;Installing $1...&quot;\n    sudo apt-get install -y $1 &gt;&gt; $LOG_FILE 2&gt;&amp;1\n    if &#x5B; $? -eq 0 ]; then\n        echo &quot;$1 installed successfully.&quot;\n    else\n        echo &quot;Failed to install $1. Check the log for details.&quot;\n    fi\n}\n\n# Updating system \necho &quot;Updating system...&quot;\nsudo apt-get update &amp;&amp; sudo apt-get upgrade -y &gt;&gt; $LOG_FILE 2&gt;&amp;1\n\n# Installing tools\ninstall_package &quot;htop&quot;           # Interactive process viewer\ninstall_package &quot;net-tools&quot;      # Network tools (ifconfig, netstat) (ifconfig, netstat)\ninstall_package &quot;curl&quot;           # Tool for transferring data with URL syntax\ninstall_package &quot;wget&quot;           # Utility for non-interactive download of files from the web\ninstall_package &quot;vim&quot;            # Text editor\ninstall_package &quot;git&quot;            # Version control system\ninstall_package &quot;ufw&quot;            # Simple firewall for managing iptables rules\ninstall_package &quot;fail2ban&quot;       # Protection against brute-force attacks\ninstall_package &quot;unattended-upgrades&quot; # Automatic installation of security updates\ninstall_package &quot;sysstat&quot;        # System monitoring and statistics collection tool\ninstall_package &quot;nmap&quot;           # Network scanner\ninstall_package &quot;lsof&quot;           # Tool to list open files and network connections\ninstall_package &quot;tmux&quot;           # Terminal multiplexer\ninstall_package &quot;screen&quot;         # Terminal multiplexer\ninstall_package &quot;ufw&quot;            # Simple firewall manager (iptables)\ninstall_package &quot;smartmontools&quot;  # Utilities for monitoring and managing S.M.A.R.T. disks\ninstall_package &quot;mdadm&quot;          # Tool for managing RAID arrays\ninstall_package &quot;snmp&quot;           # Simple Network Management Protocol for monitoring\ninstall_package &quot;snmpd&quot;          # Simple Network Management Protocol for network management\ninstall_package &quot;glances&quot;        # Cross-platform system monitoring tool\n\necho &quot;All installations are complete. Check $LOG_FILE for details.&quot;\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# Example output \n\npac-man@lab-vm:~\/labs\/scripts$ nano 0002_sys_tools\npac-man@lab-vm:~\/labs\/scripts$ chmod +x 0002_sys_tools\npac-man@lab-vm:~\/labs\/scripts$ sudo .\/0002_sys_tools\n&#x5B;sudo] password for pac-man:\nUpdating system...\nHit:1 http:\/\/ru.archive.ubuntu.com\/ubuntu focal InRelease\nHit:2 http:\/\/ru.archive.ubuntu.com\/ubuntu focal-updates InRelease\nHit:3 http:\/\/ru.archive.ubuntu.com\/ubuntu focal-backports InRelease\nHit:4 http:\/\/ru.archive.ubuntu.com\/ubuntu focal-security InRelease\nReading package lists... Done\nInstalling htop...\nhtop installed successfully.\nInstalling net-tools...\nnet-tools installed successfully.\nInstalling curl...\ncurl installed successfully.\nInstalling wget...\nwget installed successfully.\nInstalling vim...\nvim installed successfully.\nInstalling git...\ngit installed successfully.\nInstalling ufw...\nufw installed successfully.\nInstalling fail2ban...\nfail2ban installed successfully.\nInstalling unattended-upgrades...\nunattended-upgrades installed successfully.\nInstalling sysstat...\nsysstat installed successfully.\nInstalling nmap...\nnmap installed successfully.\nInstalling lsof...\nlsof installed successfully.\nInstalling tmux...\ntmux installed successfully.\nInstalling screen...\nscreen installed successfully.\nInstalling ufw...\nufw installed successfully.\nInstalling smartmontools...\nsmartmontools installed successfully.\nInstalling mdadm...\nmdadm installed successfully.\nInstalling snmp...\nsnmp installed successfully.\nInstalling snmpd...\nsnmpd installed successfully.\nInstalling glances...\nglances installed successfully.\nAll installations are complete. Check install_log for details.\npac-man@lab-vm:~\/labs\/scripts$ cat install_log\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/172"}],"collection":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":9,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/172\/revisions"}],"predecessor-version":[{"id":932,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/172\/revisions\/932"}],"wp:attachment":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}