Tuesday, May 6, 2014

ConsoleOne java.lang.UnsatisfiedLinkError: no gwadj2 in java.library.path

Face lots of sweat, google 'ing and reading about installation of ConsoleOne 1.3.6h with Groupwise 2012 snapin. Too many tricks and it is not as direct as ABC. 
Required lots of twist and turn and finally success installed the snapin...

But... something not correct.. no pop up windows when select domain or creating new system.

Then do some troubleshooting and found out there is java error.

Exception in thread "AWT-EventQueue-O" java.lang.UnsatisfiedLinkError: no gwadj2 in java.library.path







Solution for the error... 

1. Edit ConsoleOne file under the bin
vi /usr/ConsoleOne/bin/ConsoleOne

2. Adding the path "/usr/ConsoleOne/bin" to LD_LIBRARY_PATH

LD_LIBRARY_PATH=”/usr/ConsoleOne/usr/lib:/usr/lib:/opt/novell/lib:/usr/ConsoleOne/bin:/opt/novell/eDirectory/lib:$LD_LIBRARY_PATH”

3. Save and exit

4. Relaunch ConsoleOne
/usr/ConsoleOne/bin/ConsoleOne

Everything works fine now...


ps: Credit to Novell Support Page

Thursday, December 29, 2011

Transfer file via tftp for Cisco, Netscaler and Linux box

Once the TFTP server installed. We have to start do some test to perform the backup..
Here I do face some error or failure when transfering..
Do some twit and tune around and here the some way to do it..
Do advise most of the information do plug from some other blog..
Appreciate for their solution and option..


Now... let's get back to business..
Do notes, my tftp server IP is 192.168.1.250
1. Backup for Cisco devices...

Cisco#write net
This command has been replaced by the command:
'copy system:/running-config '
Address or name of remote host []? 192.168.1.250
Destination filename [ cisco-config ]? cisco-config
Write file tftp://192.168.1.250/cisco-config? [confirm]y!! [OK]
Cisco#


2. Backup for Netscaler devices..
For the netscaler devices, if do not have any function for tftp, then required to login to shell mode of the devices. From there, we required to write 2 script for the backup.

i. Create a folder to store backup script.
mkdir /var/backup

ii. create Script backup.sh - backup all the configuration, license and ssl certificate


#!/bin/sh

cd /nsconfig
tar -zcf /tmp/ns-backup.tar ns.conf license/ ssl/
cd /tmp
tftp < /var/backup/tftp.cmd
rm ns-backup.tar


iii. Create Script tftp.cmd - for run the tftp command


connect 192.168.1.250
binary
put ns-backup.tar
quit

iv. If intent to perform the backup daily, can consider to add a crontab for the script run base on your preference time.


3. Backup for Linux Box..
For this option, I do face some error such as Transfer timed out or nothing transfer. Therefore if face some of the issue, might try to perform some tuning on the client machine.

i. At the client machine add the ip_conntrack_tftp
modprobe ip_conntrack_tftp

ii. Then run tftp to put the file into the server.
root@ client[~]# tftp 192.168.1.250
tftp> put my.cnf
tftp> quit

If intent to do some auto backup, do advise use the same solution as suggest on Netscaler Backup solution.



Install TFTP Server on CentOS

Recently did some new installation on CentOS 5.6 machine with TFTP server..
For more information regarding TFTP, kindly refer to the following link..

My main reason to build a tftp server due to perform some backup server for my Cisco and Netscaler devices..
Been google all day long and at last found few nice written and well explain site that able complete my task..

Here are the steps... *sorry if my English is written in bad way..@@

1. do install tftp server, it will run together with xinetd services.
yum install tftp-server

2. move the tftpboot directory for your own easy maintain purpose. I used to located all my datafile at /var/lib. So will run the command as..
mv /tftpboot/ /var/lib/

3. Change the ownership and folder permission for tftpboot. It will run as nobody user with permission 777..
chown -R nobody:nobody /var/lib/tftpboot/
chmod 777 /var/lib/tftpboot/

4. Edit the tftp file at /etc/xinetd.d/tftp
vi /etc/xinetd.d/tftp

Then add and edit the file to have same line..
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -c -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

For the server_args, change the path to your tftpboot location. Add -c to able creating new file if/no file exist on the tftp server.

5. Start the xinetd service
service xinetd start

6. Able to see the port 69 exist when running
netstat -ntulp

7. Add iptables policy to allow port 69 udp.
-A RH-Firewall-1-INPUT -s (TFTP Subnet) -m udp -p udp --dport 69 -j ACCEPT

That all.. Can try do some file transfer from the client to server..

Will continue in next post.. how the transfer can be done from Cisco, Netscaler and Linux machine to the TFTP Server.


Friday, September 9, 2011

Change UserID (uid) and GroupID (gid) in Linux

In case, required to change certain user uid and gid in Linux. We can editing the /etc/passwd will be sufficient. But going to face some serious issue on the file permission which been associate with the user.

For example, changing the uid and gid for mysql user daemon. May face MySQL directory not working or cant start the mysql services. Same applied to apache or whatever services daemon.

So, here the step can use to solve all the headache.
Existing zabbix user uid and gid from /etc/passwd
zabbix:x:1008:1008::/home/zabbix:/bin/bash

New uid and gid for zabbix is 300:300

1. Change the uid and gid:
groupmod -g 300 zabbix
usermod -u 300 -g 300 zabbix

2. Find all directory and change to new uid and gid:
find / -user 1008 -print0 | xargs -0 chown -h 300
find / -group 1008 -print0 | xargs -0 chgrp -h 300

That all.. job done.



Tuesday, June 1, 2010

Configure Cisco Router

Last time in the first post, Lock had explained configuration for cisco router setting.

Now I do a simple post with step only..
Mostly the ISP will assign some information such as:

Serial IP : 123.123.123.121
Serial Netmask : 255.255.255.252
LAN IP : 58.123.111.97 until 58.123.111.126
LAN Netmask : 255.255.255.224
Default gateway (IP Route) : 202.188.129.113

Then the setup will be:

en
conf t
hostname routername
username routeruser password 0 routerpassword
line vty 0 4
login local
int fast 0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
no shutdown
exit
int se 0/1/0
ip address 123.123.123.121 255.255.255.252
ip nat outside
no shutdown
exit
ip route 0.0.0.0 0.0.0.0 123.123.123.122
ip nat pool public 58.123.111.97 58.123.111.97 prefix-length 27
ip nat inside source list private pool public overload
ip access-list standard private
permit 192.168.1.0 0.0.0.255
exit
exit
copy run start

Monday, May 31, 2010

Reset cisco router to factory default

Sometimes.. you may forget the password for cisco router..
or prefer set back to factory default setting..

Then can use this way to reset back..

1. Connect to the cisco router using hyper terminal..
2. Restart the router..
3. Once see booting, press
Ctrl + break
4. you will access to RONMON
5. In ronmon, type
ronmon 1> confreg 0x2142
6. Hit enter and
ronmon 2> reset
7. Wait the router boot, then press "n" and enter, when asked to enter dialogue wizard.
8. Then start tpe the following command
enable
conf t
config-register 0x2102
exit
write erase
press enter
reload

9. That all, you will see the router in factory default setting

Tested on Router 1841.

Monday, May 24, 2010

rc.local in Suse

Suse do not have any rc.local script..
Which this script useful is..
In RedHat, after the init start, it will invoke the command in rc.local..
It is very useful which almost same function with startup in windows..

I had do some google.. and turn out..
This link is a lot helpful..
HERE

1. create a new file named rclocal at /etc/init.d/
vi /etc/init.d/rclocal

2. Then add the the following in the beginning script..
#!/bin/sh
### BEGIN INIT INFO
# Provides: rclocal
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: whatever
### END INIT INFO

3. Change mode for the file
chmod 755 /etc/init.d/rclocal

4. add service
chkconfig --add rclocal

Thank all..
Then add the service you need start at the end of the file.

Below is the sample rclocal file I created..



There is some reason the file I created is rclocal instead of rc.local..
In the man innserv, it does not allow files with .local in used..
The error will appear
insserv: script name rc.local is not valid, skipped!

Friday, May 14, 2010

Installation PHP ssh2 extension on PHP5, Apache2

Here is the way for the installation of ssh2 on php5 and apache2..
Here is the document about the ssh2 php..
Try search around the google..Try doing the compilation..
It is working..So here some guide can be use for the installation

Requirements..Installer file for ssh2 and libssh2
1. "wget http://pecl.php.net/get/ssh2-0.11.0.tgz"
2. "wget http://downloads.sourceforge.net/project/libssh2/old-libssh2-releases/1.1/libssh2-1.1.tar.gz?use_mirror=nchc"

First, install libssh2..
1. tar zxf libssh2-1.1.tar.gz
2. cd libssh2-1.1
3. ./configure
4. make
5. make install

Second, install ssh2..
1. tar zxf ssh2-0.11.0.tgz
2. cd ssh2-0.11.0
3. /usr/local/php/bin/phpize
4. ./configure --with-ssh2 --with-php-config=/usr/local/php/bin/php-config
5. make
6. make install
7. make note on the "Installing shared extensions:" directory path which need in below step
Third, change the php.ini file and restart apache..
1. Edit the php.ini file
vi /usr/local/php/lib/php.ini
2. Add this column to the end of php.ini file..
[ssh2]
extension_dir= ssh2 installed library path
extension=ssh2.so
3. save and exit the php.ini
ctrl + c
:wq
4. restart the apache2
/usr/local/apache2/bin/apachectl restart
# if apache cannot be down..
/usr/local/apache2/bin/apachectl graceful

Check the phpinfo, will see ssh2 is enabled..

Tuesday, May 11, 2010

Clear PuTTY host-key

When a server keep rebuild over and over..
and try access from PuTTY time from time with same server IP and different Host..
May face problem such as..

The password keep wrong.. seem cant be authenticate..
If face this problem.. Try this..

1. Try use another SSH software to ssh to the server.
2. a. If cannot, means the server setting not done properly..
b. If CAN, then clear putty RSA and Host-Key

PuTTY host key can be found at
1. Run > regedit
2. GOTO "HKEY_CURRENT_USER\Software\SimonTatham\PuTTY"
3. If not mind reset all the setting.. Just delete the "SimonTatham".

Wednesday, March 24, 2010

Disable SELinux

Error such as:

audit(1269456413.197:0): avc: denied { create } for pid=1850 exe=/sbin/syslogd scontext=user_u:system_r:syslogd_t tcontext=user_u:system_r:syslogd_t tclass=netlink_route_socket
audit(1269456413.197:0): avc: denied { create } for pid=1850 exe=/sbin/syslogd scontext=user_u:system_r:syslogd_t tcontext=user_u:system_r:syslogd_t tclass=netlink_route_socket
audit(1269458951.691:0): avc: granted { setenforce } for pid=3659 exe=/bin/bash scontext=root:system_r:unconfined_t tcontext=system_u:object_r:security_t tclass=security

which are:
audit ( ): avc: denied

is cause by selinux policy..

SELINUX= can take one of these three values:
enforcing - SELinux security policy is enforced.
permissive - SELinux prints warnings instead of enforcing.
disabled - SELinux is fully disabled.

Permanent disable selinux:
vi /etc/selinux/config
edit at the SELINUX value:
SELINUX=disabled

The value of the SELINUX can be enforcing, permissive or disabled. If by defaults when doing the installation, the SELINUX is enable, it will be enforcing.

For temporary disable the selinux:
echo 0 > /selinux/enforce

To enable back SELINUX:
echo 1 > /selinux/enforce

Monday, March 22, 2010

Remove and Disable IE plugin

Disable the plugin will be:

1. At IE, go to "Tools" > "Manage Add-ons"
2. Disable the add-ons




Step to remove IE plugin:

1. At IE go to:
Tools > Internet Options
2. At the tab "General", "Browsing History", Press "Settings"
3. "Temporary Internet Files" press "View Objects"
4. Remove the plugin.

Or

1. Go to C:\WINDOWS\Downloaded Program Files
2. remove the plugin

Wednesday, January 13, 2010

Count Total Process using pgrep..

Here is another useful command to count total process/thread is running.
When run ps aux... indeed can get all the running process..

# ps aux | grep httpd

But the list is too long..


Therefore.. have a try use pgrep..

# pgrep httpd

Can see all the list are the process id for the httpd process.

Then to count how much thread had been running by httpd..

# pgrep httpd | wc -l

Total process/thread is show up.

Tuesday, January 12, 2010

Check RAM slot in Linux using dmidecode..

Sometimes.. when a server is running..
It is impossible to check, how many RAM slot still available on this server..
Is quite hard to identify the hardware availability without open up the chasing..

I found out, there is a command called "dmidecode"..
Where it can be grab mostly the information you need..

When run
# dmidecode

can see the server chasing information such as server tag, server model, product model and more...

Let back to our main purpose..
# dmidecode -t -17 | grep Size

to can view the RAM size that been installed and the slot not yet installed RAM.

To check the maximum RAM capacity can installed..
# dmidecode -t 16

Sometimes, may face problem with the command such as No such file or directory..
Which may cause by some module not installed or different distro.

Therefore, ignore the -t 17 or -t 16 when execute and add pipe along with keywords..

# dmidecode | grep Size
same thing can be view, just with extra information which you may not need..

# dmidecode | grep Maximum


Sometimes.. you may forget about the case sensitive letters..
Therefore add the -i to ignore the case sensitive.

# dmidecode | grep -i size
output also same as what you need.

dmidecode can retrieve a lot data..
RAM model, speed also can be retrieve...



It do a really handy works for System Engineer when it come to upgrade devices..

Monday, December 14, 2009

Directory at /var/spool/clientmqueue/ consume a lot space

When a linux server does not allow sendmail port out but the service is running..
it will cause all the mail is in queue at the /var/spool/clientmqueue/..
due the mail cannot send out..
When left it like this all the time..
It will consume a large hard disk space..
what I face at here was, this directory had consume about 6G of the hard disk space..

When I run ls at the path, the server will hang..
nothing is about come out... for about roughly 1 or 2 hour or longer..
But when I df -h, the /var directory still have 2G available..
Although there had space but nothing can be start due to the error "not enough space to run services"..

What I can do is.. I try rm -rf * at the /var/spool/clientmqueue/..
"argument list too long error will appear"
Therefore, have to manually rm -rf one by one of the file with the mask attribute (*) at the send... example rm -rf Qm3w*
But this way consume a lot of energy and time.. and the space not decrease also..
Is totally waste of time..
So I try browse and google... I found out.. some solution.

Due to I not using sendmail at all.. I will disable the sendmail service.
By rename the file /etc/mail/submit.cf to /etc/mail/submit.cf.bak
Then I restart the sendmail service... The service cannot be start due to the
"Starting sm-client: /etc/mail/submit.cf: line 0: cannot open: No such file or directory"

Therefore.. my sendmail will not run anymore... Then I deal with the /var/spool/clientmqueue/ path by deleting all the file inside...
I use this command at /var/spool/clientmqueue/
"find . -type f -exec rm {} \;"

Left it run overnight.. and... the file at the directory is completely deleted...

Sunday, June 28, 2009

Wubi - ubuntu installer

New to ubuntu? not used to ubuntu environment yet?
Dont want use virtual machine for ubuntu?

No need to worry, there is WUBI... an ubuntu installer..
Wubi can help you install the ubuntu in your hard disk and make it dual boot loader.
You can choose either to boot into ubuntu or your current windows..


Wubi is an officially supported Ubuntu installer for Windows users that can bring you to the Linux world with a single click. Wubi allows you to install and uninstall Ubuntu as any other Windows application, in a simple and safe way. Are you curious about Linux and Ubuntu? Trying them out has never been easier!


Very simple step..
get yourself the wubi installer at here and the ubuntu desktop cd at here.

Then.. insert the ubuntu desktop CD to the CD-ROM and run the wubi installer..
It will ask where you wish to install the ubuntu.
Just follow the instruction... It will guide all the process..
Once done.. when you reboot your PC/ Laptop, the boot menu will ask which OS you wish to boot into..

That all.. you can experience ubuntu on your PC.. without touching on the current windows..
If not satisfy or want to uninstall the ubuntu, you can just re-run the wubi installer.

Wubi Website

Wubi installer

Monday, June 22, 2009

Find words in each files..

This is something useful command when you want to scan hundreds of file for 1 specified words..
Such as.. you have thousands of files.. and you want to check which file consists "kame" words inside the files..
This is the commands..

grep -n -r 'kame' *

Sunday, June 21, 2009

NTLDR is missing..

Sometimes.. It is very common to see such missing or file corrupt for windows..
Just dont be panic.. everythings can be solved...
Most serious ma just FORMAT LOL..
That why, at least.. 2 partition will be made whenever I do the formatting..
1st Partition only store the Windows and Software..
No important data will store..
Which mean, My Document folder I wont use at all..
2nd partition will store all the important and personal data..
So.. when the main Windows file system corrupt..
Personal data at 2nd partition still safe..

Therefore.. when say whatever file is missing.. no harm.. just repair the windows whatever you like..
For this problem..

NTLDR is missing
Press Ctrl+Alt+Del to restart

What does NTLDR means and the function.. can be found at here
When this message appear after boot the windows..
What you need to do are:

1. Put OS Cd to the CD-ROM and boot into the CD.
2. Then enter to the repair mode which you need press "R".
3. Then you will require to choose which Windows to repair.. Choose "1" which is the main Windows.
4. It will require your Windows Administrator Passwords.. If you have then keyin, else just press "Enter".

Then you will enter the repair mode.. At here, you needs:

1. Run this 2 command..
copy e:\i386\ntldr c:\
copy e:\i386\ntdetect.com c:\
2. exit the repair mode and reboot.

After reboot, you will able to login to the Windows.. Then do some checking on the boot.ini file is it still at there or deleted. This file is located at:
Control Panel > System > Advanced > Startup and Recovery > Settings > System startup

If still exist, check the file is correct or not.. check the boot sequence is it Windows XP Pro/Home as main boot loader.

If not exist anymore..
Then just Edit and create a new boot.ini file.
Add this value into the file.

For Windows XP Professional:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect

For Windows XP Home:
[Boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating system]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect


After do the changes on boot.ini.. Restart the Windows..
To make sure does the problem still exist or not...
For more info on boot.ini and the tuning.. Mayb can refer to here and here

Friday, June 5, 2009

Forget MySQL Root Password

It is normal to forget password when you have to remember so many diff and type password..
For MySQL, there are few way you can reset the root password..
But the main condition is.. you must have access to the physical server..
It can't be reset through mysql connection..

Here I will use 1 simple way which I prefer the most.

1. Check which mysql daemon need to reset. At here.. I want to reset mysql port 3306 which using the /etc/my5.cnf config file. Use command "netstat -ntulp" to check the running process and port.


2. Check the mysql /etc/my5.cnf daemon PID. Use command "ps aux | grep mysqld".


3. After identify the pid. Kill the process with "kill -9 db_pid".


4. Double check the mysql port 3306 had been killed or not.


5. Start the mysql with additional parameter "--skip-grant-tables".. which the command will be "mysqld_safe --defaults-file=/etc/my5.cnf --skip-grant-tables --user=root &".


6. Enter the mysql port 3306. It can be access without any password.


7. Now update the root password with new password with command "UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root';".
Then flush the privileges with "flush privileges".

8. Shutdown the mysql with "mysqladmin -uroot -h127.0.0.1 -P3306 shutdown". At here.. since the grant-tables privileges not open yet, shutdown also does not require password.


9. Start back the mysql without the "--skip-grant-tables" parameter.



That all. The MySQL root password had been reset. Here is some reminder.. After reset, remember to restart the mysql without the skip-grant-tables.

Do not let anyone have access to the physical DB server, to avoid DB daemon is restart without knowledge.

Tuesday, May 26, 2009

Kernel Panic

One of the important server, frequently kernel panic.
Every few hours, after restart..
Will not responding and kernel panic again..
This server CD-ROM already defected..
I hardly can linux repair the kernel..

Things I can do also limited.. due to the not functioning CD-ROM..
But sometimes when i reboot this server..
It will have 1-3-2 beep sound which indicate the memory are not installed properly..
refer to here..
Another symptom on this server Dell Poweredge 1650..
was the BIOS screen is hang hang..

What I suspect:
1. Board defect.. which cause the BIOS hang..
2. Hard Disk defect.. due to the irq timeout..

What I had try to fixed this problem:
1. Remove the RAM.. and test the RAM pair at Bank 1.. This one can know which RAM is defected. And found out one of the 512MB RAM is defected which cause the BIOS screen hang hang.

2. Change the CD-ROM from other server. Try do linux repair.. Found out the message indicate the hda irq is timeout before change the CD-ROM.








In the end, after all the test.. Found out the main cause for the Kernel Panic was
1. 1 of the RAM is defect..
2. CD-ROM (hda) is defect..

After i remove the RAM and change the CD-ROM.. Everything is working fine..

Tuesday, April 28, 2009

Boot into Single-User Mode

There may have lots of source how to boot to single mode when Google. But my bad, my memory not good enough.. SO have to make a post to remind myself in future.

Boot in single mode in linux is almost equally with boot into safe mode in Windows. This step will be useful if using the GRUB boot loader. Single mode is useful when forget the root password or the server access.

1. When boot into linux, Press Enter when see the screen as below.


Press Enter when see this screen

2. Then choose which kernel version did you wish to boot as shown below. Press e to edit the kernel parameter.

Press e after choose the kernel version

3. When you see the screen as attachment, select the selection start with words kernel. Then press e to edit the line.

Press e to start edit the kernel parameter

4. Then go to the end of the line, and add the words single. This will indicate the kernel to boot into single mode. Once done, press Enter.

Type single at the end of the line

5. Now, press b to start boot with the new kernel parameter.

Press b to boot into single mode

That all.. you will be in single mode once the boot complete.