helloworld

選擇 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

undefined

文章標籤

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)

undefined
MySQL新手入門超級手冊-第二版(適用MySQL 8.x與MariaDB 10.x)

作者: 張益裕  
出版社:碁峰

文章標籤

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

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


可以檢查一下 VM Options 的設定
如果預設是選擇 EFI 的話,把他改成 BIOS 再重開機


undefined
VMware vSphere 6.7私有雲建置實戰

作者: 顧武雄  
出版社:碁峰 

文章標籤

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) 人氣()

我真的不會使用 momo的數位客服@@
所以每當要聯絡客服的時候還是習慣留個訊息,待客服回應
但這個網址的入口不知道在哪邊,真的不好找
所以一定要筆記一下
https://www.momoshop.com.tw/mypage/MemberCenter.jsp?func=40&mmc_source=chatbot&mmc_platform=web&mmc_campaign=membercentre&mmc_content=customerservicemail&origin=xiaoi&memid=6000013660&cid=apuad&oid=1&osm=league

最常用的功能是快速到貨,但延遲未到貨,補償 100 momo 幣
因為數位客服常常鬼打牆,不知道該怎麼使用

image

留意一下 email,是否超過最晚抵達時間

image

請選擇 momo 幣相關問題

image

在依下方欄位提示填入相關資訊,送出即可
聯絡人:
聯絡電話:
訂單編號:
問題簡述:

我覺得客服回應還算迅速
 

文章標籤

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

CentOS 6 或更早版本
[root@pxc-01 ~]# /etc/init.d/mysql bootstrap-pxc
或是
[root@pxc-01 ~]# /etc/init.d/mysql start --wsrep-cluster-address="gcomm://"

CentOS 7
[root@pxc-01 ~]# systemctl start mysql@bootstrap.service

undefined
MySQL與MariaDB學習手冊
Learning MySQL and MariaDB

作者: Russell J.T. Dyer  
譯者: 林班侯
出版社:歐萊禮  

文章標籤

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

[root@example-08 log]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
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.

# 如果是想直接 update mysql.user 的 table 的話,會出現以下錯誤
mysql> UPDATE mysql.user SET password=PASSWORD("passw0rd") where user='root';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

# 請使用 alter user 指令來變更密碼
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'passw0rd';
Query OK, 0 rows affected (0.01 sec)

# 如果有修改 mysql 使用者相關權限都建議再執行以下指令
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

undefined
Python大數據特訓班:資料自動化收集、整理、分析、儲存與應用實戰(附近300分鐘影音教學/範例程式)

作者: 文淵閣工作室  
出版社:碁峰  
 

文章標籤

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

在 CentOS 安裝好 Percona XtraDB Cluster 5.7
也正常啟用 mysql server 了
systemctl start mysql
但是無法用空密碼登入了
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

如何找到系統初始密碼?
找到 /var/log/mysqld.log
其中一行
2019-06-28T05:18:57.787444Z 1 [Note] A temporary password is generated for root@localhost: G3hshe5csL/q

沒錯,最後一個字串就是你root 密碼了

undefined
大數據分析之資料庫理論與實務(SQL Server 2017版)

作者: 曾守正, 周韻寰  
出版社:華泰文化  
 

文章標籤

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

在linux / unix 中
很習慣用 ifconfig -a 指令來檢查網路的狀態

但是在 CentOS 7 最小安裝完後
想要下這個指令
卻發現找不到了

原來是用 ip addr 這個指令來取代了
[root@example-08 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:xx:xx:xx:83 brd ff:ff:ff:ff:ff:ff
    inet 192.168.80.8/24 brd 192.168.200.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx:fe30:2e83/64 scope link
       valid_lft forever preferred_lft forever

如果還是跟我一樣習慣舊指令的話
可以安裝 net-tools 套件
[root@example-08 ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror01.idc.hinet.net
 * extras: mirror01.idc.hinet.net
 * updates: mirror01.idc.hinet.net
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.24.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch         Version                          Repository  Size
================================================================================
Installing:
 net-tools       x86_64       2.0-0.24.20131004git.el7         base       306 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 306 k
Installed size: 918 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.24.20131004git.el7.x86_64.rpm              | 306 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.24.20131004git.el7.x86_64                    1/1
  Verifying  : net-tools-2.0-0.24.20131004git.el7.x86_64                    1/1

Installed:
  net-tools.x86_64 0:2.0-0.24.20131004git.el7

Complete!

ip 指令的其他用法
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |
                   tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |
                   netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |
                   vrf }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -h[uman-readable] | -iec |
                    -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |
                    -4 | -6 | -I | -D | -B | -0 |
                    -l[oops] { maximum-addr-flush-attempts } | -br[ief] |
                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |
                    -rc[vbuf] [size] | -n[etns] name | -a[ll] | -c[olor]}

undefined
CentOS 7.3建置、管理與伺服器架設實戰

作者: 湯秉翰  
出版社:博碩  
 

文章標籤

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

# 檢查目前系統時區狀態
[root@test01 ~]# timedatectl
      Local time: Thu 2019-06-27 10:41:44 CST
  Universal time: Thu 2019-06-27 02:41:44 UTC
        RTC time: Thu 2019-06-27 02:41:43
       Time zone: Asia/Taipei (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

# 若要變更時區,首先列出所有的時區
timedatectl list-timezones

# 指定系統時區
timedatectl set-timezone Asia/Taipei

# 安裝 ntpdate
yum -y install ntp

# 校正時間
ntpdate time.stdtime.gov.tw


undefined
圖解Linux核心工作原理:透過實作與圖解學習OS與硬體的基礎知識
Linuxのしくみ ~実験と図解で学ぶOSとハードウェアの基礎知識

作者: 武內覺  
譯者: 楊季方
出版社:碁峰  
 

文章標籤

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

1. 登入管理介面,選擇dashboard 頁籤 -> 把要重設密碼的機器關機

2. 切換到 rescue 頁籤,拉到最下面,填入新密碼,並點擊 Reset Root Password

3. 回到 dashboard 頁籤 -> 開機

4. 重開機後即可用新密碼登入

undefined
Effective DevOps:使用AWS快速入門

作者: Nathaniel Felsen  
譯者: 錢亞宏
出版社:博碩  

文章標籤

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

開始寫入 log
在 shell 下以root 權限輸入 rndc querylog
# rndc querylog

接下來可以使用以下指令觀察目前的查詢log
# tail -f /var/log/messages

停止寫入 log,避免 log 檔案過大
# rndc querylog

undefined
DNS and BIND管理,第五版

作者: 蔣大偉  
出版社:歐萊禮

文章標籤

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

https://www.wemoscooter.com/
首先下載 app 註冊帳號
透過app 上傳雙證件
如果有填入邀請碼的話可以獲得額外的騎乘金
接下來就是等人工審核,其實滿快的,我當天就審核通過了

第一次借還車,建議好好閱讀一下操作流程
但app 介面其實都滿直覺的,相信很快就能上手
1. 找車,看看附近有沒有可以租的車,app 也會顯示剩餘電量和預估可以騎乘的里程,所以下手前請確定有足夠的電力可以到你的目的地
2. 預約,系統會幫你保留10分鐘
3. 開車廂,車廂內有兩頂安全帽,如果擔心衛生的話,車廂內也有提供頭套可以使用,切記不要把手機放到車廂內
4. 依系統提示發車
5. 騎車到目的地,因為不習慣電動車,停等紅綠燈的時候往往都以為是不是車子熄火了
6. 還車,台北市往往有些地方停車格一位難求,所以可能到了目的地,又要繞到更遠的地方找停車格orz

有人把他比做機車版的 ubike 或是 obike
但wemo 只能在限定的地點停車,某種程度不像是obike 無樁共享單車,更像是ubike 的有樁共享單車
在台北市騎ubike 低消 5元,所以在有騎乘金的誘使下,wemo 勝

我的邀請碼: NFQKZTWG

undefined
共享經濟:改變全世界的新經濟方案

作者: 馬化騰, 張孝榮, 孫怡, 蔡雄山  
出版社:天下文化

文章標籤

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

1. 進到 console 介面,選擇 5) Reboot System


2. 開機時選擇 single user mode

3. 登入 /bin/sh 後,依序輸入
umount -a 
mount -a

4. /etc/rc.initial/password
確定之後,admin 密碼會回復到預設的 pfsense


5. reboot
重開機後,記得登入 web 介面修改admin密碼

undefined

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

解決 NetApp AutoSupport message: (OUT OF INODES) ERROR
發生原因: 同一個volume 雖然空間夠,但檔案數量過多,inode 不足用盡,所以無法再寫入檔案

以下三種解決方式

1. 把檔案搬到其他volume 或是移除不必要的檔案

2. 新增 volume 的 maxfiles 數量
(1)登入netapp cli 介面
(2)輸入 df -i 或是 maxfiles "volume名稱"
可以看到目前volume 的使用狀況
(3)如何增加 maxfiles 
maxfiles "volume名稱" "inode數量"

example:
filer> maxfiles voltest 63753378

The new maximum number of files specified is more than twice as big as
it needs to be, based on current usage patterns.  This invocation of the
operation on the specified volume will allow disk space consumption for
files to grow up to the new limit depending on your workload. The maxfiles
setting cannot be lowered below the point of any such additional disk space
consumption and any additional disk space consumed can never be reclaimed.
Also, such consumption of additional disk space could result in less
available memory after an upgrade.


The new maximum number of files will be rounded to 63753378.

Are you sure you want to change the maximum number of files? y
finer>

3. 增加 volume 空間
undefined

文章標籤

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

timedatectl 指令可以顯示目前設定
# timedatectl
      Local time: Thu 2019-05-02 06:45:47 UTC
  Universal time: Thu 2019-05-02 06:45:47 UTC
        RTC time: Thu 2019-05-02 06:45:48
       Time zone: Etc/UTC (UTC, +0000)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

修改timezone
# cd /etc

# ls -lh | grep localtime
lrwxrwxrwx 1 root root     27 May 24  2018 localtime -> /usr/share/zoneinfo/Etc/UTC

# rm localtime && ln -s /usr/share/zoneinfo/Asia/Taipei localtime

# ls -lh | grep localtime
lrwxrwxrwx 1 root root     31 May  2 14:48 localtime -> /usr/share/zoneinfo/Asia/Taipei

# timedatectl
      Local time: Thu 2019-05-02 14:48:21 CST
  Universal time: Thu 2019-05-02 06:48:21 UTC
        RTC time: Thu 2019-05-02 06:48:22
       Time zone: Asia/Taipei (CST, +0800)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

undefined

文章標籤

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

在 ubuntu 系統下如果要列出已經安裝的套件
root@test3:~# apt list --installed

假設要看有 php 關鍵字的套件
root@test3:~# apt list --installed | grep php

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libapache2-mod-php7.2/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-common/bionic,bionic,now 1:60ubuntu1 all [installed,automatic]
php-curl/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-dev/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-fpm/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-gd/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-mbstring/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-mysql/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-pear/bionic-updates,bionic-updates,bionic-security,bionic-security,now 1:1.10.5+submodules+notgz-1ubuntu1.18.04.1 all [installed]
php-xml/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-xmlrpc/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php-zip/bionic,bionic,now 1:7.2+60ubuntu1 all [installed]
php7.2/bionic-updates,bionic-updates,bionic-security,bionic-security,now 7.2.17-0ubuntu0.18.04.1 all [installed,automatic]
php7.2-cli/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-common/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-curl/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-dev/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-fpm/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-gd/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-json/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-mbstring/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-mysql/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-opcache/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-readline/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-xml/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-xmlrpc/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
php7.2-zip/bionic-updates,bionic-security,now 7.2.17-0ubuntu0.18.04.1 amd64 [installed,automatic]
pkg-php-tools/bionic,bionic,now 1.35ubuntu1 all [installed,automatic]

undefined
Ubuntu 系統管理與架站實務(第三版)

作者: 施威銘研究室
出版社:旗標

文章標籤

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

修改 ubuntu 系統的 hostname
傳統的作法是修改 /etc/hostname
重新開機後生效

另外也可以使用 hostnamectl 指令可以不用開機就可以修改主機名稱
example:
root@test3:~# hostnamectl set-hostname myubuntu

這時候已經寫入設定檔了
root@test3:~# hostnamectl
   Static hostname: myubuntu

但是在 shell 看到的提示字串仍然是修改前的主機名稱
只要重新登入登出一次就可以了

root@test3:~# hostnamectl --help
hostnamectl [OPTIONS...] COMMAND ...

Query or change system hostname.

  -h --help              Show this help
     --version           Show package version
     --no-ask-password   Do not prompt for password
  -H --host=[USER@]HOST  Operate on remote host
  -M --machine=CONTAINER Operate on local container
     --transient         Only set transient hostname
     --static            Only set static hostname
     --pretty            Only set pretty hostname

Commands:
  status                 Show current hostname settings
  set-hostname NAME      Set system hostname
  set-icon-name NAME     Set icon name for host
  set-chassis NAME       Set chassis type for host
  set-deployment NAME    Set deployment environment for host
  set-location NAME      Set location for host

undefined
Ubuntu 系統管理與架站實務(第三版)

作者: 施威銘研究室  
出版社:旗標  
 

文章標籤

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

首先找到適合的作業系統
https://support.radware.com/app/answers/answer_view/a_id/16176/~/alteon-recommended-oids-for-snmp-monitoring

以 Alteon version 30.2 為例
假設我們要抓取 Peak SSL capacity usage in CPS 及 Current SSL capacity usage in CPS

分別可以下以下指令抓取
% /usr/local/bin/snmpwalk -v 2c -c COMMUNITY IP .1.3.6.1.4.1.1872.2.5.1.2.12.3
SNMPv2-SMI::enterprises.1872.2.5.1.2.12.3.0 = STRING: "500 CPS"

% /usr/local/bin/snmpwalk -v 2c -c COMMUNITY IP .1.3.6.1.4.1.1872.2.5.1.2.12.4
SNMPv2-SMI::enterprises.1872.2.5.1.2.12.4.0 = STRING: "124 CPS"
 


undefined

文章標籤

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

編輯測試程式
# vi stdin.php
#!/usr/local/bin/php

<?php
$stdin = file ('php://stdin');
print_r ($stdin);

給予執行權限
# chmod u+x stdin.php

準備一個測試文字檔
# vi hello.txt
Hello
HelloWorld
helloworld
Hello World

測試,把文字檔cat 出來,丟給 php 程式處理
# cat hello.txt | ./stdin.php

Array
(
    [0] => Hello

    [1] => HelloWorld

    [2] => helloworld

    [3] => Hello World

)

參考資料
https://www.php.net/manual/en/features.commandline.io-streams.php

undefined
 

PHP、MySQL與JavaScript學習手冊(第五版)
Learning PHP, MySQL & JavaScript, 5th Edition

作者: Robin Nixon  
譯者: 賴屹民
出版社:歐萊禮  

文章標籤

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

Close

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

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

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

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

reload

請輸入左方認證碼:

看不懂,換張圖

請輸入驗證碼