<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yassine Sellami</title>
    <description>The latest articles on DEV Community by Yassine Sellami (@selllami).</description>
    <link>https://dev.to/selllami</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F172652%2Ff8bb8b06-8a01-44fa-9a62-1cd19994eeca.jpeg</url>
      <title>DEV Community: Yassine Sellami</title>
      <link>https://dev.to/selllami</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/selllami"/>
    <language>en</language>
    <item>
      <title>Stop pasting JWTs into random websites</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Fri, 03 Jul 2026 00:30:00 +0000</pubDate>
      <link>https://dev.to/selllami/stop-pasting-jwts-into-random-websites-50f6</link>
      <guid>https://dev.to/selllami/stop-pasting-jwts-into-random-websites-50f6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A JWT isn't just JSON you can inspect. It's a live bearer token. Here's a safer way to decode one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A few days ago I was reviewing a bug with a teammate. They wanted to see what was inside an access token, so they copied it into the first JWT decoder Google returned.&lt;/p&gt;

&lt;p&gt;It wasn't a dummy token.&lt;/p&gt;

&lt;p&gt;It was a production access token with almost an hour left before it expired.&lt;/p&gt;

&lt;p&gt;Nobody was trying to do anything risky—it was just the quickest way to inspect a JWT. That's exactly why this keeps happening.&lt;/p&gt;

&lt;h2&gt;
  
  
  The thing people forget
&lt;/h2&gt;

&lt;p&gt;A JWT looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;header.payload.signature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The payload isn't encrypted. It's just Base64URL-encoded JSON.&lt;/p&gt;

&lt;p&gt;Because of that, people often think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The payload isn't secret, so the token is probably safe to paste."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Those aren't the same thing.&lt;/p&gt;

&lt;p&gt;The payload may be readable, but the &lt;strong&gt;token itself is still your credential&lt;/strong&gt;. Anyone holding it can usually authenticate as you until it expires.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why online decoders make me nervous
&lt;/h2&gt;

&lt;p&gt;Some JWT tools only decode locally in your browser.&lt;/p&gt;

&lt;p&gt;Others offer things like signature verification, claim validation, or key management. Features like those often require talking to a backend, which means the token gets sent somewhere else.&lt;/p&gt;

&lt;p&gt;Maybe the site is trustworthy.&lt;/p&gt;

&lt;p&gt;Maybe it isn't.&lt;/p&gt;

&lt;p&gt;From the UI alone, you usually can't tell.&lt;/p&gt;

&lt;p&gt;Even if a decoder claims everything runs client-side, I don't like assuming that's true when I'm holding a production credential.&lt;/p&gt;

&lt;h2&gt;
  
  
  You don't need a website to inspect a JWT
&lt;/h2&gt;

&lt;p&gt;Most of the time I'm only interested in the payload anyway.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TOKEN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'.'&lt;/span&gt; &lt;span class="nt"&gt;-f2&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;--decode&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | jq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because JWTs use Base64URL encoding, you may need to translate the alphabet and add padding first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;decode_jwt&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;payload&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-f2&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;'_-'&lt;/span&gt; &lt;span class="s1"&gt;'/+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="k"&gt;$((&lt;/span&gt; &lt;span class="k"&gt;${#&lt;/span&gt;&lt;span class="nv"&gt;payload&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="k"&gt;))&lt;/span&gt; &lt;span class="nt"&gt;-ne&lt;/span&gt; 0 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nv"&gt;payload&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;payload&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;="&lt;/span&gt;
  &lt;span class="k"&gt;done

  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$payload&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;--decode&lt;/span&gt; | jq
&lt;span class="o"&gt;}&lt;/span&gt;

decode_jwt &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TOKEN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives you the claims, expiration time, issuer, audience—everything most people open a decoder for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking whether it's expired
&lt;/h2&gt;

&lt;p&gt;Once you've decoded it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;exp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;decode_jwt &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TOKEN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | jq .exp&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;now&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$exp&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-lt&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$now&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"expired"&lt;/span&gt;
&lt;span class="k"&gt;else
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"valid for &lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;exp-now&lt;span class="k"&gt;))&lt;/span&gt;&lt;span class="s2"&gt; seconds"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  If you really want a web UI
&lt;/h2&gt;

&lt;p&gt;Sometimes a terminal isn't the most convenient way to inspect claims.&lt;/p&gt;

&lt;p&gt;I ran into that enough times that I ended up building my own decoder:&lt;br&gt;
&lt;a href="https://astound.tools/dev/jwt/" rel="noopener noreferrer"&gt;https://astound.tools/dev/jwt/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It does everything in the browser—decode the header and payload, inspect claims, show expiration information, and verify signatures locally. No backend required.&lt;/p&gt;

&lt;p&gt;Don't take my word for it, though.&lt;/p&gt;

&lt;p&gt;Open DevTools, switch to the &lt;strong&gt;Network&lt;/strong&gt; tab, paste in a token, and make sure nothing gets sent anywhere. That's the easiest way to verify any JWT tool, including mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Already pasted a real token?
&lt;/h2&gt;

&lt;p&gt;I'd assume it's compromised and rotate it.&lt;/p&gt;

&lt;p&gt;Maybe nothing happened.&lt;/p&gt;

&lt;p&gt;Maybe the site never stored it.&lt;/p&gt;

&lt;p&gt;But access tokens are cheap to replace, and it's not worth gambling over a debugging shortcut.&lt;/p&gt;

&lt;h2&gt;
  
  
  My rule
&lt;/h2&gt;

&lt;p&gt;If a token came from production, it stays on my machine.&lt;/p&gt;

&lt;p&gt;If I need to inspect it, I use the terminal or a tool whose behavior I've verified myself.&lt;/p&gt;

&lt;p&gt;It's one of those habits that takes almost no effort once you start doing it.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>authentication</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Why your monitoring is missing the dumbest outages</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Tue, 30 Jun 2026 22:06:02 +0000</pubDate>
      <link>https://dev.to/selllami/why-your-monitoring-is-missing-the-dumbest-outages-41hi</link>
      <guid>https://dev.to/selllami/why-your-monitoring-is-missing-the-dumbest-outages-41hi</guid>
      <description>&lt;p&gt;An expired cert took down a subdomain on a Saturday with zero alerts. Here is the bash sweep that catches the failures hiding in plain sight.&lt;/p&gt;

&lt;p&gt;A TLS certificate on a random internal subdomain expired on a Saturday. We had great uptime checks on the main app, but nobody thought to monitor the auth subdomain.&lt;/p&gt;

&lt;p&gt;No logs screamed, no exceptions fired, no deploys failed. The certificate just quietly hit its expiration date and stopped being valid. The first alert we got was a frustrated Slack message with a screenshot of Chrome's full page security warning.&lt;/p&gt;

&lt;p&gt;It was a completely stupid outage, which is exactly why it's worth talking about. As an industry we obsess over things that fail loudly. We set up complex alerting for 500s, OOM kills, and pod restarts. Then we completely ignore the infrastructure that fails by simply hitting a deadline.&lt;/p&gt;

&lt;h3&gt;
  
  
  The silent killers
&lt;/h3&gt;

&lt;p&gt;There are three domain level failures that produce exactly zero errors in your application logs until the exact second they break.&lt;/p&gt;

&lt;p&gt;TLS certificate expiry is the most common. Valid one second, hard fail the next. Browsers block the page, APIs reject the handshake, and your app looks like it's down even though the servers are running perfectly.&lt;/p&gt;

&lt;p&gt;Domain registration expiry is the nightmare scenario. The actual domain name lapses, DNS stops resolving entirely, and you get to deal with registrar redemption fees and downtime measured in days instead of minutes.&lt;/p&gt;

&lt;p&gt;DNS misconfiguration is the sneakiest. Maybe a record change didn't propagate, a CNAME is pointing to the wrong place, or a TTL is still serving an old IP address to a chunk of your users.&lt;/p&gt;

&lt;p&gt;You have to go look at the dates and the records yourself. Your app has no idea these things exist.&lt;/p&gt;

&lt;h3&gt;
  
  
  The bash cheatsheet
&lt;/h3&gt;

&lt;p&gt;Most of this uses tools you already have on your machine. I keep these in a scratchpad for whenever I spin up a new service or change a domain config.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does the DNS even resolve?&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig +short A    example.com      &lt;span class="c"&gt;# IPv4&lt;/span&gt;
dig +short AAAA example.com      &lt;span class="c"&gt;# IPv6&lt;/span&gt;
dig +short      example.com NS   &lt;span class="c"&gt;# nameservers&lt;/span&gt;
dig +short      example.com MX   &lt;span class="c"&gt;# mail&lt;/span&gt;
dig +short      example.com TXT  &lt;span class="c"&gt;# SPF / DKIM / verification records&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you just made a change and want to bypass your local cache to see if it propagated, hit a public resolver directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig @1.1.1.1 +short example.com
dig @8.8.8.8 +short example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The TLS check that would have saved my weekend&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; | openssl s_client &lt;span class="nt"&gt;-servername&lt;/span&gt; example.com &lt;span class="nt"&gt;-connect&lt;/span&gt; example.com:443 2&amp;gt;/dev/null &lt;span class="se"&gt;\&lt;/span&gt;
  | openssl x509 &lt;span class="nt"&gt;-noout&lt;/span&gt; &lt;span class="nt"&gt;-dates&lt;/span&gt; &lt;span class="nt"&gt;-subject&lt;/span&gt; &lt;span class="nt"&gt;-issuer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are looking for the &lt;code&gt;notAfter=&lt;/code&gt; date. If you want to get fancy and actually calculate the days left, pipe it through some basic date math:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;exp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; | openssl s_client &lt;span class="nt"&gt;-servername&lt;/span&gt; example.com &lt;span class="nt"&gt;-connect&lt;/span&gt; example.com:443 2&amp;gt;/dev/null &lt;span class="se"&gt;\&lt;/span&gt;
  | openssl x509 &lt;span class="nt"&gt;-noout&lt;/span&gt; &lt;span class="nt"&gt;-enddate&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;-f2&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$exp&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="m"&gt;86400&lt;/span&gt; &lt;span class="k"&gt;))&lt;/span&gt;&lt;span class="s2"&gt; days left"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The WHOIS registration check&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;whois example.com | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-iE&lt;/span&gt; &lt;span class="s1"&gt;'expir|registrar|status'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the Registry Expiry Date and the status codes like &lt;code&gt;clientTransferProhibited&lt;/code&gt;. If this date passes, you lose the domain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Turning one-liners into actual safety
&lt;/h3&gt;

&lt;p&gt;Running these manually finds today's problem. It doesn't prevent next month's problem. &lt;/p&gt;

&lt;p&gt;You really need to take that openssl snippet and wrap it in a basic cron job or set up a check with the &lt;a href="https://github.com/prometheus/blackbox_exporter" rel="noopener noreferrer"&gt;Prometheus blackbox exporter&lt;/a&gt;. Have it ping your Slack channel at 30 days, 14 days, and 7 days out. For the domain registration, just turn on auto-renew at your registrar and put the actual expiration date on your calendar as a fallback.&lt;/p&gt;

&lt;p&gt;Running these three commands manually is fine when you are troubleshooting or spinning something up. But I got tired of juggling terminal tabs and parsing openssl output just to ask a simple question. I ended up building a single page scratchpad that glues this data together so I don't have to run the commands on a Sunday morning. It pulls the WHOIS registration data, DNS records, and SSL cert transparency info into one view at &lt;a href="https://astound.tools/dev/domain-whois/" rel="noopener noreferrer"&gt;astound.tools&lt;/a&gt;. It's strictly for the ad-hoc "is this domain healthy?" check, not a replacement for actual monitoring alerting.&lt;/p&gt;

&lt;p&gt;Outages from expired certs and lapsed domains are the most embarrassing things to explain in a post-mortem because the fix is literally just looking at a calendar. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is on your domain health checklist? I am always looking to add the thing I forgot to check.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>devops</category>
      <category>networking</category>
      <category>security</category>
      <category>systems</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Tue, 29 Jul 2025 20:57:33 +0000</pubDate>
      <link>https://dev.to/selllami/-5191</link>
      <guid>https://dev.to/selllami/-5191</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/selllami/how-to-run-mobaxterm-on-ubuntu-linux-with-wine-ohf" class="crayons-story__hidden-navigation-link"&gt;How To: run MobaXterm on Ubuntu (Linux) with Wine&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/selllami" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F172652%2Ff8bb8b06-8a01-44fa-9a62-1cd19994eeca.jpeg" alt="selllami profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/selllami" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Yassine Sellami
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Yassine Sellami
                
              
              &lt;div id="story-author-preview-content-1183450" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/selllami" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F172652%2Ff8bb8b06-8a01-44fa-9a62-1cd19994eeca.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Yassine Sellami&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/selllami/how-to-run-mobaxterm-on-ubuntu-linux-with-wine-ohf" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Sep 3 '22&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/selllami/how-to-run-mobaxterm-on-ubuntu-linux-with-wine-ohf" id="article-link-1183450"&gt;
          How To: run MobaXterm on Ubuntu (Linux) with Wine
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tutorial"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tutorial&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ubuntu"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ubuntu&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/linux"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;linux&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/howto"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;howto&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/selllami/how-to-run-mobaxterm-on-ubuntu-linux-with-wine-ohf" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;54&lt;span class="hidden s:inline"&gt;&amp;nbsp;reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/selllami/how-to-run-mobaxterm-on-ubuntu-linux-with-wine-ohf#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              2&lt;span class="hidden s:inline"&gt;&amp;nbsp;comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>tutorial</category>
      <category>ubuntu</category>
      <category>linux</category>
      <category>howto</category>
    </item>
    <item>
      <title>Useful: Lombok Annotations</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Thu, 23 Feb 2023 22:13:10 +0000</pubDate>
      <link>https://dev.to/selllami/useful-lombok-annotations-3fh2</link>
      <guid>https://dev.to/selllami/useful-lombok-annotations-3fh2</guid>
      <description>&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Configuration&lt;/li&gt;
&lt;li&gt;@ToString&lt;/li&gt;
&lt;li&gt;@Tolerate&lt;/li&gt;
&lt;li&gt;@StandardException&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;-- Gradle: &lt;code&gt;build.gradle&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-- Maven: &lt;code&gt;pom.xml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  &amp;lt;dependency&amp;gt;
      &amp;lt;groupId&amp;gt;org.projectlombok&amp;lt;/groupId&amp;gt;
      &amp;lt;artifactId&amp;gt;lombok&amp;lt;/artifactId&amp;gt;
      &amp;lt;version&amp;gt;${lombok.version}&amp;lt;/version&amp;gt;
      &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;
  &amp;lt;/dependency&amp;gt;

&amp;lt;plugins&amp;gt;
  &amp;lt;plugin&amp;gt;
     &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
     &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
     &amp;lt;version&amp;gt;3.8.0&amp;lt;/version&amp;gt;
     &amp;lt;configuration&amp;gt;
         &amp;lt;source&amp;gt;11&amp;lt;/source&amp;gt; &amp;lt;!-- depending on your project --&amp;gt;
         &amp;lt;target&amp;gt;11&amp;lt;/target&amp;gt;
         &amp;lt;annotationProcessorPaths&amp;gt;
             &amp;lt;path&amp;gt;
                 &amp;lt;groupId&amp;gt;org.projectlombok&amp;lt;/groupId&amp;gt;
                 &amp;lt;artifactId&amp;gt;lombok&amp;lt;/artifactId&amp;gt;
                 &amp;lt;version&amp;gt;${lombok.version}&amp;lt;/version&amp;gt;
             &amp;lt;/path&amp;gt;
         &amp;lt;/annotationProcessorPaths&amp;gt;
     &amp;lt;/configuration&amp;gt;
   &amp;lt;/plugin&amp;gt;
&amp;lt;/plugins&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  @ToString
&lt;/h2&gt;

&lt;p&gt;Generate an implementation of the toString() method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@ToString(doNotUseGetters = true)
public class Account {
    private String id;
    private String name;
    @ToString.Exclude // Exclusion Field 
    private String adress;

    // ignored getter
    public String getId() {
        return "this is the id:" + id;
    }
}
@ToString(onlyExplicitlyIncluded = true)
public class Account {
    @ToString.Include(name = "accountId") // Modifying Field Names
    private String id;
    @ToString.Include(rank = 1) // Ordering Output
    private String name;
    private String adress;

    @ToString.Include // Method Output
    String description() {
        return "Account description";
    }
} =&amp;gt; Account(name=An account, accountId=12345, description=Account description)


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

&lt;/div&gt;



&lt;h2&gt;
  
  
  @Tolerate
&lt;/h2&gt;

&lt;p&gt;Skip, jump, and forget! Make lombok disregard an existing method or constructor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class TolerateExample {
    @Setter
    private Date date;

    @Tolerate
    public void setDate(String date) {
        this.date = Date.valueOf(date);
    }
}

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  @StandardException
&lt;/h2&gt;

&lt;p&gt;Put this annotation on your own exception types.will generate 4 constructors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;MyException()&lt;/code&gt;: representing no message, and no cause.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MyException(String message)&lt;/code&gt;: the provided message, and no cause.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MyException(Throwable cause)&lt;/code&gt;: which will copy the message from the cause, if there is one, and uses the provided cause.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MyException(String message, Throwable cause)&lt;/code&gt;: A full constructor.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>springboot</category>
      <category>lombok</category>
    </item>
    <item>
      <title>Useful: Abbreviation</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Sat, 24 Dec 2022 23:18:39 +0000</pubDate>
      <link>https://dev.to/selllami/useful-abbreviation-3c76</link>
      <guid>https://dev.to/selllami/useful-abbreviation-3c76</guid>
      <description>&lt;h1&gt;
  
  
  A
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;AD: Active Directory, directory service for Windows domain networks.&lt;/li&gt;
&lt;li&gt;ADFS: Active Directory Federation Services, Federated Identity.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  B
&lt;/h1&gt;

&lt;p&gt;BFF: Backend for Frontend, layer that sits between the clients and the backend.&lt;/p&gt;

&lt;h1&gt;
  
  
  C
&lt;/h1&gt;

&lt;h1&gt;
  
  
  D
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;DHCP: Dynamic Host Configuration Protocol, automatically assigning IP.&lt;/li&gt;
&lt;li&gt;DNS: Domain Name System&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  E
&lt;/h1&gt;

&lt;h1&gt;
  
  
  F
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Firebase: Offers NoSQL &amp;amp; real-time hosting of databases, content, social authentication, notifications.&lt;/li&gt;
&lt;li&gt;FTP:   File Transfer Protocol, transfer files from a server to a client on a computer network.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  G
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;GNU:   GNU's Not Unix&lt;/li&gt;
&lt;li&gt;GSM:   Global System for Mobile Communications&lt;/li&gt;
&lt;li&gt;GPU:   Graphics Processing Unit&lt;/li&gt;
&lt;li&gt;GUI:   Graphical User Interface&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  H
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;HA:    High availability&lt;/li&gt;
&lt;li&gt;HTTP:  Hypertext Transfer Protocol&lt;/li&gt;
&lt;li&gt;HTTPd: Hypertext Transport Protocol Daemon&lt;/li&gt;
&lt;li&gt;HTTPS: HTTP Secure&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  I
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;IPsec: Internet Protocol security&lt;/li&gt;
&lt;li&gt;IPTV:  Internet Protocol Television&lt;/li&gt;
&lt;li&gt;IPv4:  Internet Protocol version 4&lt;/li&gt;
&lt;li&gt;IPv6:  Internet Protocol version 6&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  J
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;J2EE: Java 2 Enterprise Edition&lt;/li&gt;
&lt;li&gt;J2ME: Java 2 Micro Edition&lt;/li&gt;
&lt;li&gt;J2SE: Java 2 Standard Edition&lt;/li&gt;
&lt;li&gt;JAXB: Java Architecture for XML Binding&lt;/li&gt;
&lt;li&gt;JAX-RPC: Java XML for Remote Procedure Calls&lt;/li&gt;
&lt;li&gt;JAXP: Java API for XML Processing&lt;/li&gt;
&lt;li&gt;JCE:  Java Cryptography Extension&lt;/li&gt;
&lt;li&gt;JCP: Java Community Process&lt;/li&gt;
&lt;li&gt;JDBC: Java Database Connectivity&lt;/li&gt;
&lt;li&gt;JDK: Java Development Kit&lt;/li&gt;
&lt;li&gt;JEE: Java Enterprise Edition&lt;/li&gt;
&lt;li&gt;JDS: Java Desktop System&lt;/li&gt;
&lt;li&gt;JFC: Java Foundation Classes&lt;/li&gt;
&lt;li&gt;JFS: IBM Journaling File System&lt;/li&gt;
&lt;li&gt;JIT: Just-In-Time&lt;/li&gt;
&lt;li&gt;JME: Java Micro Edition&lt;/li&gt;
&lt;li&gt;JMX: Java Management Extensions&lt;/li&gt;
&lt;li&gt;JMS: Java Message Service&lt;/li&gt;
&lt;li&gt;JNDI: Java Naming and Directory Interface&lt;/li&gt;
&lt;li&gt;JNI: Java Native Interface&lt;/li&gt;
&lt;li&gt;JNZ: Jump non-zero&lt;/li&gt;
&lt;li&gt;JPEG: Joint Photographic Experts Group&lt;/li&gt;
&lt;li&gt;JRE: Java Runtime Environment&lt;/li&gt;
&lt;li&gt;JS: JavaScript&lt;/li&gt;
&lt;li&gt;JSE: Java Standard Edition&lt;/li&gt;
&lt;li&gt;JSON: JavaScript Object Notation&lt;/li&gt;
&lt;li&gt;JSP: Jackson Structured Programming&lt;/li&gt;
&lt;li&gt;JSP: JavaServer Pages&lt;/li&gt;
&lt;li&gt;JVM: Java Virtual Machine&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  K
&lt;/h1&gt;

&lt;h1&gt;
  
  
  L
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;LDAP:  Lightweight Directory Access Protocol&lt;/li&gt;
&lt;li&gt;LRU: Least Recently Used - organizes items in order of use, allowing you to quickly identify which item hasn't been used for the longest amount of time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  M
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB: NoSQL &amp;amp; cross-platform document-oriented database program&lt;/li&gt;
&lt;li&gt;MySQL: Relational database management system&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  N
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;NFS: Network File System - distributed file system protocol allows a client computer to access files over a network in the same way they would access a local storage file.&lt;/li&gt;
&lt;li&gt;NTP: Network Time Protocol - internet protocol used to synchronize with computer clock time sources in a network&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  O
&lt;/h1&gt;

&lt;h1&gt;
  
  
  P
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;PCI: Peripheral Component Interconnect, standard for connecting hardware devices to a computer's motherboard.&lt;/li&gt;
&lt;li&gt;PHP: Hypertext Preprocessor, server-side scripting language for web development.&lt;/li&gt;
&lt;li&gt;PostgreSQL: Relational database management system&lt;/li&gt;
&lt;li&gt;PWA: Progressive Web App, web applications that offer an app-like experience to users.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Q
&lt;/h1&gt;

&lt;h1&gt;
  
  
  R
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;RAID: Redundant Array of Independent Disks, storage technology that combines multiple disk drives.&lt;/li&gt;
&lt;li&gt;RAM: Random Access Memory, temporary data storage used by the CPU for executing instructions.&lt;/li&gt;
&lt;li&gt;REDIS: Remote Dictionary Server - in-memory data structure store.&lt;/li&gt;
&lt;li&gt;REST: Representational State Transfer, software architectural style for web services.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  S
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;SaaS: Software as a Service&lt;/li&gt;
&lt;li&gt;SAN: Storage Area Network, dedicated network for providing access to consolidated storage.&lt;/li&gt;
&lt;li&gt;SAX: Simple API for XML&lt;/li&gt;
&lt;li&gt;sbin: superuser binary&lt;/li&gt;
&lt;li&gt;SDN: Software-defined networking - is an approach to networking that uses software-based controllers or application programming interfaces (APIs) to communicate with underlying hardware infrastructure and direct traffic on a network.&lt;/li&gt;
&lt;li&gt;SFTP: Simple File Transfer Protocol&lt;/li&gt;
&lt;li&gt;SFTP: SSH File Transfer Protocol&lt;/li&gt;
&lt;li&gt;SHA: Secure Hash Algorithm&lt;/li&gt;
&lt;li&gt;SOAP: Simple Object Access Protocol - XML-based messaging protocol for exchanging information among computer networks.&lt;/li&gt;
&lt;li&gt;SQL: Structured Query Language, language for managing and querying relational databases.&lt;/li&gt;
&lt;li&gt;SSH: Secure Shell, cryptographic network protocol for secure communication.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  T
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;TL;DR: too long; didn't read - used to introduce a summary of an online post or news article.&lt;/li&gt;
&lt;li&gt;TCP/IP: Transmission Control Protocol/Internet Protocol, the suite of communication protocols used on the internet.&lt;/li&gt;
&lt;li&gt;TLS: Transport Layer Security, cryptographic protocol for secure communication over a computer network.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  U
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;UI: User Interface, visual elements and interaction design of a software application.&lt;/li&gt;
&lt;li&gt;URL: Uniform Resource Locator, web address used to locate a resource on the internet.&lt;/li&gt;
&lt;li&gt;UX: User Experience, the overall experience of a user when interacting with a product or system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  V
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;VPN: Virtual Private Network, secure and encrypted network connection over a public network.&lt;/li&gt;
&lt;li&gt;VR: Virtual Reality, computer-generated simulation of a three-dimensional environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  W
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;WAN: Wide Area Network, a network that spans a large geographical area.&lt;/li&gt;
&lt;li&gt;WYSIWYG: What You See Is What You Get, user interface that shows the final output during editing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  X
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;XML: Extensible Markup Language, markup language for encoding documents in a machine-readable format.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Y
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Z
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;ZFS: Zettabyte File System, a combined file system and logical volume manager designed by Sun Microsystems.&lt;/li&gt;
&lt;li&gt;ZIP: Zone Information Protocol, a protocol used to configure and manage Zone Information Database (ZID) entries.&lt;/li&gt;
&lt;li&gt;ZK: ZooKeeper, a centralized service for maintaining configuration information, naming, synchronization, and more.&lt;/li&gt;
&lt;li&gt;ZPL: Z-level Programming Language, a high-level programming language designed for software development on Zilog Z80 microprocessors.&lt;/li&gt;
&lt;li&gt;ZSI: Zolera SOAP Infrastructure, a Python library for creating and parsing SOAP messages.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Useful: Powershell Command</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Thu, 22 Dec 2022 21:40:32 +0000</pubDate>
      <link>https://dev.to/selllami/powershell-useful-command-3l7c</link>
      <guid>https://dev.to/selllami/powershell-useful-command-3l7c</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Helpers
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Get-Help Get-Process   // find command info
Get-Command -Name A* -CommandType cmdlet // find all commands installed

Get-ChildItem -Path "C:\Program Files" // find all folders &amp;amp; sub folders
Get-ChildItem -Path "C:\Program Files\java" -Recurse | Select FullName   // find all files 

Set-Location "C:\Users\usrename\Documents" // change current dir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;OS information
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systeminfo.exe /fo csv | ConvertFrom-Csv
Get-ComputerInfo | Select WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer
winver
(Get-CimInstance Win32_BIOS).SMBIOSBIOSVersion // BIOS Version
(Get-CimInstance Win32_BIOS).SerialNumber      // Serial Number
(Get-CimInstance Win32_ComputerSystem).Model   // Model
Get-CimInstance Win32_Printer | Select-Object Name, PortName, Default   // Printers
(Get-CimInstance Win32_ComputerSystem).Domain  // AD Domain

(Get-CimInstance Win32_OperatingSystem).LastBootUpTime // Time of the Last Reboot

(Get-PSDrive $Env:SystemDrive.Trim(':')).Free/1GB  //Get Free Space for System Drive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;IO
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Copy &amp;amp; Move
Copy-Item "D:\myFolder1" -Destination "D:\myFolder2" -Recurse // Copy-paste files and folders

Move-Item -Path "E:\Folder1" -Destination "E:\Folder2"  // move folder

Remove-Item E:\Folder1\myFile.txt // remove file

---# Content
// Set content 
Set-Content -Path .\myFile.txt -Value 'This is content...'

// Get file content
Get-Content -Path .\myFile.txt
// Get content of all *.log files in the C:\myDir directory 
Get-Content -Path C:\myDir\* -Filter *.log

Get-Content ./myFile.log -Tail 5 –Wait  // follow a File 

Get-Content -Path .\myFile.txt -TotalCount 5  // first 5 lines
(Get-Content -Path .\myFile.txt -TotalCount 25)[-1]  // return the line 25
Get-Item -Path .\myFile.txt | Get-Content -Tail 1  // last line
Get-Content -Path .\myFile.txt -Raw     // get as one string
(Get-Content -Path .\myFile.txt).Count  // Count lines

Clear-Content -Path "E:\myFile.txt" // delete the contents of the file without deleting the file

Get-ChildItem -Directory  // List Subdir in the Current Directory

---# Zip / Unzip
Compress-Archive -Path "C:\myDir\*.log" -DestinationPath "C:\myDir.zip"
Compress-Archive -LiteralPath "C:\myDir\file1.txt","C:\myDir\file2.txt" -DestinationPath "C:\myFiles.zip"

Expand-Archive -LiteralPath "C:\myDir.zip" -DestinationPath "C:\myDir2"


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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Services
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Get-Process            // listing all active system processes
Start-Process notepad  // start process
Get-Service -Name "Win*"  // find services
Get-Service | Where-Object {$_.status -eq "Started"}  // List Started Services 

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Network
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Test &amp;amp; diagnostic
// Sends ICMP echo req, or pings, to one or more computers
Test-Connection -TargetName Server01 -IPv4
Test-Connection -TargetName Server01, Server02, Server12
Test-Connection -TargetName www.google.com -Traceroute  // PowerShell 6.0

// Displays diagnostic info for a connection
Test-NetConnection
Test-NetConnection -Port 80 -InformationLevel "Detailed"   // locally
Test-NetConnection -ComputerName "www.google.com" -InformationLevel "Detailed" // remotly

---# Find &amp;amp; listing
(Invoke-RestMethod ipinfo.io/json).ip // Your Public IP

// find all listening &amp;amp; established connections
netstat -a
Get-NetTCPConnection -State Listen
// Process listening on a TCP 
Get-Process -Id (Get-NetTCPConnection -LocalPort 8080).OwningProcess
// Process listening on a UDP 
Get-Process -Id (Get-NetUDPEndpoint -LocalPort 53).OwningProcess

---# Network information
Get-NetAdapter      // Gets network adapter properties.
Restart-NetAdapter  // Restarts network adapter.
Get-NetIPAddress    // Gets the IP address configuration.
// Gets an IP interface
Get-NetIPInterface
Get-NetIPInterface | Format-Table
// Gets IP route info from IP routing table.
Get-NetRoute       
Get-NetRoute | Format-List -Property *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;HTTP Call
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Invoke-WebRequest -Uri "https://jsonplaceholder.typicode.com/posts" -UseBasicParsing | Select-Object -ExpandProperty 'Content' | ConvertFrom-Json

Invoke-RestMethod "https://jsonplaceholder.typicode.com/posts/1" | Select-Object id,title | Format-List

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;History
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Displays session's history
Get-History
// Path history file
(Get-PSReadlineOption).HistorySavePath  // get
Set-PSReadlineOption –HistorySavePath C:\Temp\NewHistory.txt  // update

---# Add / Append
// Add / import history of a different session
Get-History | Export-Csv c:\Tmp\history.csv -IncludeTypeInformation
Import-Csv c:\Tmp\history.csv | Add-History


---# Delete history
Clear-History
Clear-History -Count 5 -Newest
Remove-Item (Get-PSReadlineOption).HistorySavePath // clear history
Clear-History -CommandLine *Help*, *Syntax  // match criteria
Clear-History -Id 3, 5

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;DNS
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# DNS query resolution
// Performs a DNS query resolution for the specified name
Resolve-DnsName -Name www.google.com
Resolve-DnsName -Name www.google.com -Server 10.0.0.1  // Against DNS server at 10.0.0.1.
Resolve-DnsName -Name www.google.com -Type A   // queries for A type records
Resolve-DnsName -Name www.google.com -DnsOnly  // only DNS, LLMNR &amp;amp; NetBIOS queries are not issued
Resolve-DnsName -Name example.com -Type A -Server localhost -DnssecOk

---#  DNS client cache
// Contents of DNS client cache.
Get-DNSClientCache
Get-DnsClientCache -Entry google.com


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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;NTP (Windows Time service)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;w32tm /stripchart /computer:&amp;lt;SERVER&amp;gt; /dataonly /samples:5 //check
w32tm /query /peers   // listing
w32tm /query /status  // check current ntp config
w32tm /query /configuration   // show config (MUST Admin)

-- Restore config
net stop w32time
w32tm /unregister
w32tm /register
net start w32time

function Test-NTP($ntpserver){
   $pinfo=[System.Diagnostics.ProcessStartInfo]::new("$($env:SystemRoot)\system32\w32tm.exe",@("/stripchart","/computer:$ntpserver","/dataonly","/samples:1"))
   $pinfo.RedirectStandardOutput = $true
   $pinfo.UseShellExecute = $false
   $ntptestproc=[System.Diagnostics.Process]::new()
   $ntptestproc.StartInfo=$pinfo
   $ntptestproc.Start()|Out-Null
   $ntptestproc.WaitForExit()
   return $ntptestproc.StandardOutput.ReadToEnd() -match ",\ (\+|-)0"
}

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;ADFS
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# ADFS Properties
// Get properties
Get-AdfsProperties
Get-AdfsProperties | fl "autocertificaterollover"
Get-AdfsFarmInformation
Get-AdfsSslCertificate
// Set properties
Set-AdfsProperties -AutoCertificateRollover $true       //
Set-ADFSProperties -EnableIdPInitiatedSignonPage:$true  //

---# Http headers
Set-AdfsResponseHeaders -EnableCORS $true    // Enable http CORS header
Set-AdfsResponseHeaders -CORSTrustedOrigins https://,http/..  

---# Theming
Set-AdfsWebTheme -TargetName default -Logo @{path="c:\myTheme\logo.png"}
Set-AdfsGlobalWebContent –CompanyName "My Company"

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Security
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# HotFix
Get-HotFix // Get all hotfixes on the local computer
Get-HotFix -Id KB957095
Get-HotFix -Description Security* -ComputerName SRV1, SRV2 -Credential MyDomain\myUserAdmin //Get hotfixes from multiple computers filtered by a string, with cred myUserAdmin that has permission to access the remote computers and run commands.

// Verify whether a particular update installed:
$SRV = Get-Content -Path ./Servers.txt
$A | ForEach-Object { if (!(Get-HotFix -Id KB957095 -ComputerName $_))
         { Add-Content $_ -Path ./Missing-KB957095.txt }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>React: Micro Frontend using Webpack 5 Module Federation</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Sun, 02 Oct 2022 23:44:02 +0000</pubDate>
      <link>https://dev.to/selllami/react-micro-frontend-using-webpack-5-module-federation-5ca</link>
      <guid>https://dev.to/selllami/react-micro-frontend-using-webpack-5-module-federation-5ca</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;In progress  !!!!!!!!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Init projects
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir /opt/mfe
cd /opt/mfe

# create dashboard app
npx create-react-app dashboard-app --template typescript
# create profile app
npx create-react-app profile-app --template typescript
# create host app
npx create-react-app container --template typescript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install dependencies
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Add mui
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @mui/material @emotion/react @emotion/styled
npm install @fontsource/roboto
npm install @mui/icons-material
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Add MFE dep
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save-dev webpack webpack-cli webpack-merge 
html-webpack-plugin webpack-dev-server 

npm install --save-dev @babel/core @babel/eslint-parser @babel/plugin-transform-runtime @babel/preset-env @babel/preset-react  @babel/preset-typescript @babel/runtime babel-loader css-loader postcss postcss-loader style-loader
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Config
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;index.tsx&lt;/code&gt; with &lt;code&gt;bootstrap.tsx&lt;/code&gt;:&lt;/li&gt;
&lt;li&gt;create file &lt;code&gt;./src/index.ts&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createBrowserHistory, Update } from 'history';

import('./bootstrap').then(({ mount }) =&amp;gt; {
  const localRoot = document.getElementById('dashboardApp-local');
  const browserHistory = createBrowserHistory();

  mount({
    mountPoint: localRoot!,
    historyStrategy: browserHistory,
  });
});

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

&lt;/div&gt;



&lt;p&gt;Add file &lt;code&gt;.babelrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi .babelrc
----
{
  "presets": [
    "@babel/preset-typescript",
    "@babel/preset-react",
    "@babel/preset-env"
  ],
  "plugins": [["@babel/transform-runtime"]]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add file &lt;code&gt;webpack.config.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi webpack.config.js
----
const HtmlWebPackPlugin = require('html-webpack-plugin');
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');

const deps = require('./package.json').dependencies;
module.exports = {
  output: {
    publicPath: 'http://localhost:8081/',
  },

  resolve: {
    extensions: ['.tsx', '.ts', '.jsx', '.js', '.json'],
  },

  devServer: {
    port: 8081,
    historyApiFallback: true,
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
  },

  module: {
    rules: [
      {
        test: /\.m?js/,
        type: 'javascript/auto',
        resolve: {
          fullySpecified: false,
        },
      },
      {
        test: /\.(css|s[ac]ss)$/i,
        use: ['style-loader', 'css-loader', 'postcss-loader'],
      },
      {
        test: /\.(ts|tsx|js|jsx)$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
        },
      },
    ],
  },

  plugins: [
    new ModuleFederationPlugin({
      name: 'dashboard-app',
      filename: 'remoteEntry.js',
      remotes: {},
      exposes: {
        './DashboardAppIndex': './src/bootstrap',
      },
      shared: {
        ...deps,
        react: {
          singleton: true,
          requiredVersion: deps.react,
        },
        'react-dom': {
          singleton: true,
          requiredVersion: deps['react-dom'],
        },
      },
    }),
    new HtmlWebPackPlugin({
      template: './src/index.html',
    }),
  ],
};

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Replace run script:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "build": "webpack --mode production",
    "build:dev": "webpack --mode development",
    "build:start": "cd dist &amp;amp;&amp;amp; PORT=8082 npx serve",
    "start": "webpack serve --open --mode development",
    "start:live": "webpack serve --open --mode development --live-reload --hot"
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Webpack config for container:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const HtmlWebPackPlugin = require('html-webpack-plugin');
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');

const deps = require('./package.json').dependencies;
module.exports = {
  output: {
    publicPath: 'http://localhost:8080/',
  },

  resolve: {
    extensions: ['.tsx', '.ts', '.jsx', '.js', '.json'],
  },

  devServer: {
    port: 8080,
    historyApiFallback: true,
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
  },

  module: {
    rules: [
      {
        test: /\.m?js/,
        type: 'javascript/auto',
        resolve: {
          fullySpecified: false,
        },
      },
      {
        test: /\.(css|s[ac]ss)$/i,
        use: ['style-loader', 'css-loader', 'postcss-loader'],
      },
      {
        test: /\.(ts|tsx|js|jsx)$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
        },
      },
    ],
  },

  plugins: [
    new ModuleFederationPlugin({
      name: 'container',
      filename: 'remoteEntry.js',
      remotes: {
        dashboardApp: 'dashboardApp@http://localhost:8081/remoteEntry.js',
        profileApp: 'profileApp@http://localhost:8082/remoteEntry.js',
      },
      exposes: {},
      shared: {
        ...deps,
        react: {
          singleton: true,
          requiredVersion: deps.react,
        },
        'react-dom': {
          singleton: true,
          requiredVersion: deps['react-dom'],
        },
      },
    }),
    new HtmlWebPackPlugin({
      template: './src/index.html',
    }),
  ],
};

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How To: generate CSR, Self-signed and CA certificat</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Tue, 27 Sep 2022 22:52:56 +0000</pubDate>
      <link>https://dev.to/selllami/how-to-generate-csr-self-signed-and-ca-certificat-j59</link>
      <guid>https://dev.to/selllami/how-to-generate-csr-self-signed-and-ca-certificat-j59</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Please make sure you have &lt;code&gt;openssl&lt;/code&gt; installed on your machine, or:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ubuntu: apt-get install openssl
Redhat: yum install -y  openssl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  CSR (Certificate Signing Request)
&lt;/h2&gt;

&lt;p&gt;Before you can order an SSL certificate, it is recommended that you generate a CSR from your server.&lt;/p&gt;

&lt;p&gt;To avoid the repetition of openssl cli for each domain, The below script allow you to generate CSR and Key with only pass the domain name as an agr:&lt;/p&gt;

&lt;p&gt;This script w'll generate two files: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.csr&lt;/code&gt; : TO be sent to CertProvider for purchase your SSL certificate.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.key&lt;/code&gt; : Private key used by the server to encrypt and package data for verification by clients.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vi csr-key-generator.sh
---
#!/usr/bin/env bash
DOMAIN=$1
if [ -z "$1" ]; then 
    echo "USAGE: $0 domain.com"
    exit
fi

# CSR Attributs, there is a possibility for CertProvider can change information(company, locality..) before issue the certificate.

SUBJ="
C=MA
ST=ST
O=My Company
localityName=City
commonName=$DOMAIN
organizationalUnitName=IT
emailAddress=admin@domain.com
"

# Generate CSR &amp;amp; Private Key
openssl genrsa -out "$DOMAIN.key" 2048
openssl req -new -subj "$(echo -n "$SUBJ" | tr "\n" "/")" -key "$DOMAIN.key" -out "$DOMAIN.csr"

echo "done! enjoy"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Add execution ability to the shell file, and run it:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ chmod +x csr-key-generator.sh
$ ./csr-key-generator.sh domain.com
output: done! enjoy
$ ls
domain.com.csr domain.com.key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  CA (certificate authority)
&lt;/h2&gt;

&lt;p&gt;CA is an entity responsible for issuing digital certificates to verify identities on the internet.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ openssl req -x509 -sha256 -days 356 -nodes  
    \ -newkey rsa:2048 
    \ -subj "/CN=root.com/C=MA/L=Locality"
    \ -keyout rootCA.key -out rootCA.crt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Self-signed certificate
&lt;/h2&gt;

&lt;p&gt;To-way:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Use previous CSR,Key: 

$ openssl x509 -req -days 365 -in domain.com.csr 
  \ -signkey domain.com.key -out domain.com.crt

[OR]
## Use previous CA:

$ vi extCert.conf
--- 
subjectAltName = DNS:*.domain.com

$ openssl x509 -req -in domain.com.csr 
  \ -CA rootCA.crt -CAkey rootCA.key -CAcreateserial
  \ -out demo.domain.com.crt -days 365 -sha256 
  \ -extfile extCert.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Review the certificate&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ openssl x509 -in domain.com.crt -text -noout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/selllami" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s4O0m1R4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--u-mTaefG--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/172652/f8bb8b06-8a01-44fa-9a62-1cd19994eeca.jpeg" alt="selllami"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/selllami/rhel-ubuntu-useful-command-433f" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Useful: RHEL / Ubuntu Command&lt;/h2&gt;
      &lt;h3&gt;Yassine Sellami ・ Sep 3 '22 ・ 5 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#systems&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cloud&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#linux&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



</description>
      <category>security</category>
      <category>certificat</category>
      <category>ssl</category>
      <category>tls</category>
    </item>
    <item>
      <title>Useful: VirtualBox helpers / Command</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Wed, 14 Sep 2022 22:35:35 +0000</pubDate>
      <link>https://dev.to/selllami/virtualbox-helpers-55mh</link>
      <guid>https://dev.to/selllami/virtualbox-helpers-55mh</guid>
      <description>&lt;ul&gt;
&lt;li&gt;VMs
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VBoxManage list vms  // List all the virtual machines
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Network
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Port Forwarding
// if vm is powered
VBoxManage controlvm "MyVmName" natpf1 "guestSsh,tcp,,2222,,22"
// if vm is shutdown
VBoxManage modifyvm "MyVmName" --natpf1 "guestssh,tcp,,2222,,22"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Nested Virtualization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92j302ya0jqxveznwwj9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92j302ya0jqxveznwwj9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you can't change it from the interface, run the following cmd:&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VBoxManage modifyvm &amp;lt;VMName&amp;gt; --nested-hw-virt on
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

</description>
      <category>virtualbox</category>
      <category>vm</category>
      <category>linux</category>
    </item>
    <item>
      <title>Fast Way: How To Install Docker and Docker Compose on Linux</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Wed, 14 Sep 2022 21:51:28 +0000</pubDate>
      <link>https://dev.to/selllami/faster-how-to-install-docker-and-docker-compose-on-linux-4hk3</link>
      <guid>https://dev.to/selllami/faster-how-to-install-docker-and-docker-compose-on-linux-4hk3</guid>
      <description>&lt;h2&gt;
  
  
  Docker
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- update packages: 
sudo apt update

-- install prerequisite packages:
sudo apt install apt-transport-https ca-certificates curl software-properties-common

-- Add GPG key: 
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

-- Add the Docker repository to APT sources:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null

-- Update packages again:
sudo apt update

-- Check Docker repo:
apt-cache policy docker-ce

-- install Docker
sudo apt install docker-ce

-- Check that it’s running:
sudo systemctl status docker

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

&lt;/div&gt;



&lt;p&gt;Or, All in one :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Docker Compose
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Download docker compose v2.11.0
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.11.0/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose

-- Permissions to docker compose:
chmod +x ~/.docker/cli-plugins/docker-compose

-- Verify the installation
docker compose version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or newer project from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install docker-compose-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- If you prefer the old style, create an alias: 
alias docker-compose='docker compose'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>docker</category>
      <category>linux</category>
      <category>dockercompose</category>
    </item>
    <item>
      <title>How To: run MobaXterm on Ubuntu (Linux) with Wine</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Sat, 03 Sep 2022 23:39:22 +0000</pubDate>
      <link>https://dev.to/selllami/how-to-run-mobaxterm-on-ubuntu-linux-with-wine-ohf</link>
      <guid>https://dev.to/selllami/how-to-run-mobaxterm-on-ubuntu-linux-with-wine-ohf</guid>
      <description>&lt;h2&gt;
  
  
  What is WIne?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.winehq.org/" rel="noopener noreferrer"&gt;Wine&lt;/a&gt;&lt;/strong&gt; (originally an acronym for &lt;code&gt;Wine Is Not an Emulator&lt;/code&gt;) is a compatibility layer capable of running Windows applications on several POSIX-compliant operating systems, such as Linux, Mac OSX, &amp;amp; BSD. &lt;br&gt;
Instead of simulating internal Windows logic like a virtual machine or emulator, Wine translates Windows API calls into POSIX calls on-the-fly, eliminating the performance and memory penalties of other methods and allowing you to cleanly integrate Windows applications into your desktop.&lt;/p&gt;
&lt;h2&gt;
  
  
  WIne Instalation:
&lt;/h2&gt;

&lt;p&gt;1 - WIne: download &amp;amp; Install&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable 32 bit architecture (If your system is 64 bit):
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dpkg --add-architecture i386
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Download and add the repository key:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo wget -nc -O /usr/share/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Add the repository according to the codename of your version of Ubuntu
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Update &amp;amp; Install package: chose winehq-devel | winehq-stable
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install --install-recommends winehq-stable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Wine Configuration:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;winecfg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  MobaXtrem
&lt;/h2&gt;

&lt;p&gt;2 - MobaXterm: Downloadn and Install&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download the new MobaXterm features at: &lt;a href="https://mobaxterm.mobatek.net/preview.html" rel="noopener noreferrer"&gt;Preview version&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unzip the MobaXterm package  using the &lt;code&gt;unzip&lt;/code&gt; command&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open a terminal, cd to the directory where you unzipped MobaXterm program and type:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wine MobaXterm_Personal_22.2_Preview2.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqvb0fi1t0ir4pzf55kd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqvb0fi1t0ir4pzf55kd.png" alt="MobaXterm on ubuntu" width="800" height="518"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3 - Add Application Shortcuts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download MobaXtrem icon and save it on MobaXtrem folder with name icon.jpg&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create file .desktop&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /usr/share/applications (Global) 
or
cd ~/.local/share/applications/ (Local)
vi mobaXtrem.desktop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;and past the content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Desktop Entry]
Name=MobaXtrem 
Exec=env WINEPREFIX="/home/ysellami/.wine" wine /home/ysellami/path/to/MobaXterm/MobaXterm_Personal_22.2_Preview2.exe
Type=Application
Icon=/home/ysellami/path/to/MobaXterm/icon.jpg
StartupNotify=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Enjoy, now u can search Mobaxtrem and run it or add it in dockBar favorit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fli14t1iis0p81647la9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fli14t1iis0p81647la9f.png" alt="Image description" width="141" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>ubuntu</category>
      <category>linux</category>
      <category>howto</category>
    </item>
    <item>
      <title>Useful: RHEL / Ubuntu Command</title>
      <dc:creator>Yassine Sellami</dc:creator>
      <pubDate>Sat, 03 Sep 2022 22:21:06 +0000</pubDate>
      <link>https://dev.to/selllami/rhel-ubuntu-useful-command-433f</link>
      <guid>https://dev.to/selllami/rhel-ubuntu-useful-command-433f</guid>
      <description>&lt;h2&gt;
  
  
  == [ All Distributions ] ==
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Find Linux Standard Base (LSB) information
lsb_release -a

-- Check if virtualization is supported on Linux,The output must be not empty:
grep -E --color 'vmx|svm' /proc/cpuinfo

--# Archive management
zip -r -T files folder
unzip files.zip
unzip files.zip -d /path/to/extract/ 

--# env variables
export HTTP_PROXY=http://proxy_ip_name:port
vi ~/.bashrc =then&amp;gt; add export line =then run&amp;gt; source ~/.bachrc
unset HTTP_PROXY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Content Managment
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch test-{1..50}.bak // create 50 empty file
ls -t *.bak | tail | xargs rm   // delete oldest backup


---# Find 

find / -iname "*foo*txt" 2&amp;gt;/dev/null  # Find by approximate name
find ~/Documents -ls   # Find everything
find ~ -type f         # Find by type f:file,d:dir
find ~/opt/ -maxdepth 1 -type d  # Limit listing
find ~ -type f -empty  # Find empty files
# Find by content
find ~/Documents/ -name "*log" -exec grep -Hi text-to-search {} \;
# Find files by age
- finds log files that haven't been modified in a month or more:
find /var/log -iname "*~" -o -iname "*log*" -mtime +30
- find log files modified within the past week:
find /var/log -iname "*~" -o -iname "*log*" -mtime -7
find /var/log -iname "*~" -o -iname "*log*" -mtime -7 -ls
# Search a path
find / -type d -name 'img' -ipath "*public_html/example.com*" 2&amp;gt;/dev/null

---# Find &amp;amp; delete 
find . -name ".DS_Store" -type f -delete

---# Grep 
grep -R 'import' --include='*.java' --color MySourceCodeDir


---# SED
sed -i 's#ORIGINAL_VALLUE#NEW_VALUE#g' myfile1 myfile2

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  == [ Redhat ] ==
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sys information
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Redhat sys information
cat /etc/redhat-release


---# Memory
top -o %MEM -c  # Mem by runing commands, press [e] switch memory unit, [?] details
watch -n 5 -d '/bin/free -m' # repeats cmd every 5s

# htop
yum install htop
htop

---# CPU
ps -aux  # proccess with PID

---# Disk
# Display disk partition sizes
lsblk --json | jq -c '.blockdevices[]|[.name,.size]'
# Display the size of an installed RPM
rpm --queryformat='%12{SIZE} %{NAME}\n' \
   -q java-11-openjdk-headless

---# yum
yum install yum-security
// search
yum search &amp;lt;package&amp;gt;
yum info &amp;lt;package&amp;gt;
yum -v list &amp;lt;package&amp;gt; --show-duplicates
// update
yum update
yum -y update --security //apply all security update
yum -y update-minimal --security
yum update --cve &amp;lt;CVE&amp;gt;
yum updateinfo list
yum updateinfo list cves

// clean
yum clean all
yum clean metadata
// yum repo
ls /etc/yum.repos.d/

---# Configuring Booleans
setsebool &amp;lt;boolean_name&amp;gt; on|off
getsebool httpd_can_network_connect        // Get
setsebool -P httpd_can_network_connect on  // -P: changes persistent across reboots 
setsebool -P mysql_connect_any on

---# Date &amp;amp; Time
timedatectl  // Displaying Current Date &amp;amp; Time

// change system time 
timedatectl set-time 20:52:40
timedatectl set-time "2017-06-02 23:26:00"
// time zones
timedatectl list-timezones // listing all time zone
timedatectl set-timezone "Europe/Berlin"
// Sync clock with a Remote Server
timedatectl set-ntp yes  // NTP service must be installed
systemctl restart systemd-timedated.service  // restart

---# chronyd
yum install chrony
systemctl start|status|... chronyd
vi /etc/chrony.conf  // config file
chronyc tracking     // check chrony tracking,
chronyc sources -v   // info about current time sources
chronyc sourcestats  // info about drift rate and offset estimation process for each of the sources currently being examined by chronyd.
check firewall: //123 = NTP Port
firewall-cmd --permanent --zone=public --add-port=123/udp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Alias
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias   // listing
alias search=grep  // create new alias
// Creating Permanent Aliases
vi ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc
unalias alias_name // remove alias
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Journal &amp;amp; Audit
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--# Journal CTL 
journalctl -f   #Follow like tail -f
journalctl -k   #View kernel messages from current boot
journalctl -u jenkins.service -f
journalctl _PID=[numPid]
journalctl -p [err|info..]
journalctl --since "2022-10-10 16:00:00"
journalctl --since "2022-10-10 16:00:00" --until "2022-10-10 20:00:00"

journalctl --no-pager --since today \
      --grep 'fail|error|fatal' --output json|jq '._EXE' | \
      sort | uniq -c | sort --numeric --reverse --key 1


-- config
vi /etc/systemd/journald.conf

--# RHEL Audit 
yum install audit
service auditd start
-- config
vi /etc/audit/auditd.conf
-- reporting
aureport --start 04/04/2022 00:00:00 --end 04/06/2022 00:00:00

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Java
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum install java-11-openjdk
java -version
update-alternatives --config 'java'

---# Process
jps -v
ps -aux | grep java 

---# capture heap dump Manually
jmap dump:live,format=b,file=/opt/dump.hprof &amp;lt;PID&amp;gt;
jcmd &amp;lt;PID&amp;gt; GC.heap_dump /opt/dump.hprof
jcmd &amp;lt;PID&amp;gt; Thread.print
kill -3 &amp;lt;PID&amp;gt; # useful when you use containerized
jstack &amp;lt;PID&amp;gt; &amp;gt; /opt/my-app.tdump  # Save analysis result to file

---# capture heap dump Automatically
java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=&amp;lt;file-or-dir-path&amp;gt;


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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Firewalld
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum install firewalld -y
systemctl enable firewalld
systemctl start firewalld
systemctl status firewalld
chkconfig firewalld on

---# help
man firewalld

---# Allow/Deny
firewall-cmd --zone public --permanent --add-port 7000-9000/tcp 

- allow or deny a port
firewall-cmd --add-port=12345/tcp --permanent
firewall-cmd --remove-port=8080/tcp --permanent
- allow or deny a protocol
firewall-cmd --add-protocol=smb2 --permanent
firewall-cmd --remove-protocol=smb --permanent
- allow or deny a service
firewall-cmd --get-services
firewall-cmd --add-service=smtp --permanent
firewall-cmd --remove-service=smtp --permanent

Each service has an XML file located at /usr/lib/firewalld/services which contains the port and protocol being used by the service. 
For example, the ssh.xml file is using port 22 and the TCP protocol.
    &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
    &amp;lt;service&amp;gt;
    &amp;lt;short&amp;gt;SSH&amp;lt;/short&amp;gt;
    &amp;lt;port protocol="tcp" port="22"/&amp;gt;
    &amp;lt;/service&amp;gt;

firewall-cmd --zone public --list-services

---# Zones: Each zone has its own unique set of rules. For example, public zone can be bound to eth0 and only allow HTTP, and internal zone can be bound to eth1 and allow both HTTP and SSH.
firewall-cmd --get-active-zones
firewall-cmd --list-all-zones
firewall-cmd --list-all --zone=internal
firewall-cmd --list-all --zone=public
firewall-cmd --set-default-zone=dmz
or 
vi /etc/firewalld/firewalld.conf
DefaultZone=dmz

---# IP address masquerade
firewall-cmd --add-masquerade --permanent
firewall-cmd --remove-masquerade --permanent
firewall-cmd --zone public --query-masquerade

---# port forward: 
   firewall-cmd --zone=external --add-forward-port=port=22:proto=tcp:toport=12345 --permanent
  The SSH service listening on port 12345 is on the same server as the SSH service with port 22.

  firewall-cmd --zone=external --add-forward-port=port=22:proto=tcp:toport=10.1.2.3:12345 --permanent
    To forward request to another server, add the target IP address.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;history
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;history       // get all history
history -c    // clean up
history -d 4  // remove by id 4
for i in {1..10}; do history -d 40; done  // remove 40 - 50
HISTSIZE=50   // change history size
set +o history  // disable history for current shell
set -o | grep history   // check if enabled/disabled
set -o history  // enable
// disable permanently
echo 'set +o history' &amp;gt;&amp;gt; ~/.bashrc &amp;amp; sh ~/.bashrc
echo 'unset HISTFILE' &amp;gt;&amp;gt; /etc/profile.d/nohistory.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;SSL, TLS &amp;amp; Certification
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Export the private key:
openssl pkcs12 -in certfile.pfx -nocerts -out key.pem -nodes
-- Export the certificate: 
openssl pkcs12 -in certfile.pfx -nokeys -out cert.pem
-- Remove passphrase from key: 
openssl rsa -in key.pem -out server.key 

-- save server cert
openssl s_client -connect my.domain.com:443 -servername my.doamin.com | tee logCertificatFile
-- locking for the issuer
openssl x509 -in logCertificatFile -noout -text | grep -i "issuer"
curl --output myCertificat.crt urlOfissuer
openssl x509 -inform DER -in myCertificat.crt -out myCertificat.pem -text
set NODE_EXTRA_CA_CERTS="myCertificat.pem"  // ex: for nodeJs env

trust list
trust anchor path/to/certificate.crt
trust anchor --remove path/to/certificate.crt
trust anchor --remove "pkcs..."

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;User &amp;amp; group Management
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Add user
useradd myusername 
useradd -r myusername //has some root privileges, but not all, UID &amp;lt; UID_MIN 
useradd -c "My UserName" -d /home/my_dir myusername 
useradd -m -k /dir_default myusername //copies contents /dir_default to /home/myusername
useradd -e 2022-12-15 myusername //automatically disabled on 2022-12-15

usermod -l "new-login" myusername

---# Set password
passwd myusername 
passwd -l myusername // lock 
passwd -u myusername // unlock 
passwd -e myusername // change password during the next login 
passwd -n 10 -x 60 -w 3 myusername // set password lifetime 
passwd -S myusername // short info for password status 

---# Get User iformation
lslogins myusername  // display detailed info

---# Delete user
userdel myusername
userdel -r myusername // remove file /home/myusername 

---# add user to group
useradd -G my_group myusername 
usermod -g my_group myusername

---# Create group
groupadd my_group // add group
groupdel my_roup  // delete group
getent group      // group listing

---# All user
cat /etc/passwd

---# User cmd default cofig
cat /etc/login.defs
  PASS_MAX_DAYS 99999
  PASS_MIN_DAYS 0
  PASS_MIN_LEN  5
  PASS_WARN_AGE 7
  CREATE_HOME   yes
  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Permission
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chown -R username:group /path/to/folder
chown -R $USER /path/to/folder // curent user

---# Access Control Lists
Types of ACLs:  
  Access ACLs : list for a specific file or directory.  
  Default ACLs. can only be associated with a directory.

yum install acl
[setfacl -m rules files]
-m: add or modify
u:uid:rwx =&amp;gt; user
g:gid:rwx =&amp;gt; group
m:rwx =&amp;gt; rights mask, union of all permissions.
o:rwx =&amp;gt; users other than the ones in the group for the file.
rwx-X =&amp;gt; read,write,execut,- = abdent, X = execut only folders
// helps
man setfacl

setfacl -d -m group:developer:rx /var/log
setfacl -d -m group:developer:rwx /home

// Deny access to the developer group
setfacl -m group:developer:--- /root

// remove permission
setfacl -x u:myusername /path/to/folder

// get acl for folder
getfacl /path/to/file.png

// Changing the default umask for a specific user
echo 'umask octal_value' &amp;gt;&amp;gt; /home/username/.bashrc
more: [check](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_basic_system_settings/index)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Network
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# ifconfig
yum install net-tools
ifconfig

---# Ip
ip addr

---# Check open ports, 3 way
sudo lsof -i tcp
netstat -tulpn 
sudo ss -lt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;CURL
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://amazon.com -v   // verbose
curl https://amazon.com -k  // Ignore certificat
curl https://amazon.com --noproxy '*'
curl https://amazon.com -x 'http://proxy-ip-name:port'
curl telnet://localhost:80 -v // check connected status + (ctr+c)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;SSHD
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Generating Key Pairs
su myuser
ssh-keygen -t rsa
chmod 700 ~/.ssh
cat ~/.ssh/id_rsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
!!! Never share your private key with anybody !!!


---# ssh configuration
vi /etc/ssh/sshd_config
PubkeyAuthentication yes    // enable auth with public key
#Banner none                // disable banner message

---# sshd daemon
service sshd restart OR systemctl restart sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Nginx
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Display top 10IP addresses hitting webserver
cat /var/log/nginx/access.log | cut -f 1 -d ' ' | sort | \
uniq -c | sort -hr | head -n 10

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  == [ Ubuntu ] ==
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sys information
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# Find which WM_CLASS your window has,used as value in StartupWMClass on .desktop files to ignore duplication
xprop WM_CLASS

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Soft management
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---# How to execute .bin .run file
chmod +x my_ide.run
./my_ide.run

---# add application icon to menu (dockbar)
cd /usr/share/applications (Global) 
cd ~/.local/share/applications/ (Local)
vi my_app.desktop
......
[Desktop Entry]
Comment=LiferayStudio
Terminal=false
Name=Liferay DXP Studio
Encoding=UTF-8
Exec='/opt/tools/liferay-developer-studio/DeveloperStudio'
Type=Application
Icon=/opt/tools/liferay-developer-studio/icon.xpm
StartupWMClass=LiferayDeveloper
......

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;User management:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- Get a List of All Users
less /etc/passwd
-- Add user to group
sudo usermod -aG [GROUP] [USER]
ex: sudo usermod -aG docker ${USER} =&amp;gt; add your user to docker group
-- Login to specific user 
su - [USER]

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;User Interface (UI/UX)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Minimize &amp;amp; Maximize buttons in Gnome
Separation by `:`
Left:
gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:"
Right: ":minimize,maximize,close"
Mix: "close:minimize,maximize"

## Disable task switcher grouping 
1- Open (dconf-editor)[apt://dconf-editor]
2- Go to org/gnome/desktop/wm/keybindings
3- Move the value 'Tab' from switch-applications to switch-windows : 
set switch-windows = ['&amp;lt;Alt&amp;gt;Tab']

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

&lt;/div&gt;



</description>
      <category>systems</category>
      <category>cloud</category>
      <category>devops</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
