You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

221 lines
9.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html class="no-js" lang="en-us">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#1b1b1b">
<title>Eric Chang | MCの飄狂山莊㊣</title>
<script>(function(d,e){d[e]=d[e].replace("no-js","js");})(document.documentElement,"className");</script>
<meta name="description" content="">
<link rel="stylesheet" href="/css/main.css">
<link rel="icon" href="/icons/16.png" sizes="16x16" type="image/png">
<link rel="icon" href="/icons/32.png" sizes="32x32" type="image/png">
<link rel="alternate" type="application/rss+xml" href="/author/eric-chang/index.xml" title="MCの飄狂山莊㊣">
<script type="application/javascript">
var doNotTrack = false;
if (!doNotTrack) {
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-138954876-1', 'auto');
ga('send', 'pageview');
}
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
</head>
<body>
<header class="header">
<a class="logo" href="/">MCの飄狂山莊㊣</a>
</header>
<div class="primary">
<main class="main">
<div class="page block">
<h1 class="page__title">Eric Chang</h1>
</div>
<div class="cards">
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/multiple-site-to-site-vpn-using-wireguard/">[筆記] 透過 wireguard 建立多點 site to site VPN / Multiple Site to Site VPN Using Wireguard</a></h1>
<div class="post__content"><p>因為實在受夠了現在用的 openwrt + strongswan 建立 IPSec VPN</p>
<p>雖然說其實沒有什麼不好,但是畢竟不是我建立的,而當初的文件也都不見了</p>
<p>完全沒辦法了解當時設計的邏輯造成後續debug 困難</p>
<p>可以想像一下一台VPN router ping 不到remote、ping不到internet、甚至ping不到自己 是要怎麼debug !?(翻桌</p>
<p>之前買了兩台edgerouter X 拿來玩了一下 wireguard感覺還不錯不過只有測試到點對點</p>
<p>這次試試看躲在gateway後面看看能不能建立多點的VPN環境</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/site-to-site-vpn-using-wireguard-in-two-edgerouters/">[筆記] 在edgerouter上用wireguard 建立site to site VPN / Site to Site Vpn Using Wireguard in Two Edgerouters</a></h1>
<div class="post__content"><p>之前總部和分公司之間 是用buffalo 的小AP 灌 openwrt</p>
<p>然後用strongswan 來打 IPSEC site to site VPN</p>
<p>config 看起來不是很難 (只是看起來)</p>
<p>但是實際上已經找不到當初的文件</p>
<p>所以要維護很困難(光那些RSA KEY 就不知道為何、如何產生)</p>
<p>後來採購了兩台edgerouter X 做測試</p>
<p>也用openvpn 成功的建立了 site to site VPN</p>
<p>本來想說 openvpn 已經夠簡單了</p>
<p>今天看到文章說用wireguard 可以更簡單</p>
<p>於是研究了一下,發現還真的很簡單!</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/another-way-to-keep-ansible-log/">[筆記] 為了保存log 用script 指令執行ansible / Another Way to Keep Ansible Log using script command</a></h1>
<div class="post__content"><p>之前為了能夠在執行完 ansible playbook 後能有個log 可以看</p>
<p>所以在每次執行的時候,都要加入 tee 的指令</p>
<p>像是</p>
<pre><code>ANSIBLE_CONFIG=/home/D/ansiblecontrol/ansible.cfg /usr/local/bin/ansible-playbook /home/D/ansiblecontrol/playbook.user_client.yml --vault-password-file=/home/D/ansiblecontrol/vault.passwd -i /home/D/ansiblecontrol/inventory/production -f1 --limit tyuserclients |tee /tmp/tyuserclients.log
</code></pre>
<p>一直都是放在crontab 裡面執行,也就沒有去管他</p>
<p>反正也沒有人關心結果怎樣 (攤手</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/send-mail-to-notify-after-pxe-install/">[筆記] 用pxe 安裝系統,完成後送出郵件通知 / send mail notification after pxe install</a></h1>
<div class="post__content"><p>最近有個任務需要大量安裝client</p>
<p>想用PXE來處理只要user開機按F12(acer 桌機) 選擇PXE Boot</p>
<p>然後選擇OS版本就可以自動進行安裝</p>
<p>安裝完成後會自動重新開機接著就用ansible來做user環境設定</p>
<p>PXE的部份本來是沒有什麼問題自動安裝系統的部份都做好了</p>
<p>可是因為這次的量比較多想說讓每一台在完成PXE安裝後的第一次重開機</p>
<p>就送出一封郵件來通知我說已經完成安裝可以執行ansible 了</p>
<p>看似很簡單的一件事情,卻搞了我兩天&hellip;.</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/ansible-run-task-depends-on-ipaddr/">[ansible] 用 ip 位置判斷是否要執行task /ansible run task depends on ipaddr</a></h1>
<div class="post__content"><p>因為工作上的需要要修改client端的 /etc/environment 檔案</p>
<p>在有權限使用proxy 服務的user的環境中加入proxy 的設定</p>
<p>原本的清單中有host/user/ip 這幾個值可以拿來判斷</p>
<p>proxy server 那邊是採用ip 來控制,所以這邊也跟著用 ip 來判斷要不要修改 /etc/environment</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/ansible-selectattr-from-list-in-dictionary/">[ansible] 引用事先定義好的yaml檔裡面的變數 - Ansible Selectattr From List in Dictionary file</a></h1>
<div class="post__content"><p>在ansible中關於如何引用自定義的變數一直讓我很頭疼</p>
<p>尤其是有牽涉到從外部導入yaml檔案時更是常常讓我不知道到底該怎麼抓出想要的變數</p>
<p>這次還是用selectattr 來處理,希望下次能夠記得&hellip;</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/remote-management-system-meshcentral/">linux底下遠端遙控&amp;管理的好用系統 Meshcentral / Remote Management &amp; control system Meshcentral</a></h1>
<div class="post__content"><p>之前在LAN/windows環境下一直都是用ultravnc/winvnc/tigervnc之類的VNC軟體</p>
<p>但是如果要過 internet 就會碰到各種開port的問題</p>
<p>在這種環境下,就有了當時 teamviewer 的橫空出世</p>
<p>解決了開PORT的問題讓被控端(通常是資訊技術相對弱勢,需要接受幫助的一方)不需要懂太多</p>
<p>只要下載teamviewer被控端開啟後報ID 給協助者就好了</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/install-asus-10g-nic-in-proxmox/">Install Asus 10G NIC XG-C100C in Proxmox</a></h1>
<div class="post__content"><p>前幾天接的一個case</p>
<p>因為費用的關係,所以沒有考慮用傳統定義上的伺服器(DELL R640)</p>
<p>改採用比較高階一點的洋垃圾,規格大概是 Intel E5-2680V2 x2 + 64G RAM + 128G SSD x2 (OS) + 960G SSD x4 (raid 10 , zfs)</p>
<p>storage 選擇QNAP NAS TS-932X + 960G SSD x 4 (raid 10 , NFS) + QNAP 10G Switch QSW-1280C-8C</p>
<p>既然storage這邊選用了10G的機種伺服器上當然也要增加10G網卡</p>
<p>一樣成本考量就不用INTEL 了,買了這張 ASUS 10G 網卡</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/change-timezone-in-docker/">[筆記] 修改 docker 容器內的時區 - Change Timezone in Docker</a></h1>
<div class="post__content"><p>最近一直在玩一些docker不過老是會碰到歪果扔寫的東西時區都不一致</p>
<p>有的用 UTC有的用localtime就是沒碰到用 Asia/Taipei 的&hellip;.</p></div>
</article>
</div>
<div class="card card--2col">
<article class="post card__box block">
<h1 class="post__title title-excerpt"><a class="post__title-link" href="/post/transfer-file-content-using-xclip-in-terminal/">Transfer File Content Using Xclip in Terminal</a></h1>
<div class="post__content"><p>工作上常會需要用ssh登入遠端主機檢查LOG有必要的時候還要把log複製回本機來處理。</p>
<p>以前都是傻傻的用 scp 傳檔案</p>
<p>之前就記得有這個xclip/xsel 可以用,但是一直沒有弄清楚怎麼執行</p>
<p>早上研究了一下,順便做個筆記。</p></div>
</article>
</div>
</div>
</main>
<div class="pagination block">
<a class="pagination__item pagination__item--desktop" href="/author/eric-chang/">1</a>
<span class="pagination__item pagination__item--active" data-total="5">2</span>
<a class="pagination__item pagination__item--desktop" href="/author/eric-chang/page/3/">3</a>
<span class="pagination__item pagination__item--gap">&hellip;</span>
<a class="pagination__item pagination__item--desktop" href="/author/eric-chang/page/5/">5</a>
</div>
</div>
<footer class="footer">
<div class="footer__copyright">© 2019 MCの飄狂山莊㊣. <span class="footer__copyright-credits"></span></div>
</footer>
</body>
</html>