Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Javaͨ¹ýSamba·þÎñ²Ù×÷Linux¹²ÏíÎļþ


Ê×ÏÈÔÚLinuxÉÏ´´½¨Ò»¸ö¹²ÏíÎļþ¼Ð
mkdir /home/user/share
ÓÃrootÓû§Æô¶¯samba·þÎñ
service smb start
ÐÞ¸Äsmb.confÎļþ
sudo gedit /etc/samba/smb.conf »òÕß vi /etc/samba/smb.conf
[share]
path = /home/user/share
...
writable = yes
´´½¨¹²ÏíÓû§²¢ÉèÖÃÃÜÂë
sudo useradd smbusr
sudo smbpasswd -a smbusr
ʹÓÃÃüÁî sudo smbpasswd -x ɾ³ýÓû§
ÖØÆôsamba·þÎñ
service smb restart
²âÊÔ
ÔÚwindowsÖÐÊäÈë\\192.168.0.94£¬²¢ÊäÈëÓû§ÃûÃÜÂësmbusr/***,¿´Äܲ»ÄÜ·ÃÎʵ½¹²ÏíÎļþ¼Ð¡£Èç¹û¿ÉÒԵĻ°¿½±´Ò»·Ý±¾µØtxtÎļþµ½´ËĿ¼£¬²¢ÔÚlinuxÖв鿴´ËÎļþÊÇ·ñ´æÔÚ£¬Èç¹ûÓÃviÄܹ»´ò¿ªÎļþÎļþ²¢Õý³£²é¿´ÆäÄÚÈÝ£¬congruatulations!
ÓÃjcifs²âÊÔÎļþ²Ù×÷
È¥ÏÂ
ÔØÊʵ±°æ±¾µÄjcifs£¬½«jcifs-1.3.14.jar¼ÓÈëµ½ÏîÄ¿¹¤³ÌÖС£Ð´¸ö²âÊÔÀ๲ÏíÎļþ²Ù×÷£º
public static void main(String[] args) {

FileInputStream fis = null;
SmbFileOutputStream sfos = null;
try {
fis = new FileInputStream(new File("c:/source.txt"));
sfos = new SmbFileOutputStream(new SmbFile("smb://smbusr:smbusr@192.168.1.94/smbusr/dest.txt"));

byte [] buffer = new byte[1024];
int c = 0;
while ((c = fis.read(buffer)) != -1) {
sfos.write(buffer);
}
} catch (SmbException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

finally {
try {
fis.close();
sfos.close();

} catch (IOException e) {
e.printStackTrace();
}
}
}


Ïà¹ØÎĵµ£º

LinuxÄÚºËÅäÖÃÎĵµ(make menuconfig)

Ò»¡¢ÒýÑÔ£º
    ±¾ÎĵµµÄÄÚÈݴ󲿷ÝÄÚÈݶ¼ÊÇ´ÓÍøÉÏÊÕ¼¯¶øÀ´£¬È»ºóÅäºÏһЩеĽØͼ£¨Äں˰汾£ºV2.4.19£©¡£ÔÚÿһÅäÖÃÏîºó»áÓÐÒ»¸öÑ¡ÔñÖ¸ÄϵIJ¿·Ý£¬ÓÃÀ´Ö¸µ¼´ó¼ÒÔõôÑù¸ù¾Ý×Ô¼ºµÄÇé¿öÀ´×öÏàÓ¦µÄÑ¡Ôñ£»»¹ÓÐÔÚÿһ¸ö´óÏîºÍÎĵµµÄ×îºó»áÓÐÒ»¸ö¾­Ñé̸£¬ËüÊÇһЩ¸ßÊÖÃÇÔÚÓ¦¶ÔÎÊÌâºÍ´¦ÀíÌØÓÐÓ²¼þʱµÄһЩ¾­Ñ飨Õâ¸ö»¹µ ......

¡¾JAVAѧϰ±Ê¼Ç¡¿02 ÔËËã·û¡¢±í´ïʽ

Ò»¡¢ÔËËã·û
 
ËãÊõÔËËã·û£º+£¬-£¬*£¬/£¬%£¬++£¬--
¹ØϵÔËËã·û£º>£¬<£¬>=£¬<=£¬==£¬!=
²¼¶ûÂß¼­ÔËËã·û£º!£¬&£¬^£¬|£¬&&£¬||
λÔËËã·û£º&£¬|£¬^£¬>>£¬<<£¬>>>
¸³ÖµÔËËã·û£º=
À©Õ¹¸³ÖµÔËËã·û£º+=£¬-=£¬*=£¬/=
×Ö·û´®Á´½ÓÔËËã·û£º+
 
Á½ÊýÏà³ý£¬ÄÇôÈç¹û ......

Linux¹¥·ÀÖ®udev©¶´ÑÝʾ

´Ë©¶´Õë¶Ôlinux2.6Äںˣ¬Ö»ÒªÓÐÆÕͨÓû§È¨ÏÞ£¬¼´¿ÉÌáÉýrootȨÏÞ£¬¿ªÊ¼ÊµÑé°É 1¡¢¸´ÖÆÒÔÏ´úÂ룬±£´æΪudev.sh£¬²¢¸³Óè¿ÉÖ´ÐÐȨÏÞ 2¡¢#useradd test //н¨Ò»¸öÆÕͨÓû§ 3¡¢#su - test //Çл»ÖÁtestÓû§ 4¡¢#ps -ef |grep udev //²é¿´udev id root 474 1 0 Apr09 ? 00:00:00 /sbin/udevd -d 5¡¢#sh udev.sh 473 //Ö´Ð ......

LINUXϲ鿴Ӳ¼þÐÅÏ¢

¼¸¸öcpu
more /proc/cpuinfo |grep "physical id"|uniq|wc -l
ÿ¸öcpuÊǼ¸ºË£¨¼ÙÉècpuÅäÖÃÏàͬ£©
more /proc/cpuinfo |grep "physical id"|grep "0"|wc -l
cpuʹÓÃÂÊ
vmstat  
ÍƼöС¹¤¾ßnmon£¨aixºÍlinux¶¼ÓУ©
topºó°´Êý×Ö1,¶à¸öcpuµÄ»°»áÏÔʾ¶à¸ö
fdisk -l¿ÉÒÔ¿´µ½¶à¸öÎïÀíÓ²ÅÌ£¬×öÁËÓ²raidÖ»ÄÜ¿´µ½Ò»¸öӲŠ......

linux¿ÚÁîÏà¹Ø£¨passwd/shadow£©

      ÔÚlinuxÖУ¬¿ÚÁîÎļþÔÚ/etc/passwdÖУ¬ÔçÆÚµÄÕâ¸öÎļþÖ±½Ó´æ·Å¼ÓÃܺóµÄÃÜÂ룬ǰÁ½Î»ÊÇ"ÑÎ"Öµ£¬ÊÇÒ»¸öËæ»úÊý£¬ºóÃæ¸úµÄÊǼÓÃܵÄÃÜÂ롣ΪÁË°²È«£¬ÏÖÔÚµÄlinux¶¼ÌṩÁË /etc/shadowÕâ¸öÓ°×ÓÎļþ£¬ÃÜÂë·ÅÔÚÕâ¸öÎļþÀïÃ棬²¢ÇÒÊÇÖ»ÓÐroot¿É¶ÁµÄ¡£
ÏÂÃæÀ´·ÖÎöÒ»ÏÂ/etc/passwdÎļþ£¬ËûµÄÿ¸öÌõÄ¿Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ