<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Raspberry Pi | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/raspberry-pi/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Mon, 09 Dec 2019 17:31:12 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>Raspberry Pi | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Raspberry pi 解決ip被固定的問題</title>
		<link>https://sdt.hameba.tw/243/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-%25e8%25a7%25a3%25e6%25b1%25baip%25e8%25a2%25ab%25e5%259b%25ba%25e5%25ae%259a%25e7%259a%2584%25e5%2595%258f%25e9%25a1%258c</link>
				<comments>https://sdt.hameba.tw/243/#respond</comments>
				<pubDate>Fri, 06 Dec 2019 03:40:31 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=243</guid>
				<description><![CDATA[<p>通常我都會使用AP對應好硬體的Physical Address xx:xx:xx:xx:xx:xx 就可以正常 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/243/" class="more-link">閱讀全文<span class="screen-reader-text">〈Raspberry pi 解決ip被固定的問題〉</span></a></p>
The post <a href="https://sdt.hameba.tw/243/">Raspberry pi 解決ip被固定的問題</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>通常我都會使用AP對應好硬體的Physical Address xx:xx:xx:xx:xx:xx</p>
<p>就可以正常連線上，但是上禮拜從AP外部要指定改掉內部ip</p>
<p><span id="more-243"></span></p>
<p>發現Raspbian 居然被固定住了，連AP配發也不會對</p>
<p>查文後修改 /etc/dhcpcd.conf</p><pre class="crayon-plain-tag">interface eth0
static ip_address=x.x.x.x/24
static routers=x.x.x.x
static domain_name_servers=x.x.x.x</pre><p>但是我要的不是被固定住，而是可以由AP配發對應起來</p>
<p>後來把上述的代碼全部註解掉</p>
<p>重開機即可，就會對得起來由AP配發的</p>
<p>會有此需求可能當外面透過VPN回到內部網路需要更改硬體的IP</p>
<p>我們在管理端設定即可後重開機器或網卡重啟，較為方便與彈性</p>
<p>Reference</p>
<p><a href="https://medium.com/@chungyi410/%E5%B0%87-raspberry-pi-%E7%9A%84-eth0-%E7%B6%B2%E8%B7%AF%E4%BB%8B%E9%9D%A2%E8%A8%AD%E5%AE%9A%E5%9B%BA%E5%AE%9A-ip-43010aa3effb">https://medium.com/@chungyi410/%E5%B0%87-raspberry-pi-%E7%9A%84-eth0-%E7%B6%B2%E8%B7%AF%E4%BB%8B%E9%9D%A2%E8%A8%AD%E5%AE%9A%E5%9B%BA%E5%AE%9A-ip-43010aa3effb</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/243/">Raspberry pi 解決ip被固定的問題</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/243/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Nginx Status 資訊視覺化</title>
		<link>https://sdt.hameba.tw/183/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nginx-status-%25e8%25b3%2587%25e8%25a8%258a%25e8%25a6%2596%25e8%25a6%25ba%25e5%258c%2596</link>
				<comments>https://sdt.hameba.tw/183/#respond</comments>
				<pubDate>Wed, 04 Dec 2019 07:39:26 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Grafana]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx_vts_exporter]]></category>
		<category><![CDATA[nginx-module-vts]]></category>
		<category><![CDATA[Prometheus]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspbian]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=183</guid>
				<description><![CDATA[<p>這篇主要整理作法步驟，此圖講解非常清楚 Raspberry pi 安裝 Nginx及擴充module Rasp &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/183/" class="more-link">閱讀全文<span class="screen-reader-text">〈Nginx Status 資訊視覺化〉</span></a></p>
The post <a href="https://sdt.hameba.tw/183/">Nginx Status 資訊視覺化</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p><img class="alignnone size-medium" src="https://miro.medium.com/max/964/1*GRUtK24FDYpR1Dc3jGG40A.png" width="482" height="803" /></p>
<p><span id="more-183"></span></p>
<p>這篇主要整理作法步驟，此圖講解非常清楚</p>
<ol>
<li><a href="/?p=184" target="_blank" rel="noopener noreferrer">Raspberry pi 安裝 Nginx及擴充module</a></li>
<li><a href="/?p=146" target="_blank" rel="noopener noreferrer">Raspberry pi nginx 增加模組 nginx-module-vts</a></li>
<li><a href="/?p=171" target="_blank" rel="noopener noreferrer">Raspberry pi 安裝 Nginx_vts_exporter</a></li>
<li><a href="/?p=176" target="_blank" rel="noopener noreferrer">Raspberry pi 安裝 Prometheus</a></li>
<li><a href="/?p=180" target="_blank" rel="noopener noreferrer">Raspberry pi 安裝 Grafana</a></li>
</ol>
<p>Reference</p>
<p><a href="https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c">https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c</a></p>
<p><a href="https://grafana.com/blog/2019/08/22/homelab-security-with-ossec-loki-prometheus-and-grafana-on-a-raspberry-pi/">https://grafana.com/blog/2019/08/22/homelab-security-with-ossec-loki-prometheus-and-grafana-on-a-raspberry-pi/</a></p>
<p>&nbsp;</p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/183/">Nginx Status 資訊視覺化</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/183/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Raspberry pi 安裝 Nginx及擴充module</title>
		<link>https://sdt.hameba.tw/184/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-%25e5%25ae%2589%25e8%25a3%259d-nginx%25e5%258f%258a%25e6%2593%25b4%25e5%2585%2585module</link>
				<comments>https://sdt.hameba.tw/184/#respond</comments>
				<pubDate>Wed, 04 Dec 2019 07:38:05 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Module]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspbian]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=184</guid>
				<description><![CDATA[<p>特別寫這篇主要是因為可以透過apt-get install方式 直接擴充基本的module ndk_http_ &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/184/" class="more-link">閱讀全文<span class="screen-reader-text">〈Raspberry pi 安裝 Nginx及擴充module〉</span></a></p>
The post <a href="https://sdt.hameba.tw/184/">Raspberry pi 安裝 Nginx及擴充module</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>特別寫這篇主要是因為可以透過apt-get install方式</p>
<p>直接擴充基本的module</p>
<p><span id="more-184"></span></p>
<p>ndk_http_module.so ngx_http_headers_more_filter_module.so<br />
ngx_http_auth_pam_module.so ngx_http_image_filter_module.so ngx_http_xslt_filter_module.so<br />
ngx_http_cache_purge_module.so ngx_http_lua_module.so ngx_mail_module.so<br />
ngx_http_dav_ext_module.so ngx_http_perl_module.so ngx_nchan_module.so<br />
ngx_http_echo_module.so ngx_http_subs_filter_module.so ngx_stream_module.so<br />
ngx_http_fancyindex_module.so ngx_http_uploadprogress_module.so<br />
ngx_http_geoip_module.so ngx_http_upstream_fair_module.so</p>
<p>建議使用此安裝指令方式</p><pre class="crayon-plain-tag">$ sudo apt-get nginx nginx-extras nginx-full</pre><p>&nbsp;</p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/184/">Raspberry pi 安裝 Nginx及擴充module</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/184/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Raspberry pi 安裝 Grafana</title>
		<link>https://sdt.hameba.tw/180/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-%25e5%25ae%2589%25e8%25a3%259d-grafana</link>
				<comments>https://sdt.hameba.tw/180/#respond</comments>
				<pubDate>Wed, 04 Dec 2019 07:25:04 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Grafana]]></category>
		<category><![CDATA[Monit]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspbian]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=180</guid>
				<description><![CDATA[<p>繼續 Raspberry pi 安裝 Prometheus 文章 再往下新增Grafana Dashboard &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/180/" class="more-link">閱讀全文<span class="screen-reader-text">〈Raspberry pi 安裝 Grafana〉</span></a></p>
The post <a href="https://sdt.hameba.tw/180/">Raspberry pi 安裝 Grafana</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>繼續 Raspberry pi 安裝 Prometheus 文章</p>
<p>再往下新增Grafana Dashboard功能</p>
<p><span id="more-180"></span></p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/964/1*GRUtK24FDYpR1Dc3jGG40A.png" width="482" height="803" /></p><pre class="crayon-plain-tag"># 下載 grafana
$ wget wget https://dl.grafana.com/oss/release/grafana-6.5.1.linux-armv7.tar.gz

# 解壓縮
$ tar -zxvf grafana-6.5.1.linux-armv7.tar.gz

# 新增系統服務
$ sudo nano /etc/systemd/system/grafana.service
# 新增以下內容
[Unit]
Description=Grafana UI
After=network.target

[Service]
Type=simple
User=pi
ExecStart=/home/pi/grafana-6.5.1/bin/grafana-server
WorkingDirectory=/home/pi/grafana-6.5.1/
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
 
#完成後，儲存離開
 
# 系統重新讀取服務
$ sudo systemctl daemon-reload
 
# 設定開機自動執行
$ sudo systemctl enable grafana
 
# 啟動prometheus
$ sudo systemctl start grafana
 
# 查詢執行狀況
$ sudo systemctl status grafana</pre><p>完成後即可以到http://localhost:3000，觀看grafana運行狀況</p>
<p>Default 帳號密碼為 admin/admin</p>
<p>先新增DB</p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/1696/1*OZcg_GhWfmi7EfrSgcoHaA.png" width="848" height="699" /></p>
<p>在使用左側＋圖示Create Import</p>
<p>輸入代碼2494，離開輸入框會自動帶入Dashboard資訊</p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/2534/1*IzfHgyBXrjapWyfW4pVSrA.png" width="1267" height="594" /></p>
<p>順利完成後如下</p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/2880/1*nlt6alSR7YgvHXQhHSpF3g.png" width="1440" height="651" /></p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c">https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c</a></p>
<p><a href="https://grafana.com/blog/2019/08/22/homelab-security-with-ossec-loki-prometheus-and-grafana-on-a-raspberry-pi/">https://grafana.com/blog/2019/08/22/homelab-security-with-ossec-loki-prometheus-and-grafana-on-a-raspberry-pi/</a></p>The post <a href="https://sdt.hameba.tw/180/">Raspberry pi 安裝 Grafana</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/180/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Raspberry pi 安裝 Prometheus</title>
		<link>https://sdt.hameba.tw/176/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-%25e5%25ae%2589%25e8%25a3%259d-prometheus</link>
				<comments>https://sdt.hameba.tw/176/#respond</comments>
				<pubDate>Wed, 04 Dec 2019 07:10:06 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Prometheus]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspbian]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=176</guid>
				<description><![CDATA[<p>繼續 Raspberry pi 安裝 Nginx_vts_exporter 文章 再往下新增Prometheu &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/176/" class="more-link">閱讀全文<span class="screen-reader-text">〈Raspberry pi 安裝 Prometheus〉</span></a></p>
The post <a href="https://sdt.hameba.tw/176/">Raspberry pi 安裝 Prometheus</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>繼續 Raspberry pi 安裝 Nginx_vts_exporter 文章</p>
<p>再往下新增Prometheus功能</p>
<p><span id="more-176"></span></p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/964/1*GRUtK24FDYpR1Dc3jGG40A.png" width="482" height="803" /></p><pre class="crayon-plain-tag"># 下載 prometheus
$ wget https://github.com/prometheus/prometheus/releases/download/v2.14.0/prometheus-2.14.0.linux-armv7.tar.gz

# 解壓縮
$ tar -zxvf prometheus-2.14.0.linux-armv7.tar.gz

# 修改 prometheus.yml targets要改成Nginx-vts-exporter輸出網址
$ nano prometheus-2.14.0.linux-armv7/prometheus.yml

# static_configs:
#   - targets: ['localhost:9913']

# 新增系統服務
$ sudo nano /etc/systemd/system/prometheus.service
# 新增以下內容
[Unit]
Description=Prometheus Metrics
After=network.target

[Service]
Type=simple
User=pi
ExecStart=/home/pi/prometheus-2.14.0.linux-armv7/prometheus --storage.tsdb.retention.time=30d
WorkingDirectory=/home/pi/prometheus-2.14.0.linux-armv7/
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
 
#完成後，儲存離開
 
# 系統重新讀取服務
$ sudo systemctl daemon-reload
 
# 設定開機自動執行
$ sudo systemctl enable prometheus
 
# 啟動prometheus
$ sudo systemctl start prometheus
 
# 查詢執行狀況
$ sudo systemctl status prometheus</pre><p>完成後即可以到http://localhost:9090，觀看prometheus運行狀況</p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/2872/1*t3QUEuTv2bOXvnz3GTqC9g.png" width="1436" height="515" /></p>
<p>http://localhost:9090/targets</p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/2872/1*Fu1gNlDsow9JwOW7Qb9tbQ.png" width="1436" height="170" /></p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://grafana.com/blog/2019/08/22/homelab-security-with-ossec-loki-prometheus-and-grafana-on-a-raspberry-pi/">https://grafana.com/blog/2019/08/22/homelab-security-with-ossec-loki-prometheus-and-grafana-on-a-raspberry-pi/</a></p>
<p><a href="https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c">https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/176/">Raspberry pi 安裝 Prometheus</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/176/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Raspberry pi 安裝 Nginx_vts_exporter</title>
		<link>https://sdt.hameba.tw/171/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-%25e5%25ae%2589%25e8%25a3%259d-nginx_vts_exporter</link>
				<comments>https://sdt.hameba.tw/171/#respond</comments>
				<pubDate>Wed, 04 Dec 2019 06:51:15 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Nginx_vts_exporter]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspbian]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=171</guid>
				<description><![CDATA[<p>繼續 Raspberry pi 4 nginx 增加模組 nginx-module-vts 文章 再往下新增N &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/171/" class="more-link">閱讀全文<span class="screen-reader-text">〈Raspberry pi 安裝 Nginx_vts_exporter〉</span></a></p>
The post <a href="https://sdt.hameba.tw/171/">Raspberry pi 安裝 Nginx_vts_exporter</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>繼續 Raspberry pi 4 nginx 增加模組 nginx-module-vts 文章</p>
<p>再往下新增Nginx_vts_exporter module功能</p>
<p><span id="more-171"></span></p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/964/1*GRUtK24FDYpR1Dc3jGG40A.png" width="482" height="803" /></p><pre class="crayon-plain-tag"># 下載nginx-vts-exporter
$ wget https://github.com/hnlq715/nginx-vts-exporter/archive/v0.10.5.tar.gz

# 安裝golang
$ sudo apt update 
$ sudo apt install golang

#解壓縮及安裝
$ tar -xzvf v0.10.5.tar.gz
$ cd nginx-vts-exporter-0.10.5
$ go install nginx_vts_exporter.go

# 查詢 go env 得知GOPATH="/home/pi/go"
$ go env

# 複製程式至系統執行區
$ sudo cp ~/go/bin/nginx_vts_exporter /usr/local/bin

# 新增程式使用者
$ sudo useradd --no-create-home --shell /bin/false nginx_vts_exporter

# 新增系統服務
$ sudo nano /etc/systemd/system/nginx_vts_exporter.service
# 新增以下內容，-nginx.scrape_uri依照Nginx vts的網址
[Unit]
Description=Nginx vts exporter  
Wants=network-online.target
After=network-online.target
[Service]
User=nginx_vts_exporter
Group=nginx_vts_exporter
ExecStart=/usr/local/bin/nginx_vts_exporter -nginx.scrape_uri=http://localhost:9999/format/json
Restart=always
RestartSec=3
[Install]
WantedBy=default.target

#完成後，儲存離開

# 系統重新讀取服務
$ sudo systemctl daemon-reload

# 設定開機自動執行
$ sudo systemctl enable nginx_vts_exporter

# 啟動nginx_vts_exporter
$ sudo systemctl start nginx_vts_exporter

# 查詢執行狀況
$ sudo systemctl status nginx_vts_exporter</pre><p>完成後即可以到http://localhost:9913/metric，觀看exporter運行狀況</p>
<p><img class="alignnone size-medium" src="https://miro.medium.com/max/1874/1*l9-nNmfHrkx048iRUWMv0A.png" width="937" height="226" /></p>
<p>Reference</p>
<p><a href="https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c">https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c</a></p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/171/">Raspberry pi 安裝 Nginx_vts_exporter</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/171/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Raspberry pi4 建立 OpenVPN Server PiVPN</title>
		<link>https://sdt.hameba.tw/161/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi4-%25e5%25bb%25ba%25e7%25ab%258b-openvpn-server-pivpn</link>
				<comments>https://sdt.hameba.tw/161/#respond</comments>
				<pubDate>Wed, 04 Dec 2019 02:26:05 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[PiVPN]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=161</guid>
				<description><![CDATA[<p>禁止直接從外部訪問ssh 22 port的關係，所以在內部網域架設VPN 讓外部人員可以透過VPN 連回內部網 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/161/" class="more-link">閱讀全文<span class="screen-reader-text">〈Raspberry pi4 建立 OpenVPN Server PiVPN〉</span></a></p>
The post <a href="https://sdt.hameba.tw/161/">Raspberry pi4 建立 OpenVPN Server PiVPN</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>禁止直接從外部訪問ssh 22 port的關係，所以在內部網域架設VPN</p>
<p>讓外部人員可以透過VPN 連回內部網路使用ssh</p>
<p><span id="more-161"></span></p><pre class="crayon-plain-tag"># 安裝 pivpn
$ curl -L https://install.pivpn.io | bash</pre><p>通常都是下一步-&gt;下一步</p>
<p>但是這邊選擇UDP or TCP，好像沒有效果</p>
<p><img class="alignnone size-medium" src="https://i0.wp.com/www.jkg.tw/wp-content/uploads/2018/10/2018-10-25_11-01-45.png?w=2012&amp;ssl=1" alt="PiVPN UDP TCP" width="2012" height="1069" /></p>
<p>所以後續我是選擇到openVPN 去修改</p><pre class="crayon-plain-tag"># 修改設定檔案
$ sudo nano /etc/openvpn/server.conf 

# 將第二行 proto udp 改成 tcp, 如下
# dev tun
# proto tcp
# port 1194

# 儲存離開

# 重啟服務
$ sudo service openvpn restart</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://www.jkg.tw/?p=1500">https://www.jkg.tw/?p=1500</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/161/">Raspberry pi4 建立 OpenVPN Server PiVPN</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/161/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Raspberry pi nginx 增加模組 nginx-module-vts</title>
		<link>https://sdt.hameba.tw/146/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-4-nginx-%25e5%25a2%259e%25e5%258a%25a0%25e6%25a8%25a1%25e7%25b5%2584-nginx-module-vts</link>
				<comments>https://sdt.hameba.tw/146/#respond</comments>
				<pubDate>Sat, 30 Nov 2019 08:25:12 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx-module-vts]]></category>
		<category><![CDATA[pi 4]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=146</guid>
				<description><![CDATA[<p>硬體:Raspberry pi 4 OS:Raspbian Buster Version:September  &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/146/" class="more-link">閱讀全文<span class="screen-reader-text">〈Raspberry pi nginx 增加模組 nginx-module-vts〉</span></a></p>
The post <a href="https://sdt.hameba.tw/146/">Raspberry pi nginx 增加模組 nginx-module-vts</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>硬體:Raspberry pi 4</p>
<p>OS:Raspbian Buster</p>
<p><span id="more-146"></span></p>
<p>Version:September 2019</p>
<p>Release date:2019-09-26</p><pre class="crayon-plain-tag"># 先補足相關套件
$ sudo apt-get install libpcre3 libpcre3-dev openssl libssl-dev libxslt-dev libgd-dev libgeoip-dev libgd2-xpm-dev libgd2-xpm libgd2-xpm-dev libperl-dev

# 查詢nginx 版本
$ sudo nginx -v
#nginx version: nginx/1.14.2

# 下載對應版本
$ wget 'http://nginx.org/download/nginx-1.14.2.tar.gz'
# 解壓縮
$ tar -xzvf nginx-1.14.2.tar.gz

# 下載nginx_module_vts
$ git clone git://github.com/vozlt/nginx-module-vts.git

# 查詢目前nginx setting
$ sudo nginx -V
# 出現如下資訊
# ./configure --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-7du1qr/nginx-1.14.2=.
# -fstack-protector-strong -Wformat -Werror=format-security -fPIC 簡略不列出... 
# --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module

#進入nginx-1.14.2目錄
$ cd nginx-1.14.2

#輸入剛剛查詢到的資訊，在最後面補上 --add-dynamic-module=../nginx-module-vts
$ ./configure --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-7du1qr/nginx-1.14.2=. 中間簡略不列出
 --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=../nginx-module-vts

#make 製作出檔案
$ make

$ cd /usr/sbin/

# 備份原本的nginx
$ sudo copy nginx nginx.old

# 把剛剛製作出來的nginx複製過來
$ sudo cp ~/nginx-1.14.2/objs/nginx .

# 重啟nginx 
$ sudo service nginx restart

#查詢是否有加入模組
$ sudo nginx -V
#正常會顯示出來最後一行有此句 --add-dynamic-module=../nginx-module-vts

# 將產生的模組放進系統預設地方
sudo cp ~/nginx-1.14.2/objs/ngx_http_vhost_traffic_status_module.so /usr/lib/nginx/modules/

$ sudo nano /etc/nginx/nginx.conf

# 在此兩句下面
# pid /run/nginx.pid;
# include /etc/nginx/modules-enabled/*.conf;
# 新增以下此句
# load_module modules/ngx_http_vhost_traffic_status_module.so;
# http{} 新增此句
# vhost_traffic_status_zone;
# 存擋離開

# 測試nginx是否設定有問題
$ sudo nginx -t

# 測試無誤後，新增網址觀看路徑
$ sudo nano /etc/nginx/sites-enabled/status.conf
# 內容如下
# server {
#	listen 9999;
#	location / {
#		vhost_traffic_status_display;
#		vhost_traffic_status_display_format html;
#	}
#}
# 完成存擋離開

# 重啟nginx
$ sudo service nginx restart</pre><p>以上成功完成後</p>
<p>開啟 http://localhost:9999/ 網址</p>
<p>即可以看到nginx 狀況 如下圖</p>
<p><img class="alignleft size-medium" src="https://cloud.githubusercontent.com/assets/3648408/23890539/a4c0de18-08d5-11e7-9a8b-448662454854.png" alt="nginx module vts 示意圖" width="1096" height="955" /></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/146/">Raspberry pi nginx 增加模組 nginx-module-vts</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/146/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>使用 Mac 燒錄映像檔到 SD 卡 &#8211; Raspberry Pi 教學</title>
		<link>https://sdt.hameba.tw/75/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25bd%25bf%25e7%2594%25a8-mac-%25e7%2587%2592%25e9%258c%2584%25e6%2598%25a0%25e5%2583%258f%25e6%25aa%2594%25e5%2588%25b0-sd-%25e5%258d%25a1-macos-raspberry-pi-%25e6%2595%2599%25e5%25ad%25b8</link>
				<comments>https://sdt.hameba.tw/75/#respond</comments>
				<pubDate>Sun, 24 Nov 2019 16:45:23 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Raspberry Pi]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=75</guid>
				<description><![CDATA[<p>將SD卡安裝好作業系統(OS)，在裝入Raspberry Pi就可以開機了。 開啟Mac的終端機(Termin &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/75/" class="more-link">閱讀全文<span class="screen-reader-text">〈使用 Mac 燒錄映像檔到 SD 卡 &#8211; Raspberry Pi 教學〉</span></a></p>
The post <a href="https://sdt.hameba.tw/75/">使用 Mac 燒錄映像檔到 SD 卡 – Raspberry Pi 教學</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>將SD卡安裝好作業系統(OS)，在裝入Raspberry Pi就可以開機了。</p>
<p>開啟Mac的終端機(Terminal)並使用『 dd 』這個指令。</p>
<p><span id="more-75"></span></p>
<p><img class="alignnone" src="https://images.ctfassets.net/tvfg2m04ppj4/51p5RjQfp473HP7cvhsQml/c6840ae346cd3217b87a6e7c113d2633/Raspberry-Pi-4-hero-shot.jpg?w=800" alt="pi4" width="800" height="623" /></p>
<h2>確認 SD 卡的位置</h2>
<p>使用Mac指令(disktil)</p><pre class="crayon-plain-tag">diskutil list</pre><p>利用SIZE應該很快的找到我們SD卡是哪一個<br />
(例如：/dev/disk2)</p>
<h2>開始燒錄</h2>
<p>使用Mac指令(dd)</p><pre class="crayon-plain-tag">sudo dd bs=1m if=你的映像檔位置 of=/dev/rdiskN conv=sync</pre><p>(記得把<span style="color: #ff0000;">if參數</span>調整以及把 <span style="color: #ff0000;">N</span> 換成我們SD卡的位置)<br />
燒錄會需要一段時間，大概10-15分鐘。</p>
<ul>
<li>bs 儲存單位</li>
<li>if 來源檔案位置</li>
<li>of 輸出檔案位置</li>
<li>conv 轉換格式類型</li>
</ul>
<p>最後用Mac指令(diskutil)把SD卡退出</p><pre class="crayon-plain-tag">sudo diskutil eject /dev/disk2</pre><p>完成！</p>
<p>參考文章：</p>
<ol>
<li><a href="https://www.raspberrypi.org/documentation/installation/installing-images/mac.md" target="_blank" rel="noopener noreferrer">Copying an operating system image to an SD card using Mac OS</a></li>
</ol>The post <a href="https://sdt.hameba.tw/75/">使用 Mac 燒錄映像檔到 SD 卡 – Raspberry Pi 教學</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/75/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
