<?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>System | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/category/%E7%B3%BB%E7%B5%B1/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Fri, 28 Feb 2020 08:41:57 +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>System | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Pi 3 使用Docker安裝Redmine</title>
		<link>https://sdt.hameba.tw/590/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pi-3-%25e4%25bd%25bf%25e7%2594%25a8docker%25e5%25ae%2589%25e8%25a3%259dredmine</link>
				<comments>https://sdt.hameba.tw/590/#respond</comments>
				<pubDate>Fri, 28 Feb 2020 08:41:57 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[pi]]></category>
		<category><![CDATA[redmine]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=590</guid>
				<description><![CDATA[<p>原本依照[Raspberry Pi] 在Raspbian上安裝Apache+MySQL+Redmine 3.3 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/590/" class="more-link">閱讀全文<span class="screen-reader-text">〈Pi 3 使用Docker安裝Redmine〉</span></a></p>
The post <a href="https://sdt.hameba.tw/590/">Pi 3 使用Docker安裝Redmine</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>原本依照<a href="http://rj-memo.blogspot.com/2016/09/raspberry-pi-raspbianapachemysqlredmine.html">[Raspberry Pi] 在Raspbian上安裝Apache+MySQL+Redmine 3.3.0</a>，</p>
<p>結果發生一堆問題，有些套件lib 在更新都有出現，也補足後，最後在apache2 cfg上讀不到redmine&#8230;</p>
<p><span id="more-590"></span>原本都想放棄，還好想起有這種docker這種方式，已經把環境包好，直接運行</p>
<p>pi 3安裝docker</p><pre class="crayon-plain-tag">// 下載安裝docker
$ curl -sSL https://get.docker.com | sh

// 補足帳號權限
$ sudo usermod -a -G docker pi

// 重啟
$ sudo reboot

// 檢查docker
$ docker -v</pre><p>導入docker for pi 的redmine 「<a href="https://hub.docker.com/r/arm32v7/redmine/">arm32v7/redmine</a>」，</p>
<p>此處用法的參數，可參考docker <a href="https://hub.docker.com/r/arm32v7/redmine/">arm32v7/redmine</a> 下方</p>
<p><img class="alignnone size-large wp-image-591" src="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.32.37-1024x989.png" alt="docker redmine param" width="840" height="811" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.32.37-1024x989.png?v=1582878794 1024w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.32.37-300x290.png?v=1582878794 300w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.32.37-768x742.png?v=1582878794 768w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.32.37-1536x1484.png?v=1582878794 1536w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.32.37-1200x1159.png?v=1582878794 1200w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.32.37.png?v=1582878794 1590w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p>
<p>相關參數依照每個人DB設定，</p>
<p>default設定為sqlite及3000 port，以下是我用docker 背景執行及連其他DB參數</p><pre class="crayon-plain-tag">// 啟動redmine
$ docker run -d --restart=always --name=redmine -p 9999:3000 -e REDMINE_DB_MYSQL=localhost -e REDMINE_DB_USERNAME=redmine -e REDMINE_DB_PASSWORD=password -e REDMINE_DB_DATABASE=redmine --volume=/srv/docker/redmine/redmine:/home/redmine/data arm32v7/redmine</pre><p>正確啟動沒問題</p>
<p>即可看到畫面</p>
<p><img class="alignnone size-large wp-image-592" src="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.38.03-1024x297.png" alt="redmine success" width="840" height="244" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.38.03-1024x297.png?v=1582879115 1024w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.38.03-300x87.png?v=1582879115 300w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.38.03-768x223.png?v=1582879115 768w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.38.03-1536x445.png?v=1582879115 1536w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.38.03-2048x594.png?v=1582879115 2048w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-下午4.38.03-1200x348.png?v=1582879115 1200w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://qiita.com/Shun__/items/a44a5e00c534f2aeb6cb" target="_blank" rel="noopener noreferrer">https://qiita.com/Shun__/items/a44a5e00c534f2aeb6cb</a></p>The post <a href="https://sdt.hameba.tw/590/">Pi 3 使用Docker安裝Redmine</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/590/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>ssh 登入 遠端電腦不用密碼</title>
		<link>https://sdt.hameba.tw/588/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ssh-%25e7%2599%25bb%25e5%2585%25a5-%25e9%2581%25a0%25e7%25ab%25af%25e9%259b%25bb%25e8%2585%25a6%25e4%25b8%258d%25e7%2594%25a8%25e5%25af%2586%25e7%25a2%25bc</link>
				<comments>https://sdt.hameba.tw/588/#respond</comments>
				<pubDate>Fri, 28 Feb 2020 08:16:43 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[CI/CD]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[without password]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=588</guid>
				<description><![CDATA[<p>最近做jenkins CI/CD 要跨內部server發現登入ssh需要密碼， 真的滿麻煩，也不能在shell &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/588/" class="more-link">閱讀全文<span class="screen-reader-text">〈ssh 登入 遠端電腦不用密碼〉</span></a></p>
The post <a href="https://sdt.hameba.tw/588/">ssh 登入 遠端電腦不用密碼</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>最近做jenkins CI/CD 要跨內部server發現登入ssh需要密碼，</p>
<p>真的滿麻煩，也不能在shellscript把密碼直接放入，<span id="more-588"></span></p>
<p>只好讓兩台server client -&gt; server 免除認證，</p>
<p>步驟1. 至client server(這邊對我來說是jenkins這台server)</p><pre class="crayon-plain-tag">//client 建立自己的ssh ras憑證
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
c3:e9:25:65:00:c8:65:cb:e8:fe:4e:7e:ce:06:a4:9d root@kvm8.deyu.wang
The key's randomart image is:
+--[ RSA 2048]----+
|   . o+..        |
|    o+ . .       |
|    . o   o      |
|   .  .. +       |
|    .+ .S .      |
|   .. E. +       |
|    . ...        |
|     + .o        |
|     .++o        |
+-----------------+

// 將client的pub放到server，該user 家目錄下
$ scp ~/.ssh/id_rsa.pub serverUser@serverIP:~/</pre><p>步驟2. 切換到 目標Server</p><pre class="crayon-plain-tag">// ssh 目標server，這時進去還需要需入密碼
$ ssh serverUser@serverIP

// 把剛剛client傳過來的id_rsa.pub寫入authorized_keys
$ cat ~/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys

// 離開
$ exit

// 測試ssh連線，如設定成功，就不需要密碼即可以進入
$ ssh serverUser@serverIP</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://dywang.csie.cyut.edu.tw/dywang/security/node84.html" target="_blank" rel="noopener noreferrer">https://dywang.csie.cyut.edu.tw/dywang/security/node84.html</a></p>The post <a href="https://sdt.hameba.tw/588/">ssh 登入 遠端電腦不用密碼</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/588/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Jenkins war更新教學</title>
		<link>https://sdt.hameba.tw/555/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jenkins-war%25e6%259b%25b4%25e6%2596%25b0%25e6%2595%2599%25e5%25ad%25b8</link>
				<comments>https://sdt.hameba.tw/555/#respond</comments>
				<pubDate>Thu, 27 Feb 2020 16:21:08 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[war]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=555</guid>
				<description><![CDATA[<p>先至官網下載war後，至jenkins後台-&#62;管理 Jenkins-&#62;系統資訊， 就可以看到war &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/555/" class="more-link">閱讀全文<span class="screen-reader-text">〈Jenkins war更新教學〉</span></a></p>
The post <a href="https://sdt.hameba.tw/555/">Jenkins war更新教學</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p><img class="alignnone size-large wp-image-556" src="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-27-下午11.53.54-833x1024.png" alt="jenkins download" width="833" height="1024" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-27-下午11.53.54-833x1024.png?v=1582819464 833w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-27-下午11.53.54-244x300.png?v=1582819464 244w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-27-下午11.53.54-768x944.png?v=1582819464 768w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-27-下午11.53.54-1200x1475.png?v=1582819464 1200w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-27-下午11.53.54.png?v=1582819464 1206w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><span id="more-555"></span></p>
<p>先至官網下載war後，至jenkins後台-&gt;管理 Jenkins-&gt;系統資訊，</p>
<p>就可以看到war的路徑，如下圖</p>
<p><img class="alignnone size-large wp-image-557" src="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-上午12.09.49-1024x555.png" alt="jenkins path" width="840" height="455" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-上午12.09.49-1024x555.png?v=1582819938 1024w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-上午12.09.49-300x163.png?v=1582819938 300w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-上午12.09.49-768x416.png?v=1582819938 768w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-上午12.09.49-1200x650.png?v=1582819938 1200w, https://sdt.hameba.tw/wp-content/uploads/2020/02/截圖-2020-02-28-上午12.09.49.png?v=1582819938 1236w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p>
<p>之後執行以下步驟方法，</p><pre class="crayon-plain-tag">// 查看jenkins狀態
$ sudo service jenkins status

// 停止jenkins運行
$ sudo service jenkins stop

$ cd /usr/share/jenkins/

// 原有的jenkins.war改成jenkins.war.old(以防更新失敗)
$ sudo mv jenkins.war jenkins.war.old

// 下載最新的jenkins.war
$ wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war

// 啟動jenkins運行
$ sudo service jenkins start</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://ubuntuqa.com/zh-tw/article/6248.html" target="_blank" rel="noopener noreferrer">https://ubuntuqa.com/zh-tw/article/6248.html</a></p>The post <a href="https://sdt.hameba.tw/555/">Jenkins war更新教學</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/555/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Failed to start mongod.service: Unit mongod.service not found.</title>
		<link>https://sdt.hameba.tw/524/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=failed-to-start-mongod-service-unit-mongod-service-not-found</link>
				<comments>https://sdt.hameba.tw/524/#respond</comments>
				<pubDate>Thu, 20 Feb 2020 03:55:53 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[mongod]]></category>
		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=524</guid>
				<description><![CDATA[<p>依照  Ubuntu 18.04.3 安裝 MongoDB 4.0 此篇安裝完成後， 執行 sudo serv &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/524/" class="more-link">閱讀全文<span class="screen-reader-text">〈Failed to start mongod.service: Unit mongod.service not found.〉</span></a></p>
The post <a href="https://sdt.hameba.tw/524/">Failed to start mongod.service: Unit mongod.service not found.</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>依照  <a href="https://sdt.hameba.tw/127/">Ubuntu 18.04.3 安裝 MongoDB 4.0</a> 此篇安裝完成後，</p>
<p>執行 sudo service mongod start後，</p>
<p>出現錯誤訊息:Failed to start mongod.service: Unit mongod.service not found.</p>
<p><span id="more-524"></span>解決方法:</p><pre class="crayon-plain-tag">// ubuntu 啟動 mongod.service
$ sudo systemctl enable mongod.service

// 使用service方式
$ sudo service mongod start</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://stackoverflow.com/questions/48092353/failed-to-start-mongod-service-unit-mongod-service-not-found" target="_blank" rel="noopener noreferrer">https://stackoverflow.com/questions/48092353/failed-to-start-mongod-service-unit-mongod-service-not-found</a></p>The post <a href="https://sdt.hameba.tw/524/">Failed to start mongod.service: Unit mongod.service not found.</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/524/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>MongoDB 安裝完成後，開啟對外連線</title>
		<link>https://sdt.hameba.tw/522/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mongodb-%25e5%25ae%2589%25e8%25a3%259d%25e5%25ae%258c%25e6%2588%2590%25e5%25be%258c%25ef%25bc%258c%25e9%2596%258b%25e5%2595%259f%25e5%25b0%258d%25e5%25a4%2596%25e9%2580%25a3%25e7%25b7%259a</link>
				<comments>https://sdt.hameba.tw/522/#respond</comments>
				<pubDate>Thu, 20 Feb 2020 03:34:56 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[bindIp]]></category>
		<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=522</guid>
				<description><![CDATA[<p>依照此篇 Ubuntu 18.04.3 安裝 MongoDB 4.0  安裝完後， 在外部連線時會發生無法連問 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/522/" class="more-link">閱讀全文<span class="screen-reader-text">〈MongoDB 安裝完成後，開啟對外連線〉</span></a></p>
The post <a href="https://sdt.hameba.tw/522/">MongoDB 安裝完成後，開啟對外連線</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>依照此篇 <a href="https://sdt.hameba.tw/127/">Ubuntu 18.04.3 安裝 MongoDB 4.0</a>  安裝完後，</p>
<p>在外部連線時會發生無法連問題，</p>
<p>需要修改mongodb.conf，預設允許連線位置。<span id="more-522"></span></p><pre class="crayon-plain-tag">$ sudo nano /etc/mongod.conf 

// 原本的連線只允許本機
# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1

// 修改成允許所有外部連線ip
# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0

// 指定連線ip
# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1, 192.168.0.1</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://www.kdzone.net/2017/04/mongodb-5-allow-remote-access.html" target="_blank" rel="noopener noreferrer">https://www.kdzone.net/2017/04/mongodb-5-allow-remote-access.html</a></p>The post <a href="https://sdt.hameba.tw/522/">MongoDB 安裝完成後，開啟對外連線</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/522/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>MariaDB 外部連線失敗 Can&#8217;t connect to MySQL server</title>
		<link>https://sdt.hameba.tw/520/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mariadb-%25e5%25a4%2596%25e9%2583%25a8%25e9%2580%25a3%25e7%25b7%259a%25e5%25a4%25b1%25e6%2595%2597-cant-connect-to-mysql-server</link>
				<comments>https://sdt.hameba.tw/520/#respond</comments>
				<pubDate>Tue, 18 Feb 2020 16:44:27 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Can't connect]]></category>
		<category><![CDATA[Maria]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=520</guid>
				<description><![CDATA[<p>使用Ubuntu安裝完mysql，其實是mariadb， 而當要從外部連線進來時會發現出現錯誤： Can&#8 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/520/" class="more-link">閱讀全文<span class="screen-reader-text">〈MariaDB 外部連線失敗 Can&#8217;t connect to MySQL server〉</span></a></p>
The post <a href="https://sdt.hameba.tw/520/">MariaDB 外部連線失敗 Can’t connect to MySQL server</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>使用Ubuntu安裝完mysql，其實是mariadb，</p>
<p>而當要從外部連線進來時會發現出現錯誤：</p>
<p><span id="more-520"></span></p>
<p>Can&#8217;t connect to MySQL server on (61)</p>
<p>所以可以透過以下幾個步驟來解決</p>
<p>Step 1.</p>
<p>查看帳號權限</p><pre class="crayon-plain-tag">$ mysql -u root -p
&gt; USE mysql;
&gt; SELECT User, Host FROM mysql.user;</pre><p>Host 需要出現%才代表可以外部連進來</p>
<p>Step 2.</p><pre class="crayon-plain-tag">$ netstat -tulpen</pre><p>查看是否有3306 port被使用，有的話代表mariaDB正常</p>
<p>Step 3.</p>
<p>以上都有的話，就是設定沒有設定好，路徑 ex:/etc/mysql/my.cnf</p><pre class="crayon-plain-tag">// mysql 方式
bind-address = 0.0.0.0

// mariaDB 方式
[mysqld]
bind-address = 0.0.0.0</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://mariadb.com/kb/en/configuring-mariadb-for-remote-client-access/" target="_blank" rel="noopener noreferrer">https://mariadb.com/kb/en/configuring-mariadb-for-remote-client-access/</a></p>
<p><a href="https://zhuanlan.zhihu.com/p/38419137" target="_blank" rel="noopener noreferrer">https://zhuanlan.zhihu.com/p/38419137</a></p>The post <a href="https://sdt.hameba.tw/520/">MariaDB 外部連線失敗 Can’t connect to MySQL server</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/520/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>sudo mysql -u root -p 移除 sudo 方式</title>
		<link>https://sdt.hameba.tw/518/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sudo-mysql-u-root-p-%25e7%25a7%25bb%25e9%2599%25a4-sudo-%25e6%2596%25b9%25e5%25bc%258f</link>
				<comments>https://sdt.hameba.tw/518/#respond</comments>
				<pubDate>Tue, 18 Feb 2020 16:32:12 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=518</guid>
				<description><![CDATA[<p>安裝好Ubuntu 18.04.1 以後，不能以使用者身份執行mysql 指令， 必須使用加上sudo，才可以 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/518/" class="more-link">閱讀全文<span class="screen-reader-text">〈sudo mysql -u root -p 移除 sudo 方式〉</span></a></p>
The post <a href="https://sdt.hameba.tw/518/">sudo mysql -u root -p 移除 sudo 方式</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>安裝好Ubuntu 18.04.1 以後，不能以使用者身份執行mysql 指令，<br />
必須使用加上sudo，才可以執行mysql 指令。</p>
<p><span id="more-518"></span></p>
<p>解決方式如下：</p><pre class="crayon-plain-tag">$ sudo mysql -u root -p
Enter password:【輸入密碼，如無密碼直接Enter】

// 使用mysql db
&gt; use mysql;
&gt; update user SET plugin='mysql_native_password' WHERE User='root';
&gt; update user set authentication_string=password('root新密碼') where user='root';
&gt; flush privileges;
&gt; exit;</pre><p>完成後，可以再試試看用</p>
<p>$ mysql -u root -p</p>
<p>就不會被阻擋了</p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/518/">sudo mysql -u root -p 移除 sudo 方式</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/518/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Ubuntu 安裝 Jenkins 並啟用</title>
		<link>https://sdt.hameba.tw/375/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-%25e5%25ae%2589%25e8%25a3%259d-jenkins</link>
				<comments>https://sdt.hameba.tw/375/#respond</comments>
				<pubDate>Wed, 25 Dec 2019 08:41:43 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[CI/CD]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=375</guid>
				<description><![CDATA[<p>現在很流行CI/CD，所以作者來試試看安裝Jenkins配合ShellScript， 以前都是寫crontab &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/375/" class="more-link">閱讀全文<span class="screen-reader-text">〈Ubuntu 安裝 Jenkins 並啟用〉</span></a></p>
The post <a href="https://sdt.hameba.tw/375/">Ubuntu 安裝 Jenkins 並啟用</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>現在很流行CI/CD，所以作者來試試看安裝Jenkins配合ShellScript，</p>
<p>以前都是寫crontab每天定時執行ShellScript，</p>
<p>現在用bitbucket webhook Jenkins達到master push 直接更新code。</p>
<p><span id="more-375"></span></p>
<p>安裝步驟</p><pre class="crayon-plain-tag">$ sudo apt-get update

# Jenkins是java 所以需要jdk用8即可
$ sudo apt-get install openjdk-8-jdk

$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -

#將Jenkins添加到系統
$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ &gt; /etc/apt/sources.list.d/jenkins.list'

$ sudo apt-get update

# 安裝Jenkins
$ sudo apt-get install jenkins</pre><p>完成後，可以用以下指令觀看系統狀況</p><pre class="crayon-plain-tag"># jenkins 狀況
$ sudo service jenkins status

# jenkins 啟動
$ sudo service jenkins start

# jenkins 停止
$ sudo service jenkins stop

# jenkins 重啟
$ sudo service jenkins restart

# jenkins 開機啟動
$ sudo systemctl enable jenkins</pre><p>完成後到網頁 127.0.0.1:8080，會要求輸入密碼</p><pre class="crayon-plain-tag">cat /var/lib/jenkins/secrets/initialAdminPassword</pre><p>顯示的密碼直接輸入即可</p>
<p>選擇左邊 &#8220;install suggest plugin&#8221; 標準安裝。</p>
<p>作者在安裝過程中發生安裝失敗的問題，可能是<span style="color: #ff0000">來源端Jenkins plugin Server異常</span>，可以稍後再重試，正常點擊install suggest plugin後，大概5分鐘就可以安裝完，且不會有progress lock的感覺。</p>
<p>進入Jenkins系統後，會要求輸入新的使用者及密碼。</p>
<p>大致這樣就完成Jenkins的安裝及啟用。</p>
<p>Reference</p>
<p><a href="https://easonwang01.gitbooks.io/class/jenkinsbitbucket.html">https://easonwang01.gitbooks.io/class/jenkinsbitbucket.html</a></p>
<p><a href="https://linuxhostsupport.com/blog/how-to-install-jenkins-on-ubuntu-18-04/">https://linuxhostsupport.com/blog/how-to-install-jenkins-on-ubuntu-18-04/</a></p>The post <a href="https://sdt.hameba.tw/375/">Ubuntu 安裝 Jenkins 並啟用</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/375/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux crontab 直接重新讀取</title>
		<link>https://sdt.hameba.tw/354/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-crontab-%25e7%259b%25b4%25e6%258e%25a5%25e9%2587%258d%25e6%2596%25b0%25e8%25ae%2580%25e5%258f%2596</link>
				<comments>https://sdt.hameba.tw/354/#respond</comments>
				<pubDate>Fri, 20 Dec 2019 14:28:14 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=354</guid>
				<description><![CDATA[<p>Linux的crontab排程服務， 設定完成後，可以不用重新開機直接reload，指令如下: [crayon &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/354/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux crontab 直接重新讀取〉</span></a></p>
The post <a href="https://sdt.hameba.tw/354/">Linux crontab 直接重新讀取</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>Linux的crontab排程服務，</p>
<p>設定完成後，可以不用重新開機直接reload，指令如下:</p>
<p><span id="more-354"></span></p><pre class="crayon-plain-tag">$ sudo service cron reload

# or

$ /etc/init.d/cron reload</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file">https://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file</a></p>The post <a href="https://sdt.hameba.tw/354/">Linux crontab 直接重新讀取</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/354/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux 查看CPU型號、核心數量、頻率、溫度、記憶體</title>
		<link>https://sdt.hameba.tw/344/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-%25e6%259f%25a5%25e7%259c%258bcpu%25e5%259e%258b%25e8%2599%259f%25e3%2580%2581%25e6%25a0%25b8%25e5%25bf%2583%25e6%2595%25b8%25e9%2587%258f%25e3%2580%2581%25e9%25a0%25bb%25e7%258e%2587%25e3%2580%2581%25e6%25ba%25ab%25e5%25ba%25a6%25e3%2580%2581%25e8%25a8%2598%25e6%2586%25b6%25e9%25ab%2594</link>
				<comments>https://sdt.hameba.tw/344/#respond</comments>
				<pubDate>Fri, 20 Dec 2019 12:44:23 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[溫度]]></category>
		<category><![CDATA[記憶體]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=344</guid>
				<description><![CDATA[<p>習慣使用terminal的開發者，當要查詢硬體資訊也會習慣用指令， 反而不習慣用GUI點擊，作者從GUI要找到 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/344/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux 查看CPU型號、核心數量、頻率、溫度、記憶體〉</span></a></p>
The post <a href="https://sdt.hameba.tw/344/">Linux 查看CPU型號、核心數量、頻率、溫度、記憶體</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>習慣使用terminal的開發者，當要查詢硬體資訊也會習慣用指令，</p>
<p>反而不習慣用GUI點擊，作者從GUI要找到我想要看的資訊，就找得眼花撩亂，</p>
<p><span id="more-344"></span></p>
<p>還不如學幾個指令直接查詢自己想看的硬體資訊。</p>
<ul>
<li>CPU</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ cat /proc/cpuinfo

# 每秒自動取得目前的CPU頻率
watch -n 1 "lscpu"</pre><p>接著會將CPU所有核心(包含虛擬核心)的資訊個別列出，包含核心號碼、型號、頻率(即時運行頻率)和快取大小。</p>
<ul>
<li>lscpu</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ lscpu</pre><p>lscpu可以取得CPU的架構(x86, x86_64&#8230;等等)、核心數量、執行緒數量、頻率(從不同核心的運行頻率中挑選最大的來顯示)和快取大小。</p>
<ul>
<li>cpuinfo</li>
</ul>
<p></p><pre class="crayon-plain-tag"># 抓取各個核心的運行頻率
$ cat /proc/cpuinfo | grep MHz

# 每秒自動取得目前的CPU頻率
watch -n 1 "cat /proc/cpuinfo | grep MHz"</pre><p></p>
<ul>
<li>查看CPU的溫度</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ sudo apt-get install lm-sensors

# 使用「sensors-detect」指令開啟
$ yes | sudo sensors-detect

# 執行
$ sensors</pre><p></p>
<ul>
<li>free</li>
</ul>
<p></p><pre class="crayon-plain-tag"># 以 MB 作為單位
$ free -m

# 以 GB 作為單位
$ free -g</pre><p>free顯示實體記憶體和 SWAP 的大小及使用狀況。</p>
<ul>
<li>Memory</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ cat /proc/meminfo</pre><p>/proc/meminfo 檔案儲存更詳細的記憶體用量的資訊。</p>
<ul>
<li>工作管理員</li>
</ul>
<p></p><pre class="crayon-plain-tag">$ top</pre><p>等同於windwow系統工作管理員所看到的資訊，除了記憶體外還有CPU跟相關的執行程式資訊。</p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://magiclen.org/linux-view-cpu/">https://magiclen.org/linux-view-cpu/</a></p>
<p><a href="https://www.opencli.com/linux/linux-check-ram-usage-spec">https://www.opencli.com/linux/linux-check-ram-usage-spec</a></p>The post <a href="https://sdt.hameba.tw/344/">Linux 查看CPU型號、核心數量、頻率、溫度、記憶體</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/344/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
