Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, January 9, 2012

Linux freeze at reboot

Problem:  My Linux environment (Oracle Linux 5 update 7 on Dell T1600) goes through the entire shutdown sequence normally, then hangs on a blank screen at the point when it would normally reboot the computer. It has to be manually power down and restart

Solution: Add "reboot=b" to kernel parameter (for Grub, it is inside /boot/grub/grub.conf)

For 64-bit OS, you may need "reboot=p,e,f"

Here is a excellent link about this topic

http://linux.koolsolutions.com/2009/08/04/howto-fix-linux-hangfreeze-during-reboots-and-restarts/

Update (July 3, 2012) : The following also fix the problem:

"VT for Direct I/O" from the bios



Sunday, January 8, 2012

Install VMware Tools or Virtual Guest Addition for Oracle Linux

Problem: Get your Oracle Linux ready to install  VMware Tools or Virtual Guest Addition.

Solution: Oracle Linux by default uses Oracle's own unbreakable kernel, so if you install VMware Tools or Virtual Guest Addition, you need to get the correct header files to do the compilation. Here is the "yum" command to get all you need:


yum -y install kernel-uek-headers-`uname -r` gcc kernel-uek-devel


Wednesday, May 7, 2008

eth0: unknown interface: No such device

0) Check if you see any eth* entry in one of the following files:

/etc/modprobe.conf (kernel 2.6)

/etc/modules.conf (kernel 2.4)

(or for older systems: /etc/conf.modules)


In my working case, there is

alias eth0 tg3

However, none was found in my problem Linux, if this is your case, the following steps might work for you. The network module for your network card is not loaded and the following are steps are how to add it back:

1) Find out which module does you NIC need

For me, it is a Broadcom NetXtreme and it works with tg3 module and it already exists in my system under:

/lib/modules//kernel/drivers/net/

2) Add the module

/sbin/modprobe tg3

3) Check the tg3 actually get loaded

/sbin/lsmod |grep tg3

4) ifconfig to see if it is working

5) The module will not be loaded in next reboot. To permanently add this module update the /etc/modprobe.conf with line like for each NIC:

alias eth0 tg3
alias eth1 tg3

Wednesday, March 5, 2008

Get rid of gcj

I always prefer Sun's Java over gcj, but with Linux you always default get the gcj. I found the following tip very useful here

Tuesday, February 19, 2008

CentOS - yum update failed - Retrieving GPG key ...

While using yum to update CentOS

Get the "Retrieving GPG key .." error, files get downloaded but fail to update

I solved the problem by get the RPM-GPG-KEY from the first CD of the installation media. In my case, it is "RPM-GPG-KEY-CentOS-5"

Need to import this key to RPM's DB, run the following command as root
rpm --import RPM-GPG-KEY-CentOS-5

Sunday, December 9, 2007

Apache HTTPD 2.2 with LDAP authentication

Recently I need to setup LDAP authentication on Apache Httpd. I tried the usual wayto find out how – googleing. I found that a lot of good posts do not work any more as 2.2 had gone through a major refactoring on the Authn and Authz module.

Here are some highlights ( for full version changes made in 2.2 see new features):

  • mod_access has been renamed mod_authz_host.
  • mod_auth is now split into mod_auth_basic and mod_authn_file
  • mod_auth_dbm is now called mod_authn_dbm

For LDAP related, I found Christophe Gravier’s post in users@httpd very useful. I put it here:

If you're using apache >= 2.2 and you want to:

1/ allow "any" authenticated user to enter (whatever his group membership is (i.e. no authorization control), you must "bypass" the authz_ldap authorization module by setting "AuthzLDAPAuthoritative" to off (else apache searches for require ldap-user or ldap-group directives)

AuthType basic
AuthName "Authentication domain"
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL "ldap:///ou=Development,ou=Corporate
Users,dc=financialcad,dc=com?sAMAccountName?sub?(objectclass=*)"
AuthLDAPBindDN "cn=,ou=Development,ou=Corporate
Users,dc=financialcad,dc=com"
AuthLDAPBindPassword ""
SSLRequireSSL
require valid-user


2/ allow a limited list of known users of the directory (need require ldap-user directive and not require ldap-user)

AuthType basic
AuthName "Authentication domain"
AuthBasicProvider ldap
AuthzLDAPAuthoritative *on*
AuthLDAPURL "ldap:///ou=Development,ou=Corporate
Users,dc=financialcad,dc=com?sAMAccountName?sub?(objectclass=*)"
AuthLDAPBindDN "cn=,ou=Development,ou=Corporate
Users,dc=financialcad,dc=com"
AuthLDAPBindPassword ""
SSLRequireSSL
require *ldap-user* myuser_uid


3/ allow a group of user (authorization based on group membership).


AuthType basic
AuthName "Authentication domain"
AuthBasicProvider ldap
AuthzLDAPAuthoritative *on*
AuthLDAPURL "ldap:///ou=Development,ou=Corporate
Users,dc=financialcad,dc=com?sAMAccountName?sub?(objectclass=*)"
AuthLDAPBindDN "cn=,ou=Development,ou=Corporate
Users,dc=financialcad,dc=com"
AuthLDAPBindPassword ""
SSLRequireSSL
require *ldap-group* my_group_full_dn

Friday, December 7, 2007

Linux - Better "ls" coloring scheme against dark background

After fixing the the vi(vim) problem, now we are going to fix a similar problem for "ls". Again, if your terminal has dark background, the result of ls is hard to read. I used to disable the ls coloring altogether by

>unalias ls

Since most Linux, alias the ls command as 'ls --color=tty'

It is some over kill, I found a better solution here

You can just simply unset the LS_COLORS as:
>export LS_COLORS=""

ls now use a better color scheme to display the result

Wednesday, December 5, 2007

yum through proxy

1) You can set the environment variable, http_proxy and ftp_proxy, each time before you start yum as

export http_proxy="http://ip:port"
export ftp_proxy="http://ip:port"

For corporate environment, you likely need the uesrname and password as well as:
export http_proxy="http://username:password@ip:port"
export ftp_proxy="http://username:password@ip:port"

or

2) Update the /etc/yum.conf add the following line under
proxy=http://ip:port/

Make sure you include the last slat(/)

It saves you from setting the environment variable every time, but having you plain password store in a file may not be a good idea


To get a GUI front end for yum get the yumex
>yum install yumex

vim with dark backgound

If your terminal has dark background, such as black, it is hard to read highlighted search result (white text with yellow background). Here is the fix

Under ~/.vimrc (create it if it does not exist) add the following line
set background=dark