發表文章

目前顯示的是有「centos」標籤的文章

xshell 舊版無法登入新版的ubuntu ssh 問題

圖片
ssh 使用加密演算法報錯unknown cipher type 找出目前這個版本的 ssh 支援的加密演算法 ssh -Q cipher localhost | paste -d , -s - * 到 /etc/ssh/sshd_config 加到最後面,重新啟動 sshd 就可以了...!! * 把生成的變數參考,可能長的類似下面的,把它貼入 config 。 Ciphers 3des-cbc,blowfish-cbc,cast128-cbc,arcfour,arcfour128,arcfour256,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com ref: http://mgalgs.github.io/2014/10/22/enable-arcfour-and-other-fast-ciphers-on-recent-versions-of-openssh.html 圖文不相關 圖文不相關-東京塔 HERMES 圖文不相關

How disable the touchpad in Linux MINT (暫時關掉觸控板的功能)

圖片
用了 NB 最麻煩的就是手滑,不小心摸到觸控板。 找了一下,暫時關閉的方式。 使用 root 權限 , 執行 xinput lst 觀看目前系統上的輸入裝置 id 值 BarkleyMT ~ # xinput list ⎡ Virtual core pointer                     id=2 [master pointer  (3)] ⎜   ↳ Virtual core XTEST pointer               id=4 [slave  pointer  (2)] ⎜   ↳ PixArt USB Optical Mouse                 id=11 [slave  pointer  (2)] ⎜   ↳ ETPS/2 Elantech Touchpad                 id=14 [slave  pointer  (2)] ⎣ Virtual core keyboard                   id=3 [master keyboard (2)]     ↳ Virtual core XTEST keyboard             id=5 [slave  keyboard (3)]     ↳ Power Button                           ...

php7 vs. GO lang vs. C on CentOS 7 Linux 速度比較

圖片
php7 vs. GO lang vs. C on CentOS 7 Linux 速度比較 繼上一篇後,想說 php7 已經很快了,但是到底和原生 C 差多少..... 所以就抓了php7 , GO 及 C 三種語言來比較看看氣泡演算法, 12 各項目排序 90萬次花費的時間。 結論: PHP7 ==>  5.9242088794708 s GO  ==>  0.228.885223 s C ==> 0.174889 s 換算一下, ms, us 的單位, 結論是 php7 連 GO 和 C 的車尾燈都看不到... GO 還可以看得到C 的車尾燈!!!!! 且 GO 比 C 好寫多了,我可以接受這一點點的微小差距。 有圖有真相.... C bubble sort 演算法  http://www.programmingsimplified.com/c/source-code/c-program-bubble-sort C 計算時間差 http://www.binarytides.com/get-time-difference-in-microtime-in-c/ php 及 go 的程式碼 https://jaxbot.me/articles/benchmarks_nodejs_vs_go_vs_php_3_14_2013 別人做的 php vs go https://www.ransona.com/blog/2014/11/06/go-vs-php-performance-restful-service/

升級 php7 可以不用急著換電腦.....!!!! on CentOS 7

圖片
升級 php7 可以不用急著換電腦.....!!!! on CentOS 7 Linux 先講結論: 升級前  2.767 sec 升級後  0.88 sec ---------------------- 速度增加了 3.14 倍 ,這台是 Intel Core I5 CPU, RAM 4GB 的個人PC。 更新可以參考 這篇文章 , CentOS 6 OR CentOS 7 都可以更新。 https://webtatic.com/packages/php70/  但是要注意,如果你的 Linux 系統已經有安裝第三方套件,或手動安裝的請小心更新後會毀掉。我的是都用官方的套件及 EPEL更新,直接上去沒有發生大的問題資料也都存在。 另外如果你有自行開發的程式,也需要注意套件的相容性,再行安裝。 測試程式,我是抓   http://www.php-benchmark-script.com/ 這個測試程式。 程式沒有針對平行化、I/O 這些評估,但已經明顯看得出差異。

CentOS Linux 7 xRDP (Linux RDP遠端桌面)

圖片
---- CentOS Linux 7 xRDP  (Linux RDP遠端桌面) ---- # 安裝 nux repo source 及 epel REPO [root@hnamenode2 ~]# yum install epel-release -y [root@hnamenode2 ~]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm # 安裝 xrdp [root@hnamenode2 ~]# yum -y install xrdp tigervnc-server # 啟動 xrdp [root@hnamenode2 ~]#   systemctl restart xrdp.service # 觀看啟動的狀態 [root@hnamenode2 ~]# netstat -antup | grep xrdp tcp        0      0 127.0.0.1:3350          0.0.0.0:*               LISTEN      31816/xrdp-sesman   tcp        0      0 0.0.0.0:3389            0.0.0.0:*               LISTEN      31817/xrdp # xrdp 預設啟動 [root@hnamenode2 ~]#  systemctl enable xrdp.service ln -s '/usr/lib/systemd/system/xrdp.service...

RHEL 7 yum repository 安裝 Apache + PHP 網站服務

圖片
自從 RHEL 7 Release 之後,要測試及安裝軟體都變得很麻煩,剛剛就自己重製了一份 yum 的儲存庫來使用,至少在 CENTOS 7 正式版 出來前先這樣撐著用巴。 建立方式可以參考 之前的 RHEL5 的作法 ,到 7 版方式雷同。 請到你的 /etc/yum.repos.d/ 目錄下,建立一個 local.repo 檔案。 [root@localhost yum.repos.d]# pwd /etc/yum.repos.d  [root@localhost yum.repos.d]# nano local.repo [rhel7-server] name = rhel7 server DVD 64bit baseurl = http://mt.jangmt.com/rhel7/RHEL-7.0Server.x86_64/ enabled = 1 gpgcheck = 0  [rhel7-support] name = rhel7 support DVD 64bit baseurl = http://mt.jangmt.com/rhel7/Supp-7.0RHEL-7Server.x86_64/ enabled = 1 gpgcheck = 0 裝好後安裝個 apache + PHP 服務在 RHEL7 上面巴。 因為 CENTOS7 已經正式出現了,所以可以直接使用 CENTOS7 的 REPO 當作系統的軟體來源: 目前系統 CentOS 7 的主要 REPO 檔案如下: [root@mtchang yum.repos.d]# cat /etc/yum.repos.d/CentOS-Base.repo # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client.  You should use thi...

Xen 回到 CentOS 6.4 了 .....

Xen 回來 CentOS 6 版了,但是這不是 RHEL 的套件源,所以需要注意。 如果你是 5 版的 xen 轉換到 6 版轉換成為 KVM 在效能和相容性上都會有點問題,如果用這版本或許是解救的方案........(語帶保留) 安裝請參考中文的快速入門文件 http://wiki.centos.org/zh-tw/HowTos/Xen/Xen4QuickStart But  需要注意底下文件的幾件事 http://wiki.centos.org/zh-tw/Manuals/ReleaseNotes/Xen4-01 1. Broadcom NetXtreme 2 網絡卡沒有放入 XEN 的核心檔,所以你在開機後會找不到網卡。 bnx2 就是 IBM X-Server 系列主機常用的網卡 2. 只支援 64bit 的 Xen4CentOS 3. SELinux 需要停用,這可能影響較小。因為大多數人到最後都放棄設定 SELinux 了。

PostgreSQL 9.2 及多主機 Replication 複製機制設定

PostgreSQL 9.2 及多主機同步複製機制設定 PostgreSQL install 9.2(CentOS 6.x) CentOS 6.X 版本的 postgresql 是 8.4 版,很多機制還沒有很完備。如果只是一般的使用是足夠,但如需要使用 replication 的功能,建議安裝 9.0 以上版本,比較不會有使用上面的限制。且 9.0 以上版本有很多機制可以選擇(例如:Slony-I Replication),但我選擇內建簡單設定的版本來完成我簡單備份的目的。 如果需要有複製的機制,建議更新到最新版本的 postgresql ,最新穩定版為 postgresql 9.2 版本 如果之前有預設的 postgresql 請先備份、關閉及移除,避免錯亂。在 centos 的 yum remove or rpm remove 機制並不會將 data 目錄移除,但仍建議如果有資料記得用 pg_dump_all 備份出來再做後續的變更。 [root@power pgsql]# /etc/init.d/postgresql stop Stopping postgresql service: [ OK ] [root@power pgsql]# chkconfig postgresql off 9.2版的安裝,參考官方網站 http://www.postgresql.org/download/linux/redhat/ # 安裝 yum repo , 及軟體啟動 DB [root@powerful ~]# rpm -i http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm [root@powerful ~]# yum install -y postgresql92-server postgresql92-contrib [root@powerful ~]# service postgresql-9.2 initdb [root@powerful ~]# chkconfig postgresql-9.2 on # 9.2 版預設路徑 [roo...

在 RHEL/CENTOS 6 Debian Linux 上使用 PostgreSQL資料庫

圖片
Contents 1 ABOUT 2 在RHEL/CENTOS 上使用 PostgreSQL資料庫 2.1 PostgreSQL 2.2 為何要用postgresql? 2.3 PostgreSQL 的安裝 2.3.1 postgresql 的套件安裝 2.3.2 在資料庫系統上,建立使用者與資料庫 2.4 更改 PostgreSQL 的登入認證模式 2.5 安裝 PostgreSQL 管理工具 2.6 建立使用者及匯入資料 2.6.1 建立使用者 2.6.2 建立資料庫 2.6.3 匯入資料 2.6.4 匯出資料 2.6.5 shell script 建立使用者資料 2.7 參考資料 3 debian 安裝 postgresql 資料庫 3.1 安裝 phpPgAdmin 管理介面 3.2 大量建立帳號及匯入資料 ABOUT 安裝 postgresql 在 debian linux or centos linux 在RHEL/CENTOS 上使用 PostgreSQL資料庫 PostgreSQL PostgreSQL是自由的關聯式資料庫伺服器(DBMS),授權模式採取 BSD 授權許可最大好處是可以用於商業營運或修改成為自己的產品一部分而無須支付任何費用也不必擔心需要將修改過後的原始碼公開等眾多GPL授權軟體需要面對的 問題。它具有商業資料庫絕大部分的功能,對於中小企業的應用十分的足夠。相較於 MySQL 這開放的資料庫系統,他有更完整的關聯式資料庫功能及優秀的穩定性。 為何要用postgresql? 為何要用轉用 postgresql? 我需要一個可以商業化的資料庫:PostgreSQL 採用授權較為寬鬆的 BSD 授權,對於商業公司而言不用擔心日後 PostgreSQL 的開發人員突然反悔改成其他授權模式的影響。 一個強大的資料庫引擎:交易、觸發、內存程序等完整的關聯式資料庫機制,提供開發人員在開發過程中更方便的操作。 一個取得容易,價格低廉的資料庫引擎:自由的BSD授權提供最便宜的成本。世界各地都有相關的 Mirror site。 商用資料庫知名產品經常的更新...