Wednesday, April 29, 2009

openSUSE Repositories

Hi guys...
Here are the list of repo for openSUSE, version included are 10.3, 11.0, 11.1 for KDE.

http://en.opensuse.org/KDE/Repositories

Enjoy!!!

ANL

Tuesday, April 28, 2009

System Tray icon missing in KDE4.2.2 in openSUSE

Hi all,
Yesterday i reinstall openSUSE 11.0 on my office PC with gnome and then install KDE4.2.2 from Yast.
But after logging to KDE desktop, i found that system tray icons are missing. I faced this problem before too, but did not find any solution for it that time.
Yesterday i searched about this issue, and found that, we have to update libqt4.4.0 to libqt4.4.3.
So the simple solution was that, to upgrade the libqt to update version to work with KDE4.2.2.
The update process is easy, open yast->software management and search for libqt. But for the latest libqt you have to add repo. so 1st add this repo to repo list.
For openSUSE11.0: http://download.opensuse.org/repositories/KDE:/Qt44/openSUSE_11.0/
For openSUSE11.1: http://download.opensuse.org/repositories/KDE:/Qt44/openSUSE_11.1/
For openSUSE10.3: http://download.opensuse.org/repositories/KDE:/Qt44/openSUSE_10.3/

Now, install the update version, which i think will be libqt4.4.3, and that's it.

Here is the sample of the issue:



For more about this issue read here from KDE forum:
KDE forum libqt issue

ANL

Monday, April 27, 2009

Install flash plugin for Firefox/others in Linux

After fresh installation of Linux distro, most of the packages we have to install from yast or by terminal.
As using Internet, we use Firefox for browsing. But by default there is no flash plugin. So we have to install it.
I tried myself many times from yast2 and sometime when FF pop up message for missing plugins, none of them works for me.
But i find out an easy way to sort out this problem.
I'm using currently openSUSE 11.0 Gnome,KDE and openSUSE 11.1 Gnome,KDE. I tried on both, and it works.
But i am not sure about other distros, But you can give it a try.

So lets start:
1st of all make sure all Firefox windows are closed.

Then press Alt and F2 to bring up Run applet, Type YaST or yast2 and press ENTER.
Key in your root password and press ENTER, Click on software management.
Search for flash, mark flash-player for uninstallation and click Accept.
Close YaST

Now Visit this site to download flash player(for this open FF):
http://get.adobe.com/flashplayer/

and click on the drop down list to select the version for download. Select the .rpm version and download it.

After you have downloaded it, close all Firefox windows. Then right click on the rpm and select Open With->Install software OR double click the rpm.
Key in your root password and press ENTER, it will install in a jiffy, as if nothing has happened.

Now open terminal,
Type:

sudo cp /usr/lib/flash-plugin/libflashplayer.so /usr/lib/browser-plugins/

and press ENTER

And that's it, you are finished!

Now test, open FF, and try www.youtube.com

Enjoy!!!

Monday, April 20, 2009

Linux Determine which Services are Enabled at Boot

The best protection against vulnerable software is running less software. How do I find out which services are enabled at Boot under CentOS / RHEL / Fedora Linux? How do I disable software which is not needed?
Open terminal and login as root user.

Type the following command to list all services which are enabled at boot:
#chkconfig --list | grep $(runlevel | awk '{ print $2}'):on


Task: Disable service,
To stop service, enter:
# service {service-name} stop
# service vmware stop


To disable service, enter:
# chkconfig {service-name} off
# chkconfig vmware off


A note about outdated insecure service
All of the following services must be disabled to improve server security:
1. Inetd and Xinetd (inetd xinetd) - Use direct services configured via SysV and daemons.
2. Telnet (telnet-server) - Use ssh
3. Rlogin, Rsh, and Rcp ( rsh-server ) - Use ssh and scp.
4. NIS (ypserv) : Use OpenLDAP or Fedora directory server.
5. TFTP (tftp-server) : Use SFTP or SSH.

To delete all of the service enter:
# yum erase inetd xinetd ypserv tftp-server telnet-server rsh-serve


ANL

Thursday, April 2, 2009

$_SERVER['PHP_SELF'] in PHP

Hi to all, After a long time i m back to this blog too.

$_SERVER is an array defined in PHP and it stores information about your server and execution environment information.

$_SERVER['PHP_SELF'] is an array element points out the filename of the currently executing script. For example, if you run www.example.com/index.php, $_SERVER['PHP_SELF'] would be /index.php. This is relative to the document root. This is useful to referring HTML forms and other element.

for example:


ANL

Thursday, January 29, 2009

Running Services List

There are various ways and tools to find and list all running services under Fedora / RHEL / CentOS Linux systems.
Some of them are:
service --status-all
service --status-all | grep ntpd
service --status-all | less

To print the status of apache (httpd) service:
service httpd status


ANL

Friday, January 23, 2009

1 click install of KDE4.3

Hi guys and gals,
Some days ago i faced serious problems with kde4.2 beta, i upgrade my system from 4.1.3 to 4.2 beta and everything goes wrong. Nothing was working, every time desktop crashes.
I start using gnome then.

But today i tried again the 1 click install, and wow everything back to normal. Its working very nice and smoothly. Kde4.3 is really a move and give a chance thing. i am impressed by the new added features.
Can try the 1 click install from here:
1 click install kde4.3

Note: Its for openSUSE 11.1 and 11.0.
I had tried it on openSUSE 11.0.

So best of luck, and enjoy the new polish desktop.

ANL

Monday, January 12, 2009

MySQL: Find Out Which Table is Consuming Resources

You can use mytop command a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL.
Install Mytop:
First install required perl modules:
cpan -i Term::ReadKey
cpan -i Term::ANSIColor
cpan -i Time::HiRes

Next, install mytop, enter:
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
tar -zxvf mytop-1.6.tar.gz
cd mytop-1.6
perl Makefile.PL
make
make test
make install

To view information about database called foo, enter:
$ mytop -u dba -p 'password' -h 10.2.4.5 -d foo

Where,

* -u : Database username.
* -p : Database password.
* -h : Database server IP address.
* -d : Database name.

Read mytop man page for further information:
perldoc mytop

ANL

SSH System Bootup In Progress Please Wait Error and Solution

System bootup in progress -please wait
This error appers when system config or root user creates /etc/nologin file. If the file /etc/nologin exists, login will allow access only to root. Other users will be shown the contents of this file and their logins will be refused. The solution is simple, delete the file /etc/nologin manually:
rm /etc/nologin

If this error occurs after reboot open /etc/default/rcS file and set DELAYLOGIN to no:
DELAYLOGIN=no

If this option set to yes, /etc/init.d/bootmisc.sh will create /etc/nologin, which causes a default SSH and PAM configuration to prevent all logins.

This problem cannot be solved over remote ssh session. However, if you can login via KVM or serial console, then you can fix it over remote session.

ANL

Friday, December 19, 2008

openSUSE 11.1 Released

openSUSE 11.1 is released yesterday. I am just downloading now.

Download details link is here:
Link

So download which best suites your system and you.

Have a lot of fun.

ANL

Saturday, December 13, 2008

404 Error customize it for your own site

As, i discussed mod_rewrite in the previous post,that how to enable and use it.
As we know, that some time users input wrong URL, or miss some thing from URL. So that time Apache redirect them to 404 error stating that page not found on this server.
Now the good and very easy way to remove such error and show your users a valid and fine tuned page, Apache give us a opportunity to rewrite that page.

So now you can show a page to users, with some good contents to not lose that user.
Create a .htaccess file and write the following there:

ErrorDocument 404 http://site.com/404error.html

You can change your paths. Now you have a page 404error.html(you can create it in any language PHP etc). Now write whatever you want in 404error.html and show that to user. Save it and place it in the root directory of your site. You can dress up 404error.html to make sure that user will come back or click any link there to your site. OR you can provide search area there. OR any nice page with nice graphics and contents and telling them, that the thing they are looking for can be found in HOME page and give a link to home page. Its all up to you that how you make this page.
I was just giving some tips.

ANL

Thursday, December 11, 2008

Hide .php from users to make your url more friendly

I have written an article named "How to rewrite URL in apache".
Today i am sharing with my readers and PHP programmers.
First of all we will check that either mod_rewrite in apache load modules is enabled or NOT.
In Linux openSUSE:
By default, openSUSE doesn't enable the mod_rewrite rewrite module. It's installed, but not enabled.
So lets enable it,
1. Edit the file /etc/sysconfig/apache2 as root:
i. search for APACHE_MODULES, you should find a line like this
APACHE_MODULES="suexec access actions alias auth auth_dbm autoindex cgi dir env expire include log_config mime negotiation setenvif userdir ssl php5"
ii. Add 'rewrite'(without quotes) to the content in the list between the "".
iii. Save the changes and quit
2. run SuSEconfig to update the apache configuration files.(From terminal)
3. run /etc/init.d/apache2 restart to restart the Apache server.(From terminal)
To check either mod_rewrite is enabled or not. phpinfo();, write in editor, save it in the root directory and open it in browser.
Search for word "mode_rewrite"(without quotes). If you find it, it mean rewrite is enabled. if not, then check the steps again and try.

Now you have to do some tweaking of default-server.conf file.
1. Edit the file /etc/apache2/default-server.conf with your prefered editor.
i. Search for AllowOverride - it should be below the line Directory "/srv/www/htdocs"
ii. Change AllowOverride None to AllowOverride All - this will allow custom .htaccess rewrite rules.
iii. Save your changes and exit
2. run SuSEconfig to update the apache configuration files.
3. run /etc/init.d/apache2 restart to restart the Apache server.

Now every thing is fine and running, lets test it. that it is working or not.
Create a directory with any name, i create mod_rewrite, open editor and write the following code there.

if($_GET['link']==1){echo"You are not using mod_rewrite";}
elseif($_GET['link']==2){echo"Congratulations!! Your Apache mod_rewrite test is successful";}
else{echo"Linux Apache mod_rewrite Test";}

//make it url as by href method.
"rewrite.php?link=1"LINK1 = rewrite.php?link=1
"link2.html"LINK2 = link2.html

save it as rewrite.php

Now write:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]

and save it as .htaccess in the same directory.
Open rewrite.php in browser and click on link1, and then on link2. If you see the message "Congratulations!! Your Apache mod_rewrite test is successful", means that, its working.

In WINDOWS:
How to enable mod_rewrite module in apache in xampp, wamp?

1) Find the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder.
2) Find the following line “#LoadModule rewrite_module modules/mod_rewrite.so” in the “httpd.conf” file.You can do this easily by searching the keyword “mod_rewrite” from find menu.
3) Remove the “#” at the starting of the line, “#” represents that line is commented.
4) Now restart the apache server.
5) You can see now “mod_rewrite” in the Loaded Module section while doing “phpinfo()”.



The rest of the testing is same as above.

ANL

Thursday, December 4, 2008

Round function

A simple post to show how to use round function in PHP.

Lets take a variable holding a number with decimals:
$number = 21.25116;

Now want to round this number to 3 decimal.
So:
$number = round($number,3);
echo $number;
The result will be something like: 21.251

If $number = 21.2569
then result will be: 21.257

If $number = 21.259652;
Then result will be: 21.26

ANL

Sunday, November 30, 2008

openSUSE RC1 released for final testing

The first and only release candidate for openSUSE 11.1 is out and ready for final testing.
Some changes since 11.1 beta5:
* A new shorter distro license
* Linux kernel 2.6.27.7
* glibc 2.9
* Additional translations
* Amarok 2.0 RC 1
* Zypper 1.0.1

Live CD:
Direct Download Link for KDE
Direct Download Link for Gnome

Thursday, November 27, 2008

Fedora 10 is OUT

The Fedora project has announced the release of Fedora 10.
Some major features in latest version:
- A new graphical boot system called Plymouth, designed to speed up the boot process by taking advantage of a new kernel mode setting feature.
- Increased hardware support for a vast array of web cams,
- Better handling of printers via both direct physical connections and networks.
- PackageKit, a software management tool that originally debuted in Fedora 9, has been extended in this release to provide on-demand codec software installation.
- Wireless connection sharing enables ad hoc network sharing.
- Virtualization storage provisioning for local and remote connections now simplified.
- SecTool is a new security audit and intrusion detection system.
- RPM 4.6 is a major update to the powerful, flexible software management libraries.
- Glitch free audio and better performance is achieved through a rewrite of the PulseAudio sound server to use timer-based audio scheduling.
- Better support for infrared remote controls makes them easier to connect and work with many applications.
- The paths /usr/local/sbin:/usr/sbin:/sbin have been added to the PATH for normal users, to simplify command-line administration tasks.

1 Live CD versions:
Direct Download link for Gnome desktop
Direct Download link for KDE desktop

Forum:
Fedora forum link