Category Archives: Operating Systems

Linux : Install Webmin from YUM repository

Webmin and Usermin can be installed and updated directly through YUM. To achieve this, we need to setup manually the repository.

First, create the .repo file for YUM :

vi /etc/yum.repos.d/webmin.repo

Copy, paste and save the following :

[Webmin]
name=Webmin Distribution Neutral#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

Save the PGP key :

wget http://www.webmin.com/jcameron-key.asc

Import the key :

rpm –import jcameron-key.asc

You are now all set to install the software :

yum install webmin

yum install usermin

(Packages will be automatically updated each time you run a “yum update”)

Windows : Microsoft.ACE.OLEDB provider is not registered on the local machine

Trying to import Excel datasheet into MSSQL database using .NET application and get this error?

The ‘Microsoft.ACE.OLEDB.12.0′ provider is not registered on the local machine

This indicate you are required to install the two following component on the server : Access Database Engine as well as Excel.

http://www.microsoft.com/download/en/details.aspx?id=13255

Windows : Asp.NET test page

Just like php, you can create a test page in order to verify if .NET is installed and working properly. The following will also display the running version.

Simply create plain text file using Notepad or your favorite text editor :

test.aspx

And insert this code :

<%@ Page Language=”VB” %>

<script runat=”server”>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
lblVersion.Text = “Your server is running ASP.NET and the version is ” & System.Environment.Version.ToString()
End Sub
</script>

<html>
<head>
<title>ASP.NET Version</title>
</head>
<body>
<form id=”form1″ runat=”server”>
<asp:Label ID=”lblVersion” runat=”server”></asp:Label>
</form>
</body>
</html>

Linux : Increase maximum open file descriptors

On most heavy usage servers, you probably need to override the maximum open file descriptors in order to handle the load! Do not play with this setting blindly, make sure you know what you’re doing! In most case, you will be warned in log wit message like this : Too many open files

You may have a look at the current value using the following command :

cat /proc/sys/fs/file-max

To increase it right away without reboot the server simply type (replace the value according your needs) :

sysctl -w fs.file-max=100000

Okay, now you need to add it to sysctl in order to make your new setting permanent (the above command will actually not make the setting survive to reboot) :

vi /etc/sysctl.conf

And add :

fs.file-max = 100000

 

The above was to set the maximum file descriptor system wide. Setting it for specific user is not much difficult.

Edit :

/etc/security/limits.conf

And add :

user soft nofile 8192
user hard nofile 16384

(Replace “user” with the designated username and the number according your needs.)

Windows : How To clear Offline Files server list

You may get into trouble if you didn’t remove folder synchronization on network server before deleting a user account or unlink a computer from domain… File synchronization still effective even if the user is no longer on the computer or Active Directory.

The only way to get rid of old entries, is to do it manually through the registry.

First, open up the registry editor (Start > Run) :

regedit

Go to :

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\NetCache\

Then, add a DWORD key named :

FormatDatabase

Reboot the computer and your done.

Linux : mptbase ioc0 WARNING IOC is in FAULT state

Inside system logs (/var/log/messages), you may see some message like this on a system running a RAID controller (this one is from a PERC 5/i on a Dell PowerEdge server) :

mptbase: ioc0: WARNING – IOC is in FAULT state (1600h)!!!
mptbase: ioc0: WARNING – Issuing HardReset from mpt_fault_reset_work!!
mptbase: ioc0: Initiating recovery
mptbase: ioc0: WARNING – IOC is in FAULT state!!!
mptbase: ioc0: WARNING – FAULT code = 1600h
mptbase: ioc0: Recovered from IOC FAULT
mptbase: ioc0: WARNING – mpt_fault_reset_work: HardReset: success

This indicate either a drive is failing or a driver bug. May not be critical at all, but should be taken seriously! Some time the system may hang after displaying this.

If you see a failed message about the recovery/hard reset or a device offlined soon after this message, it’s definitely a failed hard disk. In any situation, have a look at the storage device manager for more information (in this case, since this is a Dell server, we may have a look at OpenManage).

Linux : Hardware Lister

Need to show full hardware contained inside a Linux machine (board, cpu, memory, pci slots, etc.) such as you do on Windows with AIDA, Sandra, etc?

Hardware Lister (lshw) is the answer.

http://ezix.org/project/wiki/HardwareLiSter [official site : external link]

You can shot the full output using the command

lshw

Or redirect the listing in a plain text file if too many information displayed using this command :

lshw > HardwareReport.txt

You may also generate a HTML report :

lshw -html > HardwareReport.html

Active Directory : Change the default display name format for user and contact objects

Here is how to change the default display name format for user and contact objects in Active Directory. By default, it display “Last name and First name”. We want to revert this to “First name, Last name”.

Before doing this step, make sure your user is a member of either “Enterprise Admins” or “Domain Admins” group!

First, open up ADSI Edit console (Start > Run) :

adsiedit.msc

Then, connect to your Domain Controller using the “Configuration mode”.

Expand the following container :

cn=DisplaySpecifiers

Double-click on :

CN=409.NOTE

(This is the code for en-US language. You must change the value matching your language)

Then, right-click and click on Properties on the contextual menu of the following object :

createDialog

Set value to :

%<sn>. %<givenName>

 

Windows : Setting LAN Authentication Level on 7 Home Premium

Windows 7 Home Premium doesn’t have the “Local Security Policy” console (aka : secpol.mmc). In order to access SMB share running the old protocol version, you need to enable the Authentication LAN Manager directly inside the registry.

Open the registry editor (Start > Run) :

regedit

Browse to :

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

Create a new DWORD value  with the following properties :

LmCompatibilityLevel = 1

Linux : Partition and format external hard drive as ext3 filesystem

This tutorial is about partitioning a USB external hard drive as good for internal drive.

First, list devices on your system using one of the following commands :

dmesg

(USB drive should appear as SCSI drive)

fdisk -l | grep ‘^Disk’

Now, assuming your new drive is “sdb”, use the following command to invoke the fdisk partition utility :

fdisk /dev/sdb

To create a new partition (assuming this is a new unused drive), just type “n“. Then, save your work typing “w” and “q” to exit the utility.

Any doubt or need help about fdisk utility, just type “m“.

Let’s format the partition as traditional EXT3 Linux file system :

mkfs.ext3 /dev/sdb1

Okay, the hard disk partitioning and formatting is done now.

Create a directory where you want to have your drive mounted (replace all “external_hd” value with the name you want to use ) :

mkdir /mnt/external_hd

Mount the drive :

mount /dev/sdb1 /mnt/external_hd

You’re now ready to use it! However, this mount will not survive to a reboot. To make it permanent, you need to edit fstab :

vi /etc/fstab

And add the following line :

/dev/sdb1               /mnt/external_hd           ext3    defaults        1 2

NOTE : If you manually mount the drive instead doing the fstab way, do not forget to manually unmount it before unplug it! Serious data loss problem may occur if you skip this step!

umount /dev/sdb1