<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="https://sourceexample.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://sourceexample.com/" rel="alternate" type="text/html" /><updated>2020-10-27T08:26:15+00:00</updated><id>https://sourceexample.com/feed.xml</id><title type="html">Source Example</title><subtitle>java, python linux ,java, source example</subtitle><entry xml:lang="en"><title type="html">Apparently CentOS doesn’t have a terminal shortcut</title><link href="https://sourceexample.com/en/0de26a914384b220b5fe/" rel="alternate" type="text/html" title="Apparently CentOS doesn't have a terminal shortcut" /><published>2020-10-22T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/0de26a914384b220b5fe-en</id><content type="html" xml:base="https://sourceexample.com/en/0de26a914384b220b5fe/">&lt;p&gt;Since I was using Ubuntu, it seems that terminal cannot be opened with a shortcut such as Ctrl + Alt + t.&lt;/p&gt;

&lt;p&gt;Click [Applications] → [System Tools] → [Settings] → [Devices] → [Keyboard] and click + at the bottom.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/22f45937-8800-dfe2-308c-29e0e3b5526b.png&quot; alt=&quot;Screenshot from 2020-10-22 16-02-55.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To add a shortcut&lt;br /&gt;
 Name: terminal (anything is fine)&lt;br /&gt;
 Command: gnome-terminal&lt;br /&gt;
 Shortcut: Ctrl + Alt + t (if you like)&lt;/p&gt;

&lt;p&gt;Press the add button&lt;br /&gt;
 &lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/e8faf902-7451-de99-2253-f69cbb669543.png&quot; alt=&quot;Screenshot from 2020-10-22 16-08-33.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;that’s all!&lt;/p&gt;

&lt;p&gt;Reference url https://sironekosukaru.hatenablog.com/entry/2018/01/20/160510&lt;/p&gt;</content><author><name></name></author><category term="CentOS" /><summary type="html">Since I was using Ubuntu, it seems that terminal cannot be opened with a shortcut such as Ctrl + Alt + t.</summary></entry><entry xml:lang="en"><title type="html">I tried to easily put CentOS-7 in a PC that I no longer need</title><link href="https://sourceexample.com/en/1449c55e799ebc5eb6be/" rel="alternate" type="text/html" title="I tried to easily put CentOS-7 in a PC that I no longer need" /><published>2020-10-22T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/1449c55e799ebc5eb6be-en</id><content type="html" xml:base="https://sourceexample.com/en/1449c55e799ebc5eb6be/">&lt;p&gt;at first&lt;/p&gt;

&lt;p&gt;Things necessary&lt;br /&gt;
 PC, USB (about 8GB)&lt;/p&gt;

&lt;p&gt;Obtaining installation media&lt;br /&gt;
https://buildlogs.centos.org/rolling/7/isos/x86_64/CentOS-7-x86_64-Everything-1511.iso&lt;/p&gt;

&lt;p&gt;Create USB installation media from ISO file&lt;br /&gt;
 Use Rufus&lt;br /&gt;
https://github.com/pbatard/rufus/releases/download/v3.12/rufus-3.12.exe&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/8513847c-be4b-2d9f-3359-cd54707177be.png&quot; alt=&quot;スクリーンショット 2020-10-22 115550.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Specify the iso file from the boot type selection and&lt;br /&gt;
 Specify the partition configuration, target system, and file system and press the start button.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/7cb257a8-faa4-ecc2-7630-d4e96377e3aa.png&quot; alt=&quot;スクリーンショット 2020-10-22 120049.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you see this after pressing the start button, select Write as ISO image&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/17d44f1f-9b2e-0298-c2c9-ca63e08601a2.png&quot; alt=&quot;スクリーンショット 2020-10-22 120313.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Since such a warning message appears, if the data in the USB memory to be used remains, move it to a PC etc. before doing it.&lt;/p&gt;

&lt;p&gt;When the writing is completed, a notification sound will sound, so this completes the USB installation media creation.&lt;/p&gt;

&lt;p&gt;PC USB boot&lt;br /&gt;
 After inserting the USB installation media into the PC you no longer need, start the PC and then press F12 (depending on the PC model) to enter the Boot Menu.&lt;/p&gt;

&lt;p&gt;Select USB to enter the CentOS 7 installation screen&lt;/p&gt;

&lt;p&gt;Select Install CentOS 7&lt;/p&gt;

&lt;p&gt;Select language as Japan&lt;/p&gt;

&lt;p&gt;I’ll go into the installation overview so what to do&lt;br /&gt;
 ・ Software selection (insert GUI)&lt;br /&gt;
 -Select installation destination&lt;br /&gt;
 &lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/d20d015c-9425-cbd5-5ea9-0cac37301c55.png&quot; alt=&quot;screenshot-0002.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Select the server (using GUI) in the software selection&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/26c617ed-0a94-c739-10b8-2628c22883ac.png&quot; alt=&quot;screenshot-0003.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Select installation destination&lt;br /&gt;
 Select a PC disk&lt;br /&gt;
 Partition configuration is automatic (manual is also acceptable)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/78612ef1-1d2a-e850-c457-e8b3824ba43b.png&quot; alt=&quot;screenshot-0004.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you press [Finish], you will get angry if there is no area, so select [Secure area].&lt;/p&gt;

&lt;p&gt;Select [Delete All] → [Reuse Space]&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/230784c4-6605-0ee8-728e-6e983ea94d11.png&quot; alt=&quot;screenshot-0010.png&quot; /&gt;&lt;br /&gt;
 When you return to the installation summary, the yellow display disappears and the minimum settings are completed, so select [Start Installation].&lt;/p&gt;

&lt;p&gt;Set ROOT password and user during installation&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/7888db65-7a36-c9e4-cf53-f0ef86a16901.png&quot; alt=&quot;screenshot-0011.png&quot; /&gt;&lt;br /&gt;
 Set ROOT password and complete&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/7a8594dc-52be-bb7a-bdb2-b55f5f4ececd.png&quot; alt=&quot;screenshot-0013.png&quot; /&gt;&lt;br /&gt;
 Set the full name, user name and password in user creation and complete&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/1dfa6e6c-43d4-44b7-19c7-dfad7d34ce0d.png&quot; alt=&quot;screenshot-0014.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;When the user settings are completed, a screen like this will appear. All you have to do is wait for the installation&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/dd3d6128-c414-1821-f246-e14452c647f1.png&quot; alt=&quot;screenshot-0017 (2).png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Reboot when installation is complete&lt;/p&gt;

&lt;p&gt;After restarting, you will be asked for a license, so agree and complete the setting&lt;br /&gt;
 &lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/92142470-e547-f670-7f06-3f2b6ac56ce8.png&quot; alt=&quot;screenshot-0000.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/70917005-e41d-d2fe-17c7-eb9541669997.png&quot; alt=&quot;screenshot-0001.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Done&lt;br /&gt;
 &lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/813031/dd366954-70b2-a45f-b46b-496452a3c76d.png&quot; alt=&quot;Screenshot from 2020-10-22 13-57-57.png&quot; /&gt;&lt;/p&gt;</content><author><name></name></author><category term="CentOS" /><summary type="html">at first</summary></entry><entry xml:lang="en"><title type="html">Publish IP camera videos on web pages</title><link href="https://sourceexample.com/en/dca866616d441e0d6fd8/" rel="alternate" type="text/html" title="Publish IP camera videos on web pages" /><published>2020-10-22T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/dca866616d441e0d6fd8-en</id><content type="html" xml:base="https://sourceexample.com/en/dca866616d441e0d6fd8/">&lt;p&gt;Publish a video of an IP camera installed at home on a web page.&lt;/p&gt;

&lt;p&gt;Thanks to ahonomics, I am now a country of poor people without hiding, and I try to achieve this on the lowest possible budget. At this time, I rely on (1) cheap and high-quality IP cameras made in China, (2) free and high-quality free software (open source software), and (3) useful life. It is a used laptop computer that has passed.&lt;/p&gt;

&lt;p&gt;As prerequisites, (A) a home LAN with an optical line and (B) a web server installed on the Internet are assumed. (A) is mandatory. It would be possible without (B), but the intended readers of this article will not complain even if we proceed as if it were.&lt;/p&gt;

&lt;h1 id=&quot;1-ip-camera&quot;&gt;1: IP camera&lt;/h1&gt;

&lt;p&gt;The IP camera used is a model called SV-801W-1080P-HX of the SV3C brand, and the main specifications are as follows.&lt;/p&gt;

&lt;p&gt;–Aluminum die-cast housing, IP66 waterproof / dustproof&lt;br /&gt;
 –Fixed angle of view 2 million pixels (1920 x 1080)&lt;br /&gt;
 –Both wired / WiFi compatible&lt;br /&gt;
 –Power supply by AC adapter&lt;br /&gt;
 –Infrared night vision photography&lt;br /&gt;
 –Motion detection&lt;br /&gt;
 –Supports micro SD card (up to 64 GB)&lt;br /&gt;
 –RTSP compatible&lt;br /&gt;
 –ONVIF compatible&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;send e-mail&lt;br /&gt;
 –FTP upload&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The price is 4,899 yen (as of October 2020) on Amazon.co.jp, which is one of the cheapest, but at first glance it is robust and equipped with all the functions expected of this kind of surveillance camera. ing. There are other similar products, but I have the impression that the manuals on the support site are relatively substantial, so I choose the SV3C one.&lt;/p&gt;

&lt;p&gt;It’s important to support ** RTSP ** and ** ONVIF **, but it’s rare for today’s IP cameras to support it.&lt;/p&gt;

&lt;h2 id=&quot;1-1-ip-camera-setup&quot;&gt;1-1: IP camera setup&lt;/h2&gt;

&lt;p&gt;Set up the camera before installing it outdoors (on the edge of the house).&lt;/p&gt;

&lt;p&gt;The following explanation is based on the SV3C SV-801W-1080P-HX, but I think that the procedure will be similar for cameras from other companies. I’m sorry if it’s different.&lt;/p&gt;

&lt;h3 id=&quot;1-1-1-micro-sd-card&quot;&gt;1-1-1: Micro SD card&lt;/h3&gt;

&lt;p&gt;First, attach the micro SD card (64GB, 1,596 yen) that you bought together to the camera.&lt;/p&gt;

&lt;p&gt;This product is a little more difficult to work with because you can’t access the card slots on the board without removing the lens cover and pulling out the contents. However, once inserted, it is a card that will never be taken out, so I think this is fine.&lt;/p&gt;

&lt;p&gt;The camera works without a card. You don’t need a card for video distribution, and even if you use it for crime prevention, you can omit the card when connecting to NVR (Network Video Recorder).&lt;/p&gt;

&lt;p&gt;However, if you have a card installed, you can automatically record and save videos and snapshots. Besides, adding cards after installation is a hassle. It’s cheap, so it’s better to wear it from the beginning.&lt;/p&gt;

&lt;h3 id=&quot;1-1-2-connect-to-home-lan&quot;&gt;1-1-2: Connect to home LAN&lt;/h3&gt;

&lt;p&gt;Turn on the camera by connecting it to a router (or hub, etc.) on your home LAN with a LAN cable.&lt;/p&gt;

&lt;p&gt;The router’s DHCP will now get the camera a dynamic IP address.&lt;/p&gt;

&lt;p&gt;1-1-2 : CamHi&lt;/p&gt;

&lt;p&gt;Install and launch an app called CamHi on your smartphone. By searching for and connecting to an IP camera connected to your home LAN with this app, you will be able to watch videos and access camera settings. Needless to say, smartphones need to be connected to the home LAN via WiFi in advance.&lt;/p&gt;

&lt;p&gt;Subsequent settings can be done with CamHi, but it is easier to access the camera settings screen with a web browser, so just make a note of the camera’s IP address and CamHi will quit. (It will be used again later to check the image during outdoor installation work.)&lt;/p&gt;

&lt;h3 id=&quot;1-1-3-setting-by-web-browser&quot;&gt;1-1-3: Setting by web browser&lt;/h3&gt;

&lt;p&gt;Access the camera’s IP address with a web browser and configure the camera settings.&lt;/p&gt;

&lt;p&gt;The browser uses ** Internet Explorer **. You will first be asked to install the ActiveX for video playback. I wonder what this is, but follow the instructions. It can be set with other browsers, but it is inconvenient because the image is not displayed. Give up and use IE.&lt;/p&gt;

&lt;p&gt;There are a wide variety of items that can be set. For items that you do not understand well, leave the default settings and make the following initialization and setting changes that are considered to be the minimum necessary.&lt;/p&gt;

&lt;p&gt;–Change the administrator password&lt;br /&gt;
 –The IP address is a static address (here, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.0.101&lt;/code&gt;)&lt;br /&gt;
 –Set the time zone to GMT +09: 00&lt;br /&gt;
 –Set the NTP server to ntp.nict.jp&lt;br /&gt;
 –Initialize SD card&lt;/p&gt;

&lt;p&gt;This time, we will go with a wired connection in consideration of the installation location and stability, so turn off WiFi. Also, since the purpose is different, it is set not to use functions for crime prevention such as infrared night vision, motion detection, alarm by e-mail or FTP.&lt;/p&gt;

&lt;h2 id=&quot;1-2-outdoor-installation-work-of-ip-camera&quot;&gt;1-2: Outdoor installation work of IP camera&lt;/h2&gt;

&lt;p&gt;Install an IP camera on the eaves of your home, where you will be shooting videos.&lt;/p&gt;

&lt;p&gt;While checking the image with CamHi of the smart phone, decide the installation position and shooting direction and fix it. Since it is a wide-angle lens, it is inevitable that the peripheral part will be distorted, but since the human eye is sensitive to horizontal deviation, the angle of the camera is determined by paying close attention to the horizontal and vertical parts of the center of the image.&lt;/p&gt;

&lt;p&gt;Since it is a place exposed to rain, the joint between the LAN cable and the power cable should be waterproofed with self-bonding tape.&lt;/p&gt;

&lt;h2 id=&quot;1-3-delivery-of-still-images&quot;&gt;1-3: Delivery of still images&lt;/h2&gt;

&lt;p&gt;With the SV3C HX series, it will be possible to deliver still images at this point.&lt;/p&gt;

&lt;p&gt;There is a function to upload snapshots to an external FTP server on a regular basis, so if you take advantage of this and perform appropriate processing on the web server side, you can display almost real-time still images on a web page. You can.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/12310/de059ff7-8708-20f4-863e-26a06aa19da1.png&quot; alt=&quot;photo.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This time, we will create a page to distribute still images in case the video distribution stops.&lt;/p&gt;

&lt;h3 id=&quot;1-3-1-client-side-html--javascript&quot;&gt;1-3-1: Client side (HTML + javascript)&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;img id=&quot;live-img&quot; width=&quot;950&quot; height=&quot;534&quot; 
  src=&quot;/livecam/snapshot&quot; 
  alt=&quot;Live camera snapshot&quot; /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The source of the image is the URL &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/ livecam / snapshot&lt;/code&gt;. It makes the work on the server side easier than specifying it by file name like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot; snapshot.jpg &quot;&lt;/code&gt;. You no longer have to worry about the negative effects of the file cache.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;function updateImage() {
    $('#live-img').attr('src', '/livecam/snapshot');
}
var timer = setInterval(updateImage, 30000);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then the javascript timer requests the image from the server every 30 seconds.&lt;/p&gt;

&lt;h3 id=&quot;1-3-2-server-side&quot;&gt;1-3-2: Server side&lt;/h3&gt;

&lt;p&gt;On the server side, the image data is sent to the client from the action corresponding to the URL &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/ livecam / snapshot&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Since snapshots from the camera are being uploaded one after another to the directory specified in advance, select the newest file among them, read the contents, and add the header of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;'Content-Type: image / jpeg'&lt;/code&gt;. And send it.&lt;/p&gt;

&lt;p&gt;To put it in detail, it requires some troublesome processing such as resizing images and deleting unnecessary files, but I will omit the details.&lt;/p&gt;

&lt;h1 id=&quot;2-video-distribution&quot;&gt;2: Video distribution&lt;/h1&gt;

&lt;h2 id=&quot;2-1-schematic-diagram&quot;&gt;2-1: Schematic diagram&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/12310/9a0ec35a-b012-9810-062e-feb3b926e5c0.png&quot; alt=&quot;movie.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In order to distribute videos from IP cameras, ** video conversion server ** and ** video distribution server ** are required in addition to the conventional web server, as shown in the figure.&lt;/p&gt;

&lt;p&gt;First, the ** video conversion server ** converts the stream of video data output by the camera according to ** RTSP ** (Real Time Streaming Protocol) into data according to ** RTMP ** (Real Time Messaging Protocol). Convert. The substance of this video conversion server is an application program called ** ffmpeg **.&lt;/p&gt;

&lt;p&gt;Then, the ** video distribution server ** that receives the output of ** RTMP ** from the video conversion server distributes the stream converted to the ** HLS ** (HTTP Live Streaming) protocol to the web client. The substance of this video distribution server is a web server program called ** NGINX ** equipped with ** nginx-rtmp-module **.&lt;/p&gt;

&lt;p&gt;Although not supported this time and not shown in the figure, this video distribution server can distribute ** RTMP ** streams as they are, or ** MPEG-DASH ** protocol (DASH is Dynamic Adaptive Streaming over HTTP). It is also possible to convert it to) and distribute it.&lt;/p&gt;

&lt;h2 id=&quot;2-2-video-server&quot;&gt;2-2: Video server&lt;/h2&gt;

&lt;p&gt;Make a used laptop computer into a server that combines video conversion and video distribution, and install it on your home LAN.&lt;/p&gt;

&lt;p&gt;In some cases, it may be better to have only a video conversion server on the home LAN and let a web server on the Internet also serve as video distribution.&lt;/p&gt;

&lt;p&gt;2-2-1 : CentOS 8&lt;/p&gt;

&lt;p&gt;Install CentOS 8 on your laptop. Nothing has changed in particular.&lt;/p&gt;

&lt;p&gt;The reason for CentOS is simply because you’re used to it, and there’s no other reason. It should be any linux distribution.&lt;/p&gt;

&lt;p&gt;The IP address of this video server on the home LAN is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.0.99&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;2-2-2 : ffmpeg&lt;/p&gt;

&lt;p&gt;There are many articles on the net that build ffmpeg from source, but if you go there, you’ll usually be in distress. Until a decade ago, I would have had no choice but to do so, but now that I have a package, I don’t have to worry about it.&lt;/p&gt;

&lt;p&gt;Specifically, install ffmpeg using the ** RPM Fusion ** repository.&lt;/p&gt;

&lt;p&gt;First, the ʻEPEL` repository is required, so install it.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# dnf -y install epel-release
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then enable the repositories &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PowerTools&lt;/code&gt; and ʻepel-playground`.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# dnf config-manager --set-enabled PowerTools
# dnf config-manager --set-enabled epel-playground
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then install the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RPM Fusion&lt;/code&gt; repository.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# rpm -ivh https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can now install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffmpeg&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# dnf install ffmpeg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For details, see &lt;a href=&quot;https://www.rootlinks.net/2020/02/17/install-ffmpeg-on-centos-8-with-rpmfusion- See the article repo /&quot;&gt;** “Install FFmpeg on CentOS 8 with RPMFusion repo” **&lt;/a&gt;. The title is English, but the article is in Japanese.&lt;/p&gt;

&lt;p&gt;2-2-3 : NGINX + nginx-rtmp-module&lt;/p&gt;

&lt;p&gt;If you only use NGINX, you can use the package, but in order to use nginx-rtmp-module, you need to get the source and build it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www. Work by referring to nginx.com/blog/video-streaming-for-remote-learning-with-nginx/&quot;&gt;** NGINX official website &lt;strong&gt;](https://www.nginx.com) technical blog [&lt;/strong&gt; “Enabling Video Streaming for Remote Learning with NGINX and NGINX Plus” **&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, install the tools you use to build.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo yum update
$ sudo yum groupinstall &quot;Development Tools&quot;
$ sudo yum install git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, install the dependent packages.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo yum groupinstall pcre-devel zlib-devel openssl-devel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then, create an appropriate build directory, go into it, and clone the sources of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nginx-rtmp-module&lt;/code&gt; and&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; nginx&lt;/code&gt; from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;github&lt;/code&gt; to get them.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /path/to/build/dir
$ git clone https://github.com/arut/nginx-rtmp-module.git
$ git clone https://github.com/nginx/nginx.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then go into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nginx&lt;/code&gt; directory, add&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; nginx-rtmp-module&lt;/code&gt; to your configuration, and run the build and install.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd nginx
$ ./auto/configure --add-module=../nginx-rtmp-module
$ make
$ sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will make NGINX work, so check it just in case.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo systemctl start nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When you access the home page of the video server (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.0.99/&lt;/code&gt;) from a personal computer connected to your home LAN, the NGINX welcome page should be displayed.&lt;/p&gt;

&lt;p&gt;I can’t stream the video yet (naturally because I haven’t set it up yet), but once I put in ** ffmpeg ** and ** NGINX + nginx-rtmp-module **, it’s like winning. ..&lt;/p&gt;

&lt;p&gt;The rest is the setting of video conversion by ffmpeg and the setting of video distribution by NGINX, but before that, I will finish the work of environment maintenance necessary for the operation of the video server.&lt;/p&gt;

&lt;h3 id=&quot;2-2-4-video-server-environment-maintenance&quot;&gt;2-2-4: Video server environment maintenance&lt;/h3&gt;

&lt;h4 id=&quot;2-2-4-1-firewall&quot;&gt;2-2-4-1: Firewall&lt;/h4&gt;

&lt;p&gt;Open ports for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http&lt;/code&gt;,&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; https&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RTSP&lt;/code&gt;, and&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; RTMP&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo firewall-cmd --permanent --add-service=http 
$ sudo firewall-cmd --permanent --add-service=https 
$ sudo firewall-cmd --permanent --add-service=rtsp
$ sudo firewall-cmd --permanent --add-port=1935/tcp
$ sudo firewall-cmd --reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1935 / tcp&lt;/code&gt; is the standard port for&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; RTMP&lt;/code&gt;. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RTSP&lt;/code&gt; uses&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; 554 / tcp&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;554 / udp&lt;/code&gt; as standard ports, but in CentOS 8 it can be set using&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; --add-service = rtsp&lt;/code&gt;.&lt;/p&gt;

&lt;h4 id=&quot;2-2-4-2-router-port-mapping&quot;&gt;2-2-4-2: Router port mapping&lt;/h4&gt;

&lt;p&gt;Change the port mapping setting of the router of the home LAN so that the video server can be accessed from the Internet, and the incoming call to the WAN side global address is the local address of the LAN side video server (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.0.99&lt;/code&gt;). Try to go to.&lt;/p&gt;

&lt;p&gt;You can just use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http (80)&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https (443)&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rtmp (1935)&lt;/code&gt;, but also map &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh (22)&lt;/code&gt; for remote management.&lt;/p&gt;

&lt;p&gt;2-2-4-3 : DDNS (Dynamic DNS)&lt;/p&gt;

&lt;p&gt;Use the DDNS (Dynamic DNS) service so that you can specify the video server by domain name instead of IP address.&lt;/p&gt;

&lt;p&gt;Change &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;server_name&lt;/code&gt; in&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; nginx.conf&lt;/code&gt; to the DDNS domain name (assuming it is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camsvr.on.ddns&lt;/code&gt;) and restart NGINX.&lt;/p&gt;

&lt;h4 id=&quot;-nginxconf&quot;&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; nginx.conf&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;n&quot;&gt;http&lt;/span&gt; {
    &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;server_name&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;camsvr&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;ddns&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At this point, I’d like to see if the router’s port mapping and DDNS are working as expected, but to do that I need to go out of my home LAN. When I access &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://camsvr.on.ddns/&lt;/code&gt; with a web browser on a PC connected to my home LAN, the NGINX welcome page of the video server is not displayed, and the home page of the router (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http:: //192.168.0.1/&lt;/code&gt;) is displayed. In short, port mapping does not work for access from within the LAN. It’s a good idea to use a smartphone browser with WiFi turned off for testing.&lt;/p&gt;

&lt;p&gt;2-2-4-4 : Let’s Encrypt&lt;/p&gt;

&lt;p&gt;The plan is that the video distribution web page will be a mix of content from the new video server with the page provided by the existing web server. The web server is already &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SSL&lt;/code&gt; and provides the&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; https&lt;/code&gt; page as a whole. If there is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http&lt;/code&gt; content that does not support&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; SSL&lt;/code&gt;, it will be sick.&lt;/p&gt;

&lt;p&gt;Therefore, let’s Encrypt is used to make the video server &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SSL&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For the procedure, please refer to &lt;a href=&quot;https://qiita.com/matsuyoro/items/65fb8de2e7197e2ed472&quot;&gt;** “Simple free SSL conversion to CentOS8 (nginx) using certbot &amp;amp; SSL automatic update” **&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After completing the above (1) firewall, (2) router port mapping, and (3) DDNS settings, (4) start &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;certbot&lt;/code&gt; with NGINX running. Then, at the same time as getting the certificate, it will make appropriate changes to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nginx.conf&lt;/code&gt; and make the video server SSL.&lt;/p&gt;

&lt;h4 id=&quot;-nginxconf-1&quot;&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; nginx.conf&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;n&quot;&gt;http&lt;/span&gt; {
    &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;server_name&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;camsvr&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;ddns&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;443&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ssl&lt;/span&gt;; &lt;span class=&quot;c&quot;&gt;# managed by Certbot
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;ssl_certificate&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;letsencrypt&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;live&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;camsvr&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;ddns&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;fullchain&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;pem&lt;/span&gt;; &lt;span class=&quot;c&quot;&gt;# managed by Certbot
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;ssl_certificate_key&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;letsencrypt&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;live&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;camsvr&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;ddns&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;privkey&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;pem&lt;/span&gt;; &lt;span class=&quot;c&quot;&gt;# managed by Certbot
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;letsencrypt&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;options&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;ssl&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;conf&lt;/span&gt;; &lt;span class=&quot;c&quot;&gt;# managed by Certbot
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;ssl_dhparam&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;letsencrypt&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;ssl&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;dhparams&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;pem&lt;/span&gt;; &lt;span class=&quot;c&quot;&gt;# managed by Certbot
&lt;/span&gt;    }
    &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;n&quot;&gt;host&lt;/span&gt; = &lt;span class=&quot;n&quot;&gt;camsvr&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;ddns&lt;/span&gt;) {
            &lt;span class=&quot;n&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;301&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;https&lt;/span&gt;://$&lt;span class=&quot;n&quot;&gt;host&lt;/span&gt;$&lt;span class=&quot;n&quot;&gt;request_uri&lt;/span&gt;;
        } &lt;span class=&quot;c&quot;&gt;# managed by Certbot
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;server_name&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;camsvr&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;ddns&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;404&lt;/span&gt;; &lt;span class=&quot;c&quot;&gt;# managed by Certbot
&lt;/span&gt;    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The commented &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;# managed by Certbot&lt;/code&gt; is where&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; certbot&lt;/code&gt; rewrote or added.&lt;/p&gt;

&lt;h4 id=&quot;2-2-4-5-cors-header&quot;&gt;2-2-4-5: CORS header&lt;/h4&gt;

&lt;p&gt;As mentioned just above, video distribution web pages will be a mix of content from the new video server with pages provided by existing web servers. At this time, the problem of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CORS (Cross-Origin Resource Sharing)&lt;/code&gt; arises.&lt;/p&gt;

&lt;p&gt;To deal with this, add a CORS-enabled header to the response from the video server.&lt;/p&gt;

&lt;h4 id=&quot;-nginxconf-2&quot;&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; nginx.conf&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;n&quot;&gt;http&lt;/span&gt; {
    &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; / {
            &lt;span class=&quot;c&quot;&gt;# CORS start
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Access-Control-Allow-Origin'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'https://my.web.server'&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;c&quot;&gt;# Allow CORS preflight requests
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;n&quot;&gt;request_method&lt;/span&gt; = &lt;span class=&quot;s1&quot;&gt;'OPTIONS'&lt;/span&gt;) {
                &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Access-Control-Allow-Origin'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'https://my.web.server'&lt;/span&gt;;
                &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Access-Control-Max-Age'&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1728000&lt;/span&gt;;
                &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Content-Type'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'text/plain charset=UTF-8'&lt;/span&gt;;
                &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Content-Length'&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;;
                &lt;span class=&quot;n&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;204&lt;/span&gt;;
            }
            &lt;span class=&quot;c&quot;&gt;# CORS end
&lt;/span&gt;        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The setting is to allow only specific origins who know their identity. To be honest, I’m not sure about CORS. For the time being, shake it off to the safe side.&lt;/p&gt;

&lt;h3 id=&quot;2-2-5-video-distribution-by-nginx&quot;&gt;2-2-5: Video distribution by NGINX&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://www.nginx.com/blog/video-streaming-for-remote-learning-with-nginx/&quot;&gt;** “Enabling Video Streaming for Remote Learning with NGINX and NGINX Plus” **&lt;/a&gt; Add the video distribution settings to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nginx.conf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The following are the settings for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HLS&lt;/code&gt;.&lt;/p&gt;

&lt;h4 id=&quot;-nginxconf-3&quot;&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; nginx.conf&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;n&quot;&gt;http&lt;/span&gt; { 
    &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; { 
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; / { 
            &lt;span class=&quot;n&quot;&gt;root&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;hls&lt;/span&gt;; 
        } 
    }
    &lt;span class=&quot;n&quot;&gt;types&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;vnd&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;apple&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;mpegurl&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;m3u8&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;video&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;mp2t&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ts&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;html&lt;/span&gt;;
    } 
}
&lt;span class=&quot;n&quot;&gt;rtmp&lt;/span&gt; { 
    &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; { 
        &lt;span class=&quot;n&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1935&lt;/span&gt;; 
        &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;livecam&lt;/span&gt; { 
            &lt;span class=&quot;n&quot;&gt;live&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;; 
            &lt;span class=&quot;n&quot;&gt;interleave&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;hls&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;; 
            &lt;span class=&quot;n&quot;&gt;hls_path&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;hls&lt;/span&gt;; 
            &lt;span class=&quot;n&quot;&gt;hls_fragment&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;; 
        } 
    } 
} 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;–&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http&lt;/code&gt;&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;server&lt;/code&gt;&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; location / &lt;/code&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; root&lt;/code&gt; changed to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/ tmp / hls&lt;/code&gt;&lt;br /&gt;
 –Additional settings for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http&lt;/code&gt;&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; types&lt;/code&gt; blocks&lt;br /&gt;
 –In addition to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;html&lt;/code&gt;, set the types of&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; m3u8&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ts&lt;/code&gt; for&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; HLS&lt;/code&gt;&lt;br /&gt;
 –Additional settings for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rtmp&lt;/code&gt; block&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hls_path&lt;/code&gt; should be&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; / tmp / hls&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;location&lt;/code&gt;&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; root&lt;/code&gt; setting on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http&lt;/code&gt; side and the&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; hls_path&lt;/code&gt; setting on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rtmp&lt;/code&gt; side are paired. This video server is set to deliver &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HLS&lt;/code&gt; videos directly under&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; / &lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;2-2-6-video-conversion-by-ffmpeg&quot;&gt;2-2-6: Video conversion by ffmpeg&lt;/h3&gt;

&lt;p&gt;Finally, ffmpeg converts the IP camera’s RTSP stream into an RTMP stream and sends it to the video distribution server.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ffmpeg -i rtsp://192.168.0.101/12.amp -c copy -an -f flv rtmp://192.168.0.99/livecam/std
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;–&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-i rtsp: //192.168.0.101/12.amp&lt;/code&gt; … Specify the RTSP stream of the IP camera as input.&lt;br /&gt;
 –The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;12&lt;/code&gt; part depends on the IP camera used.&lt;br /&gt;
 –SV3C SV-801W-1080P-HX provides two streams, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;11&lt;/code&gt; (1920 x 1080) and&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; 12&lt;/code&gt; (640 x 352). The latter is used here.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-c copy&lt;/code&gt; … Leave the codec as input.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-an&lt;/code&gt; … No audio output.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-f flv&lt;/code&gt; … Specify the output format. FLV is Flash Video.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; rtmp: //192.168.0.99/livecam/std&lt;/code&gt; … Specify the output destination.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;livecam&lt;/code&gt; … application name.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;std&lt;/code&gt; … Stream name.&lt;br /&gt;
 –The URL for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RTMP&lt;/code&gt; will be&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; rtmp: //camsvr.on.ddns/livecam/std&lt;/code&gt;.&lt;br /&gt;
 –The URL for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HLS&lt;/code&gt; will be&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; https://camsvr.on.ddns/std.m3u8&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you don’t need to process the video, you can use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-c copy&lt;/code&gt;. It saves you the trouble of decoding the input and encoding the output, so there is almost no load on the CPU.&lt;/p&gt;

&lt;p&gt;Resizing the image and adjusting the tint can be a bit more complicated and CPU-intensive.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ffmpeg -i rtsp://192.168.0.101/12.amp -c:v libx264 -b:v 512k -r 15 -vf hue=h=10 -an -f flv rtmp://192.168.0.99/livecam/std
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;–&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-c: v libx264&lt;/code&gt; … Specify the video codec. It is H.264.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-b: v 512k&lt;/code&gt; … Specify the bit rate of the video. 512kb / sec.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-r 15&lt;/code&gt; … Specifying the frame rate. 15 fps.&lt;br /&gt;
 –&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-vf hue = h = 10&lt;/code&gt; … Specify the video filter. Rotate the hue 10 degrees.&lt;/p&gt;

&lt;p&gt;The final hue adjustment is to correct the redness of the image, whether it is a characteristic of this IP camera as a model or an individual.&lt;/p&gt;

&lt;p&gt;The strength of ffmpeg is endless.&lt;/p&gt;

&lt;h4 id=&quot;2-2-6-1-ffmpeg-monitoring-obsoleted&quot;&gt;2-2-6-1: ffmpeg monitoring (obsoleted)&lt;/h4&gt;

&lt;p&gt;If the RTSP stream is disturbed due to a malfunction of the IP camera, ffmpeg may end. That’s not good as a video conversion server, so create a shell script that monitors the operation of ffmpeg and restarts it if it stops.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#!/usr/bin/bash
# The script runs for 18 hours (12 x 60 x 18 = 12960)
limit=12960
counter=0
while [ $counter -le $limit ]; do
    sleep 5
    alive=`ps -aef | grep ffmpeg | grep livecam | wc -l`
    # echo `date` &quot;:ffmpeg alive =&quot;$alive
    if [ $alive = 0 ]; then
        echo `date` &quot; : ffmpeg is not running.&quot;
        echo &quot;starting ffmpeg ...&quot;
        ffmpeg -i rtsp://192.168.0.101/12.amp -c:v libx264 -an -r 15 -b:v 512k -vf hue=h=10 -f flv rtmp://192.168.0.99/livecam/std 2&amp;gt;&amp;gt;/var/log/nginx/ffmpeg.log &amp;amp;
        echo &quot;done.&quot;
    fi
    ((counter++))
done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Check ffmpeg for survival every 5 seconds for 18 hours and launch if dead. Start this script with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cron&lt;/code&gt; every day at 3:00 AM. It is a crazy setting that you can die between 9:00 PM and 3:00 AM.&lt;/p&gt;

&lt;h4 id=&quot;2-2-6-2-start-ffmpeg-on-nginx&quot;&gt;2-2-6-2: Start ffmpeg on NGINX&lt;/h4&gt;

&lt;p&gt;Actually, you don’t have to start ffmpeg yourself and monitor it as described above. Just start ffmpeg on NGINX.&lt;/p&gt;

&lt;h4 id=&quot;nginxconf&quot;&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nginx.conf&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
        &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;livecam&lt;/span&gt; { 
            &lt;span class=&quot;n&quot;&gt;live&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;; 
            &lt;span class=&quot;n&quot;&gt;interleave&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;hls&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;; 
            &lt;span class=&quot;n&quot;&gt;hls_path&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;tmp&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;hls&lt;/span&gt;; 
            &lt;span class=&quot;n&quot;&gt;hls_fragment&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;exec_static&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;usr&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;bin&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;ffmpeg&lt;/span&gt; -&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rtsp&lt;/span&gt;://&lt;span class=&quot;m&quot;&gt;192&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;168&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;101&lt;/span&gt;/&lt;span class=&quot;m&quot;&gt;12&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;amp&lt;/span&gt; -&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;:&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;libx264&lt;/span&gt; -&lt;span class=&quot;n&quot;&gt;an&lt;/span&gt; -&lt;span class=&quot;n&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15&lt;/span&gt; -&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;:&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;512&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;k&lt;/span&gt; -&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flv&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rtmp&lt;/span&gt;: //&lt;span class=&quot;m&quot;&gt;192&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;168&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;m&quot;&gt;99&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;livecam&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;std&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&amp;gt;&amp;gt;/&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;log&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;ffmpeg&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;log&lt;/span&gt;;
        } 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’m using ʻexec_static&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; here because, for some reason, ʻexec_push&lt;/code&gt; doesn’t start ffmpeg as expected in my environment. This failure is also recorded as an open issue on github of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nginx-rtmp-module&lt;/code&gt;, which seems to bother a lot of people.&lt;/p&gt;

&lt;p&gt;Fortunately, ʻexec_static` will start successfully. And even if you kill the launched ffmpeg, another instance will be launched immediately, probably because NGINX is monitoring it. When you quit NGINX, ffmpeg also quits. This is fine.&lt;/p&gt;

&lt;h2 id=&quot;2-3-client-side&quot;&gt;2-3: Client side&lt;/h2&gt;

&lt;p&gt;On the client side, use the JavaScript video playback library ** VIDEO JS **.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;head&amp;gt;
    &amp;lt;link href=&quot;https://vjs.zencdn.net/7.8.4/video-js.css&quot; rel=&quot;stylesheet&quot; /&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;video id=&quot;live-cam&quot; class=&quot;video-js&quot; controls autoplay
            width=&quot;640&quot; height=&quot;352&quot; data-setup=&quot;{}&quot;&amp;gt;
        &amp;lt;source src=&quot;https://camsvr.on.ddns/std.m3u8&quot; type=&quot;application/x-mpegURL&quot; /&amp;gt;
        &amp;lt;p class=&quot;vjs-no-js&quot;&amp;gt;
To watch this video, enable JavaScript and
Use a browser that supports the HTML5 video tag.
        &amp;lt;/p&amp;gt;
    &amp;lt;/video&amp;gt;

    &amp;lt;script src=&quot;https://vjs.zencdn.net/7.8.4/video.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For details, see &lt;a href=&quot;https://videojs.com/&quot;&gt;** “Getting Started” &lt;strong&gt;](https://videojs.com/getting-started) and documentation on [&lt;/strong&gt; VIDEO JS Official Site **&lt;/a&gt;. Please refer.&lt;/p&gt;

&lt;p&gt;That’s it for publishing IP camera videos on web pages.&lt;/p&gt;

&lt;p&gt;If there is something wrong, strange, or something that needs improvement, please let us know.&lt;/p&gt;</content><author><name></name></author><category term="nginx" /><category term=" ffmpeg" /><category term=" rtmp" /><category term=" RTSP" /><category term=" nginx-rtmp-module" /><summary type="html">Publish a video of an IP camera installed at home on a web page.</summary></entry><entry xml:lang="en"><title type="html">[Introduction] A collection of carefully selected links from how to get started on GitHub to how to solve errors when you encounter an error on Git.</title><link href="https://sourceexample.com/en/e4ccf3212a11d42396b6/" rel="alternate" type="text/html" title="[Introduction] A collection of carefully selected links from how to get started on GitHub to how to solve errors when you encounter an error on Git." /><published>2020-10-22T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/e4ccf3212a11d42396b6-en</id><content type="html" xml:base="https://sourceexample.com/en/e4ccf3212a11d42396b6/">&lt;h1 id=&quot;how-to-use-git-such-as-windows10-centos7&quot;&gt;How to use Git such as Windows10, CentOS7&lt;/h1&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/kerobot/items/78372640127771f92ee0&quot;&gt;Use git on Windows 10 and Powershell (including WSL)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/park-jh/items/fb221b680ae578cead82&quot;&gt;Install the latest version of git on CentOS 7&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;what-you-need-to-know-before-using-github-how-to-use-git&quot;&gt;What you need to know before using GitHub How to use Git&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;https://qiita.com/konweb/items/621722f67fdd8f86a017&quot;&gt;[Git] Basic commands&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;how-to-resolve-git-errors&quot;&gt;How to resolve Git errors&lt;/h3&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/09rd193/items/4fdfebf7519c8e35f2ae&quot;&gt;Commit failed –Exit code 1 Received remedy&lt;/a&gt; When this error occurs, a file called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.git&lt;/code&gt; is created in the file. Because it is done. So you can &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;commit&lt;/code&gt; by showing the hidden files and deleting the&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; .git&lt;/code&gt; files. Please refer to &lt;a href=&quot;https://www.4900.co.jp/smarticle/7333/&quot;&gt;this site&lt;/a&gt; to display the hidden files of .git and delete them. By doing so, you can eliminate the error. j&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.ipentec.com/document/git-error-revert-is-not-possible-in-git-revert&quot;&gt;When I run the git revert command, I get an “error: revert is not possible because you have unmerged files.”-How to use Git&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/pugiemonn/items/6f3adef98d279a5aac98&quot;&gt;The solution that says error: Your local changes to the following files would be overwritten by checkout in git checkout&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/knknkn1162/items/b3af70918770d85bc313&quot;&gt;git checkout didn’t understand&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://kaizentech.hatenablog.com/entry/2018/04/27/104909&quot;&gt;What to do when “Clone succeeded, but checkout failed” appears when cloning with Git&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;how-to-get-started-on-github&quot;&gt;How to get started on GitHub&lt;/h1&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/YUMA-NAGAO/items/8f7d49096d5792a798c2&quot;&gt;Carefully selected links from creation to rewind on GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://employment.en-japan.com/engineerhub/entry/2017/01/31/110000&quot;&gt;GitHub to start today ~ Explains how beginners can install Git and pull request&lt;br /&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;about-pull-request&quot;&gt;About Pull Request&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://backlog.com/ja/git-tutorial/pull-request/03/&quot;&gt;Development process using pull request&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Create a pull request from a fork (&lt;br /&gt;
https://docs.github.com/ja/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://hacknote.jp/archives/9781/&quot;&gt;[GitHub] Revert to a specific commit&lt;br /&gt;
&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/kamorits/items/b2624cff212ddf21ad1d&quot;&gt;git When you want to delete only a specific commit (revert)&lt;br /&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;github-application&quot;&gt;GitHub application&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;[What is git submodule]&lt;br /&gt;
(https://qiita.com/sotarok/items/0d525e568a6088f6f6bb)&lt;br /&gt;
 The git submodule is a mechanism for registering an external git repository as a subdirectory of your git repository and referencing a specific commit.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://plasticscafe.hatenadiary.org/entry/20110409/1302339402&quot;&gt;Command memo when you want to update only the git submodule&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/yysskk/items/974c9c55d66a26515651&quot;&gt;Github SSH communication settings&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/shizuma/items/2b2f873a0034839e47ce&quot;&gt;Procedure for ssh connection on GitHub ~ From generation of public / private key ~&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;how-to-apply-githhub-to-publish-a-simple-program-to-the-internet&quot;&gt;How to apply GithHub to publish a simple program to the Internet&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;Configure a custom domain for your GitHub page site&lt;br /&gt;
https://help.github.com/en/github/working-with-github-pages/configuring-a-custom-domain-for-your-github-pages-site)&lt;/li&gt;
  &lt;li&gt;[Websites for you and your projects.]&lt;br /&gt;
(https://pages.github.com/)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://qiita.com/tatane616/items/8624e61473a9957d9a81&quot;&gt;Introduction to GitHub + CircleCI&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;how-to-set-up-git-and-github-in-pycharm&quot;&gt;How to set up Git and GitHub in PyCharm&lt;/h1&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://bit.ly/39ZMjcw&quot;&gt;How to push to GitHub with PyCharm&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bit.ly/3egMvqY&quot;&gt;How to use Git with PyCharm&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</content><author><name></name></author><category term="Windows" /><category term=" Git" /><category term=" GitHub" /><category term=" CentOS" /><summary type="html">How to use Git such as Windows10, CentOS7 Use git on Windows 10 and Powershell (including WSL) Install the latest version of git on CentOS 7</summary></entry><entry xml:lang="en"><title type="html">Use ffmpeg or ffprobe with ffmpeg-aws-lambda-layer</title><link href="https://sourceexample.com/en/c3ffae2276390cc62f31/" rel="alternate" type="text/html" title="Use ffmpeg or ffprobe with ffmpeg-aws-lambda-layer" /><published>2020-10-20T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/c3ffae2276390cc62f31-en</id><content type="html" xml:base="https://sourceexample.com/en/c3ffae2276390cc62f31/">&lt;h1 id=&quot;use-ffmpeg-or-ffprobe-with-ffmpeg-aws-lambda-layer&quot;&gt;Use ffmpeg or ffprobe with ffmpeg-aws-lambda-layer&lt;/h1&gt;

&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This section describes the procedure for building a ffmpeg execution environment that is convenient for formatting and resizing videos and generating thumbnails using AWS Lambda functions and layers.&lt;br /&gt;
 Here, we will use &lt;a href=&quot;https://github.com/serverlesspub/ffmpeg-aws-lambda-layer&quot;&gt;ffmpeg-aws-lambda-layer&lt;/a&gt;. By creating an &lt;a href=&quot;https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/configuration-layers.html&quot;&gt;AWS Lambda layer&lt;/a&gt; that includes ffmpeg and ffprobe separately from the Lambda function, these The command is called under / opt in the Lambda function execution environment. It can be called like a library without including the binary for command execution in the deployment package.&lt;/p&gt;

&lt;p&gt;With &lt;a href=&quot;https://aws.amazon.com/jp/elastictranscoder/&quot;&gt;Amazon Elastic Transcoder&lt;/a&gt;, you can easily format and resize videos, but it is expensive and requires machine power. If it is not a conversion, I think it is easier and better to process it with Lambda.&lt;br /&gt;
 Transfer the ATOM Cam video used in the previously written article (&lt;a href=&quot;https://qiita.com/revsystem/items/d0821a437d4538d039bf&quot;&gt;Set up smart home camera ATOM Cam&lt;/a&gt;) to S3 via NAS and use Amazon Elastic Transcoder. When I created a process to convert the video format, I quickly consumed thousands of yen. It seems better to use ffmpeg for this purpose.&lt;/p&gt;

&lt;h2 id=&quot;what-you-can-do-with-this-sample&quot;&gt;What you can do with this sample&lt;/h2&gt;
&lt;p&gt;If you deploy the sample project provided in &lt;a href=&quot;https://github.com/serverlesspub/ffmpeg-aws-lambda-layer&quot;&gt;ffmpeg-aws-lambda-layer&lt;/a&gt;, ffmpeg-layer-example-uploadbucket-xxxx in S3 And ffmpeg-layer-example-resultbucket-xxxx (xxxx is a random string, the same applies below) will be generated, and the connection with the Lambda function and the IAM role setting will be done automatically.&lt;br /&gt;
 When a video file is uploaded to ffmpeg-layer-example-uploadbucket-xxxx, a thumbnail image is automatically generated in ffmpeg-layer-example-resultbucket-xxxx.&lt;/p&gt;

&lt;h2 id=&quot;things-to-prepare&quot;&gt;Things to prepare&lt;/h2&gt;
&lt;p&gt;-What is written in &lt;a href=&quot;https://github.com/serverlesspub/ffmpeg-aws-lambda-layer&quot;&gt;ffmpeg-aws-lambda-layer&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;- Unix Make environment
- AWS command line utilities (just for deployment)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This time, we confirmed the operation in the following environment.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;aws &lt;span class=&quot;nt&quot;&gt;--version&lt;/span&gt;
aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;–AWS account&lt;br /&gt;
 –You need a role that can operate Lambda, S3, CloudFormation. There is no problem if you have Administrator privileges.&lt;/p&gt;

&lt;h2 id=&quot;reference-information&quot;&gt;Reference information&lt;/h2&gt;
&lt;p&gt;-&lt;a href=&quot;https://qiita.com/yu-croco/items/49f8600a1f7acbdac96f&quot;&gt;Create thumbnails from videos using FFmpeg on AWS Lambda&lt;/a&gt;&lt;br /&gt;
 -&lt;a href=&quot;https://qiita.com/makotok7/items/0e7d2f941e5da8cec8d1&quot;&gt;Analyze video with ffprobe&lt;/a&gt;&lt;br /&gt;
 -&lt;a href=&quot;https://xp-cloud.jp/blog/2018/05/18/3345/&quot;&gt;Encode with AWS Lambda (Node.js) + ffmpeg&lt;/a&gt;&lt;br /&gt;
 -&lt;a href=&quot;http://blog.kumoto.jp/2019/01/08/custom-aws-lambda-runtimes/&quot;&gt;Try to generate and convert audio files with custom AWS Lambda runtime&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;preparation&quot;&gt;Preparation&lt;/h2&gt;
&lt;h3 id=&quot;git-clone-ffmpeg-aws-lambda-layer&quot;&gt;git clone ffmpeg-aws-lambda-layer&lt;/h3&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/serverlesspub/ffmpeg-aws-lambda-layer.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;preparing-a-temporary-s3-bucket&quot;&gt;Preparing a temporary S3 bucket&lt;/h3&gt;
&lt;p&gt;Creates a bucket in the same region as the region specified in the default profile in ~ / .aws / credentials.&lt;/p&gt;

&lt;h2 id=&quot;deploy-sample-project&quot;&gt;Deploy sample project&lt;/h2&gt;
&lt;p&gt;Specify the bucket name of the temporary S3 bucket for the value of the DEPLOYMENT_BUCKET option.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ffmpeg-aws-lambda-layer
make deploy-example &lt;span class=&quot;nv&quot;&gt;DEPLOYMENT_BUCKET&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;BUCKET NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When you execute the make command, the following log will be displayed.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd example &amp;amp;&amp;amp; \
		make deploy DEPLOYMENT_BUCKET=&amp;lt;BUCKET NAME&amp;gt; LAYER_STACK_NAME=ffmpeg-lambda-layer
mkdir -p build
aws cloudformation package --template-file template.yaml --output-template-file output.yaml --s3-bucket net.rev-system.nas
Uploading to d5886731828e201e755325e950d28eab  1742 / 1742.0  (100.00%)
Successfully packaged artifacts and wrote output template to file output.yaml.
Execute the following command to deploy the packaged template
aws cloudformation deploy --template-file /tmp/ffmpeg-aws-lambda-layer/example/output.yaml --stack-name &amp;lt;YOUR STACK NAME&amp;gt;
aws cloudformation deploy --template-file output.yaml --stack-name ffmpeg-layer-example --capabilities CAPABILITY_IAM --parameter-overrides LambdaLayer=arn:aws:lambda:ap-northeast-1:************:layer:ffmpeg:1

Waiting for changeset to be created..
Waiting for stack create/update to complete
Successfully created/updated stack - ffmpeg-layer-example
aws cloudformation describe-stacks --stack-name ffmpeg-layer-example --query Stacks[].Outputs --output table
--------------------------------------------------------------------------------------------
|                                      DescribeStacks                                      |
+-------------------+----------------+-----------------------------------------------------+
|    Description    |   OutputKey    |                     OutputValue                     |
+-------------------+----------------+-----------------------------------------------------+
|  Upload S3 bucket |  UploadBucket  |  ffmpeg-layer-example-uploadbucket-xxxxxxxxxxx      |
|  Results S3 bucket|  ResultsBucket |  ffmpeg-layer-example-resultsbucket-yyyyyyyyyyyy    |
+-------------------+----------------+-----------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here, the following resources are created.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Resource type&lt;/th&gt;
      &lt;th style=&quot;text-align: left&quot;&gt;Name example&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Lambda function&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;ffmpeg-layer-example-ConvertFileFunction-nnnnnnnnnnnn&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;Lambda layer&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;ffmpeg&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;S3 bucket(For upload)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;ffmpeg-layer-example-uploadbucket-xxxxxxxxxxx&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;S3 bucket(Converted)&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;ffmpeg-layer-example-resultsbucket-yyyyyyyyyyyy&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;CloudFront stack&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;ffmpeg-layer-example&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;IAM roll&lt;/td&gt;
      &lt;td style=&quot;text-align: left&quot;&gt;ffmpeg-layer-example-ConvertFileFunctionRole-zzzzzzzzzzzz&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;thumbnail-generation&quot;&gt;Thumbnail generation&lt;/h2&gt;
&lt;p&gt;Upload the appropriate video file to the S3 bucket ffmpeg-layer-example-uploadbucket-xxxxxxxxxxx.&lt;br /&gt;
 After a while, the thumbnail image will be output to ffmpeg-layer-example-resultsbucket-yyyyyyyyyyyy.&lt;/p&gt;

&lt;h3 id=&quot;output-other-than-thumbnails&quot;&gt;Output other than thumbnails&lt;/h3&gt;

&lt;p&gt;If you want to format the video in a different format or output the meta information of the video file with ffprobe, you can try various things by changing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffmpeg-aws-lambda-layer / example / src / index.js&lt;/code&gt; and redeploying.&lt;/p&gt;

&lt;h2 id=&quot;create-only-lambda-layer&quot;&gt;Create only Lambda layer&lt;/h2&gt;

&lt;p&gt;If you want to deploy only the Lambda layer without deploying the uploaded / converted S3 bucket or Lambda function, execute the following command.&lt;br /&gt;
 Specify the bucket name of the temporary S3 bucket for the value of the DEPLOYMENT_BUCKET option.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ffmpeg-aws-lambda-layer
make deploy &lt;span class=&quot;nv&quot;&gt;DEPLOYMENT_BUCKET&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;BUCKET NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Only the Lambda layer is deployed, so you can use it by adding this layer to any Lambda function.&lt;/p&gt;</content><author><name></name></author><category term="AWS" /><category term=" ffmpeg" /><category term=" AWS Lambda" /><summary type="html">Use ffmpeg or ffprobe with ffmpeg-aws-lambda-layer</summary></entry><entry xml:lang="en"><title type="html">CentOS 7 curl version upgrade</title><link href="https://sourceexample.com/en/dd37b494ab924c04ed2a/" rel="alternate" type="text/html" title="CentOS 7 curl version upgrade" /><published>2020-10-20T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/dd37b494ab924c04ed2a-en</id><content type="html" xml:base="https://sourceexample.com/en/dd37b494ab924c04ed2a/">&lt;p&gt;I thought that if I followed the procedure introduced in some article, it would be completed smoothly, but I struggled unexpectedly, so I summarized my own procedure.&lt;/p&gt;

&lt;p&gt;I hope it helps those who hit the same wall, saying, “I installed the latest version, but when I checked the version, it remained old.”&lt;/p&gt;

&lt;h2 id=&quot;install-the-required-modules&quot;&gt;Install the required modules&lt;/h2&gt;

&lt;p&gt;Basically, I followed this article. I’m not sure what the required modules are. .. ..&lt;br /&gt;
 https://sterfield.co.jp/programmer/curlの最新版をインストールする/&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;yum &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;openssl-devel libmetalink-devel libssh2-devel c-ares-devel lbzip2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;get-the-latest-version-targz-download-link-address&quot;&gt;Get the latest version tar.gz download link address&lt;/h2&gt;
&lt;p&gt;Copy the latest &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl-X.X.X.tar.gz&lt;/code&gt; link address at https://curl.haxx.se/download.html.&lt;/p&gt;

&lt;h2 id=&quot;download-the-latest-version-of-targz-in-any-directory&quot;&gt;Download the latest version of tar.gz in any directory&lt;/h2&gt;

&lt;p&gt;After the installation is complete, I want to delete unnecessary folders and files, so download them to my home directory in an easy-to-understand manner.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$wget&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;copied &lt;span class=&quot;nb&quot;&gt;link &lt;/span&gt;address]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;extract-the-downloaded-curl-xxxtargz&quot;&gt;Extract the downloaded curl-X.X.X.tar.gz&lt;/h2&gt;

&lt;p&gt;After unpacking, a directory called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl-X.X.X&lt;/code&gt; will be created, so move the working directory.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;tar &lt;/span&gt;xfvz curl-X.X.X.tar.gz
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;curl-X.X.X
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;install-the-latest-version-of-curl&quot;&gt;Install the latest version of curl&lt;/h2&gt;

&lt;p&gt;To be honest, I ran it without knowing the meaning of these commands, but when I put together this article, I looked it up again and found an article that was explained carefully.&lt;br /&gt;
https://qiita.com/chihiro/items/f270744d7e09c58a50a5/&lt;br /&gt;
https://www.itmedia.co.jp/help/tips/linux/l0302.html&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./configure &lt;span class=&quot;nt&quot;&gt;--enable-libcurl-option&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;make &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;not-the-latest-version-&quot;&gt;Not the latest version …&lt;/h2&gt;

&lt;p&gt;Finally, I checked the version &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -V&lt;/code&gt;, but for some reason it wasn’t the latest version, so I checked the full path of the command with&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; which -a curl&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;which &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; curl
/usr/local/bin/curl
/usr/bin/curl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After checking each version, it seems that the latest version is installed in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/ usr / local / bin / curl&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;/usr/local/bin/curl &lt;span class=&quot;nt&quot;&gt;-V&lt;/span&gt;
New version information

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;/usr/bin/curl &lt;span class=&quot;nt&quot;&gt;-V&lt;/span&gt;
Old version information
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;delete-old-version--create-link-for-new-version&quot;&gt;Delete old version &amp;amp; create link for new version&lt;/h2&gt;

&lt;p&gt;I tried to copy “I made a mistake in the installation path, so I deleted the old one and made it a link” in this article, and I found that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -V&lt;/code&gt; was the latest version!&lt;br /&gt;
https://m-shige1979.hatenablog.com/entry/2018/10/08/080000&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo rm&lt;/span&gt; /usr/bin/curl
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /usr/local/bin/curl /usr/bin/curl
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;curl &lt;span class=&quot;nt&quot;&gt;-V&lt;/span&gt;
New version information
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><category term="CentOS" /><category term=" curl" /><summary type="html">I thought that if I followed the procedure introduced in some article, it would be completed smoothly, but I struggled unexpectedly, so I summarized my own procedure.</summary></entry><entry xml:lang="en"><title type="html">802.1X authentication to the network of Bonding setting in CentOS7</title><link href="https://sourceexample.com/en/fc2750d5aa9564d834cc/" rel="alternate" type="text/html" title="802.1X authentication to the network of Bonding setting in CentOS7" /><published>2020-10-18T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/fc2750d5aa9564d834cc-en</id><content type="html" xml:base="https://sourceexample.com/en/fc2750d5aa9564d834cc/">&lt;h1 id=&quot;network-settings-on-a-single-nic-work-but-&quot;&gt;Network settings on a single NIC work, but …&lt;/h1&gt;

&lt;p&gt;There was a case where I wanted the installed server network to be ** Bonging using multiple NIC ports and join the network with 802.1X authentication **.&lt;br /&gt;
 I was only able to participate in the network with a single NIC by myself, but with the cooperation of the people around me, I was able to participate with 802.1X authentication even in the case of Bonking.&lt;/p&gt;

&lt;p&gt;Even if I searched on the net, I could not find the method of 802.1X authentication with “** Bonding setting **”, so I will publish it as an article here. (Thanks to everyone who cooperated!)&lt;/p&gt;

&lt;h1 id=&quot;environment--things-to-prepare&quot;&gt;Environment / things to prepare&lt;/h1&gt;
&lt;p&gt;I can’t answer the device information of the server and network switch, but I hope you can think that the server is a racking type server such as Fujitsu, HP, IBM, and the network switch is done using products such as NETGEAR and Cisco. think.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;We will proceed on the premise that the network bonding settings are created in CentOS 7 in advance.&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class=&quot;language-environment&quot;&gt;OS:CentOS7.8
NIC port to be Bonding: Wired connection with two ports on Intel 10G NIC
Certificate file: ZZZZZZ.pem(Or it may be in crt format)
Private key file: ZZZZZZ.p12
&lt;/code&gt;&lt;/pre&gt;

&lt;h1 id=&quot;-convert-the-certificate-file-from-crt-format-to-pem-format&quot;&gt;① Convert the certificate file from crt format to pem format&lt;/h1&gt;
&lt;p&gt;Initially, I received a certificate in the crt file format from the user, but I don’t know the cause, but in the crt format, 802.1X authentication failed in the subsequent work.&lt;br /&gt;
 So, convert from crt to pem format with the following command.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;If the certificate file remains in pem format, this work is not necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;```Command line&lt;br /&gt;
openssl x509 -in ZZZZZZ.crt -out ZZZZZZ.pem&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
# (2) Migrate the storage directory of the certificate file and private key file
 Save ZZZZZZ.pem and ZZZZZZ.p12 in `/ etc / pki / CA / certs /`.

# ③ Edit the ifcfg file
 The bonding setting file is set as follows in `/ etc / sysconfig / network-scripts / ifcfg-bond0`.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;BONDING_OPTS=”mode=4 miimon=100 xmit_hash_policy=layer2+3”&lt;br /&gt;
DEVICE=bond0&lt;br /&gt;
TYPE=Bond&lt;br /&gt;
BOOTPROTO=none&lt;br /&gt;
BONDING_MASTER=yes&lt;br /&gt;
NAME=bond0&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;br /&gt;
MTU=9000&lt;br /&gt;
DNS1=aaa.bbb.ccc.ddd&lt;br /&gt;
DNS2=aaa.bbb.ccc.ddd&lt;br /&gt;
GATEWAY=aaa.bbb.ccc.ddd&lt;br /&gt;
IPADDR=aaa.bbb.ccc.ddd&lt;br /&gt;
NETMASK=aaa.bbb.ccc.ddd&lt;br /&gt;
PREFIX=yy&lt;/p&gt;

&lt;h1 id=&quot;8021x-authentication-settings&quot;&gt;802.1X authentication settings&lt;/h1&gt;
&lt;p&gt;KEY_MGMT=IEEE8021X&lt;br /&gt;
IEEE_8021X_EAP_METHODS=TLS&lt;br /&gt;
IEEE_8021X_IDENTITY=XXXXXXXXX&lt;br /&gt;
IEEE_8021X_CA_CERT=/etc/pki/CA/certs/ZZZZZZ.pem #Specify the path where the pem format file is saved in ②&lt;br /&gt;
IEEE_8021X_PRIVATE_KEY=/etc/pki/CA/certs/ZZZZZZ.p12 #Specify the path where the p12 format file is saved in (2)&lt;br /&gt;
DOMAIN=zzzz.zzzz.zzzz&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
# ④ Edit /etc/sysconfig/wpa_supplicant and /etc/wpa_supplicant/wpa_supplicant.conf
 Edit the contents of `/etc/wpa_supplicant/wpa_supplicant.conf` as follows.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;INTERFACES=”-iZZZZZZ”&lt;br /&gt;
DRIVERS=”-Dwired”&lt;br /&gt;
OTHER_ARGS=”-u -f /var/log/wpa_supplicant.log -P /var/run/wpa_supplicant.pid -t”&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
 Edit the contents of `/ etc / sysconfig / wpa_supplicant` as follows.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;ctrl_interface=/var/run/wpa_supplicant&lt;br /&gt;
ctrl_interface_group=0&lt;br /&gt;
network={&lt;br /&gt;
        key_mgmt=IEEE8021X&lt;br /&gt;
        eap=tls&lt;br /&gt;
        identity=”ZZZZZZ”&lt;br /&gt;
        ca_cert=”/etc/pki/CA/certs/ZZZZZZ.pem”&lt;br /&gt;
        private_key=”/etc/pki/CA/certs/ZZZZZZ.p12”&lt;br /&gt;
        private_key_passwd=”ZZZZZZ”&lt;br /&gt;
        }&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
# (5) Disable the startup of NetworkManager when the server starts.
 If NetworkManager is started in advance, 802.1X authentication cannot be performed, so ** disable the service **.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;chkconfig NetworkManager off&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
# ⑥ Enable and start wpa_supplicant
 Since wpa_supplicant must be started for 802.1X authentication, ** enable and start the service **.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;chkconfig wpa_supplicant on&lt;br /&gt;
systemctl start wpa_supplicant&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
# ⑦ Start wpa_supplicant and check if Connection succeeds.

 If you get `bond0: CTRL-EVENT-CONNECTED --Connection to &amp;lt;MAC address&amp;gt; completed` with the following command, 802.1X authentication is successful.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -D wired -i bond0&lt;br /&gt;
```&lt;/p&gt;

&lt;h1 id=&quot;-check-if-supplicant-authentication-is-successful-on-the-network-switch-side&quot;&gt;⑧ Check if Supplicant authentication is successful on the network switch side&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Log output and commands vary depending on the manufacturer and device of the network switch, so they are omitted.&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="CentOS" /><category term=" centos7" /><category term=" bonding" /><category term=" 802.1x" /><summary type="html">Network settings on a single NIC work, but …</summary></entry><entry xml:lang="en"><title type="html">Check the version of Cent OS</title><link href="https://sourceexample.com/en/3c6316544123b62d7c0e/" rel="alternate" type="text/html" title="Check the version of Cent OS" /><published>2020-10-17T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/3c6316544123b62d7c0e-en</id><content type="html" xml:base="https://sourceexample.com/en/3c6316544123b62d7c0e/">&lt;p&gt;You can check the version with the following command.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[root@sandbox ~]# cat /etc/centos-release
CentOS Linux release 7.8.2003 (Core)

[root@sandbox ~]# bash --version
GNU bash,Version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+:GNU GPL version 3 or later&amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><category term="CentOS" /><summary type="html">You can check the version with the following command.</summary></entry><entry xml:lang="en"><title type="html">Until you can watch the HDR video taken with Sony’s mirrorless α6400 on Youtube (FFMpeg option story)</title><link href="https://sourceexample.com/en/1145108231641a4fb043/" rel="alternate" type="text/html" title="Until you can watch the HDR video taken with Sony's mirrorless α6400 on Youtube (FFMpeg option story)" /><published>2020-10-16T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/1145108231641a4fb043-en</id><content type="html" xml:base="https://sourceexample.com/en/1145108231641a4fb043/">&lt;p&gt;It’s mainly about ffmpeg settings.&lt;/p&gt;

&lt;p&gt;I bought a mirrorless interchangeable-lens camera this time. It is α6400.&lt;br /&gt;
 I was told that I wouldn’t recommend a kit lens, so I chose a sharp one and chose Sirui’s 50mm F1.8 Anamorphic.&lt;br /&gt;
 This time I decided to use the α6400 because it is possible to shoot HDR, so I took a test shot and tried it until it was uploaded to Youtube, so it is a memorandum.&lt;br /&gt;
 I think that it is not necessary information especially for those who have a paid version of DaVinci or Adobe products.&lt;/p&gt;
&lt;h2 id=&quot;purpose&quot;&gt;Purpose&lt;/h2&gt;
&lt;p&gt;The α6400 shoots HDR video with HLG and saves it as mp4. First of all, I tried how to take this and post it on Youtube.&lt;br /&gt;
 Also, since it is an anamorphic lens, it needs to be stretched sideways after shooting, so I will do this together as well.&lt;/p&gt;

&lt;h3 id=&quot;issue-with-pq&quot;&gt;Issue with PQ&lt;/h3&gt;
&lt;p&gt;If you are not an anamorphic lens, you do not need the -aspect 24:10 -s 3840x1600 section.&lt;/p&gt;

&lt;h4 id=&quot;ffmpeg--y--i-c0001mp4--aspect-2410--s-3840x1600--cv-libx265--tagv-hvc1--crf-22--pix_fmt-yuv420p10le--x265-params-colorprimbt2020transfersmpte2084colormatrixbt2020nc-c0001outmp4&quot;&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ffmpeg -y -i C0001.MP4 -aspect 24:10 -s 3840x1600 -c:v libx265 -tag:v hvc1 -crf 22 -pix_fmt yuv420p10le -x265-params &quot;colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc&quot; C0001out.mp4&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
 Click here for the uploaded video
https://youtu.be/uPuNuE5b0As
 I feel that I'm used to playing games because I often use it during HDR. When I posted it on Youtube, it was recognized as HDR, but the video that was automatically converted on Youtube, which is played when viewed in the SDR environment, is crushed and dirty. It looks better on an HDR monitor, but it still feels crushed.
### Issue with HLG
 If this is also not an anamorphic lens, the section -aspect 24:10 -s 3840x1600 is unnecessary.
 HLG is specified by color_trc 18.

#### **`ffmpeg -y -i C0001.MP4 -aspect 24:10 -s 3840x1600 -c:v libx265 -tag:v hvc1 -crf 22 -pix_fmt yuv420p10le -color_trc 18 -color_primaries 9 -colorspace 9 C0001out.mp4`**
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Click here for the uploaded video&lt;br /&gt;
https://youtu.be/N0Rkmyfb2Ho&lt;br /&gt;
 Both SDR and HDR can be seen in a safe form with less crushing than PQ, but worse, it feels a little sleepy. It’s in a state of being taken without grading, and I feel like this.&lt;/p&gt;
&lt;h3 id=&quot;about-resolution&quot;&gt;About resolution&lt;/h3&gt;
&lt;p&gt;For upload requirements&lt;br /&gt;
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;720p、1080p、1440p、2160p
 For best quality playback, use the UHD standard instead of the DCI standard (for example, use an aspect ratio of 3840x1600 instead of 4096x1716).&lt;/code&gt;``&lt;br /&gt;
 So I chose 3840 * 1600.&lt;/p&gt;

&lt;h3 id=&quot;to-check-if-the-uploaded-video-is-what-you-intended&quot;&gt;To check if the uploaded video is what you intended&lt;/h3&gt;
&lt;p&gt;Right-click on the video and click Detailed Statistics&lt;br /&gt;
 &lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/502600/e0e4d2f6-0223-672b-2e1a-723c8e0c3ede.png&quot; alt=&quot;image.png&quot; /&gt;&lt;br /&gt;
 Then, the codec, color space, color gamut, etc. will be displayed in the upper right corner of the screen.&lt;br /&gt;
 &lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/502600/b9a343cf-3ca6-8d43-8fcb-b12ba23063e4.png&quot; alt=&quot;image.png&quot; /&gt;&lt;br /&gt;
 As a caveat, if you view it on a monitor or browser that is not in an HDR playback environment, the information of the automatically converted one will be displayed, so it is better to first check whether HDR is effective.&lt;br /&gt;
 &lt;img src=&quot;https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/502600/05e1a35c-0dff-e5d4-899e-d83a29d8f769.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;finally&quot;&gt;Finally&lt;/h3&gt;
&lt;p&gt;It seems that it is converted to vp9 at the time of uploading, so it may be more efficient to put it out with webm / vp9 from the beginning.&lt;br /&gt;
 I’m still completely lacking in knowledge about HDR, so please let me know if you have any questions.&lt;br /&gt;
 As an aside, I learned for the first time that Youtube uses ffmpeg for these upload conversions in the following words.&lt;/p&gt;

&lt;h4 id=&quot;if-trc-is-not-supported-by-ffmpegs-color-space-conversion-filter-youtube-will-btset-it-back-to-709&quot;&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;If TRC is not supported by FFmpeg's color space conversion filter, YouTube will BT.Set it back to 709.&lt;/code&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;```Set it back to 709.&lt;/p&gt;

&lt;p&gt;From the color space section of the encoding settings in the reference.&lt;/p&gt;

&lt;h2 id=&quot;reference&quot;&gt;reference&lt;/h2&gt;
&lt;p&gt;Options etc.&lt;br /&gt;
https://developers.google.com/media/vp9/hdr-encoding&lt;br /&gt;
 Upload High Dynamic Range (HDR) videos&lt;br /&gt;
https://support.google.com/youtube/answer/7126552?hl=ja&lt;br /&gt;
 Encoding settings&lt;br /&gt;
https://support.google.com/youtube/answer/1722171&lt;/p&gt;</content><author><name></name></author><category term="ffmpeg" /><summary type="html">It’s mainly about ffmpeg settings.</summary></entry><entry xml:lang="en"><title type="html">Install PostgreSQL 12 on Centos8</title><link href="https://sourceexample.com/en/7ae5ecc18ebae6a0dfbc/" rel="alternate" type="text/html" title="Install PostgreSQL 12 on Centos8" /><published>2020-10-15T00:00:00+00:00</published><updated>2020-10-23T00:00:00+00:00</updated><id>https://sourceexample.com/en/7ae5ecc18ebae6a0dfbc-en</id><content type="html" xml:base="https://sourceexample.com/en/7ae5ecc18ebae6a0dfbc/">&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Since I had only touched Mysql, I installed Postgresql using the installation method on the official website for verification.&lt;br /&gt;
 This time, we assume a local postgres user connection without authentication.&lt;/p&gt;

&lt;h1 id=&quot;environment&quot;&gt;environment&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;CentOS8&lt;/li&gt;
  &lt;li&gt;Postgresql12&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;installation&quot;&gt;Installation&lt;/h1&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql
dnf install -y postgresql12-server
/usr/pgsql-12/bin/postgresql-12-setup initdb
systemctl enable postgresql-12
systemctl start postgresql-12
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Select the one you want to install from the official website below and install it.&lt;br /&gt;
https://www.postgresql.org/download/linux/redhat/&lt;/p&gt;

&lt;h1 id=&quot;setting-change&quot;&gt;setting change&lt;/h1&gt;
&lt;h2 id=&quot;advance-preparation&quot;&gt;Advance preparation&lt;/h2&gt;
&lt;h3 id=&quot;user-change&quot;&gt;User change&lt;/h3&gt;
&lt;p&gt;After installation, the postgres user has been added, so change the user.&lt;br /&gt;
 Basically, the operation is performed by the postgres user.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;su - postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;directory-transition&quot;&gt;Directory transition&lt;/h3&gt;
&lt;p&gt;Change to the directory where the configuration file is.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd /var/lib/pgsql/12/data
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;add-path&quot;&gt;Add PATH&lt;/h3&gt;
&lt;p&gt;Make pg_ctl available in relative PATH.&lt;br /&gt;
 You may add it to .bash_profile.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;export PATH=$PATH:/usr/pgsql-12/bin/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;postgresql.conf&lt;br /&gt;
 A file for basic settings. Change the settings as appropriate.&lt;br /&gt;
 This time it is a verification, so leave it as the default.&lt;/p&gt;

&lt;p&gt;pg_hba.conf&lt;br /&gt;
 A file that sets the network to connect to.&lt;br /&gt;
 By changing from ident to trust, you can connect to the local host without authentication.&lt;br /&gt;
 If postgresql.conf is the default, you may go to connect with ipv6, so change ipv6 as well.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Change before&lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;After change&lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;reflection-of-settings&quot;&gt;Reflection of settings&lt;/h2&gt;
&lt;p&gt;Apply the settings with the following command.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pg_ctl reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;verification&quot;&gt;Verification&lt;/h1&gt;
&lt;h2 id=&quot;login-confirmation&quot;&gt;Login confirmation&lt;/h2&gt;
&lt;p&gt;Confirm that you can log in with the following command.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;psql -h localhost
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;password-change-optional&quot;&gt;Password change (optional)&lt;/h2&gt;
&lt;p&gt;After connecting, change the password of the postgres user.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;alter role postgres with password 'password';
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;
&lt;p&gt;I installed it on the official website.&lt;br /&gt;
 I forgot to change the ipv6 settings, I didn’t know the initial password of the postgres user, or I was caught unexpectedly.&lt;br /&gt;
 And the initial password for the postgres user is still unknown.&lt;/p&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;https://www.postgresql.org/download/linux/redhat/&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://nextpublishing.jp/book/11673.html&quot;&gt;PostgreSQL classroom for database beginners&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="CentOS" /><category term=" PostgreSQL" /><category term=" PostgreSQL12" /><category term=" centos8" /><summary type="html">Introduction Since I had only touched Mysql, I installed Postgresql using the installation method on the official website for verification. This time, we assume a local postgres user connection without authentication.</summary></entry></feed>