寻觅生命中的那一片浅草......

文章属于类别 Linux

Update_Broadcom_NIC_driver_on_CentOS

1、build rpm package from source code
cd /dist/dist/
wget http://www.broadcom.com/docs/driver_download/NXII/linux-5.2.55.zip
cd /dist/src
unzip ../dist/linux-5.2.55.zip
cd Server/Linux/Driver/
rpm -Uvh netxtreme2-5.2.55-1.src.rpm

The source will be instlled in /usr/src/redhat/SOURCES
The build rules file will be instlled in /usr/src/redhat/SPECS

cd /usr/src/redhat/SPECS
rpmbuild -bb netxtreme2.spec
the package is stored in /usr/src/redhat/RPMS/x86_64/

2、install rpm package
vi update_net_driver.sh

if rpm -Uvh /usr/src/redhat/RPMS/x86_64/netxtreme2-5.2.55-1.x86_64.rpm
then
rmmod bnx2
modprobe bnx2
fi

save and quit
sh update_net_driver.sh

3、check driver version
ethtool -i eth0
ethtool -i eth1

samba共享设置

首先,将共享方式改为

security = share

1、免密码访问

mkdir /data/test_share
cd /data/
chown -R nobody.nobody test_share
chmod -R 777 test_share
vi /etc/samba/smb.conf
加入以下内容

[File]
comment = File Server
path = /data/test_share
browseable = yes
writable = yes
guest ok = yes
write list = +staff

service smb restart
这样就可以免密码访问了

2、需要密码才能访问的共享

假设用户是share1,密码是i3zH7Xhw

mkdir /data/share1
cd /data/share1
useradd share1
passwd share1
输入密码:i3zH7Xhw
chown -R share1.share1 share1
chmod -R 770 share1
smbpasswd -a ming2
输入密码:i3zH7Xhw

vi /etc/samba/smb.conf
加入以下内容

[share1]

comment = share1

path = /data/share1

writable = yes

valid users = share1

public = no

service smb restart

这样,就需要输入密码才能访问共享

install Kernel-2.6.34 on debian 5.0.4

install Kernel-2.6.34 on debian 5.0.4

1、add packages source
vi /etc/apt/sources.list
add followed content,then save and quit:

deb-src http://debian.lcs.mit.edu/debian lenny main
deb http://debian.lcs.mit.edu/debian sid main
deb http://mirrors.163.com/debian stable contrib main non-free
deb-src http://mirrors.163.com/debian stable contrib main non-free
deb http://mirrors.163.com/debian sid contrib main non-free
deb-src http://mirrors.163.com/debian sid contrib main non-free
deb http://mirror.dlut.edu.cn/debian/ lenny main non-free contrib
deb-src http://mirror.dlut.edu.cn/debian/ lenny main non-free contrib
deb http://debian.ustc.edu.cn/debian/ lenny main non-free contrib
deb-src http://debian.ustc.edu.cn/debian/ lenny main non-free contrib
deb http://ftp.tw.debian.org/debian lenny main
deb-src http://ftp.tw.debian.org/debian lenny main

2、update package list and install tools
sudo apt-get update
sudo apt-get install kernel-package libncurses5-dev fakeroot
sudo apt-get install build-essential udev
sudo apt-get install libhtml-template-perl libparse-recdescent-perl
sudo apt-get install yaird

3、download the kernel source and install it.
cd /usr/src/
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.tar.bz2
tar xf linux-2.6.34.tar.bz2
cd linux-2.6.34
sudo make mrproper
sudo make menuconfig
sudo make clean
sudo make bzImage modules
sudo make install modules_install
sudo cd /boot
sudo mkinitrd.yaird -o initrd.img-2.6.34 2.6.34
sudo update-grub
sudo reboot

References
http://www.bearhou.com/?p=184
http://hi.baidu.com/higkoo/blog/item/6188b42a9ec13796023bf6cc.html

VboxHeadless & How To Swing It

About a week ago I posted a guide on how to install VirtualBox 3.0.2. While it is a great desktop virtualization solution there are a few things that leave you wanting more when it comes to a headless server. VMWare in this area still has much better solutions for managing several servers. But for small operations VirtualBox does have some options for managing your headless vm’s. This guide assumes that you already have VirtualBox 3 installed. If not I suggest you go take a look at my guide on how to perform the installation before you continue here.

Most tutorials you find out there will always suggest running thing through the sudo command as a regular user. However for this particular guide does not. The commands run here depend on the user running them. So in essence, if you follow this guide as it is written all VirtualBox settings are written to the ~/.VirtualBox/ directory. But, if you run these as root. All the configuration information would be stored in the /root/.VirtualBox/ directory.

So what we will need to continue are the following,

Remote connection to our host server (ssh is ideal)
rdesktop(linux) or Remote Desktop Connection(windows) installed to remotely connect to our headless vm’s from a remote computer
A .iso installation medium or an existing .vdi image to import.
First I’ll cover how to create a new virtual machine, afterwards I’ll go over how to import an existing virtual machine to your headless server.

Login to your Linux headless server and create a new vm. I’ve chosen to install a gentoo vm as it was the first .iso file I found on my computer.
$ VBoxManage createvm –name “Gentoo” –register
Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Virtual machine ‘Gentoo’ is created and registered.
UUID: faa5fe89-f75a-4bc9-93b2-063630353e25
Settings file: ‘/scott/.VirtualBox/Machines/Gentoo/Gentoo.xml’
Next we must set our system settings for the virtual machines use. Here I will configure it with 512 megs of memory, enable ACPI, set the first boot device to a DVD, and configure the network adapter to use NAT instead of Bridged networking.

$ VBoxManage modifyvm “Gentoo” –memory “512” –acpi on –boot1 dvd –nic1 nat
Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
After defining the system settings, we must create the virtual hard disk. I will be making mine a 10gigabyte virtual disk.$ sudo VBoxManage createhd –filename “Gentoo.vdi” –size 10000 –remember
Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Disk image created. UUID: ce4226ed-fc66-4749-ac8e-b08975a66ce8
Attach our newly created virtual hard disk to our newly created virtual machine as the first hard drive.

$ VBoxManage modifyvm “Gentoo” –hda “Gentoo.vdi”

Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Register our installation .iso file to our virtual machine so that it may boot from it to begin the installation. Be sure to replace the path with your relevant path.

$ VBoxManage modifyvm “Gentoo” –dvd /path/to/your/install.iso

Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
We should now be ready to start our vm. This will run the vm in the terminal as a background process.

$ VBoxHeadless –startvm “Gentoo” &

Assuming everything went smoothly you can now connect to your headless vm with a RDP viewer. Be sure to replace the “YOURSERVERIP” with your host server’s IP address.$ rdesktop -a 16 YOURSERVERIP
To stop your vm from command line.

$ VBoxManage controlvm “Gentoo” savestate

Most desktop computers should already have this. Ubuntu users can use the above command to run rdesktop. If you are in Gnome, it is also located under Applications > Internet > Remote Desktop Viewer. Windows user’s can use the Remote Desktop Connection utility found under Start > Programs > Accessories > Remote Desktop Connection.
So as a closing note, I would highly recommend heading over to http://www.virtualbox.org/manual/UserManual.html#id2515738 . Sun’s documentation on VirtualBox is very well written. There are tons of other things you can do from the command line to manage your vm’s.

install vim7.2 on debian

wget ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2

sudo apt-get install libncurses5-dev

tar xf vim-7.2.tar.bz2

cd vim72

sudo ./configure –with-features=huge –enable-cscope –enable-multibyte

sudo make

sudo make install

enable syntax :

/bin/cp runtime/gvimrc_example.vim ~/.vimrc

2025年九月
« 5月    
1234567
891011121314
15161718192021
22232425262728
2930