Source : Distrowatch.com
Trust Goes in Favour Of Open-Source Linux Extends it
Distrolove is our love towards Open-Source OS Linux , world fines OS Try atleast once
Sep 11, 2012
PUREOS 6.0 released with GNOME 3
Source : Distrowatch.com
Jul 9, 2012
Validate an E-Mail Address with PHP, complete script
Complete Coding is here
$email=(isset($_POST['email']))?trim($_POST['email']):'';
function verify($email){
if(!preg_match('/^[_A-z0-9-]+((\.|\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/',$email)){
return false;
} else {
return $email;
}
}
if(isset($_POST['submit'])){
if(verify($email)){
echo $email." is a valid E-mail ID";
} else {
echo $email." is an invalid E-mail ID";
}
}
?>
<form action="" method="post">
<input type="text" name="email" value="<?php echo $email;?>"/><br/>
<input type="submit" name="submit" value="validate" />
</form>
Source: http://html5planet.blogspot.in/2012/07/validate-e-mail-address-with-php.html
Jun 11, 2012
Play With Xampp on linux 32 bit and 64 bit OS
In Previous blog , I just taught you how to install Xampp on 32 bit and 64 bit distro , in this tutorial I am going to tell you how to make web development easy on Linux. When you work on Linux environment everything is not easy as it is stable and secure , you have to come up with lots of issues and how to solve it.
Problem no.1
How to give write permission to /htdocs to create folder and files?
This is one of biggest issue after installing xampp as we have to create .php files under /htdocs folder
solution : Its not a rocket science to give write permission to a folder .
open terminal
Note if you use KDE then use su command else use sudo.
after opening terminal write
=========================================
=========================================
Problem no.2
Which editor will be best?
solution: If you want dreamweaver like editor then kompozer will come closer ,if you want fast and stable editor there is numeros my personal favorite are
- kate
- geany
- gedit (you have to twaeked it)
- bluefish
- kompozer
Problem no. 3
Which browser will be better?
solution : I prefer Firefox over any browser and don't know why. You can work with any browser of your choice . My top 5 browser are
- firefox
- chrome
- opera
- safari
- konqueror
May 25, 2012
Launching tasks when computer is idle
DistroWatch answers: It is possible to check how busy your CPU is and run certain programs when the processor is idle. However, this may not be the best solution if your goal is running programs without having them interfere with system performance. First, let's look at how to run a command when the CPU is relatively idle. There are a few ways to check to see how busy the CPU is, but one of the easiest is using the uptime command:
jesse@drew:~$ uptimeThe uptime program shows us the current time, how long the computer has been running, how many users are logged in and the processor's load average. The load average tells us how busy the CPU is. The uptime program displays three numbers for load averages, the first shows us how busy the CPU has been, on average, for the past minute, the second number indicates average processor load for the past five minutes and the third number indicates load for the past fifteen minutes. A load average of 1.00 would mean the CPU is constantly busy, a load of 0.00 would indicate the machine is practically idle. If we want, we can set a job to run only if the load average falls to a certain point, say 0.01. The following script checks the system load once a minute and, when the load drops below 0.05, it will run a job, provided on the command line, for us:
15:40:49 up 8:17, 3 users, load average: 0.92, 0.88, 0.85
#!/bin/bashNow there are problems with this approach. One being that we're constantly running checks, which is a little wasteful. Another is that if our load average never drops below 0.05 our task doesn't get to run. Another issue is that if we want to use the computer while our intensive task is running we either have to interrupt it or deal with reduced performance while our important job is running. In my opinion a better way to handle the situation is to run our special task whenever we want, but make sure it does not affect system performance.
if [ $# -lt 1 ]
then
echo usage $0 command
exit 0
fi
load=`cat /proc/loadavg | awk '{print $1*100}'`
while [ $load -gt 5 ]
do
sleep 60
load=`cat /proc/loadavg | awk '{print $1*100}'`
done
$@
One command useful for keeping jobs out of the way is nice. The nice command tells the operating system to assign a lower priority to our job. The lower priority will help to keep the job from using the CPU while other, higher priority tasks, are active. Here is an example of the nice command in action, being used to run the apt-get program:
nice apt-get updateShould a job already be running and we want to lower its priority, making it less intrusive, we can use the renice command. The renice command typically accepts two pieces of information, the new priority we want to assign and the process ID of the job we want to alter. Priority numbers are typically set in the range of -20 to 19, with 19 being the lowest possible priority. The following command assigns the lowest priority to process 3175:
renice -n 19 -p 3175While the nice and renice commands work on adjusting the priority of jobs in the CPU sometimes we find that the main bottle neck to performance is with the hard drive. For instance backup processes require a lot of disk access and we might want to keep them out of the way. For these sorts of tasks we have the command ionice. The ionice command works much the same way as nice and renice. With ionice we can either launch a new task with altered priority to the disk or we can make adjustments to processes already running. The ionice command recognizes three classes of priority: realtime (which is the most aggressive), best-effort (which is the default) and idle (which should not interfere at all with other tasks trying to access the disk). The ionice manual page tells us to make a process idle, we assign it a class of 3. In the following example we perform a backup using a polite, idle, disk priority:
ionice -c 3 tar czf mybackup.tar.gz ~/DocumentsIn this next example we tell the system to make sure the process with ID 4571 takes the lowest priority when accessing the disk:
ionice -c 3 -p 4571Should we wish to, we can use both the ionice and renice commands to make sure our job stays out of the way both when accessing the CPU and the disk. This next example begins a backup of our Documents directory and assigns the process both a low disk and low CPU priority:
ionice -c 3 tar czf mybackup.tar.gz ~/Documents &The above commands -- nice, renice and ionice -- affect the scheduling and priority of a task. There is another command, called CPUlimit, which throttles a process. (CPUlimit is usually not installed by default, but is available in many Linux repositories.) What's the difference between throttling and scheduling? Well, a task with a low priority can still use 99% of the CPU if nothing else is competing for system resources. The low-priority task only backs off when another process wants to step in. Throttling a process, on the other hand, forces that process to only use a limited per cent of the available CPU. We can limit a process to use only 10%, 20%, 50%, etc of the CPU, whether the machine is idle or busy. The CPUlimit command typically takes two pieces of information, a process ID of the job we want to throttle and the maximum percentage of the CPU we want to allow to the process. For example, the following limits the process 6112 to using just 25% of our CPU:
renice -n 19 -p $!
cpulimit -p 6112 -l 25The following commands start a new backup job and then throttles its CPU usage to 10%:
tar czf mybackup.tar.gz ~/Documents &
cpulimit -p $! -l 10 -b
Source : http://distrowatch.com/weekly.php?issue=20120521
May 6, 2012
Install XAMPP on 64 bit Linux Distro
LAMPP: Starting Apache...
Read complete tutorial at Cellguru
Mar 26, 2012
5 Tips and Tricks for Using Yum
If you're using one of the Fedora/Red Hat derived Linux distributions, odds are you spend some time working with Yum. You probably already know the basics, like searching packages and how to install or remove them. But if that's all you know, you're missing out on a lot of features that make Yum interesting. Let's take a look at a few of the less commonly used Yum features.
Yum comes with a lot of different distributions, but I'm going to focus on Fedora here. Mainly because that's what I'm running while I'm writing this piece. I believe most, if not all, of this should apply to CentOS, Red Hat Enterprise Linux, etc., but if not, you may need to check your man pages or system documentation.
Working with Groups
If you use the PackageKit GUI, you can view and manage packages by groups. This is pretty convenient if you want to install everything for a MySQL database or all packages you should need for RPM development.
But, what if you (like me) prefer to use the command line? Then you've got the group commands.
To search all groups, use yum group list
. This will produce a full list of available groups to install or remove. (Yum lists the groups by installed groups, installed language groups, and then available groups and language groups.)
To install a group, use yum group install "group name"
. Note that you may need quotes because most group names are two words. If you need to remove the group, just use yum group remove "group name"
.
Want to learn more about a group? Just use yum group info
with the group name.
Love the Yum Shell
If you're going to be doing a lot of package management, you want to get to know the Yum shell.
Just run yum shell
and you'll be dumped in the Yum shell. (Which makes sense. It'd be weird if you got a DOS prompt or something...) Now you can run whatever Yum commands you need to until you're ready to exit the Yum shell.
For instance, want to search packages? Just type search packagename.
install
or remove
, Yum will not complete the transaction immediately. You need to issue the run
command to tell Yum to do it. This gives..............Read more at linux.com