2014年10月7日 星期二

交大資工---SA--作業筆記全

 chrome white screen

 


Also you must go to /etc/sysctl.conf and add this line
Code:
kern.ipc.shm_allow_removed=1
After do
Code:
/etc/rc.d/sysctl restart

---------------------------------------------------------

virtualbox-ose 不能裝


會出現virtualbox-ose-kmod 
要ignore

這是兂位當初灌freebsd沒有安裝src


補裝就好


---------------------------------------------------------

 no sound


http://forums.freebsd.org/showthread.php?t=30502

 The /dev/sndstat shows: 
去找哪個音效介面才是對的  可能預設是錯的

去 /etc/sysctl.conf
hw.snd.default_unit=0
改成正確的ID 我的是1
hw.snd.default_unit=1

之後
/etc/rc.d/sysctl restart

就應該可以


---------------------------------------------------------

chrome flash



Add:

Code:
linux_enable="YES"
to /etc/rc.conf, and reboot.


nspluginwrapper 


nspluginwrapper 必須不是root呼叫




www/linux-f10-flashplugin11 is the latest flash - version 11 not version 10. How about deleting flash-related ports and start again? The following is the step I copied from this forum, and it still works well for me.
Code:
# portsnap fetch update ## OR portsnap fetch extract if you use portsnap for the first time.
# echo 'linux_enable="YES"' >> /etc/rc.conf
# mkdir -p /usr/compat/linux/proc
# echo 'linproc /usr/compat/linux/proc linprocfs rw 0 0' >> /etc/fstab
# mount /usr/compat/linux/proc
# cd /usr/ports/emulators/linux_base-f10 && make install clean
# /etc/rc.d/abi start
# /etc/rc.d/sysctl start
# cd /usr/ports/www/linux-f10-flashplugin11 && make install clean
# cd /usr/ports/www/nspluginwrapper && make install clean
# exit
$ nspluginwrapper -v -a -i 
$ su
# reboot ## it should work without reboot but sometimes it's better to reboot

---------------------------------------------------------

evloution email



---------------------------------------------------------

pidgin



---------------------------------------------------------

virtualbox on freebsd




---------------------------------------------------------

字幕中文化



輸入
mplayer -vf scale -zoom -xy 600 -subcp UCS-2 -sub 字幕檔案 -ass -ass-force-style 自行(/usr/local/share/fonts/TreuType/fireflysing.ttf) 影片






---------------------------------------------------------

中文化


講義的灌好之後

雖然講義都寫zh_TW.Big5

但是ibus只看的到zh_TW.UTF-8

所以要設定UTF-8

所以在進入startx之前
要先在.tcshrc裡面打


#ibus
setenv XIM ibus
setenv GTK_IM_MODULE ibus
setenv QT_IM_MODULE xim
setenv XMODIFIERS @im=ibus
setenv XIM_PROGRAM ibus-daemon
setenv XIM_ARGS "--daemonize --xim"



在.xinitrc


LC_CTYPE=zh_TW.UTF-8
LANG=zh_TW.UTF-8

XIM=ibus
GTK_IM_MODULE=ibus
QT_IM_MODULE=xim
XMODIFIERS='@im=ibus'
XIM_PROGRAM="ibus-daemon"
XIM_ARGS="--daemonize --xim"

/usr/local/bin/startxfce4


在進入startx


可以參考


---------------------------------------------------------

freenx


根本不能用

藥用VNC


---------------------------------------------------------

VNC


設定

但是在xstartup裡面
最後一行改成
startxfce4 &就好  因為不是gmo

最重要的一點
不能再x window底下啟動VNC
必須先在外面的console介面先啟動VNC在打startx啟動xfce4
不然VNC不會讓你同時啟動兩個fce4 session

所以先在外面啟動VNC  在近xwindows


還有 port是590X   X是指VNC打開來的時候他會有告訴你這是第幾個server    如果是:1
代表port是5901
  所以要打開來

VNC viewer必須要打成IP:port
只打IP一輩子連不到


---------------------------------------------------------

roxterm


樣連到Bs2要中文 必須在編碼那邊改成Big5
因為他不會獨UTF-8

---------------------------------------------------------

SSH 要chroot


pw useradd gimpy -d /usr/local/gimpy -s /bin/sh
passwd gimpy # enter password
mkdir /usr/local/gimpy
chown root:gimpy /usr/local/gimpy # root must own the chroot directory
mkdir /usr/local/gimpy/bin
cp /rescue/sh /usr/local/gimpy/bin/
# at the bottom of /etc/ssh/sshd_config:
        Match User gimpy
                ChrootDirectory /usr/local/gimpy(我是用%h  expands to the user's home
 )
                X11Forwarding no
                AllowTcpForwarding no
                ForceCommand       internal-sftp

/etc/rc.d/sshd reload (也可以試試restart)



http://freebsdrocks.net/index.php/guides-mainmenu-25/20-customizing-your-freebsd-box/108-chroot-scp-users-using-ssh

http://therub.org/2011/08/24/minimal-ssh-chroot-in-freebsd/

http://unix.stackexchange.com/questions/53409/how-to-restrict-ssh-users-to-browse-only-home-u-contents   -->best


---------------------------------------------------------

SAMBA


  • 啟動服務:
  • /usr/local/etc/rc.d/samba.sh start
  • 停止服務:
    /usr/local/etc/rc.d/samba.sh stop

test1 test
test2 test
admin     admin     
guest

mount_smbfs -I 192.168.2.100 '//user@user-PC/sa_hw2' /home/ftp/windows/


注意 wind7換帳號 要開cmd把帳號移除
不行的話就把samba stop 之後再連一次看看 

http://www2.lsps.tp.edu.tw/~gsyan/freebsd2001/samba.html



r的權限是可以讀 所以檔案還是打得開  要打不開必須是沒有r讓他打不開

如果smbd打不開 去看log黨  裡面會寫發生什麼錯誤 

如果要guest 在pw useradd的時候不要打密碼
 在pdbedit也不要打密碼

win7要 砍掉登入的帳號
cmd NET USE
.Example Output:
Status                 Local       Remote            Network
--------------------------------------------------------------------------------
OK                                 \\name\IPC$       Microsoft Windows Network
OK                                 \\name2\folder    Microsoft Windows Network
2) Then using the Remote name we can disconnect using on of the following statements, depending on which one we want to disconnect from:
Net use \\name /delete
OR
Net use \\name2\folder /delete




分享window到samba


上一個連結會跟你說資料夾的路徑是啥  
我用這個的#mount_smbfs -I 192.168.1.10 '//username@sharehost/music' /mnt //執行此指令後會請您輸入密碼 (可登入 Windows XP 的帳號及密碼)
之後再打密碼




samba分享的目錄中,隱藏檔案或目錄不讓使用者存取
有兩個參數一個是hide files(只隱藏,但是可存取)
                veto files(隱藏,不可存取)
它可以是全域變數,也可以是區域變數,其設定方式一模一樣
如果是你有分享一個目錄A但是要隱藏其子目錄B
[A]
  comment=......
  veto files=/B/
  
其中一行vote files就是隱藏並拒絕存取
如果是檔案如*.tmp 則使用  veto files=/*.tmp/  --->把tmp擋住
如果是檔案如*.tmp和目錄mydirectory 則使用veto files=/*.tmp/mydirectory/

http://csc.ocean-pioneer.com/docum/samba_tip.html






---------------------------------------------------------

 zfs

 


zfs set mountpoint=/home/ftp tanl/ftp
會把tanl/ftp掛載到/home/ftp  且開機還會再



zfs rollback tank/ftp@today  會把這個資料蓋過去

zfs get all tank/ftp
zfs snapshot tank/ftp@sademo
zfs rollback tank/ftp@sademo







---------------------------------------------------------

 

 transmission-daemon

 


unmask 改成2



transmission-daemon -g /home/BT -w /home/ftp/public --incomplete-dir /home/BT -c /home/fot/puv




---------------------------------------------------------

 FTP


 

目錄的權限 會影響他底下的檔案權限(只會影響一層
所以如果目錄有W的權限 就算你把它底下檔案的W拿掉  他媽的她還是會有W權限
EX: FTP 底下有1 2 3這三個資料夾
FTP(777)  就算你1(111) 2(555) 3(444)
但是1 2 3 還是777


還有注意  如果有更改甚麼pure-pw的東西 都記得到mkdb讓他更新

umask 打 103:002  出來會是 0674:0775  他是XOR...........




http://www.bsdguides.org/2010/virtual-ftp-users-ssl/   <---pure-ftpd .pem="" div="">


---------------------------------------------------------




---------------------------------------------------------

沒有留言:

張貼留言