Categories
php

List of Php Resources

This is the list of websites that are useful for learning php and has useful info for beginners. By the way the best method to learn php is to create a website yourself..

Tutorial Websites

  1. Php.net
  2. W3 Schools Php Section
  3. Tizag Php
  4. Php Freaks

Scripts Websites

These website have php scripts that of great use for all of you.

  1. Php Scripts
  2. Php Resource Index
  3. Php Classes Org

This list will grow. Please submit a new site or link  in the comments.

We will add after checking them.

Categories
php

PHP Function to list contents of a directory

Many times you need to get the list of contents of a directory in php scripts. You can get list of files and directories in a directory by using following function. It returns the list of items as an array.
[php]
function getdirlist($dir){

return array_diff( scandir( $dir ), Array( “.”, “..” ) );

}

[/php]
This function works in php5 environment only.

But if there are too many files in the folder you can use the below function to list each of them.

[php]

function getlist($directory){
$results = array();

// create a handler for the directory
//$directory=”.”;
$handler = opendir($directory);

// keep going until all files in directory have been read
while ($file = readdir($handler)) {

// if $file isn’t this directory or its parent,
// add it to the results array
if ($file != ‘.’ && $file != ‘..’){
$results[] = $file;
}
}
// tidy up: close the handler
closedir($handler);

return $results;

}

[/php]

 

Categories
Uncategorized

Hello All

This is our first post :)

Categories
tutorials

Chown Tutorial

A brief tutorial on usage of chown linux command
What is this tool for..
It is to change the ownership of a file.
you should use like

chown newuser filename

To change owenership of all files and directories in current directory use *

chown newowner *

To change owner ship of all files and sub directories and files recursively

chown -R newowner .

Categories
utilities

How to remove large no of files

You just wanted to remove a directory with large no of files in it and you issued the command

$rm -rf *

But the rm throws an error argument list  too long, then how to remove  the files?

Here is a simple fix that will allow you to remove large no of files easily..

First copy and paste the below code in the terminal

function large_rm() { while read line1 ; do rm -f ./$line1; done; };

Then cd to that directory where you need to remove the files then issue the command

ls -l |large_rm

Thats it.. it will remove all the files in that directory within seconds :)

Categories
ftp

Transfering Files or Whole directory From One Server to another.

Ok.. this is a life save for most of the webmasters. Take the scenario when you have to move from one server from other. This work only if you are on a dedicated or vps server. You need wget to do this job.
Issue this command after logging into your server

$wget -m –user=’your-ftp-user-name’ –password=’you-ftp-password’ ftp://your-host/directory-to-download

Categories
php accelerators server

Install Eaccelerator on Centose Server

Php eaccelerator is php accelerator which reduces load on your servers by compiling them in caches state. Here is tutorials explaining how to install this in centos.

  1. http://www.php.ph/2007/12/21/centos-5-eaccelerator-installation/ 
  2. http://eaccelerator.net/
Categories
phone

Sync your iPhone Music Libary With Rhythmbox in Ubuntu Karmic (No Jailbreaking Required)

In Mac and Windows, you can easily sync your iPhone/iPod Touch with iTunes, but in Linux, there is no easy way to sync your iDevice’s music library with any of the media player. Even if you are willing to jailbreak your phone, there are still plenty of complicated steps that you need to do to get the syncing to work
Read Articles More →

Categories
chat

Configuring Kopete to Use Facebook’s New XMPP Chat

As Facebook usage continues to grow, many people rely on Facebook as their primary method for chatting in real time with their friends and family. I am not one of those people, but since many of my friends are, having a way to easily contact them in real time is very important. There have been attempts to make plugins for major IM clients such as Pidgin and Kopete that can work with Facebook, but they were difficult to maintain and did not always perform well….
Read Rest of Article Here

Categories
desktop apps

8 Of The Best Linux Dockapps

How much functionality can you pack into a 64×64 square? That’s the basic question behind many dockapps – utilities that can be run on the “dock” of many popular desktop environments. While most of them are designed for Step-type window managers such as Windowmaker, these dockapps can also run in things like XFCE, Fluxbox and Openbox. These are just like vista widgets…
Read More Here