2015年9月30日 星期三

[SSHFS]安裝設定使用(ssh遠端掛載目錄)


安裝
Centos 安裝套件後,使用者必須加入fuse群組才能使用FUSE功能
yum install fuse-sshfs
usermod -a -G fuse username
設定
新增/etc/fuse.conf,增加以下內容,掛載時才可以使用-o allow_other參數
# Allow non-root users to specify the 'allow_other' or 'allow_root'
# mount options.
#
user_allow_other
手動掛載
如果想要讓資料夾可以被帳號以外的其他使用者帳號存取可加入-o allow_other參數
sshfs -o allow_other username@IP:/path/to/folder /path/to/local/folder
手動缷載
fusermount -u /path/to/local/folder
開機自動掛載
/etc/fstab下新增 (SSH Trust要先做好!!!)
 username@ip:/path/to/folder /path/to/local/folder   fuse.sshfs idmap=user,identityfile=/home/username/.ssh/id_dsa,allow_other,uid=User_uid,gid=User_gid 0 0

資料來源:
http://blog.miniasp.com/post/2013/11/30/Useful-tool-SSHFS-SSH-Filesystem.aspx
http://what-a-good-day.blogspot.tw/2015/05/ssh-mount-linux.html
http://unix.stackexchange.com/questions/37168/unable-to-use-o-allow-other-with-sshfs-option-enabled-in-fuse-conf
http://fuse.sourceforge.net/
https://www.variux.com/sshfs-automount-at-boot-with-fstab-on-ubuntu-14-04/

2015年5月15日 星期五

yum fix 404 error

yum (404錯誤訊息)
========================================================================
epel                                                                           | 4.4 kB     00:00
http://download.fedoraproject.org/pub/epel/6/x86_64/repodata/06fdcd0885b07462710fc206a438bb143580807569fd02723e08a681384996ad-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
http://download.fedoraproject.org/pub/epel/6/x86_64/repodata/06fdcd0885b07462710fc206a438bb143580807569fd02723e08a681384996ad-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.

Error: failure: repodata/06fdcd0885b07462710fc206a438bb143580807569fd02723e08a681384996ad-primary.sqlite.bz2 from epel: [Errno 256] No more mirrors to try.
========================================================================

解決方法 yum clean metadata ,再yum即可正常安裝或更新


2015年5月11日 星期一

[備忘]如何解決舊版本Ubuntu無法更新套件或安裝套件的問題


如舊版本Ubuntu 12.10由於sources.list檔案中的更新套件的來源伺服器連不到無法使用,
所以會無法更新或安裝套件

解決方法:
在/etc/apt/sources.list.d/sources.list檔案中加入以下
deb http://old-releases.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse
加入後更新一下套件清單apt-get update,即可更新或安裝套件


資料來源:http://askubuntu.com/questions/518856/upgrade-12-10-sources-list
參考連結:http://www.arthurtoday.com/2010/11/ubuntu-apt-get.html

2013年12月20日 星期五

修復: PDF 檔案於 Internet Explorer 10 | 11無法開啟的解決方法

文章轉貼資料來源:The Windows Club

1. Press Windows Key + R combination, type put Regedt32.exe in Run dialog box and hit Enter to open the Registry Editor.


2. Navigate to the following location:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
3. In the right pane of this location, look for the TabProcGrowth named DWORD. This DWORD actually is short from of Tab Process Growth; which sets the rate at which IE creates New Tab processes. If you’ll find the DWORD there, it must having the Value data as 0. If you don’t find it there, create it manually using Right click -> New -> DWORD Value. Now click on the same DWORD to modify its Value data:

 4. Now set the Value data from 0 to 1. Click OK. Putting Value data 1 ensures that all tabs for a given frame process run in a single tab process for a given mandatory integrity level (MIC) level. You may now close the Registry Editor and reboot to see the results.

PHP 錯誤訊息提示功能 php.ini display_errors

文章轉貼資料來源:IT達人
php.ini 檔案設定:
當display_errors = on 時若 php 的程式有問題即會把錯誤訊息顯示在瀏覽器上,這對開發人員非常方便,但當網站對外開放時,一般都會把這個功能關閉,因為php若遇嚴重錯誤時不管你有沒有開啟這個功能它都會顯示錯誤訊息在瀏覽器上通常正式上線的 php 網站都會將這個功能關閉。
檢查 php.ini 檔中的 display_errors 的設定是否為
display_errors = on (若有錯誤會顯示在瀏覽器上) 
將它改成
display_errors = off (關閉錯誤提示訊息)
設定好之後重新將apache 啟動即可

2013年7月17日 星期三

[備忘]調整 SQL 最佳輸出顯示

mysql> pager less -n -i -s;

mysql> SHOW PROCESSLIST \G;

2013年6月30日 星期日

[備忘]Clamav freshclam doesn't update

轉貼來自於http://jerryclc.blogspot.tw/2012/06/etccron.html
Clamav freshclam doesn't update  Error message as below

ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).



Modify "/etc/cron.daily/freshclam
==============================

#!/bin/sh

### A simple update script for the clamav virus database.
### This could as well be replaced by a SysV script.

### fix log file if needed
LOG_FILE="/var/log/clamav/freshclam.log"
if [ ! -f "$LOG_FILE" ]; then
    touch "$LOG_FILE"
    chmod 644 "$LOG_FILE"
   // modify chown clam.clam ==> clamav.clamav
    chown clamav.clamav "$LOG_FILE"
fi

/usr/bin/freshclam \
    --quiet \
    --datadir="/var/lib/clamav" \
    --log="$LOG_FILE"