https://avatars.githubusercontent.com/u/6058558

程式狂想筆記

Linux DHCP DNS重開機跑掉的問題

問題描述 在 Linux 上使用 DHCP 取得 IP 時,雖然手動設定了 DNS,但每次重開機後 /etc/resolv.conf 的 DNS 設定就會被覆蓋,導致 DNS 解析失敗。 DHCP 與 DNS 的關係 DHCP(Dynamic Host Configuration Protocol)在分配 IP 時,同時也會提供 DNS 伺服器資訊。當網路服務啟動或 DHCP 更新 lease 時,DHCP client 程式(如 dhclient)預設會將 DHCP 伺服器提供的 DNS 寫入 /etc/resolv.conf,覆蓋掉手動設定的內容。 解決方法 CentOS / RHEL(使用 ifcfg 設定) 修改對應網卡的設定檔,加入 PEERDNS=no,告知 DHCP client 不要更新 DNS 設定: 1 2 # 假設網卡為 eth0 sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 在設定檔中加入或修改: 1 2 3 4 BOOTPROTO=dhcp PEERDNS=no # 加入這行,禁止 DHCP 覆蓋 DNS DNS1=8.

記錄網頁特效動機

最近看到一些日本動畫網站做的越來越厲害
以前看到動態以為是Flash做出來的東西
但仔細一看,竟然是HTML5+JavaScript合出來的東西
於是我對一些網站製作手法開始有興趣了

AngularJS讀取載入檔案資訊

http://www.dotblogs.com.tw/regionbbs/archive/2012/06/28/html5.file.api.aspx http://odetocode.com/blogs/scott/archive/2013/07/05/a-file-input-directive-for-angularjs.aspx http://stackoverflow.com/questions/16579427/html5-file-upload-with-angularjs http://plnkr.co/edit/JPxSCyrxosVXfZnzEIuS?p=preview http://plnkr.co/edit/HEA7wYq8Uv0Ee0J4SX7u?p=preview html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <!doctype html> <html ng-app="plunker" > <head> <meta charset="utf-8"> <title>AngularJS Plunker</title> <script>document.write('<base href="' + document.location + '" />');</script> <link rel="stylesheet" href="style.css"> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.js"></script> <script src="app.js"></script> </head> <body ng-controller="MainCtrl"> <input type="file" filelist-bind multiple="multiple" name="files"/> <br> files : <pre>{{ files | json }}</pre> </body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 var app = angular.

Bootstrap相關不錯的工具網站

Bootstrap 是目前最廣泛使用的前端 CSS 框架之一,圍繞它有許多優質的工具和資源。以下整理幾個實用的 Bootstrap 相關工具網站。 主題與樣式 Bootswatch 網址:https://bootswatch.com 用途:提供多款免費的 Bootstrap 主題,只需替換一個 CSS 檔案即可完全改變網站外觀 特色:主題設計精美,涵蓋各種風格(扁平化、深色、鮮豔等),完全免費且開源 1 2 <!-- 只需替換 Bootstrap CSS 連結 --> <link rel="stylesheet" href="https://bootswatch.com/5/flatly/bootstrap.min.css"> Bootstrap 官方主題市場 網址:https://themes.getbootstrap.com 用途:官方提供的付費進階主題,品質有保障 圖示(Icons) Bootstrap Icons 網址:https://icons.getbootstrap.com 用途:Bootstrap 官方圖示庫,提供超過 1800 個 SVG 圖示,免費開源 使用方式: 1 2 3 4 5 6 <!-- 引入圖示庫 --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css"> <!-- 使用圖示 --> <i class="bi bi-heart-fill"></i> <i class="bi bi-github"></i> Font Awesome 網址:https://fontawesome.com 用途:最廣泛使用的圖示庫,與 Bootstrap 搭配使用效果極佳,提供免費版和付費版 版面生成器 Bootstrap Layout Builder 用途:視覺化拖拉生成 Bootstrap Grid 排版代碼,適合快速建立頁面骨架 Layoutit!