20200120 20200120 今日花況
過年期間可以來賞花

 

IMG_1199

IMG_1200

IMG_1201

IMG_1202

IMG_1203

IMG_1204

IMG_1205

IMG_1189

IMG_1190

IMG_1191

IMG_1192

IMG_1193

IMG_1194

IMG_1195

IMG_1196

IMG_1197

undefined

一年四季賞花輕旅行:邂逅臺灣之美,花現四季繽紛色彩

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

根據網路上的說法
Bytespider 是字節跳動旗下的今日頭條正在開發搜索引擎所派出來的爬蟲
但頻率真的太高了
有些小網站根本受不了
如果要擋的話有幾個方式

1. robots.txt
不允許 Bytespider 來爬網站,但可能不會有效

2. apache rewrite rule 
判斷 agent 為 Bytespider 則回應 403

3. 防火牆直接擋在外面
這是最直接有效的方式,也不用讓人家進到web server 後再給人家拒絕
目前整理出來幾個網段可以參考
110.249.202.0/24
110.249.201.0/24
111.225.149.0/24
111.225.148.0/24
60.8.123.0/24
220.243.135.0/24
220.243.136.0/24
 

helloworld 發表在 痞客邦 留言(0) 人氣()

準備啟動第二個node 要加入 perconaxtradb cluter 中
但是啟動失敗
看一下 /var/log/mysqld.log
[ERROR] WSREP: Command did not run: wsrep_sst_xtrabackup-v2 --role 'donor' --address ' :4444/xtrabackup_sst//1' --socket '/var/lib/mysql/mysql.sock' --datadir '/home/mysql' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --mysqld-version '5.7.28-31-57'   '' --gtid 'xxxx'

暫時的解法,把 wsrep_sst_method 由 xtrabackup-v2 改成 rsync
vi /etc/percona-xtradb-cluster.conf.d/wsrep.cnf
# SST method
#wsrep_sst_method=xtrabackup-v2
wsrep_sst_method=rsync

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

> use mydb
switched to db mydb
> db.getCollection('mycollection').find({}).count()
53637
>

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

varnish 預設使用 regular expression 比對字串是有區分大小寫的
如 

if (req.http.User-Agent ~ "spider") {
    return (synth(403));
}

如果要不分大小寫比對字串時,可以在字串前面加入 (?i) 

if (req.http.User-Agent ~ "(?i)spider") {
    return (synth(403));
}
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

隨著顯卡和螢幕解析度大幅提高後
如果發現部分程式的顯示畫面或是文字模糊不清
可以嘗試以下方式解決,或許有機會可以解決

選取應用程式,點擊右鍵 -> 內容 -> 相容性 變更高DPI設定 將以下兩個checkbox 都勾選起來 確定離開

image

重新開啟應用程式看看顯示情形是否有改善

undefined

 

helloworld 發表在 痞客邦 留言(0) 人氣()

在 shell 下如果要用curl 指定IP抓取 virtual host 網頁內容可以用以下指令
# curl 'http://192.168.5.111/path/pagename' -H "Host: example.pass.tw"

相對於以上指令,如果要用php 執行的話
<?php
$ch = curl_init('http://192.168.5.111/path/pagename');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: example.pass.tw'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

AWStats 是一套強大的 opensource log 分析工具
可以分析來自 web , mail , ftp server 等格式的紀錄

以下測試環境:
FreeBSD 12.1-RELEASE
apache24/httpd-2.4.41
awstats-7.7

更新ports
# portsnap fetch update

安裝 apache24
# cd /usr/ports/www/apache24/
# make install clean

接下來安裝 AWStats
# cd /usr/ports/www/awstats/
# make install clean

設定apache, 將以下註解拿掉
# cd /usr/local/etc/apache24/
# vi httpd.conf
LoadModule cgid_module libexec/apache24/mod_cgid.so

設定vhost , 如果這台是單一功能的機器也可以直接寫在 httpd.conf 內
# cd /usr/local/etc/apache24/Includes/
# vi awstats.conf
<VirtualHost *:80>
        ServerAdmin webadm@staff.pass.tw
        ServerName awstats.pass.tw
        ErrorLog /home/archive/logs/error_log-awstats.log
        CustomLog /home/archive/logs/access_log-awstats.log combined

        Alias /awstatsclasses "/usr/local/www/awstats/classes/"
        Alias /awstatscss "/usr/local/www/awstats/css/"
        Alias /awstatsicons "/usr/local/www/awstats/icon/"
        ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/"

        <Directory "/usr/local/www/awstats/">
                Options None
                AllowOverride None
                Require all granted
        </Directory>
        <Directory "/usr/local/www/awstats/cgi-bin/">
                Options ExecCGI
                SetHandler cgi-script
        </Directory>
</VirtualHost>

重新啟動apache
# apachectl restart

編輯設定檔,簡單調整適合自己的設定
# cd /usr/local/www/awstats/cgi-bin/
# cp awstats.model.conf awstats.pass.tw.conf
# vi awstats.pass.tw.conf
LogFile="gzip -cd /home/workdir/access_log.pass.tw*.gz |"
LogType=W
LogFormat=1
LogSeparator=" "
SiteDomain="books.pass.tw"
DirData="/usr/local/www/awstats/data"

開始分析數據
# mkdir /usr/local/www/awstats/data
# /usr/local/www/awstats/cgi-bin/awstats.pl -config=pass.tw -update

打開瀏覽器,網址輸入
http://主機名稱或ip/awstats/awstats.pl?config=設定檔

http://awstats.pass.tw/awstats/awstats.pl?config=pass.tw

測試如果正常的話,將 /usr/local/www/awstats/cgi-bin/awstats.pl 寫入 crontab 每日固定時間執行即可

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

FreeBSD 安裝 AWStats

AWStats 是一套強大的 opensource log 分析工具
可以分析來自 web , mail , ftp server 等格式的紀錄

以下測試環境:
FreeBSD 12.1-RELEASE
apache24/httpd-2.4.41
awstats-7.7

更新ports
# portsnap fetch update

安裝 apache24
# cd /usr/ports/www/apache24/
# make install clean

接下來安裝 AWStats
# cd /usr/ports/www/awstats/
# make install clean

設定apache, 將以下註解拿掉
# cd /usr/local/etc/apache24/
# vi httpd.conf
LoadModule cgid_module libexec/apache24/mod_cgid.so

設定vhost , 如果這台是單一功能的機器也可以直接寫在 httpd.conf 內
# cd /usr/local/etc/apache24/Includes/
# vi awstats.conf
<VirtualHost *:80>
        ServerAdmin webadm@staff.pass.tw
        ServerName awstats.pass.tw
        ErrorLog /home/archive/logs/error_log-awstats.log
        CustomLog /home/archive/logs/access_log-awstats.log combined

        Alias /awstatsclasses "/usr/local/www/awstats/classes/"
        Alias /awstatscss "/usr/local/www/awstats/css/"
        Alias /awstatsicons "/usr/local/www/awstats/icon/"
        ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/"

        <Directory "/usr/local/www/awstats/">
                Options None
                AllowOverride None
                Require all granted
        </Directory>
        <Directory "/usr/local/www/awstats/cgi-bin/">
                Options ExecCGI
                SetHandler cgi-script
        </Directory>
</VirtualHost>

重新啟動apache
# apachectl restart

編輯設定檔,簡單調整適合自己的設定
# cd /usr/local/www/awstats/cgi-bin/
# cp awstats.model.conf awstats.pass.tw.conf
# vi awstats.pass.tw.conf
LogFile="gzip -cd /home/workdir/access_log.pass.tw*.gz |"
LogType=W
LogFormat=1
LogSeparator=" "
SiteDomain="books.pass.tw"
DirData="/usr/local/www/awstats/data"

開始分析數據
# mkdir /usr/local/www/awstats/data
# /usr/local/www/awstats/cgi-bin/awstats.pl -config=pass.tw -update

打開瀏覽器,網址輸入
http://主機名稱或ip/awstats/awstats.pl?config=設定檔

http://awstats.pass.tw/awstats/awstats.pl?config=pass.tw

測試如果正常的話,將 /usr/local/www/awstats/cgi-bin/awstats.pl 寫入 crontab 每日固定時間執行即可

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

目前幾乎所有的瀏覽器都已支援壓縮功能
以下幾個網站可以方便檢測你的網站是否有開啟壓縮的功能
https://aruljohn.com/gziptest.php
https://www.whatsmyip.org/http-compression-test/
http://www.gidnetwork.com/tools/gzip-test.php

操作方式都一樣,只需輸入網址就可以方便知道結果


undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

情境
example.com/a/test.html -> a.example.com/test.html
example.com/b/test.html -> b.example.com/test.html

# vi /etc/varnish/default.vcl
 

vcl 4.0;

import directors;
import std;

[.... 中間略 ....]

sub vcl_recv {
    if (req.http.host ~ "example.com") {
        if (req.url ~ "^/a/") {
            set req.url = regsub(req.url, "^/a","");
            set req.http.host = "a.example.com";
            set req.backend_hint = a.backend();
        } else if (req.url ~ "^/b/") {
            set req.url = regsub(req.url, "^/b","");
            set req.http.host = "b.example.com";
            set req.backend_hint = b.backend();
        }
    }
}

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

我們可能會遇到系統硬體不夠力,想要換一台新的NAS
或是空間不族,想要更換大一點的硬碟空間

首先除了先要把裡面的資料備份出來外
如果原來的設定很單純的話,當然可以直接在新機器上面設定
但是如果裡面很多的服務和帳號的話,建議還是用系統提供的備份還原機制

控制台 -> 更新 & 還原 -> 系統設定備份

1. 備份設定
系統會將以下的設定及帳號密碼備份出來一個 .dss 的檔案

2. 還原設定
(1) 選擇要還原哪一個備份檔

(2) 選擇要還原的設定及是否要覆寫衝突
如果是全新的設定的話,當然是全選
但是如果只是單純因為前一刻手誤,不小心改壞設定或是誤刪帳號,就可以選擇各別的設定還原






PS. 還原設定的時候不會異動到網路設定,所以可以不用擔心新舊兩台機器會有IP 衝突的狀況
 

undefined

 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

測試Synology DS413 可以抓到單顆10TB硬碟
但是這個型號的NAS 每個 volume 的上限是 16TB
所以裝 10TB的硬碟很尷尬
做成 raid10 / raid5 / raid6 都會超過 16TB
只能做成兩個raid1 的 volume



官方資料
https://www.synology.com/zh-tw/knowledgebase/DSM/tutorial/Storage/Why_does_my_Synology_NAS_have_a_single_volume_size_limitation

因應現在硬碟空間愈做愈大,建議就買可以上到108TB 的機型

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

手頭上剛好有 Dell R310 和 4顆SEAGATE 10TB的硬碟
想要來試試可不可以用舊機器裝一台空間大一點的NAS

進到 Raid BIOS , 很順利的抓到10TB的硬碟
也可以成功建立 Raid 5 && Virtual Disk

但進到CentOS 8 的安裝介面的時候,看不到剛剛建立的 Virtual Disk

結論: 失敗,冏
undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

來到萬華除了知名古蹟龍山寺外
當然還有各種好吃的美食不能錯過
如果想來點甜點的話,不能錯過這50年的古早味-- 涼粉伯



地址: 台北市萬華區貴陽街二段202號
facebook 粉絲頁:  https://www.facebook.com/sweetpotatojelly

undefined

helloworld 發表在 痞客邦 留言(0) 人氣()

首先介紹 runuser 這個指令

# runuser --help

Usage:
 runuser [options] -u <user> [[--] <command>]
 runuser [options] [-] [<user> [<argument>...]]

Run <command> with the effective user ID and group ID of <user>.  If -u is
not given, fall back to su(1)-compatible semantics and execute standard shell.
The options -c, -f, -l, and -s are mutually exclusive with -u.

Options:
 -u, --user <user>               username
 -m, -p, --preserve-environment  do not reset environment variables
 -g, --group <group>             specify the primary group
 -G, --supp-group <group>        specify a supplemental group

 -, -l, --login                  make the shell a login shell
 -c, --command <command>         pass a single command to the shell with -c
 --session-command <command>     pass a single command to the shell with -c
                                   and do not create a new session
 -f, --fast                      pass -f to the shell (for csh or tcsh)
 -s, --shell <shell>             run <shell> if /etc/shells allows it
 -P, --pty                       create a new pseudo-terminal

 -h, --help                      display this help
 -V, --version                   display version


For more details see runuser(1).

範例:
runuser -l mongod -c '/usr/bin/mongod -f /home/example/mongod-27020.conf'

runuser -l mongod -c '/usr/bin/mongod -f /home/example/mongod-27020.conf --shutdown'

透過這個做法,我們可以將開機後要執行的服務寫在同一支 script 中,方便重開機後自動執行,很方便喔

另外還有幾種作法,也是可以在root 的權限下,使用特定的使用者權限來執行程式,提供作參考
1. su - username
2. suid (set uid)

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

選擇 CentOS 最小安裝後

# yum -y install epel-release bind-utils net-tools sysstat

# yum -y update

# systemctl disable firewalld

# vi /etc/selinux/config
SELINUX=disabled

# reboot

以上是我習慣裝完OS 後的習慣,僅參考用

接下來才是真的安裝 MongoDB 4.2
編輯 /etc/yum.repos.d/mongodb.repo
# vi /etc/yum.repos.d/mongodb.repo
[MongoDB]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc

透過 yum 安裝
# yum -y install mongodb-org

手動啟動服務
# systemctl start mongod.service


設定下次重開機後自動啟用
# systemctl enable mongod.service

檢查安裝的版本
# mongod --version
db version v4.2.1
git version: edf6d45851c0b9ee15548f0f847df141764a317e
OpenSSL version: OpenSSL 1.1.1 FIPS  11 Sep 2018
allocator: tcmalloc
modules: none
build environment:
    distmod: rhel80
    distarch: x86_64
    target_arch: x86_64

測試可否進入 mongo shell
# mongo

安裝好的 MmongoDB ,預設只允許 localhost 可以登入
如果確認你的網路環境夠安全的話,請修改 /etc/mongod.conf
# vi /etc/mongod.conf
  bindIp: 127.0.0.1 ---> 0.0.0.0

存檔,重新啟動 mongod
# systemctl restart mongod.service

預設 port 為 tcp 27017
# netstat -na | grep LISTEN
tcp        0      0 0.0.0.0:27017           0.0.0.0:*               LISTEN
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

https://www.apple.com/tw/macos/catalina/

macOS Catalina是蘋果公司用於麥金塔電腦的桌面作業系統 macOS 的第16個主要版本。它是 macOS Mojave 的繼任者,於2019年6月3日在蘋果全球開發者大會發布,並於2019年10月8日正式推出。Catalina 是第一個只支援64位元應用程式的 macOS 版本。
節錄自維基百科
https://zh.wikipedia.org/zh-tw/MacOS_Catalina

升級了這次的macOS 最主要的災情應該就是不能在執行原本已經安裝的32bit 軟體
如果是安裝舊版的microsoft office , 則會讓你安裝 office 365
之前跟微軟買斷的office 也只能跟這台電腦說881 

如果原來已經安裝了32bit的軟體也有可能因為升級,而無法 uninstall 
讓你看的到用不到,也丟不掉... orz

總之,這次升級前就好好三思一下

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

因為沒有見過棉花田長什麼樣子
所以趁著上星期的雙十連假走訪了一趟雲林
想要一睹棉花的真面目
雲端埒活棉花田沒有比較明顯的路標
入口就在埒內福德廟旁


埒內是虎尾的一個地名
注音 ㄌㄜˋ
台語發音 ㄌㄨㄚ,是矮牆、界限的意思

棉花田主人目前提供導覽服務,每人150/約2小時導覽
可以電話或是facebook 預約
透過導覽可以親眼看到原來棉花是怎麼生長的
並從中獲取一些棉花的小知識
和農村的一些特色
是一個悠閒又充滿知性的一趟小旅程






























 

結束了導覽之旅,如果時間還夠的話
還能去附近逛逛 興隆毛巾觀光工廠 和 貓咪小學堂拍個幾張網美照喔



undefined
棉花帝國:資本主義全球化的過去與未來
Empire of cotton: A Global History

作者: 斯溫・貝克特 (Sven Beckert)
譯者: 林添貴
出版社:天下文化  

雲端埒活棉花田
地址: 雲林縣虎尾鎮埒內里18鄰255-16號
電話:0926-559-755
facebook: https://www.facebook.com/Cottoner/

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

1. 如果還沒安裝 portupgrade 套件,請先安裝該套件

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

2. 列出 portsclean 功能

#  portsclean -h
portsclean 2.4.15 (2019/10/04)

usage: portsclean [-hCDDiLnPPQQq]

    -h, --help         Show this message
    -C, --workclean    Clean up working directories
    -D, --distclean    Clean up distfiles which are not referenced from any
                       port in the ports tree;
                       Specified twice, clean up distfiles which are not
                       referenced from any port that is currently installed
    -i, --interactive  Turn on interactive mode
    -L, --libclean     Clean up old shared libraries
    -n, --noexecute    Do not actually delete files
    -P, --pkgclean     Clean up outdated package tarballs;
                       Specified twice, delete all the package tarballs
    -Q, --quiet        Do not write anything to stdout;
                       Specified twice, stderr neither
    -q, --noconfig     Do not read pkgtools.conf

Environment Variables [default]:
    PACKAGES         packages directory [$PORTSDIR/packages]
    PKGTOOLS_CONF    configuration file [$PREFIX/etc/pkgtools.conf]
    PKG_DBDIR        packages DB directory [/var/db/pkg]
    PORTSDIR         ports directory [/usr/ports]
    PORTS_DBDIR      ports db directory [$PORTSDIR]
    PORTS_INDEX      ports index file [$PORTSDIR/INDEX]


3. 刪除 work 資料匣

# portsclean -C
Cleaning out /usr/ports/*/*/work...
Delete /usr/ports/databases/pecl-mongodb/work
Delete /usr/ports/shells/bash/work
Delete /usr/ports/textproc/xmlto/work
Delete /usr/ports/textproc/asciidoc/work
Delete /usr/ports/devel/libatomic_ops/work
Delete /usr/ports/devel/boehm-gc/work
Delete /usr/ports/devel/git/work
Delete /usr/ports/devel/cvsps/work
Delete /usr/ports/www/w3m/work
Delete /usr/ports/security/p5-Authen-SASL/work
Delete /usr/ports/security/p5-Digest-HMAC/work
Delete /usr/ports/misc/getopt/work
Delete /usr/ports/lang/p5-Error/work
done.

undefined
精通 Shell 程式設計(第四版)
Shell Programming in Unix, Linux and OS X, 4th Edition

作者: Stephen G. Kochan, Patrick Wood  
譯者: 蔡明志
出版社:碁峰

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

編輯 /etc/yum.repos.d/mongodb.repo
# vi /etc/yum.repos.d/mongodb.repo
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

透過 yum 安裝
# yum -y install mongodb-org

手動啟動 mongodb
# systemctl start mongod.service    // For CentOS 7 
# service mongod restart            // For CentOS 6/5 

設定下次重開機後自動啟動
# systemctl enable mongod.service    // For CentOS 7 
# chkconfig mongod on                // For CentOS 6/5 

測試登入
# mongo

預設 LISTEN 本機的 tcp/27017
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN

undefined
7天學會大數據資料處理—NoSQL(第三版):MongoDB入門與活用

作者: 黃士嘉, 林敬傑  
出版社:博碩

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

身為一個依賴台鐵上下班,又要趕著接送小孩的家長
如果可以在下班前知道火車誤點又會主動通知,然後趁早考慮其他交通工具是很重要的

最近安裝一個 app : 台鐵e訂通
apple store:  https://apps.apple.com/app/id1441617748
google play:  https://play.google.com/store/apps/details?id=tw.gov.tra.twtraffic
有以下幾個功能提供給大家做參考

如果有狀況時會推播到手機


也可以依照你預計上車的車站看一下目前火車誤點或是準點的狀況


undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

安裝好 wordpress 5 ,修改永久連結(Permalinks) 後新增文章
如果出現 Publishing failed 或是 發佈時發生錯誤 等錯誤訊息

請確認 apache 的 rewrite module 是否有安裝並啟用
<Directory "/home/www/wp">
    ....
    AllowOverride All
    ....
</Directory>

並且在 wordpress 的目錄下面新增一個 .htaccess 檔案
內容如下

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp5/index.php [L]
</IfModule>



undefined
WordPress架站的12堂課增訂版:網域申請x架設x佈景主題x廣告申請

作者: 張正麒, 何敏煌  
出版社:碁峰 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

首先先找一下預設密碼是什麼
新版的mysql root 預設密碼已經不是空值
而是在第一次啟動時給予一個亂數字串

[root@pxc-example ~]# grep password /var/log/mysqld.log
2019-08-28T06:03:02.554033Z 1 [Note] A temporary password is generated for root@localhost: PrA!OOXXC3ir

預設使用mysqladmin 會出現以下錯誤
[root@pxc-example ~]# mysqladmin -u root -p password 'XXXXXX'
Enter password:
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
mysqladmin: unable to change password; error: 'Percona XtraDB Cluster doesn't allow use of CURRENT_USER/USER function for USER operation while operating in cluster mode'

可以利用 mysql client 修改
[root@pxc-example ~]#  mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.7.26-29-57-log

Copyright (c) 2009-2019 Percona LLC and/or its affiliates
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEW-Password';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在 vmware esxi 安裝 windows 10 如果出現 efi vmware virtual sata cdrom Drive (0.0) ... unsuccessful 錯誤訊息
解決 vmware esxi 安裝 windows 10 出

可以檢查一下 VM Options 的設定
如果預設是選擇 EFI 的話,把他改成 BIOS 再重開機
解決 vmware esxi 安裝 windows 10 出

 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在瀏覽器輸入 synology nas 的主機名稱或是ip 的話
預設會自動轉址到 5000 port
如果想要轉址到其他應用服務去的話

可以修改以下檔案
# vi /usr/syno/share/nginx/WWWService.mustache


server {
    listen 80 default_server{{#reuseport}} reuseport{{/reuseport}};
    listen [::]:80 default_server{{#reuseport}} reuseport{{/reuseport}};

    gzip on;

    {{> /usr/syno/share/nginx/WWW_Main}}

    location ~ ^/$ {
        //rewrite / http://$host:{{DSM.port}}/ redirect;
        //取代成想要轉址的port

        rewrite / http://$host:8080/ redirect;
    }
}

最後重啟服務
# synoservicecfg --restart nginx

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

家裡有台 Sony Bravia 42" 電視
因為有時候會自動重開機,所以想更新一下軟體
也想順便測試一下直接用電視看Youtube

由於這台TV沒有內建無線網卡,瞄一下背後,有usb port 和 RJ-45
但家裡只有手機熱點可以分享網路給其他設備
所以就先拿了一張usb無線網卡插上去
結果不支援,爬文之後才發現他只支援 Bravia 電視專用的無線網卡
如: UWA-BR100

但是這張卡單價不便宜,台灣也沒什麼通路在賣
所以只能接有線了

測試環境
手機熱點 <- wifi -> BR-6428nS <- Lan -> Sony Bravia TV

以下是用【EDIMAX 訊舟】BR-6428nS V4 N300多模式無線網路分享器 實測畫面

undefined

EDIMAX 訊舟 BR-6428nS V4 N300多模式無線網路分享器
 
--高增益天線+特調無線參數,效能超越同級產品20%--
 
延續前一代BR-6428nS V3 優異的無線傳輸技術,搭配高增益天線,不僅讓您可於大空間的無線網路環境下輕鬆使用。針對現代住宅多隔間與多樓層,訊號死角多的問題,BR-6428nS V4 的無線訊號延伸器模式(Extender Mode)也提供了專為延伸跨樓層、多房間的無線網路環境設計的無線訊號延伸功能,它能延伸家中現有的無線網路、有效減少訊號死角,大幅提昇上網品質。
 
在設定安裝方面,BR-6428nS V4 採用新一代iQ Setup快速設定功能,讓您使用手機即可無障礙安裝,連線上網更快更方便。同時,BR-6428nS V4 智慧五合一多模式設計,大幅簡化繁複設定,讓一台無線分享器可輕易變身為「無線訊號延伸器(Range Extender Mode)」、「無線基地台(Access Point Mode)」、「無線橋接器(AP Client)」及「無線公共熱點(WISP)」,使您的網路環境應用更添彈性,而這樣的功能切換,只要透過手機或平板執行iQSetup,您不必是行家也可輕鬆操作。
 
此外,BR-6428nS V4 同樣採用最新Green WLAN技術,內建新一代低溫無線晶片,可以主動調整資料傳輸所需電量,省電效果高達66%,重點是節能省電之外,絕對不省效能,讓您在馳騁無線網上的同時,也能為綠色環保盡一分心力。

1. 找一台電腦網卡設成dhcp自動抓取, 並接上 BR-6428nS 的Lan port
網址輸入 http://edimax.setup/
如果需要帳號密碼,出廠的預設值是 admin / 1234
選擇 WISP 模式


2. 選擇手動設定


3. 選擇一個基地台,也就是你手機的熱點


4. 輸入密碼


5. 下一步


6. 下一步


7. 設定你這台分享器的ssid 和密碼


8. 設定完成


9. 等待設備同步完設定


10. 恭喜,設定完成

接下來就是把電視和分享器用網路線接起來就可以了
 

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

在esxi 6.x 的web 管理介面新增一個使用者第一個步驟
Host -> Manage -> Security & Users -> User -> Add User

新增完之後的使用者還沒有任何的權限
就跟MS SQL 或是 Sybase 之類的資料庫一樣
還需要指派角色後才能真正使用

指派角色的步驟如下
1. Host -> Actions -> Permissions


2. Add user



3. 輸入剛剛新增的user 並指派角色



4. Add user



最後開啟無痕瀏覽或是登出再用新帳號登入測試

undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

如果是把usb 隨身碟格式化成預設的 FAT32
無法寫入單一檔案超過4GB 資料

解決方式:
將usb 格式化成 exFAT



undefined

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

安裝完 CentOS 7 最小安裝後
會發現以前習慣的工具預設都不會安裝了,取而代之的是新的指令
如果還是習慣以前的工具的話可以另外再透過yum 安裝
例如

nslookup
dig
host
# yum -y install bind-utils

ifconfig
netstat
# yum -y install net-tools

iostat
# yum -y install sysstat

另外如果還想再安裝其他工具,但不知道要安裝哪個套件的話
可以執行以下指令,來找到應該要安裝哪一個套件

# yum provides */iostat
or
# yum provides iostat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
pcp-4.1.0-4.el7.x86_64 : System-level performance monitoring and performance management
Repo        : base
Matched from:
Filename    : /var/lib/pcp/config/pmlogconf/tools/iostat

pcp-4.1.0-5.el7_6.x86_64 : System-level performance monitoring and performance management
Repo        : updates
Matched from:
Filename    : /var/lib/pcp/config/pmlogconf/tools/iostat

pcp-testsuite-4.1.0-4.el7.x86_64 : Performance Co-Pilot (PCP) test suite
Repo        : base
Matched from:
Filename    : /var/lib/pcp/testsuite/sadist/iostat

pcp-testsuite-4.1.0-5.el7_6.x86_64 : Performance Co-Pilot (PCP) test suite
Repo        : updates
Matched from:
Filename    : /var/lib/pcp/testsuite/sadist/iostat

sysstat-10.1.5-17.el7.x86_64 : Collection of performance monitoring tools for Linux
Repo        : base
Matched from:
Filename    : /usr/bin/iostat

undefined
鳥哥的Linux私房菜:基礎學習篇(附DVD一片)(第四版)

作者: 鳥哥  
出版社:碁峰

文章標籤

helloworld 發表在 痞客邦 留言(0) 人氣()

Close

您尚未登入,將以訪客身份留言。亦可以上方服務帳號登入留言

請輸入暱稱 ( 最多顯示 6 個中文字元 )

請輸入標題 ( 最多顯示 9 個中文字元 )

請輸入內容 ( 最多 140 個中文字元 )

reload

請輸入左方認證碼:

看不懂,換張圖

請輸入驗證碼