Saturday, January 31, 2009

Print out kernel message or control ring buffer

Print out kernel message or control ring buffer
dmesg [ -c ] [ -n level ] [ -s bufsize ]

Options

-c
Clear the ring buffer contents after printing.
-sbufsize
Use a buffer of size bufsize to query the kernel ring buffer. This is 16392 by default. (The default kernel syslog buffer size was 4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.) If you have set the kernel buffer to be larger than the default then this option can be used to view the entire buffer.
-nlevel
Set the level at which logging of messages is done to the console. For example, -n 1 prevents all messages, expect panic messages, from appearing on the console. All levels of messages are still written to /proc/kmsg, so syslogd(8) can still be used to control exactly where kernel messages appear. When the -n option is used, dmesg will not print or clear the kernel ring buffer.

When both options are used, only the last option on the command line will have an effect.

Friday, January 30, 2009

Solution for Windows Server 2008 Network Problem

This is to resolve the network issue for Windows Server 2008 cannot be up after reboot:

1.       Check the network adapter device ID using powershell (http://blogs.msdn.com/daiken/archive/2007/02/09/enable-disable-network-connection.aspx) :

a.        Open powershell



b.       key in the following command to find out which network adapter:

Get-wmiobject win32_NetworkAdapter | format-table



You will see the device ID and key in the following command to the detail of the network adapter and open the network properties to reconfirm:

                   Get-WmiObject win32_networkadapter | where {$_.DeviceId -eq 5}


2.       Create a script, in folder C:\Windows\restart_lan.ps1

a.        Content for restart_lan.ps1 (make sure you have the correct "deviceid")
$lannetwork = Get-WmiObject win32_networkadapter | where {$_.DeviceId -eq 5}

$lannetwork.Disable()

$lannetwork.Enable()

3.       Create a bat file to run the powershell script in folder C:\Windows\restart_lan.bat

a.        Content for restart_lan.bat
powershell c:\windows\restart_lan.ps1

4.       Add the script to windows startup (http://www.tutorial5.com/content/view/157/47/ )

a.        Click Start - Run and type mmc

b.       On the Management console that starts, click File -> Add/Remove Snap-in.

c.        On the window that opens, search for Group Policy Object editor on the left panel, click Add and in the properties window that pops out leave the settings that are selected (Local computer) and click ok.

d.       Navigate through the left panel by opening each branch like this: Console Root -> Computer configuration -> Windows Settings -> Scripts (Startup/shutdown)

e.       Open the properties window for Startup or Shutdown as you desire from the right panel; on the window that pops out add, edit or remove scripts that you want.

Wednesday, January 28, 2009

How to install Cpanel & WHM in Fedora

yum -y install tcp_wrappers-devel perl tar



mkdir /home/cpins



cd /home/cpins



wget http://layer1.cpanel.net/latest



sh latest &

& wait... until the cpanel said "done"

How to install Cpanel & WHM

Get the power of root.

1. cd /home
2. wget http://layer1.cpanel.net/latest
3. sh latest