Posts Tagged ‘Usage’

How to get disk usage/space for a directory

Monday, June 30th, 2008

du -h /home/user | sort -n -r > disk_usage.log
-h - gives results in KB/ MB etc.
redirecting the output helps later inspection because if you have many folders you won’t be able to see the folders that take a lot of space.

Linux:Simple cron/crontab daemon usage run/execute/schedule script/program every 5 10 15 minutes

Monday, June 30th, 2008

crontab -u root -e
Edit current job list for root user.
crontab -u root -l - lists the crontab job list for the root user.
crontab -u root -r - removes the crontab job list for the root user.
crontab run script every 5 minutes
# min  hour day/month   month   day/week
*/5 * * * * /root/script.pl
crontab run script every 10 minutes
# min  hour day/month   month   day/week
*/10 * * * * /root/script.pl
crontab run script every 15 minutes
# min  hour day/month   month   day/week
*/15 * * * * /root/script.pl
# run fifteen minutes after midnight, every day
15 0 * * * /root/script.pl
a crontab entry fields are:
1. Minute - Minutes after the hour (0-59).
2. Hour - 24-hour format (0-23).
3. Day - Day of the month (1-31).
4. Month - Month of the year (1-12).
5. Weekday - Day of the week. (0-6, where 0 indicates Sunday).

PHP:Simple Asynchronous JavaScript and XML (AJAX) example usage of: PHP SAjax framework.

Monday, June 30th, 2008

<?php

require(”Sajax.php”);
// auth check
function login($user, $pass) {
if ($user == ‘test’
&& $pass == ‘test’) {
return “<font color=’green’>Authorization OK</font>”;
} else
return “<font color=’red’>Authorization Failed</font>”;
}
$sajax_request_type = “GET”;
sajax_init();
// $sajax_debug_mode = 1;
sajax_export(”login”);
sajax_handle_client_request();
?>
<html>
<head>
<title>Ajax login box</title>
<script>
<?
sajax_show_javascript();
?>
function do_login_cb(status) {
document.getElementById(”status”).innerHTML = status;
}
function do_login() {
// get the folder name
var user, pass;
user = document.getElementById(”username”).value;
pass = document.getElementById(”password”).value;
x_login(user, pass, do_login_cb);
}
</script>
</head>
<body>
<div id=”status”><em></em></div>
Username:
<input type=”text” name=”username” id=”username”>
Password:
<input type=”password” name=”password” id=”password”>

<input type=”button” name=”check” value=”Go!”
onclick=”do_login(); return false;”>
</body>
</html>

Firefox:Improved Memory Management

Friday, June 27th, 2008

With all new management functions in place, Firefox 3 keeps memory usage under control. The XPCOM cycle collector continuously cleans up unused memory. Plus, hundreds of memory leaks are now remedied.

Search Engine Reach and Ratings

Saturday, June 21st, 2008

In 2004 the search engines were ranked according to popularity and usage. the study polled 225,000 individuals in 26 countries. The users had real-time metrics installed on their computers that tracked the web sites that they visited. What was tracked were unique visits to the various search engines, not search activity. This poll was conducted over the period of 1 month.

The top 5 search engines used were:

* Google 39.4%

* Yahoo 30.4%

* MSN 29.6%

* AOL 15.5%

* Ask Jeeves 8.5%

In this coming year it will be interesting to see if MSN (Microsoft) will gain any ground on the top 2 Google and Yahoo. MSN is scheduled to launch their new search engine in the beginning of the year.

In the tests that we have conducted on MSN we have found their results to be more accurate than Google’s in a lot of cases. Let the search wars begin!

Proper Usage of Web Site Redirects in SEO

Saturday, June 21st, 2008

The main reason to redirect anyone to another site or another page on a web site is because a page and or web site has moved. The redirect may point to another site or a subdirectory. You may also have different domain extensions like .net, .org, .info that you want to point to your main .com extension. There are numerous ways to redirect domains, but it’s important to note the correct ways to do redirects.

One of the ways that people do redirects is via a JavaScript meta-refresh tag. While this works the search engines frown on it’s use because you could create a page to rank high in the search engines and then redirect them to another page. So search engines can penalize you for the use of this tag.

Some webmasters use parked domains to redirect to other sites, so they may but 5 domains for example and have them all point to the same domain. What happens here is the search engines now think that you have 5 different web sites when actually you only have one. Once the search engines realize what’s going on chances are you will be removed from all the SERP’s because of a duplicate content penalty, and it will take you considerable work to get re-listed.

To do a proper redirect you want to do a 301 or 302 redirects, depending on what you are trying to do. From a search engines point of view the only proper redirect is a 301 redirect which states that the redirect is permanent. A 301 redirect is instituted on the server and it carries over whatever link popularity that it has to the new URL. A 302 redirect is considered a temporary move and in most cases link popularity is not transferred over which can effect ranking negatively.