<?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 AmirHossein Goodarzi on Medium]]></title>
        <description><![CDATA[Stories by AmirHossein Goodarzi on Medium]]></description>
        <link>https://medium.com/@agoodarzi?source=rss-f3ba4943b10e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tkYvrIhDBOGjgR4omXyGdg.jpeg</url>
            <title>Stories by AmirHossein Goodarzi on Medium</title>
            <link>https://medium.com/@agoodarzi?source=rss-f3ba4943b10e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 08:43:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@agoodarzi/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[Your very own resume on git]]></title>
            <link>https://medium.com/@agoodarzi/your-very-own-resume-on-git-275a98cf61c3?source=rss-f3ba4943b10e------2</link>
            <guid isPermaLink="false">https://medium.com/p/275a98cf61c3</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[html2pdf]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[resume]]></category>
            <dc:creator><![CDATA[AmirHossein Goodarzi]]></dc:creator>
            <pubDate>Sat, 08 Aug 2020 23:25:20 GMT</pubDate>
            <atom:updated>2020-08-22T08:57:19.703Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<h3>Your very own resume on Git using JSON Resume</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rwwwLF4stXBHd1KBtLlv6w.png" /><figcaption>Gitlab-CI + Jsonresume</figcaption></figure><h3>TL;DR</h3><p>Check the <a href="https://gitlab.com/Numb95/resume">repo</a> of the project and take a look at the <strong>.gitlab-ci.yml</strong> file, <strong>Dockerfile</strong>, and <strong>resume.json</strong> file. That’s it.</p><h3>Introduction</h3><p>Automating things makes us satisfied. From automation of reducing or increasing the temperature of a heater to publishing your resume :D.</p><p>It’s very important to have an updated version of the resume, but keeping the editable document is more important. Some folks use traditional ways like having an <em>MS word</em> document, but versioning it and the risk of losing the data is always behind you. for many years I use <em>Latex</em> and <em>Travis-ci</em> to published my Resume and using git for keeping the data and it’s history. You can check that <a href="https://github.com/numb95/resume">Github repo</a></p><p>For me That’s ok but there are lots of pains. It works fine but editing and adding a section in <em>Latex</em> kills you. Also, <em>Travis-ci</em> for the opensource projects is damn slow. So I decided to completely change the stack.</p><p>As a DevOps engineer, I use GitLab-ci. It’s easy to use, easy to maintain, and easy to set up.</p><p>I was looking for a tool which I can edit and publish it easily, Also, It should be more human-readable. Something like JSON or YAML and not the Latex. I found <a href="https://jsonresume.org/"><strong>Jsonresume</strong></a>. A great tool that makes a JSON document to a beautiful PDF/HTML resume. In this article, we are going to get our resume done using <em>Jsonresume</em>, <em>Gitlab-ci</em>, <em>GitLab pages</em>, and some tricks on <em>Docker</em>.</p><h3>Initializing</h3><p>First, we need to install “<strong><em>resume-cli</em></strong>” tool. You need to install <strong><em>npm</em></strong> and <strong><em>node</em></strong>. Search through google or Duckduckgo for the instruction of installing them. Install “<strong><em>resume-cli” </em></strong>using:</p><pre>npm install -g resume-cli</pre><p>Create a directory for storing your resume stuffs .like this:</p><pre>mkdir ~/resume</pre><p>This step is necessary because we need to run this command to initialize our resume.json file.</p><pre>resume init</pre><p>You can also use a docker container to skip installing <em>npm</em> and <em>node</em>.</p><pre>docker run -it  --user root--workdir /home/pptruser -v $(pwd):/home/pptruser numb95/resume-cli:latest resume init</pre><p>Then, Enter your name and Email address. Note that you can mask your email address for preventing spammer to find that. (e.g mail [AT] domain dot com.</p><p>Remember this file was created as the <em>root </em>user. so you need to do:</p><pre>sudo chown -R $USER:$USER resume.json</pre><p>Now open the <em>resume.json</em> and fill the file with your contact information, your skills, your social networks, and your job experiences.</p><blockquote>Please note that if you are using docker method, change the permission of resume.json file.</blockquote><p>Now everything is fine, So we can jump to the CI section</p><h3>Setup CI</h3><p>Before the start, I should mention that I created a docker image for resume-cli with most of the official themes. If you are looking for more themes take a look at <a href="https://www.npmjs.com/search?q=jsonresume-theme-*">this</a>.</p><p>need to install them? add a line to the script section and install them. e.g:</p><pre>script:<br>    - npm install  jsonresume-theme-mytheme</pre><p>You can check the <a href="https://gitlab.com/Numb95/resume/-/blob/master/Dockerfile.resume-cli"><strong>Dockerfile</strong></a> of it here.</p><p>Create a file called .gitlab-ci.yml. Paste this into that file. We will talk about all the parameters.</p><h4>Setup Pages</h4><p>First, We need to explain the “Pages” section, then, we move to generate PDF. Check out this section. We will describe all the stages and lines of it.</p><pre>pages:<br>  image: registry.gitlab.com/numb95/resume:latest<br>  stage: deploy<br>  script:<br>    - mkdir public<br>    - resume export public/index.html -f html --theme stackoverflow<br>  artifacts:<br>    paths:<br>    - public<br>  only:<br>  - master<br>  when: manual</pre><p>First, we have to create a “<strong><em>pages”</em></strong> pipeline. This job should have a “<strong><em>pages”</em></strong> name on it to publish on GitLab pages. If you don’t know what is Gitlab pages search for that. Then we have to specify our lovely docker image. we use <strong><em>numb95/resume-cli:latest</em> </strong>which I build before. in the stage section, we add <strong><em>deploy</em></strong> names on it.</p><p>In the script section, we create a directory called <em>public</em> which we add the HTML file in it. The next line is the command of building the HTML file. Feel free to change the theme, but before that, check the <a href="https://jsonresume.org/themes/">jsonresume themes</a>.</p><p>Job <strong>artifacts</strong> are a list of files and directories created by a job once it finishes, So, The next section is for accessing the HTML file.</p><p>we set <strong><em>when: manual</em></strong><em> </em>because we want to do the job manually and from the pipeline page in the repo. You can remove it. Also, I set it to only run in the <strong><em>master </em></strong>branch. You can remove it or change it to your desired branch.</p><p>That’s it. Your resume is ready from <a href="https://yourname.gitlab.io/REPONAME">https://YOURNAME.gitlab.io/REPONAME</a></p><p>But What about having this page on the custom domain? like <em>resume.mydomain.com. </em>So<em>, </em>navigate to <strong>Settings &gt; pages &gt; New Domain</strong> and add your Domain. Follow the instruction of adding DNS records for your domain provider and wait for verification. Right after the verification, your resume is ready on your custom domain.</p><blockquote>Please note that if you want to have a public page, Your GitLab repo should be public.</blockquote><p>Also, you can set up several Resumes using git branches for several positions. For example a branch for SRE position jobs, a branch for DevOps engineer, and a branch for Software Engineer.</p><h4>Setup PDF</h4><p>Having a PDF file of a resume is a great idea(actually lots of companies want a PDF file of your resume :D) <strong>But</strong>, it takes a lot of time to fix the issues of <strong><em>resume-cli</em></strong> . Thanks to chromium and <a href="https://github.com/puppeteer/puppeteer">puppeteer</a> which <strong><em>resume-cli</em> </strong>uses them for generating PDF. But let’s not talk about the result. It’s awful. completely looks not like a resume.</p><p>I use a command-line tool called <strong>wkhtmltopdf. </strong>It’s a popular and powerful tool for converting webpages to PDF. We know that we published our resume webpage using Gitlab pages. In this section, we want to generate a PDF based on that webpage and download it from the artifacts section in the Gitlab pipeline page.</p><p>So, let’s move to the GitLab-ci for building PDF</p><pre>build-pdf:<br>  image: numb95/wkhtmltopdf:latest<br>  stage: deploy<br>  script:<br>      - export NOWTIME=$(date +&#39;%Y_%m_%d_%H_%M&#39;)<br>      - mkdir public<br>      - echo $CI_PAGES_URL<br>      - wkhtmltopdf -s A4 -B 10 -L 10 -R 10 -T 10 --no-background --javascript-delay 6000  $CI_PAGES_URL public/AmirHossein_Goodarzi_CV_$NOWTIME.pdf<br>      - ls public<br>      - pwd<br>  artifacts:<br>      paths:<br>      - $(pwd)/public<br>  only:<br>  - master<br>  when: manual</pre><p>For image, I created a custom docker image with <strong><em>wkhtmltopdf. </em></strong>You can check the <strong>Dockerfile</strong> of it <a href="https://gitlab.com/Numb95/resume/-/blob/master/Dockerfile.wkhtmltopdf">here</a>. Also, for more options of <strong><em>wkhtmltopdf</em></strong> check <a href="https://wkhtmltopdf.org/usage/wkhtmltopdf.txt">here</a>.</p><p>In the script section, we set an environment variable for the current time. It’s handy when we want to name files based on the date. The next line is <strong><em>wkhtmltopdf</em></strong> command which creates a pdf file with a size of A4, with a margin of 10mm on each side of the paper, no need for background, and a 6000ms delay on loading javascript files. Also, we use a Gitlab-CI environment variable($CI_PAGES_UR)L to get the URL of our resume(“pages”).</p><p>That’s it. You can download a PDF version of your resume on artifacts. Just take a look at the right side of the pipeline page.</p><p>Create a Gitlab repo and add all the files (resume.json and .gitlab-ci.yml) to that.</p><p>And this is our complete<strong><em> .gitlab-ci.yml</em></strong> file.</p><pre>image: docker:latest</pre><pre>services:<br>  - docker:dind<br>variables:<br>  GIT_SUBMODULE_STRATEGY: recursive<br>stages:<br>  - deploy<br>pages:<br>  image: numb95/resume-cli:latest<br>  stage: deploy<br>  script:<br>    - mkdir public<br>    - resume export public/index.html -f html --theme stackoverflow<br>    - ls public<br>  artifacts:<br>    paths:<br>    - public<br>  only:<br>  - master<br>  when: manual<br>build-pdf:<br>  image: numb95/wkhtmltopdf:latest<br>  stage: deploy<br>  script:<br>      - export NOWTIME=$(date +&#39;%Y_%m_%d_%H_%M&#39;)<br>      - mkdir public<br>      - echo $CI_PAGES_URL<br>      - wkhtmltopdf -s A4 -B 10 -L 10 -R 10 -T 10 --no-background --javascript-delay 6000  $CI_PAGES_URL public/AmirHossein_Goodarzi_CV_$NOWTIME.pdf<br>      - ls public<br>      - pwd<br>  artifacts:<br>      paths:<br>      - $(pwd)/public<br>  only:<br>  - master<br>  when: manual</pre><blockquote>Remember that, first you need to run “pages” pipeline then build-pdf.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=275a98cf61c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Nexus repository manager with Nginx reverse proxy and Let’s Encrypt SSL certificate on Docker]]></title>
            <link>https://medium.com/@agoodarzi/setup-nexus-repository-manager-with-nginx-reverse-proxy-and-lets-encrypt-ssl-certificate-on-docker-1c1b05988ce3?source=rss-f3ba4943b10e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c1b05988ce3</guid>
            <category><![CDATA[reverse-proxy]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[nexus-repository]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[AmirHossein Goodarzi]]></dc:creator>
            <pubDate>Mon, 19 Aug 2019 11:13:15 GMT</pubDate>
            <atom:updated>2019-08-19T11:13:15.346Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setup Nexus repository manager with Nginx reverse proxy and Let’s Encrypt SSL certificate on Docker.</h3><p>So let’s get to the topic. We want a <a href="https://www.sonatype.com/nexus-repository-sonatype">Nexus repository manager</a> (which it’s default port is 8081). Also, We want <a href="http://nginx.org/">Nginx</a> as a reverse proxy to serve Nexus on port 443 (Yes, we want SSL, so we use<a href="http://letsencrypt.org/"> let’s encrypt</a> here). Also, we want to have a docker proxy registry on our Nexus. All on Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*8lreKNCycUS3eT_zKslPig.jpeg" /></figure><p>TL: DR, you can clone the repository from <a href="https://github.com/numb95/nexus-nginx-letsencrypt-docker">here</a> and execute <em>init.sh</em> script.</p><h3>Preparation</h3><p>Let’s Get something off the ground. First, we need to install Docker. I prefer using <em>get.docker.com. </em>So, I use this to install Docker.</p><blockquote>$ curl -fsSL <a href="https://get.docker.com/">https://get.docker.com</a> -o get-docker.sh</blockquote><blockquote>$ sh get-docker.sh</blockquote><p>IT doesn’t matter you are a go-getter Ubuntu user or company man CentOS user; the script installs <em>Docker</em> based on your environment. However, pay attention to its output. You have to add yourself to the docker group to access the Docker in standard user mode.</p><p>make sure Docker is installed and work properly</p><blockquote>$ Docker -v</blockquote><blockquote>$docker run hello-world</blockquote><p>Second, we need <em>docker-compose</em>, we install it using this:</p><blockquote>$ sudo curl -L “<a href="https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$%28uname">https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname</a> -s)-$(uname -m)” -o /usr/local/bin/docker-compose</blockquote><blockquote>$ sudo chmod +x /usr/local/bin/docker-compose</blockquote><p>Now, Let do the job.</p><h3>Structure</h3><p>Create a directory with a desirable name. I called it <em>docker-nexus.</em> Inside this directory, I created a directory and named it <em>confs</em>. All the confs stores here. Oh, what a shame. Use this <em>mkdir</em> command to create all we need.</p><blockquote>mkdir -p docker-nexus/confs/{certbot,nginx}</blockquote><p>We create <em>Certbot</em> and <em>Nginx</em> directory inside <em>confs</em> directory. That’s it.</p><p>In the root of docker-nexus, create a <em>docker-compose.yml</em> file. I borrow some parts from <a href="https://github.com/wmnnd/nginx-certbot">here</a>. Thanks to the Filip and his <em>init-lets-encrypt.sh</em> script, the script downloading recommended TLS parameter, create dummy certificates, start Nginx, delete dummy certificates, and requesting let’s encrypt certificates. We are going to review it later.</p><p>Let’s review what should we have on <em>confs</em> directory. This tree is a good flow of what happened in the project directory.</p><p>├── confs<br>│ ├── certbot<br>│ │ ├── Dockerfile<br>│ │ └── entrypoint.sh<br>│ └── nginx<br>│ ├── Dockerfile<br>│ └── nginx.conf</p><p>Let’s see the <strong>certbot</strong> directory. We have <em>Dockerfile</em> and<em> entrypoint.sh</em>. Let’s take a look at them.</p><p><strong>Dockerfile</strong></p><pre>FROM certbot/certbot<br>COPY entrypoint.sh /bin/<br>ENTRYPOINT [ &quot;entrypoint.sh&quot; ]</pre><p><strong>entrypoint.sh</strong></p><pre>#!/bin/sh<br>while :<br>	do certbot renew; sleep 72h;<br>done</pre><p>On the other side, in <strong>nginx</strong> directory, we have <em>Dockerfile</em> and <em>nginx.conf</em> file. Take a look at them.</p><p><strong>Dockerfile</strong></p><pre>FROM nginx</pre><pre>COPY nginx.conf /etc/nginx/nginx.conf</pre><p><strong>nginx.conf</strong></p><pre>events {<br>}<br>http {<br>  proxy_send_timeout        120;<br>  proxy_read_timeout        300;<br>  proxy_buffering           off;<br>  keepalive_timeout         5 5;<br>  tcp_nodelay               on;<br>  ssl                       on;<br>  ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;<br>  ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;<br>  include /etc/letsencrypt/options-ssl-nginx.conf;<br>  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;<br>  client_max_body_size      1G;<br>  server {<br>    listen                  *:443;<br>    location / {<br>      proxy_pass            <a href="http://nexus:8081/;">http://nexus:8081/;</a><br>      proxy_redirect        off;<br>      proxy_set_header      Host $host;<br>      proxy_set_header      X-Real-IP $remote_addr;<br>      proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;<br>      proxy_set_header      X-Forwarded-Host $server_name;<br>      proxy_set_header      X-Forwarded-Proto $scheme;<br>    }<br>  }<br>  server {<br>    listen                  *:5000;<br>    location / {<br>      proxy_pass            <a href="http://nexus:5000/;">http://nexus:5000/;</a><br>      proxy_redirect        off;<br>      proxy_set_header      Host $host;<br>      proxy_set_header      X-Real-IP $remote_addr;<br>      proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;<br>      proxy_set_header      X-Forwarded-Host $server_name;<br>      proxy_set_header      X-Forwarded-Proto $scheme;<br>    }<br>  }<br>}</pre><p>(Don’t pay attention to DOMAINNAME, in init.sh, the script replaces it with your domain name)</p><p>Let us take a look at all part of the project directory structure.</p><p>├── confs<br>│ ├── certbot<br>│ │ ├── Dockerfile<br>│ │ └── entrypoint.sh<br>│ └── nginx<br>│ ├── Dockerfile<br>│ └── nginx.conf<br>├── docker-compose.yml<br>├── init.sh<br>└── README.md</p><p>this is our <strong>docker-compose.yml </strong>file</p><pre>version: &#39;3&#39;</pre><pre>services:<br>  nginx:<br>    build: ./confs/nginx<br>    ports:<br>      - &#39;443:443&#39;<br>      - &#39;5000:5000&#39;<br>    volumes:<br>      - ./confs/certbot/conf:/etc/letsencrypt<br>      - ./confs/certbot/www:/var/www/certbot<br>    links:<br>      - nexus<br>    command: [ nginx, &#39;-g&#39;, &#39;daemon off;&#39; ]<br>  certbot:<br>    build: ./confs/certbot<br>    restart: unless-stopped<br>    volumes:<br>      - ./confs/certbot/conf:/etc/letsencrypt<br>      - ./confs/certbot/www:/var/www/certbot<br>  nexus:<br>    image: sonatype/nexus3<br>    volumes:<br>      - &#39;nexus-data:/nexus-data&#39;</pre><pre>volumes:<br>  nexus-data:</pre><p>I do some changes to the script and add some section. First I rename to init.sh :D, then after running the init.sh, you have your valid SSL certificate on Let’s encrypt. Also, all the services are going to become up. It shows you the temporary password of the admin user of Nexus, and again create you a docker registry so you can pull images from there. Also, there are some other changes that you can track.</p><p>And our lovely <strong>init.sh</strong> script.</p><pre>#!/bin/bash</pre><pre>if ! [ -x &quot;$(command -v docker-compose)&quot; ]; then<br>  echo &#39;Error: docker-compose is not installed.&#39; &gt;&amp;2<br>  exit 1<br>fi</pre><pre>domains=(example.com <a href="http://www.example.com/">www.example.com</a>)<br>rsa_key_size=4096<br>data_path=&quot;./confs/certbot&quot;<br>email=&quot;<a href="/service/mailto:you@yourdomain.com">you@yourdomain.com</a>&quot; # Adding a valid address is strongly recommended<br>staging=1 # Set to 1 if you&#39;re testing your setup to avoid hitting request limits</pre><pre>if [ -d &quot;$data_path&quot; ]; then<br>  sed -i &#39;s/DOMAINNAME/&#39;$domains&#39;/g&#39; ./confs/nginx/nginx.conf<br>  read -p &quot;Existing data found for $domains. Continue and replace existing certificate? (y/N) &quot; decision<br>  if [ &quot;$decision&quot; != &quot;Y&quot; ] &amp;&amp; [ &quot;$decision&quot; != &quot;y&quot; ]; then<br>    exit<br>  fi<br>fi</pre><pre>if [ ! -e &quot;$data_path/conf/options-ssl-nginx.conf&quot; ] || [ ! -e &quot;$data_path/conf/ssl-dhparams.pem&quot; ]; then<br>  echo &quot;### Downloading recommended TLS parameters ...&quot;<br>  mkdir -p &quot;$data_path/conf&quot;<br>  curl -s <a href="https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/tls_configs/options-ssl-nginx.conf">https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/tls_configs/options-ssl-nginx.conf</a> &gt; &quot;$data_path/conf/options-ssl-nginx.conf&quot;<br>  curl -s <a href="https://raw.githubusercontent.com/certbot/certbot/master/certbot/ssl-dhparams.pem">https://raw.githubusercontent.com/certbot/certbot/master/certbot/ssl-dhparams.pem</a> &gt; &quot;$data_path/conf/ssl-dhparams.pem&quot;<br>  echo<br>fi</pre><pre>echo &quot;### Creating dummy certificate for $domains ...&quot;<br>path=&quot;/etc/letsencrypt/live/$domains&quot;<br>mkdir -p &quot;$data_path/conf/live/$domains&quot;<br>docker-compose run --rm --entrypoint &quot;\<br>  openssl req -x509 -nodes -newkey rsa:1024 -days 1\<br>    -keyout &#39;$path/privkey.pem&#39; \<br>    -out &#39;$path/fullchain.pem&#39; \<br>    -subj &#39;/CN=localhost&#39;&quot; certbot<br>echo</pre><pre>echo &quot;### Starting nginx ...&quot;<br>docker-compose up --force-recreate -d nginx<br>echo</pre><pre>echo &quot;### Deleting dummy certificate for $domains ...&quot;<br>docker-compose run --rm --entrypoint &quot;\<br>  rm -Rf /etc/letsencrypt/live/$domains &amp;&amp; \<br>  rm -Rf /etc/letsencrypt/archive/$domains &amp;&amp; \<br>  rm -Rf /etc/letsencrypt/renewal/$domains.conf&quot; certbot<br>echo</pre><pre>echo &quot;### Requesting Let&#39;s Encrypt certificate for $domains ...&quot;<br>#Join $domains to -d args<br>domain_args=&quot;&quot;<br>for domain in &quot;${domains[@]}&quot;; do<br>  domain_args=&quot;$domain_args -d $domain&quot;<br>done</pre><pre># Select appropriate email arg<br>case &quot;$email&quot; in<br>  &quot;&quot;) email_arg=&quot;--register-unsafely-without-email&quot; ;;<br>  *) email_arg=&quot;--email $email&quot; ;;<br>esac</pre><pre># Enable staging mode if needed<br>if [ $staging != &quot;0&quot; ]; then staging_arg=&quot;--staging&quot;; fi</pre><pre>docker-compose run --rm --entrypoint &quot;\<br>  certbot certonly --webroot -w /var/www/certbot \<br>    $staging_arg \<br>    $email_arg \<br>    $domain_args \<br>    --rsa-key-size $rsa_key_size \<br>    --agree-tos \<br>    --force-renewal&quot; certbot<br>echo</pre><pre>echo &quot;### Reloading nginx ...&quot;<br>docker-compose exec nginx nginx -s reload<br>docker-compose up -d</pre><pre>until curl -sk -f <a href="https://$domains/">https://$domains</a> -o /dev/null ; do<br>    sleep 5<br>done<br>adminpass=`docker-compose exec nexus sudo cat /nexus-data/admin.password`<br>echo &#39;### nexus admin username: admin&#39;<br>echo &#39;### nexus admin password:&#39; $adminpass<br>echo &#39;### change your password after login ###&#39;<br>curl -u admin:$adminpass -k -H &#39;Content-Type: application/json&#39; &#39;<a href="https://&/#39;$domains&#39;/service/rest/v1/script&#39;">https://&#39;$domains&#39;/service/rest/v1/script&#39;</a>  -d &#39;{&quot;name&quot;: &quot;CreateDockerProxy&quot;,&quot;type&quot;: &quot;groovy&quot;,&quot;content&quot;: &quot;repository.createDockerProxy(&#39;\&#39;&#39;docker-proxy-registry&#39;\&#39;&#39;, &#39;\&#39;&#39;<a href="https://registry-1.docker.io&/#39;\&#39;&#39;">https://registry-1.docker.io&#39;\&#39;&#39;</a>, &#39;\&#39;&#39;HUB&#39;\&#39;&#39;, null, 5000, null)&quot;}&#39;<br>curl -X POST -u admin:$adminpass -k -H &#39;Content-Type: text/plain&#39; &#39;<a href="https://&/#39;$domains&#39;/service/rest/v1/script/CreateDockerProxy/run&#39;">https://&#39;$domains&#39;/service/rest/v1/script/CreateDockerProxy/run&#39;</a></pre><h3>Before running the script</h3><p>Open the <em>init.sh</em> file and edit your domains section. Add both domains with and without the www subdomain. Then enter your email in the email section. Then select 1 or 0 for staging or production deployment to avoid requests limits of Let’s encrypt.</p><p>Everything looks fine, so let’s run the script (of-course with <em>./init.sh</em>) and wait until all comes up.</p><p>Check the output of the script for the password. Copy it and log in to Nexus. Don’t forget to change your password.</p><p>Everything should work fine. In another article, I’m going to show you how to use your docker registry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c1b05988ce3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get the total duration of several video files in Linux]]></title>
            <link>https://medium.com/@agoodarzi/get-the-total-duration-of-several-video-files-in-linux-32db3e59e644?source=rss-f3ba4943b10e------2</link>
            <guid isPermaLink="false">https://medium.com/p/32db3e59e644</guid>
            <category><![CDATA[linux-hack]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[linux-mint]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[AmirHossein Goodarzi]]></dc:creator>
            <pubDate>Sat, 11 May 2019 19:15:38 GMT</pubDate>
            <atom:updated>2019-05-11T19:15:38.631Z</atom:updated>
            <content:encoded><![CDATA[<p>a long time ago I try to estimate the total duration of several video files in Linux. if you don’t get what I mean, I mean I had lots of video files and want to know the duration of all of them not each of them :)))that not complicated.</p><p>but I found two solutions. these are the solutions:</p><h3>Solution one — for GUI Guys:</h3><p>open the VLC media player then select all of the files in your desirable file manager.</p><p>then drag them into Playlist section in VLC.</p><p>the lovely VLC shows you the duration.</p><ul><li>where?</li><li>look at the left top and beside Playlist 🙂</li></ul><h3>Solution two — The Lovely Linux TERMINAL:</h3><p>open a terminal emulator (e.g gnome-terminal) then navigate to the directory of video files.</p><blockquote>cd /home/USER/Videos/ALLVIDEOSDIRECTORY</blockquote><p>before executing the following command, please ensure that you have already <strong><em>libimage-exiftool-perl<br></em></strong>installed<br>in Debian/Ubuntu/Mint based distros you can install it with this command:</p><blockquote>sudo apt install libimage-exiftool-perl</blockquote><p>after install, execute this command as a normal user and see the result.</p><blockquote>exiftool -n -q -p ‘${Duration;our $sum;$_=ConvertDuration($sum+=$_)</blockquote><blockquote>}’ ./*.EXT| tail -n1</blockquote><p>please remember to change the EXT with what you want to want. for me it’s mp4.</p><p>and this is the output for me 🙂</p><blockquote>┌─[numb@Numb-ThinkPad-T430] — [~/Videos/education/courses/django_rest] — [2017–07–15 06:07:41]</blockquote><blockquote>└─[1] &lt;&gt; exiftool -n -q -p ‘${Duration;our $sum;$_=ConvertDuration($sum+=$_)</blockquote><blockquote>}’ ./*.*| tail -n1</blockquote><blockquote>4:07:47</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32db3e59e644" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>