Search This Blog

Tuesday, December 16, 2008

Linux - how to determine file type (32 bit or 64 bit)

as a developer sometimes you need to know to the file type of a shared object (32 bit or 64 bit) , link to a wrong file type can cause you problem during linkage.
so the command is:
file [name file ]
the output will be the file type (32/64).
for more information
man file

Set Linux/Unix prompt and getting previous command

in case you don't like your Linux prompt , you can change that in very easy way .
you just need to export & declare the PS1 environment parameter.
e.g.
export PS1='$USER@$HOSTNAME $PWD >'
will give you prompt like this:
root@myLinux /usr/src >
you can change your prompt to be as you want .

sometime the current shell could not show you the previous command when you press the up arrow key, to make it work ,in the shell prompt type:
set -o emacs

Wednesday, December 10, 2008

LDAP error code

i used LDAP authentication via java , in case of wrong user name or password you get an exception of type AuthenticationException, as you guess in ldap Authentication there could be more than one reason ( not just wrong pwd or user) it could be account is locked , not allowed this time, etc.
i found a list that can help to understand the reason in case you need it:

525 - user not found
52e - invalid credentials
530 - not permitted to logon at this time
531 - not permitted to logon from this workstation
532 - password expired
533 - account disabled
701 - account expired
773 - user must reset password
775 - account locked

more details for the code above you can find here Active Directory LDAP Errors.