<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adam on Medium]]></title>
        <description><![CDATA[Stories by Adam on Medium]]></description>
        <link>https://medium.com/@sud0?source=rss-c12bd60a323a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ZOkWdWoNlRDVTbHN</url>
            <title>Stories by Adam on Medium</title>
            <link>https://medium.com/@sud0?source=rss-c12bd60a323a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:42:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sud0/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to automate speedtest cli and sent to email (Gmail) in Debian OS]]></title>
            <link>https://medium.com/@sud0/how-to-automate-speedtest-cli-and-sent-to-email-gmail-in-debian-os-c09ed826e357?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c09ed826e357</guid>
            <category><![CDATA[script]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[speed-test]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Fri, 16 Jan 2026 07:50:33 GMT</pubDate>
            <atom:updated>2026-01-16T07:50:33.187Z</atom:updated>
            <content:encoded><![CDATA[<p>Lets create simple speedtest script and get automate speedtest result via email with Debian OS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41L0leY6Et_dlI2Q4Tedhg.png" /></figure><p>As we know we can easily to check our ISP bandwith throughput with speedtest, but can we make it automate and run in time we scheduled and get the result direct to our email inbox?</p><p>The answer is YES! we can do it through simple script and cron job to do it automaticaly every day, every week, every month or any custom time you want. Speedtest itself provide speedtest cli which can run in any environtment you can find the detail <a href="https://www.speedtest.net/apps/cli">here</a></p><blockquote>Follow this guide to create automatic speedtest and sent to our inbox regularly</blockquote><p>To automatically run a speed test and send the result via email on a Debian system, you can create a script using speedtest-cli and mail or msmtp</p><p><strong>Step 1: Install Required Packages<br></strong><em>sudo apt update<br>sudo apt install msmtp msmtp-mta</em><br><em>sudo apt-get install curlcurl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bashsudo apt-get install speedtest</em></p><p><strong>Step 2: Create the speedtest script and fill with this<br></strong><em>nano ~/speedtest_email.sh</em></p><p><em>#!/bin/bash</em></p><p><em># Run speed test<br>result=$(speedtest </em><strong><em>-s 21296</em></strong><em>) -&gt; </em><strong>you can change other server that closest to you</strong></p><p><em># Email details<br>TO=”</em><strong><em>your-email@gmail.com</em></strong><em>” </em><strong>-&gt; replace with your email</strong><em><br>SUBJECT=”Daily Speedtest Result”<br>BODY=”Internet Speed Test Result:\n\n$result”</em></p><p><em># Send the email<br>echo -e “$BODY” | mail -s “$SUBJECT” “$TO”</em></p><p><strong>Step 3: Make script executable</strong><br><em>chmod +x ~/speedtest_email.sh</em></p><p><strong>Step 4: Configure Mailutils SMTP (for Gmail)</strong><br><em>nano ~/.msmtprc</em></p><p><em>defaults<br>auth on<br>tls on<br>tls_trust_file /etc/ssl/certs/ca-certificates.crt<br>logfile ~/.msmtp.log</em></p><p><em>account gmail<br>host smtp.gmail.com<br>port 587<br>from </em><strong><em>your-email@gmail.com </em>-&gt; replace with your email</strong><em><br>user </em><strong><em>your-email@gmail.com -&gt;</em> replace with your email<em> </em></strong><em><br>password </em><strong><em>your-app-password -&gt; </em>replace with your app password </strong><br><em>account default : gmail</em></p><p>(Use an App Password if you have 2FA enabled on your Gmail account)</p><p><strong>Test to sent email</strong><br><em>echo “This is a test” | msmtp </em><a href="/service/mailto:your-email@gmail.com"><em>your-email@gmail.com</em></a></p><p><strong>Step 5: Automate with Cron<br></strong><em>crontab -e<br>0 1 * * * /root/speedtest_email.sh</em> -&gt; <strong>Add this line to run daily at 1 AM</strong></p><p><strong>If everything is good at 1 AM your inbox email will be get the notification like this</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*drxQ1RrsYkjbl2PQiALwPg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c09ed826e357" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Juniper Cheatsheet]]></title>
            <link>https://medium.com/@sud0/juniper-cheatsheet-50f5d8929c33?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/50f5d8929c33</guid>
            <category><![CDATA[juno]]></category>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[juniper]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 10:18:46 GMT</pubDate>
            <atom:updated>2024-07-30T10:18:46.321Z</atom:updated>
            <content:encoded><![CDATA[<p>Help you to manage Juniper easier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72YsVIniSNNO4n8qdtCgUA.png" /></figure><h3><strong>Pipe Command</strong></h3><p>Equivalent to show ip interface brief command from the Cisco</p><pre>&gt; show interface terse</pre><p>Equivalent to show run interface | include 0/1 command from the Cisco</p><pre>&gt; show interface terse | match ge-0/0/1</pre><p>Equivalent to show run interface | exclude 0/1 command from the Cisco</p><pre>&gt; show interface terse | except ge-0/0/1</pre><p>Equivalent to show run interface | begin 0/1 command from the Cisco</p><pre>&gt; show interface terse | find ge-0/0/1</pre><p>Counts the total number of lines</p><pre>&gt; show interface terse | count</pre><p>Prevents the output from being paginated</p><pre>&gt; show interface terse | no-more</pre><h3>Set Command</h3><p>Use the set command to add or change configuration statements. Set command creates configuration statements, or changes them ifthey already exist</p><pre>#set system host-name LAB-SRX-XXXX <br>#set interface so-0/0/0 unit 0 family inet address 1.1.1.1/24</pre><h3>Delete Command</h3><p>Removes configuration statements</p><pre>#delete system host-name LAB-SRX-XXXX<br>#delete interface so-0/0/0 unit </pre><h3>Show Command</h3><p>Shows the candidate config within the config mode.</p><p>Shows the interfaces section of the config</p><pre># show interfaces</pre><p>Shows state of the component from operational mode</p><p>Shows the state of the interfaces on the router</p><pre>&gt; show interfaces</pre><h3>Run Command</h3><p>Executes the operational mode CLI commands from the configuration mode</p><pre># run show interface ge-0/0/0<br># run show bgp sum</pre><h3>Top Command</h3><p>Moves to top of the hierarchy, like Unix cd / command</p><pre># top</pre><h3>Up Command</h3><p>Moves up one level in edit hierarchy Like a Unix cd</p><pre># up</pre><h3>Copy, Rename &amp; Replace Command</h3><p>Creates new interface fe-0/0/2 with similar properties to fe-0/0/1, copy configuration statements</p><pre># copy interfaces fe-0/0/1 to fe-0/0/</pre><p>Changes IP address from 1.1.1.1.1 to 2.2.2.2, rename parameters</p><pre># rename interface fxp0 unit00 family inet address1.1.1.1/24 to address 2.2.2.2/24</pre><p>Replace parameters across the entire configuration</p><pre>#replace pattern “SRX100” with “SRX210”</pre><h3>Save Command</h3><p>Saves the configuration to an ASCII file to the home directory /var/home/username</p><pre># save &lt;filename&gt;</pre><h3>Commit Command</h3><p>Checks uncommitted changes against the parser errors and returns failure or success. Highly recommended before activating changes using the commit command</p><pre># commit check</pre><p>Applies uncommitted changes to the active running configuration</p><pre># commit</pre><p>Commits changes and exits back to operational mode</p><pre># commit and-quit</pre><p>schedules a commit for a later time and date e.g. commit at 23:00</p><pre># commit at</pre><p>Commits changes but automatically rolls them back if another commit is not used. By default, the configuration runs for 10 minutes before the rollback. Requires another commit to save the changes permanently</p><pre># commit confirmed</pre><p>Watch each step of the commit operation; useful to debug failed commit</p><pre># commit | display detail</pre><h3><strong>Rollback Commands</strong></h3><p>Displays the list of previously committed configuration that are saved</p><pre># rollback ?</pre><p>Resets the candidate configuration to the currently running configuration, which is the last version committed.</p><pre># rollback or rollback 0</pre><p>Loads the configuration part of rollback 2</p><pre># rollback 2</pre><h3><strong>Configuration File Differences</strong></h3><p>Show differences between candidate config file and rollback config</p><pre># show | compare rollback &lt;#&gt;</pre><p>Show differences between candidate config file and user.conf file</p><pre># show | compare user.conf</pre><h3><strong>File Commands</strong></h3><p>Displays a list of all files for the current directory</p><pre>&gt; file list /var/tmp</pre><p>Displays detailed list output for the matched file</p><pre>&gt; file list detail /var/tmp/ | match junos</pre><p>Displays the contents of a file.</p><pre>&gt; file show /config/rescue.conf.gz</pre><p>Compares two local files and describe the differences between them</p><pre>&gt; file compare files /config/juniper.conf.gz /config/rescue.conf.gz</pre><p>Copies files from one location to another location on the local deviceor to a location on a remote device</p><pre>&gt; file copy server1:/tmp//router-base-conf /var/tmp/juniper.conf.gz</pre><p>Deletes file on the local device</p><pre>&gt; file delete /var/tmp/juniper.conf.gz</pre><h3><strong>Load Commands</strong></h3><p>The override option with the load command replaces the entire candidate configuration with the contents of the file you are loading</p><pre>&gt; load override router-base-configuration</pre><p>Loads config directly to router terminal</p><pre>&gt; load merge terminal</pre><p>Merges the new “config-user” config to existing candidate config</p><pre>&gt; load merge /var/tmp/config-user</pre><p>Replaces existing statement in current configuration</p><pre>&gt; load replace /var/tmp/ config-user</pre><h3><strong>Help Command</strong></h3><p>Shows all command that has route keyword</p><pre>&gt; help apropos route</pre><p>Displays random tips on cli</p><pre>&gt; help tip cli</pre><p>Displays some background info on ospf area (similar to man command in Linux)</p><pre>&gt; help reference ospf area</pre><p>Displays usage guidelines for configuration statements.</p><pre>&gt; help topic</pre><p>Displays information on specific syslog events</p><pre>&gt; help syslog</pre><h3><strong>System Monitoring Commands</strong></h3><p>Shows the CPU utilization on the device and lists the processes in order of CPUutilization</p><pre>&gt; show system processes extensive</pre><p>Display system-wide memory distribution and usage including the Junos OSkernel, software processes, and memory disks.</p><pre>&gt; show system memory</pre><p>Shows protocol statistics related to device; Very useful command</p><pre>&gt; show system statistics</pre><p>Displays statistics about the amount of free disk space in the device’s filesystems.</p><pre>&gt; show system storage</pre><p>Displays the current time and information about how long the device or softwarehave been running</p><pre>&gt; show system uptime</pre><p>Displays licenses and information about how they are used.</p><pre>&gt; show system license</pre><p>Displays the software version running on the device</p><pre>&gt; show system software&gt; show version</pre><p>Lists information about the users who are currently logged in to the device</p><pre>&gt; show system users</pre><p>Forcefully logs-out the requested user</p><pre>&gt; request system logout user &lt;USER&gt;</pre><h3><strong>Hardware Monitoring Commands</strong></h3><p>Shows environmental related / temperature related info for the device</p><pre>&gt; show chassis environment</pre><p>Shows hardware related info and serial numbers of the device</p><pre>&gt; show chassis hardware</pre><p>Shows memory, CPU, RE temperature related info of the device</p><pre>&gt; show chassis route-engine</pre><p>Displays base mac-address of the device</p><pre>&gt; show chassis mac-addresses</pre><p><strong>System Shutdown Commands</strong></p><p>Shuts down the software and gracefully terminates process. <br>Note: Device won’t go down but software does</p><pre>&gt; request system halt</pre><p>Powers-off the software on RE</p><pre>&gt; request system power-off</pre><p>Reloads the software on a device</p><pre>&gt; request system reboot</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50f5d8929c33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mikrotik Cheatsheet]]></title>
            <link>https://medium.com/@sud0/mikrotik-cheatsheet-ca7b189ee025?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca7b189ee025</guid>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[mikrotik]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Mon, 29 Jul 2024 08:43:48 GMT</pubDate>
            <atom:updated>2024-07-29T08:43:48.633Z</atom:updated>
            <content:encoded><![CDATA[<p>Usefull cheatsheet to easier mikrotik management</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fHLg_2XIQYCN47WD2u12A.png" /></figure><h3>SFP Information</h3><pre>/interface ethernet; :foreach i in=([find default-name~&quot;sfp&quot;]) do={monitor [get $i default-name] once without-paging}</pre><h3>Hostname</h3><p>The hostname configuration is set in the system/identity/ section.</p><pre>/system/identity/set name=&lt;hostname&gt;</pre><p>Confirm the hostname with the system/identity/print command.</p><pre>/system/identity/print <br>name: &lt;hostname&gt;</pre><h3>Bridge</h3><p>In Mikrotik land, a bridge is a logical grouping of interfaces. Bridge config lives in the interface/bridge/ section.</p><pre>/interface/bridge/add name=&lt;bridge-name&gt; vlan-filtering=yes pvid=&lt;vlan-id&gt;</pre><h3>VLAN</h3><p>VLAN’s are added to bridges and are configured under the interface/bridge/vlan/ section.</p><pre>/interface/bridge/vlan/add name=&lt;bridge-name&gt; vlan-ids=&lt;vlan-id&gt;</pre><h3>Access Port</h3><p>Access ports are defined by applying the untagged property to an interface.</p><pre>/interface/bridge/vlan/add bridge=&lt;bridge-name&gt; untagged=&lt;interface-name&gt;,&lt;interface-name&gt; vlan-ids=&lt;vlan-id&gt;</pre><p>It’s possible to also set the native VLAN for an interface.</p><pre>/interface/bridge/port/add bridge=&lt;bridge-name&gt; interface=&lt;interface-name&gt; pvid=&lt;vlan-id&gt;</pre><h3>Trunk Port</h3><p>Trunk ports are defined by applying the tagged property to an interface.</p><pre>/interface/bridge/vlan/add bridge=&lt;bridge-name&gt; tagged=ether15 vlan-ids=&lt;vlan-ids&gt;</pre><h3>VLAN Interface</h3><p>VLAN interfaces are logical Layer 3 interface assigned to a VLAN that have an IP address and are similar to SVI’s or IRB’s on other vendor platforms.</p><p>The below example configures a VLAN interface and assigns and IP address.</p><pre>/interface/vlan/add interface=&lt;bridge-name&gt; name=&lt;vlan-name&gt; vlan-id=&lt;vlan-id&gt;<br>ip/address/add address=&lt;ip-address&gt;/&lt;prefix-length&gt; interface=&lt;vlan-name&gt; network=&lt;network-address&gt;</pre><h3>Static Route</h3><p>Create a static default route. Routes are configured under the ip/route/ section.</p><pre>/ip/route/add disabled=no dst-address=0.0.0.0/0 gateway=&lt;gateway-ip&gt; routing-table=main suppress-hw-offload=no</pre><h3>DNS Client</h3><p>DNS servers are set under the ip/dns/ section.</p><pre>/ip/dns/set servers=&lt;server-1&gt;,&lt;server-2&gt;</pre><p>Confirm the DNS configuration with the ip/dns/print command.</p><pre>/ip/dns/print</pre><pre>                    servers: &lt;server-1&gt;,&lt;server-2&gt;<br>            dynamic-servers: <br>             use-doh-server: <br>            verify-doh-cert: no<br>      allow-remote-requests: no<br>        max-udp-packet-size: 4096<br>       query-server-timeout: 2s<br>        query-total-timeout: 10s<br>     max-concurrent-queries: 100<br>max-concurrent-tcp-sessions: 20<br>                 cache-size: 2048KiB<br>              cache-max-ttl: 1w<br>                 cache-used: 28KiB</pre><p>Confirm name resolution works by pinging a host by domain name.</p><pre>ping google.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZR9gWkhXS_l8AHi8V_ELQ.png" /></figure><h3>NTP Client</h3><p>NTP servers are set under the system/ntp/client/ section.</p><pre>/system/ntp/client/set enabled=yes mode=unicast servers=&lt;server-1&gt;,&lt;server-2&gt;</pre><p>Confirm the NTP configuration with the system/ntp/client/print command.</p><pre>system/ntp/client/print</pre><pre>       enabled: yes<br>          mode: unicast<br>       servers: &lt;server-1&gt;,&lt;server-2&gt;<br>           vrf: main<br>    freq-drift: 0 PPM<br>        status: synchronized<br> synced-server: &lt;server-1&gt;<br>synced-stratum: 2<br> system-offset: 1.474 ms</pre><p>See the current time with the system/clock/print command</p><pre>/system/clock/print</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*-m8ONKb2AvFmwI2hmAxHuw.png" /></figure><h3>LLDP Client</h3><p>LLDP is configured under the ip/neighbor/discovery-settings/ section.</p><pre>/ip/neighbor/discovery-settings/set protocol=lldp</pre><p>Confirm the LLDP configuration with the ip/neighbor/discovery-settings/print command.</p><pre>/ip/neighbor/discovery-settings/print </pre><pre> discover-interface-list: static<br>lldp-med-net-policy-vlan: disabled<br>                protocol: cdp,lldp,mndp</pre><p>See the LLDP neighbors with the ip/neighbor/print command.</p><pre>/ip/neighbor/print</pre><pre>Columns: INTERFACE, MAC-ADDRESS, IDENTITY<br>#  INTERFACE  MAC-ADDRESS        IDENTITY<br>0  ether1     88:C9:B3:B0:DE:5F          <br>   bridge1                               <br>1  ether23    54:4B:22:11:AA:BB  sw01    <br>   bridge1</pre><p><strong>Note</strong></p><p>Detailed output can be obtained by adding the detail keyword to the command.</p><pre>/ip/neighbor/print detail<br> <br>0 interface=ether1,bridge1 mac-address=88:C9:B3:B0:DE:5F identity=&quot;&quot; platform=&quot;&quot; version=&quot;&quot; unpack=none age=2m40s <br>  system-caps=other,repeater system-caps-enabled=router </pre><pre>1 interface=ether23,bridge1 mac-address=54:4B:22:11:AA:BB identity=&quot;sw01&quot; platform=&quot;&quot; version=&quot;&quot; unpack=none age=24s <br>  interface-name=&quot;ge-0/0/7.0&quot; system-description=&quot;Juniper Networks, Inc. ex2200-c-12p-2g Ethernet Switch, kernel <br>                  JUNOS 15.1R6-S3, Build date: 2017-08-11 09:23:44 UTC Copyright (c) 1996-2017 Juniper Networks, <br>                  Inc.&quot; <br>  system-caps=bridge,router system-caps-enabled=bridge,router</pre><h3>HTTP Server</h3><p>Generate a TLS cert to assign to the HTTPS web server. I am using a self-signed cert in the below example.</p><pre># Create and sign a Root Cert<br>certificate/add name=root-cert common-name=&lt;hostname&gt; days-valid=365 key-usage=key-cert-sign,crl-sign, key-size=4096<br>certificate/sign root-cert</pre><pre># Create and sign a HTTPS cert<br>certificate/add name=https-cert common-name=&lt;hostname&gt;.&lt;domain&gt; subject-alt-name=IP:&lt;mgmt-ip&gt;,DNS:&lt;hostname&gt; days-valid=365 key-usage=tls-server key-size=4096<br>certificate/sign ca=root-cert https-cert</pre><p>Apply the certificate to the HTTP server for both the www-ssl and api-ssl services.</p><pre>/ip/service/set www-ssl certificate=https-cert disabled=no tls-version=only-1.2<br>/ip/service/set api-ssl certificate=https-cert disabled=no tls-version=only-1.2</pre><h3>Disable Services</h3><p>Out of the box, device have alot of services enabled. Disable the unused/insecure ones.</p><pre>/ip/service/disable www<br>/ip/service/disable ftp<br>/ip/service/disable telnet<br>/ip/service/disable api</pre><h3>Service Status</h3><p>You can view the service status with the ip/service/print command.</p><pre>/ip/service/print</pre><pre>Flags: X, I - INVALID<br>Columns: NAME, PORT, ADDRESS, CERTIFICATE, VRF<br>#   NAME     PORT  ADDRESS      CERTIFICATE  VRF<br>0 X telnet     23                             main<br>1 X ftp        21    <br>2 X www        80                             main<br>3   ssh        22                             main<br>4   www-ssl   443                https-cert   main<br>5 X api      8728                             main<br>6   winbox   8291                             main<br>7   api-ssl  8729                https-cert   main</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca7b189ee025" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Unifi Controller on Linux]]></title>
            <link>https://medium.com/@sud0/how-to-install-unifi-controller-on-linux-ff55e8439ec8?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff55e8439ec8</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[wifi]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[unifi]]></category>
            <category><![CDATA[controller]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Wed, 24 Jul 2024 05:56:37 GMT</pubDate>
            <atom:updated>2024-07-24T05:56:37.358Z</atom:updated>
            <content:encoded><![CDATA[<p>Use this easy script to install unifi controller</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*XTDZ-TRSBtPr1o46MtfOXg.jpeg" /></figure><ol><li><strong>Install ca-certificates package</strong></li></ol><pre>apt-get update; apt-get install ca-certificates curl -y</pre><p><strong>2. Install latest controller</strong></p><pre>curl -sO https://get.glennr.nl/unifi/install/install_latest/unifi-latest.sh &amp;&amp; bash unifi-latest.sh</pre><p><strong>3. Once completed access your unifi controller</strong></p><pre>https://your-server-ip:8443</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff55e8439ec8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ESXi Cheatsheet]]></title>
            <link>https://medium.com/@sud0/esxi-cheatsheet-76d4f4a05799?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/76d4f4a05799</guid>
            <category><![CDATA[esxi]]></category>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[vmware]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Tue, 23 Jul 2024 04:03:25 GMT</pubDate>
            <atom:updated>2024-07-23T04:03:25.414Z</atom:updated>
            <content:encoded><![CDATA[<p>Complete cheatsheet to easier ESXi management</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*E2-jeic7usKxU9dcS2vM0A.png" /></figure><h3>General</h3><p>Get ESXi build and version numbers</p><pre>esxcli system version get</pre><p>Get host hostname, domain, and FQDN</p><pre>esxcli system hostname get</pre><p>Get date and time ESXi was installed</p><pre>esxcli system stats installtime get</pre><p>List local users on ESXi host</p><pre>esxcli system account list</pre><p>Create local ESXi user</p><pre>esxcli system account add -d=&quot;Description&quot; -i=&quot;username&quot; -p=&quot;password&quot; -c=&quot;password&quot;</pre><p>List available commands with descriptions</p><pre>esxcli command getdetails</pre><p>List all available namespaces with corresponding commands</p><pre>esxcli esxcli command list</pre><p>Check maintenance mode</p><pre>esxcli system maintenanceMode get</pre><p>Enable/Disable maintenance mode</p><pre>esxcli system maintenanceMode set –enable true</pre><p>Reboot/Restart ESXi host</p><pre>esxcli system shutdown reboot -r &quot;message&quot;</pre><p>Reboot/Restart ESXi maintenance mode host with countdown timer</p><pre>esxcli system shutdown reboot -d 10 -r &quot;Patch Updates&quot;</pre><p>Get CPU information of host (family, model, and cache)</p><pre>esxcli hardware cpu list</pre><p>Get memory information (available and non-uniform memory access)</p><pre>esxcli hardware memory get</pre><p>Configuration of and information about syslog</p><pre>esxcli system syslog</pre><p>Generate support and log information bundle from host</p><pre>vm-support</pre><h3>Management</h3><p>Restart Management, HA Services (change to /sbin/services directory)</p><pre>restart</pre><p>List Virtual Machines (VMIDs)</p><pre>vim-cmd vmsvc/getallvms</pre><p>List running VMs with world ID</p><pre>esxcli vm process list</pre><p>Terminate running VM process (forcibly powers off VM)</p><pre>esxcli vm process kill</pre><p>Power On</p><pre>vim-cmd vmsvc/power.on</pre><p>Power Off (Soft)</p><pre>vim-cmd vmsvc/power.off</pre><p>Power Off (Hard)</p><pre>esxcli vm process kill -w [worldID] -t [soft,hard,force]</pre><p>Reboot VM</p><pre>vim-cmd vmsvc/power.reboot</pre><p>Suspend VM</p><pre>vim-cmd vmsvc/power.suspend</pre><p>Resume VM</p><pre>vim-cmd vmsvc/power.suspendResume</pre><p>Reset VM</p><pre>vim-cmd vmsvc/power.reset</pre><p>Shutdown VM</p><pre>vim-cmd vmsvc/power.shutdown</pre><p>Show VM info summary</p><pre>vim-cmd vmsvc/get.summary</pre><p>Check Host Performance</p><pre>esxtop</pre><p>Check storage I/O performance</p><pre>vscsiStats</pre><h3>Install Software</h3><p>Lists currently installed software and drivers (VIBs) on ESXi</p><pre>esxcli software vib list</pre><p>Install package (VIB)</p><pre>esxcli software vib install -v file:/tmp/[NewVIB].vib</pre><p>Uninstall VIB</p><pre>esxcli software vib remove -n VIBname</pre><p>Update installed VIB on ESXi</p><pre>esxcli software vib update -d “/tmp/update.zip”</pre><p>Install patch</p><pre>esxcli software vib install /tmp/[patchName].zip</pre><h3>Virtual Disks</h3><p>Extend virtual disk</p><pre>vmkfstools -X 1500G /vmfs/volumes/exampledatastore/Example/Example.vmdk</pre><p>Rename disk</p><pre>mv Name.vmdk Name_changed.vmdk</pre><p>Clone disk</p><pre>vmkfstools -i Name_changed.vmdk -d zeroedthick Name_changed_clone.vmdk</pre><p>Remove disk</p><pre>rm Name.vmdk</pre><p>Jump to directory of VM and monitor activity of delta, flat, and sesparse files</p><pre>cd /vmfs/volumes/esxdatastore0/vm/vmfs/volumes/510a4e43-4bf56f05-5a34-0034791e8a3/vm # watch -d &#39;ls -luth | grep -E &quot;delta|flat|sesparse&quot;&#39;</pre><p>Delete all snapshots and power off VM. Convert thick provisioned disk to thin disk.</p><pre>vmkfstools -i /vmfs/volumes/exampledatastore/vm/diskname.vmdk -d thin /vmfs/volumes/exampledatastore/vm/diskname-thin.vmdk</pre><p>Delete VM thick disk</p><pre>rm /vmfs/volumes/exampledatastore/vm/diskname-flat.vmdk.thick</pre><p>Determine configured size of thin disk</p><pre>ls -lh /vmfs/volumes/exampledatastore/vm/diskname-flat.vmdk</pre><p>Determine used size of thin disk</p><pre>du -h /vmfs/volumes/exampledatastore/vm/diskname-flat.vmdk</pre><h3>Snapshots</h3><p>List all VM snapshots</p><pre>vim-cmd vmsvc/snapshot.get</pre><p>Create snapshot for running VM</p><pre>vmware-cmd vmsvc/snapshot createsnapshot &quot;New Snaphot Name&quot; &quot;Snapshop Description&quot;</pre><p>Create snapshot for running VM, with RAM</p><pre>vim-cmd vmsvc/snapshot.create &quot;New Snaphot Name&quot; &quot;Snapshop Description&quot; includeMemory</pre><p>Delete a snapshot</p><pre>vim-cmd vmsvc/snapshot.remove</pre><p>Monitor deleting of snapshot from VM on host</p><pre>vim-cmd vimsvc/task_list (to get task ID)<br>vim-cmd vimsvc/task_info &lt;task ID&gt;</pre><p>Remove all snapshots</p><pre>vmware-cmd /vmfs/volumes/local0/Example/Example.vmx removesnapshots</pre><p>Check if volume is native snaphot capable</p><pre>vmkfstools -Ph /vmfs/volumes/exampledatastore/</pre><h3>Networking</h3><p>List VM networking information</p><pre>esxcli network vm list</pre><p>Get IPv4 configuration for all interfaces on host</p><pre>esxcli network ip interface ipv4 get</pre><p>Get firewall state</p><pre>esxcli network firewall get</pre><p>Disable firewall</p><pre>esxcli network firewall set –enabled true | false</pre><p>Get firewall rules</p><pre>esxcli network firewall ruleset list</pre><p>Get firewall rules piped to awk</p><pre>esxcli network firewall ruleset list | awk &#39;$2 ==&quot;true&quot;&#39;</pre><p>Activate ESXi Firewall Ruleset</p><pre>esxcli network firewall ruleset set --ruleset-id=sshClient --enabled=true</pre><p>Specify allowed IP Range for SSH</p><pre>esxcli network firewall ruleset allowedip add --ruleset-id sshServer --ip-address 10.10.0.0/24</pre><p>List Kernel Network Interfaces</p><pre>esxcli network ip interface list</pre><p>List physical Network Interfaces</p><pre>esxcli network nic list</pre><p>Shutdown physical network interface</p><pre>esxcli network nic down -n</pre><p>List host routing table</p><pre>esxcli network ip route ipv4 list</pre><p>Add static route to esxi host</p><pre>esxcli network ip route ipv4 add --gateway 10.10.1.1 --network 10.10.0.0/24</pre><p>Set ESXi host default gateway</p><pre>esxcfg-route -a default 192.168.254.1</pre><p>Test ESXi host default gateway</p><pre>vmkping -D</pre><p>Send ICMP request</p><pre>vmkping –I</pre><p>Test host connectivity to specific port</p><pre>nc –z</pre><p>List arp cache</p><pre>esxcli network ip neighbor list</pre><p>Clear arp cache entry</p><pre>esxcli network ip neighbor remove -a -v</pre><p>List virtual switches</p><pre>esxcli network vswitch standard list</pre><p>Change physical uplink of vSwitch</p><pre>esxcli network vswitch standard uplink remove -u -v<br>esxcli network vswitch standard uplink add -u -v</pre><p>List portgroups</p><pre>esxcli network vswitch standard portgroup list</pre><p>Add new portgroup to vSwitch</p><pre>esxcli network vswitch standard portgroup add -p &quot;Portgroup_Name -v</pre><p>Set Management Network Interface</p><pre>esxcli network ip interface tag add -i -t Management</pre><p>Set VLAN id</p><pre>esxcli network vswitch standard portgroup set --vlan-id -p &quot;Portgroup_Name&quot;</pre><p>Set SNMP Community</p><pre>esxcli system snmp set --communities &quot;COMMUNITY_NAME&quot;</pre><p>Set SNMP Trap destination</p><pre>esxcli system snmp set --targets 10.10.1.150/COMMUNITY_NAME</pre><p>Send test SNMP trap</p><pre>esxcli system snmp test</pre><p>Check SNMP State</p><pre>esxcli system snmp get</pre><p>Enable IPMI as SNMP source</p><pre>esxcli system snmp set --hwsrc sensors</pre><p>Enable CIM as SNMP source</p><pre>esxcli system snmp set --hwsrc indications</pre><p>Enable ESXi Host SNMP</p><pre>esxcli system snmp set --enable true</pre><p>Capture Network Packets on the a physical interface</p><pre>pktcap-uw --uplink</pre><p>List all physical network interfaces</p><pre>esxcli network nic list</pre><p>Enable iSCSI software adapter</p><pre>esxcli iscsi software set –enabled true</pre><p>Verify iSCSI adapter is enabled</p><pre>esxcli iscsi software get</pre><p>List metrics for specific iSCSI adapter</p><pre>esxcli iscsi adapter param get -A</pre><p>List established iSCSI sessions</p><pre>esxcli iscsi sessions</pre><h3>Storage</h3><p>List current storage devices</p><pre>esxcli storage core device list</pre><p>List all storage devices accessible by host</p><pre>esxcli storage filesystem list</pre><p>Rename datastore</p><pre>vim-cmd hostsvc/datastore/rename</pre><p>List all storage paths</p><pre>esxcli storage core path list</pre><p>List storage pathes for specific drive</p><pre>esxcli storage core path list -d</pre><p>Generate a list of all LUN paths currently connected to the ESXi host</p><pre>esxcli storage vmfs extent list</pre><p>List all storage devices</p><pre>esxcli storage nmp device list</pre><p>Get hypervisor filesystem information</p><pre>vdf</pre><p>Get usage of hypervisor filesystem</p><pre>vdu</pre><p>List all HBAs</p><pre>esxcfg-scsidevs -a</pre><p>List all HBAs with WWNN and WWPN</p><pre>esxcli storage san fc list</pre><p>Reset HBA and force fabirc logon</p><pre>esxcli storage san fc reset -A</pre><p>Check if attached storage LUN supports VAAI</p><pre>esxcli storage core device vaai status get</pre><h3>Host Services</h3><p>Enable ESXi shell</p><pre>vim-cmd hostsvc/enable_esx_shell</pre><p>Disable ESXi shell</p><pre>vim-cmd hostsvc/disable_esx_shell</pre><p>Start ESXi shell</p><pre>vim-cmd hostsvc/start_esx_shell</pre><p>Enable the SSH daemon</p><pre>vim-cmd hostsvc/enable_ssh</pre><p>Disable SSH daemon</p><pre>vim-cmd hostsvc/disable_ssh</pre><p>Start SSH daemon</p><pre>vim-cmd hostsvc/start_ssh</pre><p>Enter Maintenance mode</p><pre>vim-cmd hostsvc/maintenance_mode_enter</pre><p>Exit Maintenance Mode</p><pre>vim-cmd hostsvc/maintenance_mode_exit</pre><h3>ESXi Kernel modules</h3><p>List loaded kernel modules</p><pre>vmkload_mod -l</pre><p>List kernel interfaces</p><pre>esxcfg-vmknic -l</pre><p>Utility for capturing VMkernel events</p><pre>vmkeventd</pre><p>Utility for logging VMkernel events</p><pre>vmklogger</pre><p>Display physical adapters with link state and MAC addresses</p><pre>esxcfg-nics -l<br>esxcfg-vswitch -l<br>esxcfg-vmknic -l</pre><p>Create Kernel interface with specfic MAC and IP Address and add it to portgroup</p><pre>esxcfg-vmknic -a -i 10.10.1.2 -n 255.255.254.0 -M 00:11:22:aa:bb:cc -p<br>esxcfg-vmknic -p -e true</pre><p>Delete Kernel interface</p><pre>esxcfg-vmknic -d -p</pre><p>List all enabled kernel modules</p><pre>esxcfg-module -q</pre><p>Get parameters of a kernel modul, i.e. an Emulex FC HBA module</p><pre>esxcfg-module -g</pre><p>Set kernel module parameters</p><pre>esxcfg-module -s &quot;lpfc0_lun_queue_depth=8 lpfc1_lun_queue_depth=8 lpfc2_lun_queue_depth=8 lpfc3_lun_queue_depth=8&quot;</pre><p>Show all kernel module information</p><pre>esxcfg-module -i</pre><p>List Advanced Kernel Settings/Parameters</p><pre>esxcli system settings advanced list -d</pre><p>Set Advanced Kernel Parameter</p><pre>esxcli system settings advanced set -o /UserVars/ExampleKernelParameter -i 0</pre><p>Add Kernel interface to portgroup</p><pre>esxcfg-vmknic –a -i -n &quot;Portgroup_Name&quot;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76d4f4a05799" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proxmox Cheatsheet]]></title>
            <link>https://medium.com/@sud0/proxmox-cheatsheet-b3e92da768bc?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3e92da768bc</guid>
            <category><![CDATA[network]]></category>
            <category><![CDATA[proxmox]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[virtualization]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Mon, 22 Jul 2024 05:30:15 GMT</pubDate>
            <atom:updated>2024-07-22T06:58:10.460Z</atom:updated>
            <content:encoded><![CDATA[<p>This all based on my experience</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YgkMwyPUJib3v0si_GMXMA.png" /></figure><ol><li><strong>Common Setup</strong></li></ol><ul><li><strong>Find fastest repository</strong></li></ul><pre>apt install netselect-apt<br>netselect-apt sid -nc ID -o /etc/apt/sources.list</pre><ul><li><strong>Downgrade debian to stable</strong></li></ul><pre>apt show base-files<br>Update /etc/apt/sources.list<br>Replacing all testing with stable.<br><br># cat /etc/apt/sources.list<br>deb http://deb.debian.org/debian stable main contrib non-free<br>deb-src http://deb.debian.org/debian stable main contrib non-free<br><br>deb http://deb.debian.org/debian-security/ stable/updates main contrib non-free<br>deb-src http://deb.debian.org/debian-security/ stable/updates main contrib non-free<br><br>deb http://deb.debian.org/debian stable-updates main contrib non-free<br>deb-src http://deb.debian.org/debian stable-updates main contrib non-free<br><br>Running apt update &amp;&amp; apt dist-upgrade now wouldn&#39;t change any packages, because packages from testing have newer version numbers than the ones from stable.<br><br>To circumvent this, create /etc/apt/preferences.d/downgrade with the following content. This file can be deleted after the update has completed.<br><br># $ cat /etc/apt/preferences.d/downgrade<br>Package: *<br>Pin: release a=stable<br>Pin-Priority: 1001<br>Now, Debian will install packages from stable.<br><br>WARNING: BACKUP YOUR SYSTEM BEFORE THE NEXT STEP.<br><br>sudo apt update<br>sudo apt dist-upgrade<br><br>Cleanup<br>rm /etc/apt/preferences.d/downgrade</pre><ul><li><strong>Clean proxmox kernel</strong></li></ul><pre>sudo apt-get install cron curl git<br>curl -o pvekclean.sh https://raw.githubusercontent.com/jordanhillis/pvekclean/master/pvekclean.sh<br>chmod +x pvekclean.sh<br>./pvekclean.sh</pre><ul><li><strong>Remove kernel boot</strong></li></ul><pre>proxmox-boot-tool kernel list<br>proxmox-boot-tool kernel remove [Kernel Version]<br>proxmox-boot-tool refresh<br>uname -a</pre><ul><li><strong>Enable QEMU guest</strong></li></ul><pre>apt update &amp;&amp; apt -y install qemu-guest-agent<br>systemctl enable qemu-guest-agent<br>systemctl start qemu-guest-agent<br>systemctl status qemu-guest-agent</pre><ul><li><strong>How to replace proxmox IP</strong></li></ul><pre>Change IP in this area<br>-----<br>nano /etc/hosts<br>nano /etc/hostname<br>nano /etc/network/interfaces<br>----<br>reboot</pre><ul><li><strong>Setup proxmox with openvswitch &amp; LACP</strong></li></ul><pre>Install openvswitch<br>-----------<br>apt update<br>apt install openvswitch-switch<br><br>Create Config [/etc/network/interfaces]<br>-------------------------<br>auto lo<br>iface lo inet loopback<br><br>iface eno1 inet manual<br>iface eno2 inet manual<br><br>allow-vmbr1 bond0<br>iface bond0 inet manual<br>    ovs_bonds eno1 eno2<br>    ovs_type OVSBond<br>    ovs_bridge vmbr1<br>    ovs_options other_config:lacp-time=fast bond_mode=balance-tcp lacp=active<br>    pre-up ip link set eno1 mtu 9000<br>    pre-up ip link set eno2 mtu 9000<br>    mtu 9000<br><br>auto vmbr1<br>iface vmbr1 inet manual<br>    ovs_type OVSBridge<br>    ovs_ports bond0 mgmt1<br>    ovs_extra set int vmbr1 mtu_request=9000<br>    mtu 9000<br><br>allow-vmbr1 mgmt1<br>iface mgmt1 inet static<br>    address  [your-ip-address]<br>    netmask  [your-netmask]<br>    gateway  [your-gateway]<br>    ovs_type OVSIntPort<br>    ovs_bridge vmbr1<br>    #ovs_options tag=102<br>    ovs_extra set int mgmt1 mtu_request=8000<br>    mtu 8000<br><br></pre><ul><li><strong>Create ZFS</strong></li></ul><pre>Raid0<br>----------<br>zpool create &lt;pool&gt; &lt;path1&gt; &lt;path2&gt;<br>check path lsblk<br>zfs list<br>zfs create &lt;pool&gt;/&lt;folder</pre><ul><li><strong>Install GlusterFS</strong></li></ul><pre># Requires names set in /etc/hosts<br>wget -O - https://download.gluster.org/pub/gluster/glusterfs/7/rsa.pub | apt-key add -<br><br>#install glusterfs<br>-----------<br>apt-get update<br>apt full-upgrade -y<br>apt install glusterfs-server<br>systemctl enable glusterd<br>systemctl start glusterd<br><br>#prepare storage<br>-----------<br>cfdisk /dev/sda<br>choose gpt<br>choose write<br>choose quit<br><br>#format &amp; mount storage (master)<br>---------------<br>mkfs.xfs /dev/sda -f<br>mkdir -p /glusterfs/1<br>echo &quot;/dev/sdb /glusterfs/1 xfs defaults 0 0&quot; &gt;&gt; /etc/fstab<br>mount -a &amp;&amp; mount<br>mkdir -p /glusterfs/1/gv0<br><br>#format &amp; mount storage (slave)<br>---------------<br>mkfs.xfs /dev/sda -f<br>mkdir -p /glusterfs/2<br>echo &quot;/dev/sdb /glusterfs/2 xfs defaults 0 0&quot; &gt;&gt; /etc/fstab<br>mount -a &amp;&amp; mount<br>mkdir -p /glusterfs/2/gv0<br><br>#format &amp; mount storage (master 2)<br>---------------<br>mkfs.xfs /dev/sdb -f<br>mkdir -p /glusterfs/3<br>echo &quot;/dev/sdb /glusterfs/3 xfs defaults 0 0&quot; &gt;&gt; /etc/fstab<br>mount -a &amp;&amp; mount<br>mkdir -p /glusterfs/3/gv0<br><br>#format &amp; mount storage (slave 2)<br>---------------<br>mkfs.xfs /dev/sdc -f<br>mkdir -p /glusterfs/4<br>echo &quot;/dev/sdc /glusterfs/4 xfs defaults 0 0&quot; &gt;&gt; /etc/fstab<br>mount -a &amp;&amp; mount<br>mkdir -p /glusterfs/4/gv0<br><br><br><br>#create glusterfs volume<br>-----------------<br>gluster volume create gv0 replica 2 10.1.1.10:/glusterfs/1/gv0 10.1.1.10:/glusterfs/2/gv0 10.1.1.11:/glusterfs/3/gv0 10.1.1.11:/glusterfs/4/gv0 force<br><br>#required probing check on slave node<br>gluster peer probe IP-Proxmod-Master<br><br>#start gluster volume<br>--------------<br>gluster volume start gv0<br><br>#check status gluster volume<br>------<br>gluster vol info gv0<br>gluster vol status gv0<br>gluster volume profile gv0 start<br>gluster volume profile gv0 info<br><br>#restart glusterfs<br>--------<br>systemctl restart glusterd.service<br>=========================================<br><br>Add New Storage<br>-----<br>gluster volume add-brick gv0 replica 3 IP-Node:/glusterfs/3/gv0 force<br>gluster volume add-brick gv0 replica 4 IP-Node:/glusterfs/4/gv0 force<br><br><br>Remove glusterfs volume<br>-------<br>gluster volume delete [Volname]<br><br>Commands to avoid split-brain situation:<br>---------------------------<br>gluster vol set gv0 cluster.heal-timeout 5<br>gluster volume heal gv0 enable<br>gluster vol set gv0 cluster.quorum-reads false<br>gluster vol set gv0 cluster.quorum-count 1<br>gluster vol set gv0 network.ping-timeout 2<br>gluster volume set gv0 cluster.favorite-child-policy mtime<br>gluster volume heal gv0 granular-entry-heal enable<br>gluster volume set gv0 cluster.data-self-heal-algorithm full<br>gluster volume set gv0 performance.io-thread-count 8<br><br><br>(First do not forget to edit /etc/hosts to include the proper hostnames and IP&#39;s for each network)<br>Lines to add in /etc/fstab (do this in both server)<br>/dev/sdx1 /data xfs defaults 0 0<br>gluster1:VMS /vms glusterfs defaults,_netdev,x-systemd.automount,backupvolfile-server=gluster2 0 0<br><br>Lines to add in /etc/glusterfs/glusterd.vol (do this in both server)<br>    option transport.rdma.bind-address gluster1<br>    option transport.socket.bind-address gluster1<br>    option transport.tcp.bind-address gluster1<br>COROSYNC<br><br>quorum {<br>  provider: corosync_votequorum<br>  expected_votes: 1<br>  two_node: 1<br>}</pre><ul><li><strong>Recover Missing VM</strong></li></ul><pre>Create new vm with same configuration but no disk<br>qm rescan --vmid [id-vm]</pre><ul><li><strong>Rename Node</strong></li></ul><pre>Powerdown all VMs and containers<br>-------<br>Edit /etc/hostname and /etc/hosts with the new hostname<br>Reboot the host<br>---<br>At this point you will see your old host as &quot;disconnected&quot; in the web interface, and a new host with your new hostname appears.<br><br>SSH into the machine and navigate to /etc/pve/nodes - here you will see two folders (one with your new hostname, one with your old hostname)<br><br>The config for the containers is located at /etc/pve/nodes/&lt;currenthostname&gt;/lxc<br>The config for virtual machines is stored at /etc/pve/nodes/&lt;currenthostname&gt;/qemu-server<br>etc. <br><br>depending on what other technologies you are using<br>So I just moved the contents of each folder into the folder for the new host - i.e. /etc/pve/nodes/&lt;newhostname&gt;/lxc etc.<br>The second I did this, I saw the web interface update with the VMs and containers now showing in the correct datacenter and under the correct host.<br><br>Finally, move the folder with the old server&#39;s hostname (/etc/pve/nodes/&lt;oldhostname&gt;) somewhere for backup.<br>Reboot</pre><ul><li><strong>Fix warning-remote host identification has changed</strong></li></ul><pre>Update to all node<br>==============<br>pvecm updatecerts -F<br>systemctl restart pvedaemon pveproxy<br><br><br>Remove all in <br>----<br>/etc/pve/priv/known_hosts</pre><p><strong>2. Cluster</strong></p><ul><li><strong>Remove cluster</strong></li></ul><pre>systemctl stop pve-cluster corosync<br>pmxcfs -l<br>rm /etc/corosync/*<br>rm /etc/pve/corosync.conf<br>killall pmxcfs<br>systemctl start pve-cluster<br><br>===================<br>Remove node <br>=================<br>pvecm delnode [node]<br>rm -rf /etc/pve/nodes/[nodes name]</pre><ul><li><strong>Fix login cluster error</strong></li></ul><pre>pvecm expected 1</pre><p><strong>3. Virtual Machines (VM)</strong></p><ul><li><strong>Add new disk Alpine Linux</strong></li></ul><pre>fdisk /dev/sdb<br>choose n,p,1,w<br>mkfs.ext4 /dev/sdb1<br>mkdir /data<br>mount /dev/sdb1 /data<br>mount<br>blkid (find UUID)<br>nano /etc/fstab<br>echo -e &quot;UUID=6648cee4-6063-4df1-842c-4814599ce958       /data   ext4    rw,relatime,user        0 0&quot; &gt;&gt; /etc/fstab<br>reboot</pre><ul><li><strong>Add new disk proxmox XFS</strong></li></ul><pre>fdisk /dev/sdb<br>choose n,p,1,w<br>blkid (find UUID)<br>nano /etc/fstab<br>UUID=77de149f-f46b-0041-ba8a-9756756dd1e9 / xfs defaults 0 1</pre><ul><li><strong>Install docker Apline Linux</strong></li></ul><pre>apk add --update docker openrc<br>edit the /etc/apk/repositories file to add (or uncomment) a line. Community repository link: http://dl-cdn.alpinelinux.org/alpine/latest-stable/community<br>rc-update add docker boot<br>rc-service docker start<br>service docker status <br><br>===============<br>Docker UI<br>===============<br>docker run -d \<br>--name=&quot;portainer&quot; \<br>--restart on-failure \<br>-p 9000:9000 \<br>-v /var/run/docker.sock:/var/run/docker.sock \<br>-v portainer_data:/data \<br>portainer/portainer-ce</pre><ul><li><strong>Install docker LXC</strong></li></ul><pre>apt-get update --allow-releaseinfo-change<br>apt-get upgrade <br>apt-get install curl<br><br>Prune/Cleanup Docker<br>================<br>docker system prune --all --volumes --force<br><br>============<br>Automatic<br>============<br>curl -fsSL https://get.docker.com -o get-docker.sh<br>sh get-docker.sh<br><br>==============<br>Manual<br>==============<br>apt install docker.io<br>systemctl enable docker<br>systemctl start docker<br>systemctl status docker<br><br>===============<br>Docker UI<br>===============<br>docker run -d \<br>--name=&quot;portainer&quot; \<br>--restart on-failure \<br>-p 9000:9000 \<br>-v /var/run/docker.sock:/var/run/docker.sock \<br>-v portainer_data:/data \<br>portainer/portainer-ce<br><br>=============<br>IP Container<br>==============<br>ip addr<br><br>============<br>Tools<br>============<br>apt install docker-compose</pre><ul><li><strong>Install Gnome desktop debian</strong></li></ul><pre>apt install tasksel -y<br>tasksel install desktop gnome--desktop</pre><ul><li><strong>Install docker prometheus &amp; Grafana Alpine Linux</strong></li></ul><pre>==============<br>Install Docker<br>==============<br>apk add --update docker openrc<br>rc-update add docker boot<br>rc-service docker start<br>service docker status <br><br>===============<br>Docker UI<br>===============<br>docker run -d \<br>--name=&quot;portainer&quot; \<br>--restart on-failure \<br>-p 9000:9000 \<br>-v /var/run/docker.sock:/var/run/docker.sock \<br>-v portainer_data:/data \<br>portainer/portainer-ce<br><br>==============<br>Node Exporter<br>==============<br>docker pull prom/node-exporter<br>docker run -d -p 9100:9100 --net=&quot;host&quot; prom/node-exporter<br><br>==========================<br>Install Docker Prometheus<br>=========================<br>mkdir /etc/monitoring<br>nano /etc/monitoring/prometheus.yml<br>----------------<br>global:<br>  scrape_interval: 15s<br><br>scrape_configs:<br>- job_name: node<br>  static_configs:<br>  - targets: [&#39;localhost:9100&#39;]<br>------------------<br>docker run \<br>    -p 9090:9090 \<br>    -v /prometheus-2.39.1.linux-amd64:/prometheus-2.39.1.linux-amd64 \<br>    prom/prometheus<br><br>docker run \<br>    -p 9090:9090 \<br>    -v /etc/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml \<br>    prom/prometheus<br><br>=====================<br>Install Prometheus Node<br>=====================<br>wget https://github.com/prometheus/prometheus/releases/download/v2.39.1/prometheus-2.39.1.linux-amd64.tar.gz<br>tar xvf prometheus-*.*-amd64.tar.gz<br>cd prometheus-*.*<br>nano prometheus.yml <br>----------------<br>global:<br>  scrape_interval: 15s<br><br>scrape_configs:<br>- job_name: node<br>  static_configs:<br>  - targets: [&#39;localhost:9100&#39;]<br>------------------<br><br>==============<br>Start Service<br>==============<br>cd prometheus-*.*<br>./prometheus --config.file=./prometheus.yml<br><br>============<br>Stop Service<br>============<br>pgrep -f prometheus<br>kill -TERM &lt;id service&gt;<br><br>================<br>Install Docker Grafana<br>================<br>docker run --name grafana -d -p 3000:3000 grafana/grafana-enterprise</pre><ul><li><strong>Install docker Samba</strong></li></ul><pre>docker pull dperson/samba<br>docker images<br>docker run -it -e TZ=Asia/Jakarta --name samba -p 139:139 -p 445:445 \<br>            -v /mnt/usbc:/mount \<br>            -d dperson/samba -p \<br>            -u &quot;<strong>user</strong>;<strong>password</strong>&quot; \<br>            -s &quot;<strong>user</strong>;/mount;yes;no;no;<strong>user</strong>&quot;  <br><br>docker pull elswork/samba<br>docker images<br>sudo docker run -it -e TZ=Asia/Jakarta --name samba -m 1024m -p 139:139 -p 445:445 \<br>            -v /mnt/usbc:/mount \<br>            -d elswork/samba -p \<br>            -u &quot;1000:1000:<strong>user</strong>:<strong>user</strong>:<strong>password</strong>&quot; \<br>            -s &quot;<strong>user</strong>:/mount:rw:<strong>user</strong>&quot; <br>docker run -d -p 139:139 -p 445:445 -e TZ=Asia/Jakarta --name samba \<br>    -v /mnt/usbc:/mount elswork/samba \<br>    -u &quot;1000:1000:<strong>user</strong>:<strong>user</strong>:<strong>password</strong>&quot; \<br>    -s &quot;<strong>user</strong>:/mount:rw:<strong>user</strong>&quot;</pre><ul><li><strong>Install Samba with Alpine Linux</strong></li></ul><pre>apk -U upgrade<br>apk add samba<br>setup-disk<br>mkdir /[storage-mount]<br>chmod 0777 /[storage-mount]<br>apk add nano<br>nano /etc/samba/smb.conf<br>[nas]<br>  browseable = yes<br>  writeable = yes<br>  path = /data<br>adduser &lt;username&gt;<br>smbpasswd -a &lt;username&gt;<br>rc-update add samba<br>rc-service samba start</pre><ul><li><strong>Instant boot debian</strong></li></ul><pre>nano /etc/default/grub<br>GRUB-TIMEOUT=0<br>sudo update-grub</pre><ul><li>Resize disk</li></ul><pre>qm resize &lt;vmid&gt; &lt;disk&gt; &lt;size&gt; <br>---------<br>qm resize 100 virtio0 +5G<br><br>LXC<br>====<br>shutdown a CT.<br>edit /etc/pve/lxc/xxx.conf - with a new correct size.<br></pre><p><strong>4. Ceph</strong></p><ul><li><strong>Benchmark Ceph</strong></li></ul><pre>apt install fio<br>fio --ioengine=libaio --filename=/dev/sda --direct=1 --sync=1 --rw=write --bs=4K --numjobs=1 --iodepth=1 --runtime=60 --time_based --name=fio<br><br>fio --ioengine=libaio --filename=/dev/sda --direct=1 --sync=1 --rw=write --bs=4M --numjobs=1 --iodepth=1 --runtime=60 --time_based --name=fio</pre><ul><li><strong>Ceph OSD crush rule</strong></li></ul><pre>add new crush<br>========<br>ceph osd crush rule create-replicated replicated-ssd default host ssd<br>ceph osd crush rule create-replicated replicated-hdd default host hdd<br><br>check crush<br>=======<br>ceph osd crush tree --show-shadow<br><br>remove crush<br>======<br>ceph osd crush rule rm [Name Crush]</pre><ul><li><strong>Fix Error [rbd error/ rbd/ listing images failed/ (2) No such file or directory (500)]</strong></li></ul><pre>rbd ls -l [cephpool]<br>rbd rm vm-[id]-disk-[1] -p [cephpool]</pre><ul><li><strong>Increase Ceph pg_numb</strong></li></ul><pre>ceph osd lspools<br>ceph osd pool get &lt;your-ceph-storage&gt; pg_num<br>ceph osd pool set &lt;your-ceph-storage&gt; pg_num &lt;new-number&gt;</pre><ul><li><strong>Optimize Ceph configuration</strong></li></ul><pre>auth_cluster_required = none<br>auth_service_required = none<br>auth_client_required = none<br>debug_lockdep = 0/0<br>debug_context = 0/0<br>debug_crush = 0/0<br>debug_buffer = 0/0<br>debug_timer = 0/0<br>debug_journaler = 0/0<br>debug_osd = 0/0<br>debug_optracker = 0/0<br>debug_objclass = 0/0<br>debug_filestore = 0/0<br>debug_journal = 0/0<br>debug_ms = 0/0<br>debug_monc = 0/0<br>debug_tp = 0/0<br>debug_auth = 0/0<br>debug_finisher = 0/0<br>debug_heartbeatmap = 0/0<br>debug_perfcounter = 0/0<br>debug_asok = 0/0<br>debug_throttle = 0/0</pre><ul><li><strong>Remove Ceph</strong></li></ul><pre>1 - Stop/Out all OSDs<br>2 - Remove all OSDs<br>3 - Remove ALL Mons (except the master)<br>4 - Remove ALL Managers (except the master)<br>5 - Execute on each OSD node: pveceph purge<br>6 - On last node (master mon/mgr): stop all ceph services, and execute: pveceph purge<br>====================<br>rm -rf /etc/systemd/system/ceph*<br>killall -9 ceph-mon ceph-mgr ceph-mds<br>rm -rf /var/lib/ceph/mon/  /var/lib/ceph/mgr/  /var/lib/ceph/mds/<br>pveceph purge<br>apt purge ceph-mon ceph-osd ceph-mgr ceph-mds<br>rm /etc/init.d/ceph<br>for i in $(apt search ceph | grep installed | awk -F/ &#39;{print $1}&#39;); do apt reinstall $i; done<br>dpkg-reconfigure ceph-base<br>dpkg-reconfigure ceph-mds<br>dpkg-reconfigure ceph-common<br>dpkg-reconfigure ceph-fuse<br>for i in $(apt search ceph | grep installed | awk -F/ &#39;{print $1}&#39;); do apt reinstall $i; done<br>rm -rf /etc/ceph<br>rm -rf /var/lib/ceph<br>pveceph install<br><br>=========<br>Remove monitor ceph<br>ceph mon remove [monitor]</pre><ul><li><strong>Remove CephFS</strong></li></ul><pre>pveceph fs destroy NAME --remove-storages --remove-pools</pre><ul><li><strong>Basic</strong></li></ul><pre>List VMs<br>qm list<br><br>Create or restore a virtual machine.<br>qm create &lt;vmid&gt;<br><br>Create or restore a virtual machine with core, memory, disks specified.<br>qm create &lt;vmid&gt; --name &lt;vm-name&gt; --cores &lt;number-of-cores&gt; --memory &lt;memory-size-in-bytes&gt; --scsi0 file=&lt;vg-name&gt;:&lt;size-in-gb&gt; --cdrom local:&lt;iso-name&gt; --net0 virtio,bridge=&lt;bridge-name&gt;<br><br>Start a VM<br>qm start &lt;vmid&gt;<br><br>Suspend virtual machine.<br>qm suspend &lt;vmid&gt;<br><br>Shutdown a VM<br>qm shutdown &lt;vmid&gt;<br><br>Reboot a VM<br>qm reboot &lt;vmid&gt;<br><br>Reset a VM<br>qm reset &lt;vmid&gt;<br><br>Stop a VM<br>qm stop &lt;vmid&gt;<br><br>Destroy the VM and all used/owned volumes.<br>Note: Removes any VM specific permissions and firewall rules<br>qm destroy &lt;vmid&gt;<br><br>Enter Qemu Monitor interface.<br>qm monitor &lt;vmid&gt;<br><br>Get the virtual machine configuration with both current and pending values.<br>qm pending &lt;vmid&gt;<br><br>Send key event to virtual machine.<br>qm sendkey &lt;vmid&gt; &lt;key&gt; [OPTIONS]<br><br>Show command line which is used to start the VM (debug info).<br>qm showcmd &lt;vmid&gt; [OPTIONS]<br><br>Unlock the VM.<br>qm unlock &lt;vmid&gt;<br><br>Clone a VM<br>qm clone &lt;vmid&gt; &lt;newid&gt;<br><br>Clone a VM in full clone mode and also set the name.<br>qm clone &lt;vmid&gt; &lt;newid&gt; --full --name &lt;name&gt;<br><br>Migrate a VM<br>qm migrate &lt;vmid&gt; &lt;target-node&gt;<br><br>Show VM status<br>qm status &lt;vmid&gt;<br><br>Clean up resources for a VM<br>qm cleanup &lt;vmid&gt; &lt;clean-shutdown&gt; &lt;guest-requested&gt;<br><br>Create a Template.<br>qm template &lt;vmid&gt; [OPTIONS]<br><br>Set virtual machine options (synchrounous API)<br>qm set &lt;vmid&gt; [OPTIONS]</pre><ul><li><strong>Cloudinit</strong></li></ul><pre>Get automatically generated cloudinit config.<br>qm cloudinit dump &lt;vmid&gt; &lt;type&gt;<br><br>Get the cloudinit configuration with both current and pending values.<br>qm cloudinit pending &lt;vmid&gt;<br><br>Regenerate and change cloudinit config drive.<br>qm cloudinit update &lt;vmid&gt;</pre><ul><li><strong>Disk</strong></li></ul><pre>Import an external disk image as an unused disk in a VM.<br>Note: The image format has to be supported by qemu-img(1).<br>qm disk import &lt;vmid&gt; &lt;source&gt; &lt;storage&gt;<br><br>Move volume to different storage or to a different VM.<br>qm disk move &lt;vmid&gt; &lt;disk&gt; [&lt;storage&gt;] [OPTIONS]<br><br>Rescan all storages and update disk sizes and unused disk images.<br>qm disk rescan [OPTIONS]<br><br>Extend volume size.<br>qm disk resize &lt;vmid&gt; &lt;disk&gt; &lt;size&gt; [OPTIONS]<br><br>Unlink/delete disk images.<br>qm disk unlink &lt;vmid&gt; --idlist &lt;string&gt; [OPTIONS]<br><br>Rescan volumes<br>qm rescan</pre><ul><li><strong>Snapshoot</strong></li></ul><pre>List all snapshots.<br>qm listsnapshot &lt;vmid&gt;<br><br>Snapshot a VM<br>qm snapshot &lt;vmid&gt; &lt;snapname&gt;<br><br>Delete a snapshot.<br>qm delsnapshot &lt;vmid&gt; &lt;snapname&gt;<br><br>Rollback a snapshot<br>qm rollback &lt;vmid&gt; &lt;snapname&gt;<br><br>Open a terminal using a serial device<br>(The VM need to have a serial device configured, for example serial0: socket)<br>qm terminal &lt;vmid&gt; [OPTIONS]<br><br>Proxy VM VNC traffic to stdin/stdout<br>qm vncproxy &lt;vmid&gt;</pre><ul><li><strong>PV, VG &amp; LV Management</strong></li></ul><pre>Create a PV<br>pvcreate &lt;disk-device-name&gt;<br><br>Remove a PV<br>pvremove &lt;disk-device-name&gt;<br><br>List all PVs<br>pvs<br><br>Create a VG<br>vgcreate &lt;vg-name&gt; &lt;disk-device-name&gt;<br><br>Remove a VG<br>vgremove &lt;vg-name&gt;<br><br>List all VGs<br>vgs<br><br>Create a LV<br>lvcreate -L &lt;lv-size&gt; -n &lt;lv-name&gt; &lt;vg-name&gt;<br><br>Remove a LV<br>lvremove &lt;vg-name&gt;/&lt;lv-name&gt;<br><br>List all LVs<br>lvs</pre><ul><li><strong>Storage Management</strong></li></ul><pre>Create a new storage.<br>pvesm add &lt;type&gt; &lt;storage&gt; [OPTIONS]<br><br>Allocate disk images.<br>pvesm alloc &lt;storage&gt; &lt;vmid&gt; &lt;filename&gt; &lt;size&gt; [OPTIONS]<br><br>Delete volume<br>pvesm free &lt;volume&gt; [OPTIONS]<br><br>Delete storage configuration.<br>pvesm remove &lt;storage&gt;<br><br>List storage content.<br>pvesm list &lt;storage&gt; [OPTIONS]<br><br>An alias for pvesm scan lvm.<br>pvesm lvmscan<br><br>An alias for pvesm scan lvmthin.<br>pvesm lvmthinscan<br><br>List local LVM volume groups.<br>pvesm scan lvm<br><br>List local LVM Thin Pools.<br>pvesm scan lvmthin &lt;vg&gt;<br><br>Get status for all datastores.<br>pvesm status [OPTIONS]</pre><ul><li><strong>Template Management</strong></li></ul><pre>List All Templates<br>pveam available<br><br>List All Templates<br>pveam list &lt;storage&gt;<br><br>Download Appliance Templates<br>pveam download &lt;storage&gt; &lt;template&gt;<br><br>Remove a Template<br>pveam remove &lt;template-path&gt;<br><br>Update Container Template Database.<br>pveam update</pre><ul><li><strong>Container Management</strong></li></ul><pre><strong>======== Basic ===========<br>--------------------------</strong><br><br>List Containers<br>pct list<br><br>Create or Restore a Container<br>pct create &lt;vmid&gt; &lt;ostemplate&gt; [OPTIONS]<br><br>Start the Container<br>pct start &lt;vmid&gt; [OPTIONS]<br><br>Create a Container Clone/Copy<br>pct clone &lt;vmid&gt; &lt;newid&gt; [OPTIONS]<br><br>Suspend the Container - This is Experimental<br>pct suspend &lt;vmid&gt;<br><br>Resume the Container<br>pct resume &lt;vmid&gt;<br><br>Stop the Container<br>This will abruptly stop all processes running in the container.<br>pct stop &lt;vmid&gt; [OPTIONS]<br><br>Shutdown the Container<br>This will trigger a clean shutdown of the container, see lxc-stop(1) for details<br>pct shutdown &lt;vmid&gt; [OPTIONS]<br><br>Destroy the Container (Also Delete All Uses Files)<br>pct destroy &lt;vmid&gt; [OPTIONS]<br><br>Show CT Status<br>pct status &lt;vmid&gt; [OPTIONS]<br><br>Migrate the Container to Another Node. Creates a New Bigration Task<br>pct migrate &lt;vmid&gt; &lt;target&gt; [OPTIONS]<br><br>Get Container Configuration<br>pct config &lt;vmid&gt; [OPTIONS]<br><br>Print the List of Assigned CPU Sets<br>pct cpusets<br><br>Get Container Configuration, Including Pending Changes<br>pct pending &lt;vmid&gt;<br><br>Reboot the Container by Shutting it Down, and Starting it Again. Applies Pending Changes.<br>pct reboot &lt;vmid&gt; [OPTIONS]<br><br>Create or Restore a Container<br>pct restore &lt;vmid&gt; &lt;ostemplate&gt; [OPTIONS]<br><br>Set Container Options<br>pct set &lt;vmid&gt; [OPTIONS]<br><br>Create a Template.<br>pct template &lt;vmid&gt;<br><br>Unlock the VM.<br>pct unlock &lt;vmid&gt;<br><br><strong>============= Disk ===========<br>------------------------------</strong><br><br>Get the Container’s Current Disk Usage<br>pct df &lt;vmid&gt;<br><br>Run a Filesystem Check (fsck) on a Container Volume<br>pct fsck &lt;vmid&gt; [OPTIONS]<br><br>Run fstrim on a Chosen CT and Its Mountpoints<br>pct fstrim &lt;vmid&gt; [OPTIONS]<br><br>Mount the Container’s Filesystem on the Host<br>This will hold a lock on the container and is meant for emergency maintenance only<br>as it will prevent further operations on the container other than start and stop.<br>pct mount &lt;vmid&gt;<br><br>Move a rootfs-/mp-Volume to a Different Storage or to a Different Container<br>pct move-volume &lt;vmid&gt; &lt;volume&gt; [&lt;storage&gt;] [&lt;target-vmid&gt;] [&lt;target-volume&gt;] [OPTIONS]<br><br>Unmount the Container’s Filesystem<br>pct unmount &lt;vmid&gt;<br><br>Resize a Container Mount Point<br>pct resize &lt;vmid&gt; &lt;disk&gt; &lt;size&gt; [OPTIONS]<br><br>Rescan All Storages and Update Disk Sizes and Unused Disk Images<br>pct rescan [OPTIONS]<br><br>Launch a Console for the Specified Container<br>pct console &lt;vmid&gt; [OPTIONS]<br><br>Launch a Shell for the Specified Container<br>pct enter &lt;vmid&gt;<br><br>Launch a Command Inside the Specified Container<br>pct exec &lt;vmid&gt; [&lt;extra-args&gt;]<br><br>Copy a File from the Container to the Local System<br>pct pull &lt;vmid&gt; &lt;path&gt; &lt;destination&gt; [OPTIONS]<br><br>Copy a Local File to the Container<br>pct push &lt;vmid&gt; &lt;file&gt; &lt;destination&gt; [OPTIONS]<br><br><strong>============= Snapshoot =============<br>-------------------------------------</strong><br><br>Snapshot a Container<br>pct snapshot &lt;vmid&gt; &lt;snapname&gt; [OPTIONS]<br><br>List all Snapshots<br>pct listsnapshot &lt;vmid&gt;<br><br>Rollback LXC State to Specified Snapshot<br>pct rollback &lt;vmid&gt; &lt;snapname&gt; [OPTIONS]<br><br>Delete a LXC Snapshot<br>pct delsnapshot &lt;vmid&gt; &lt;snapname&gt; [OPTIONS]<br><br><strong>============= Web GUI =================<br>---------------------------------------</strong><br><br># Restart Web GUI<br>service pveproxy restart</pre><ul><li><strong>Important File/Dir Path</strong></li></ul><pre><strong>====== PVE ========<br>-------------------</strong><br><br>/etc/pve/authkey.pub           Public key used by the ticket system<br>/etc/pve/ceph.conf           Ceph configuration file (note: /etc/ceph/ceph.conf is a symbolic link to this)<br>/etc/pve/corosync.conf    Corosync cluster configuration file (prior to Proxmox VE 4.x, this file was called cluster.conf)<br>/etc/pve/datacenter.cfg    Proxmox VE data center-wide configuration (keyboard layout, proxy, …)<br>/etc/pve/domains.cfg    Proxmox VE authentication domains<br>/etc/pve/firewall/cluster.fw   Firewall configuration applied to all nodes<br>/etc/pve/firewall/&lt;NAME&gt;.fw   Firewall configuration for individual nodes<br>/etc/pve/firewall/&lt;VMID&gt;.fw   Firewall configuration for VMs and containers<br>/etc/pve/ha/crm_commands   Displays HA operations that are currently being carried out by the CRM<br>/etc/pve/ha/manager_status   JSON-formatted information regarding HA services on the cluster<br>/etc/pve/ha/resources.cfg   Resources managed by high availability, and their current state<br>/etc/pve/nodes/&lt;NAME&gt;/config   Node-specific configuration<br>/etc/pve/nodes/&lt;NAME&gt;/lxc/&lt;VMID&gt;.conf  VM configuration data for LXC containers<br>/etc/pve/nodes/&lt;NAME&gt;/openvz/   Prior to PVE 4.0, used for container configuration data (deprecated, removed soon)<br>/etc/pve/nodes/&lt;NAME&gt;/pve-ssl.key  Private SSL key for pve-ssl.pem<br>/etc/pve/nodes/&lt;NAME&gt;/pve-ssl.pem  Public SSL certificate for web server (signed by cluster CA)<br>/etc/pve/nodes/&lt;NAME&gt;/pveproxy-ssl.key  Private SSL key for pveproxy-ssl.pem (optional)<br>/etc/pve/nodes/&lt;NAME&gt;/pveproxy-ssl.pem  Public SSL certificate (chain) for web server (optional override for pve-ssl.pem)<br>/etc/pve/nodes/&lt;NAME&gt;/qemu-server/&lt;VMID&gt;.conf VM configuration data for KVM VMs<br>/etc/pve/priv/authkey.key   Private key used by ticket system<br>/etc/pve/priv/authorized_keys                   SH keys of cluster members for authentication<br>/etc/pve/priv/ceph*    Ceph authentication keys and associated capabilities<br>/etc/pve/priv/known_hosts   SSH keys of the cluster members for verification<br>/etc/pve/priv/lock/*    Lock files used by various services to ensure safe cluster-wide operations<br>/etc/pve/priv/pve-root-ca.key   Private key of cluster CA<br>/etc/pve/priv/shadow.cfg   Shadow password file for PVE Realm users<br>/etc/pve/priv/storage/&lt;STORAGE-ID&gt;.pw  Contains the password of a storage in plain text<br>/etc/pve/priv/tfa.cfg    Base64-encoded two-factor authentication configuration<br>/etc/pve/priv/token.cfg    API token secrets of all tokens<br>/etc/pve/pve-root-ca.pem   Public certificate of cluster CA<br>/etc/pve/pve-www.key               Private key used for generating CSRF tokens<br>/etc/pve/sdn/*     Shared configuration files for Software Defined Networking (SDN)<br>/etc/pve/status.cfg    Proxmox VE external metrics server configuration<br>/etc/pve/storage.cfg           Proxmox VE storage configuration<br>/etc/pve/user.cfg    Proxmox VE access control configuration (users/groups/…)<br>/etc/pve/virtual-guest/cpu-models.conf  For storing custom CPU models<br>/etc/pve/vzdump.cron    Cluster-wide vzdump backup-job schedule<br><br><strong>========== Debug =========<br>--------------------------</strong><br><br>/etc/pve/.version  File Versions (to detect file modifications)<br>/etc/pve/.members  Info about Cluster Members<br>/etc/pve/.vmlist  List of all VMs<br>/etc/pve/.clusterlog     Cluster Log (last 50 entries)<br>/etc/pve/.rrd   RRD Data (most recent entries)<br><br><strong>============ OpenVz ==========<br>------------------------------</strong><br><br>/etc/vz/conf/xxx.conf   config<br>/var/lib/vz/root/xxx   data<br>/var/lib/vz/template/cache  template<br>/var/lib/vz/dump   snapshot<br>/etc/vz/vz.conf    OpenVZ config<br><br><strong>============= KVM ===========<br>-----------------------------</strong><br><br>/var/lib/vz/images/xxx   data<br>/var/lib/vz/template/iso  template<br>/var/lib/vz/dump   snapshot<br><br><strong>============= LXC ===========<br>-----------------------------</strong><br><br>/var/lib/lxc/xxx/config   config<br>/var/lib/vz/images/xxx   data<br>/var/lib/vz/template/cache  template<br>/var/lib/vz/dump   snapshot</pre><ul><li><strong>Others</strong></li></ul><pre>Execute Qemu Guest Agent commands.<br>qm guest cmd &lt;vmid&gt; &lt;command&gt;<br><br>Executes the given command via the guest agent<br>qm guest exec &lt;vmid&gt; [&lt;extra-args&gt;] [OPTIONS]<br><br>Gets the status of the given pid started by the guest-agent<br>qm guest exec-status &lt;vmid&gt; &lt;pid&gt;<br><br>Sets the password for the given user to the given password<br>qm guest passwd &lt;vmid&gt; &lt;username&gt; [OPTIONS]</pre><ul><li>Other references -&gt; <a href="https://pengwin.ca/posts/Proxmox-Cheatsheet/">https://pengwin.ca/posts/Proxmox-Cheatsheet/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3e92da768bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create Mikrotik Backup & Sent to Email]]></title>
            <link>https://medium.com/@sud0/how-to-create-mikrotik-backup-sent-to-email-6ed76c23938a?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ed76c23938a</guid>
            <category><![CDATA[script]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[mikrotik]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Thu, 18 Jul 2024 05:27:35 GMT</pubDate>
            <atom:updated>2024-07-18T05:27:35.853Z</atom:updated>
            <content:encoded><![CDATA[<p>This way will be create backup configuration more efficient</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGHR76xlXWHSpFj0sm5w4A.png" /></figure><p>In Mikrotik we can create automation for create backup and sent to our email with a script and scheduler to makesure our Mikrotik always backup by our decided time. Here is how to do that</p><ol><li>Create App Password in your email (go to menu <strong>Manage Your Google Account </strong>— <strong>Security</strong> — <strong>2-Step Verification</strong> — <strong>App Passwords</strong>) dan save App Password which has been created</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*EsDhe0Edxp3kkE2h77LmFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NR8hZBq5Gaev6IsftrAMzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4dB5hMKlXZ9Uw18PmvsNw.png" /></figure><p>2. In Mikrotik goto menu <strong>Tools — Email</strong> fill this setting<br>- <strong>Server: </strong><a href="http://smtp.gmail.com/"><strong>smtp.gmail.com</strong></a><strong><br>- Port: 587<br>- Tls: Starttls<br>- VRF: main<br>- User: (fill your email for sending backup ex:</strong><a href="/service/mailto:backup@gmail.com"><strong>backup@gmail.com</strong></a><strong>)<br>- Password: (fill your app password here)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*h2exE5PfPby7522tQohm9Q.png" /></figure><p>3. Then goto menu <strong>system — scheduler</strong> insert this script</p><pre>/system script<br>### Default &quot;local file name&quot; is always the same to avoid lots of files and running out of space<br>:local hostname [/system identity get name]<br>:local localfilename &quot;$hostname-Backup-Daily&quot;;<br>### Enable for Debug removing staing hash in the following lines<br>:log info &quot;$localfilename&quot;;<br>:log info &quot;$hostname&quot;;<br>### Stating the Backup<br>:log info &quot;STARTING DAILY BACKUP&quot;;<br>### Create backup file and export the config.<br>export compact file=&quot;$localfilename&quot;<br>/system backup save name=&quot;$localfilename&quot;<br>:log info &quot;Backup Created Successfully&quot;<br>:delay 5s;<br>/tool e-mail send to=&quot;fill your email here (ex: backup@gmail.com)&quot; subject=&quot;[Backup-Daily-Mikrotik] $hostname&quot; body=&quot;Mikrotik Daily Backup OK&quot; file=&quot;$localfilename.rsc,$localfilename.backup&quot;;<br>:log info &quot;Backup Sent to Email Successfully&quot;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*JH5XQyz5XNU9cnEwY9jR-A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ed76c23938a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy SSTP VPN on Mikrotik]]></title>
            <link>https://medium.com/@sud0/how-to-deploy-sstp-vpn-on-mikrotik-40f02b983e08?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/40f02b983e08</guid>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[mikrotik]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[sstp]]></category>
            <category><![CDATA[setup]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Sat, 13 Jul 2024 07:28:39 GMT</pubDate>
            <atom:updated>2024-07-13T07:28:39.933Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide will help you to create SSTP connection easily</p><p>We already know that so many VPN that can be created on mikrotik. One of them is SSTP connection. SSTP connection can be use in Windows OS to create connection betwen PC or Laptop client to mikrotik in a secure way. Although, there is PPTP to connect easily but it not secure as well as SSTP does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*vNLTNoei53UXePqcVJMKNw.png" /></figure><p>If you want to deploy SSTP on mikrotik here is the guide you can follow</p><ol><li><strong>Create CA certificate</strong></li></ol><p><strong>Go to System — Certificate — click plus (+) sign</strong></p><ul><li>Fill the name (CA-SSTP for this example)</li><li>Fill the Common Name (with your mikrotik public IP)</li><li>Days Valid (how long your certificate validity)</li></ul><p>Click apply</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43uiWz-6nZhWp5UOUjcDqg.png" /></figure><p>Click sign</p><ul><li>Fill CA CRL Host (with your mikrotik public IP)</li></ul><p>Click start and wait until success</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*bjv8q4CFwn2AFOv5KwW2Yg.png" /></figure><p>2. <strong>Create Server certificate</strong></p><p><strong>Go to System — Certificate — click plus (+) sign</strong></p><ul><li>Fill the name (Server-SSTP for this example)</li><li>Fill the Common Name (for identity)</li><li>Days Valid (how long your certificate validity)</li></ul><p>Click apply</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBGggdGcD8YLwfam2ce3TA.png" /></figure><p>Click sign</p><ul><li>Choose CA that previously created</li></ul><p>Click start and wait until success</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*m4Adga6LconPRz9eWSh0Pg.png" /></figure><p>3. <strong>Create Client certificate</strong></p><p><strong>Go to System — Certificate — click plus (+) sign</strong></p><ul><li>Fill the name (Server-SSTP for this example)</li><li>Fill the Common Name (for identity)</li><li>Days Valid (how long your certificate validity)</li></ul><p>Click apply</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vdq906NsdEKnnIDyTSfaPA.png" /></figure><p>Click sign</p><ul><li>Choose CA that previously created</li></ul><p>Click start and wait until success</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*BLsu9hx4_dLPWf7voWaNcQ.png" /></figure><p>4. <strong>Export the certificate</strong></p><p>Export CA certificate &amp; client certificate</p><ul><li>Click export (do for each certificate)</li><li>Checklist trusted (do for each certificate)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mbIXpnh7mnEp51tH6uMPig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAvnAQ_-k5XB_Svt8unvXQ.png" /></figure><p>5. <strong>Setting SSTP Server</strong></p><p><strong>Go to PPP — SSTP Server</strong></p><ul><li>Checklist enabled</li><li>Checklist mschap2</li><li>Choose CA sertificate</li></ul><p>Click apply and OK</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7R1uxQXTwstQYAXKpHaKQ.png" /></figure><p>6. <strong>Download exported CA certificate &amp; client certificate</strong></p><p>Go to files</p><ul><li>Right click exported CA &amp; client to your PC or laptop and download this</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M7NFZbaTJE53j0ryYxJlhA.png" /></figure><p>7. <strong>Done your SSTP should be running and up</strong></p><p>You can import downloaded certificate to your PC or computer and create new VPN connection to your mikrotik</p><p>8. <strong>Create new secret for SSTP user</strong></p><p><strong>Go to PPP — Secrets — click plus (+) sign</strong></p><ul><li>Fill name (user for your SSTP server)</li><li>Password (password for sstp user)</li><li>Service (SSTP)</li><li>Local address (fill with your private local IP)</li><li>Remote address (fill with your next private local IP)</li></ul><p><strong>Click apply &amp; OK</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*b8RrjIHP_FIBwIv3TZch4Q.png" /></figure><h3><strong>How to use SSTP server on Windows?</strong></h3><p>A. <strong>Double click CA sertificate</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*1hwnb_KRlfQ9rFQqxMMbYw.png" /></figure><p>B. <strong>Click install certificate</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*2NtXJzDsubBlQiLFlPjhOA.png" /></figure><p>C. <strong>Choose local machine &amp; click next</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*u4vW_1Y3cS6-s4ChHUscCw.jpeg" /></figure><p>D. <strong>Choose place all certificates in the following store and browse &amp; click browse</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*U7CBDbYkHNagoEUFiqzbHg.jpeg" /></figure><p>E. <strong>Choose trusted root certification authorities &amp; click OK</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*6_DSfWf_v_pkpZF3fb-s7g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*WoYjQ1V6tJE-usOpILdeKA.jpeg" /></figure><p>F. <strong>Click next &amp; finish</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*zQdpdkGshfJxU6Ay2woS-Q.jpeg" /></figure><p>G. <strong>Create new VPN account</strong></p><ul><li>Search VPN &amp; click VPN setting</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUHz1q3dfjP3-1lu53BogQ.png" /></figure><ul><li>Add new VPN</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*icSdXIGKDqDqt2cqKJhONQ.png" /></figure><ul><li>Fill the parameter like this &amp; click save</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*O76ZXtGsssPVMGUq1UbKVQ.png" /></figure><p>H. <strong>SSTP connection successfully connected</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfyK1PwF5dITVDnrIyJBIA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40f02b983e08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Downgrade Debian to Stable Version]]></title>
            <link>https://medium.com/@sud0/how-to-downgrade-debian-to-stable-version-a20be627594e?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a20be627594e</guid>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[proxmox]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[system]]></category>
            <category><![CDATA[downgrade]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Tue, 14 May 2024 08:15:35 GMT</pubDate>
            <atom:updated>2024-05-14T08:27:06.529Z</atom:updated>
            <content:encoded><![CDATA[<p>Since downgrading Debian system is not supported but it still possible</p><p>Officially system downgrade not supported can be read <a href="https://wiki.debian.org/SystemDowngrade">here</a> but it still possible to downgrade the debian system in case you accidentaly upgrade to non stable version. You can follow this trick to successfuly downgrade your Debian system without losing your data</p><ol><li><strong>Check your current base-files</strong></li></ol><pre><strong>apt show base-files</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*SHN3gy0jmV5uqywmzV15JA.png" /></figure><p>2.<strong> Update your repository from testing to stable</strong></p><pre><strong>nano /etc/apt/sources.list</strong></pre><p>3.<strong> Replace your repository content from testing to stable</strong></p><ul><li>For common Debian</li></ul><pre><strong>deb http://deb.debian.org/debian stable main contrib non-free<br>deb-src http://deb.debian.org/debian stable main contrib non-free<br><br>deb http://deb.debian.org/debian-security/ stable/updates main contrib non-free<br>deb-src http://deb.debian.org/debian-security/ stable/updates main contrib non-free<br><br>deb http://deb.debian.org/debian stable-updates main contrib non-free<br>deb-src http://deb.debian.org/debian stable-updates main contrib non-free</strong></pre><ul><li>For Proxmox Debian</li></ul><pre><strong>deb http://ftp.debian.org/debian bookworm main contrib<br>deb http://ftp.debian.org/debian bookworm-updates main contrib<br><br># security updates<br>deb http://security.debian.org bookworm-security main contrib<br>deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription</strong></pre><p>4. <strong>Create new file called downgrade</strong></p><pre><strong>nano /etc/apt/preferences.d/downgrade</strong></pre><ul><li>Fill with this content</li></ul><pre><strong># $ cat /etc/apt/preferences.d/downgrade<br>Package: *<br>Pin: release a=stable<br>Pin-Priority: 1001</strong></pre><p>5. <strong>Start downgrade with this command</strong></p><pre><strong>sudo apt update<br>sudo apt dist-upgrade</strong></pre><p>6<strong>. Cleanup &amp; Remove file downgrade</strong></p><pre><strong>rm /etc/apt/preferences.d/downgrade</strong></pre><p>7. <strong>Reboot your system</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a20be627594e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Ceph] Fix Error rbd error/ rbd/ listing images failed/ (2) No such file or directory (500)]]></title>
            <link>https://medium.com/@sud0/ceph-fix-error-rbd-error-rbd-listing-images-failed-2-no-such-file-or-directory-500-689acecfc844?source=rss-c12bd60a323a------2</link>
            <guid isPermaLink="false">https://medium.com/p/689acecfc844</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[proxmox]]></category>
            <category><![CDATA[ceph]]></category>
            <dc:creator><![CDATA[Adam]]></dc:creator>
            <pubDate>Wed, 08 May 2024 06:50:00 GMT</pubDate>
            <atom:updated>2024-05-08T06:50:00.445Z</atom:updated>
            <content:encoded><![CDATA[<p>This tutorial will guide you how to easily fix this issue</p><p>When we failed to remove VM on proxmox sometimes we will get this issue when accessing ceph pool and we can’t see anything in the pool</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*nhrlp8l1_Cp5uOgCHLYN4g.png" /></figure><p>This issue happen when the removal of the VM not completed or we cancel the removal of the VM and cause the disk or image still exist but can not be validated by the ceph. To fix this issue we can do several command to find out what disk cause this error.</p><p>We can type this command in the proxmox console</p><pre><strong>rbd ls -l [cephpool]  </strong></pre><p>In this example i have pool named vm-host and when i run that command i get this error indicating what disk cause this issue</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GNUnOgqerjWtzx5jZNKhhg.png" /></figure><p>I have error on disk <strong><em>vm-102-disk-1</em> </strong>and we can remove this disk directly to the ceph to fix this error then i run next command</p><pre><strong>rbd rm vm-[id]-disk-[id] -p [cephpool]</strong></pre><p>After i run this command just wait until the removal process finish</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*tfgcaDC4JrYEfAL0el1hkA.png" /></figure><p>When it was finish you can try to access the pool again and voila! your pool can be access normaly</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=689acecfc844" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>