sponsors:

сервер

серверні технології

Grepping disk usage for biggest folders

Finding where was free space gone and who that guy that should be cleared on a server can be a challenge
Unix as I know has no usable UI tools for that, but there is a console that has power.
How to find folders for cleanup on Unix/Linux/Ubuntu?
Here is a command for grepping folders/files that has Gigabytes of size

du -c -h | grep -P "G\t"

The same for Megabytes as well, but I guess not so usable at admin level, mostly good for user folders.

du -c -h | grep -P "M\t"

And here is a sample output for the first command



Centos installation steps for eio and event extensions.

Centos installation steps for eio and event extensions.

Install eio extension

sudo pecl install http://pecl.php.net/get/eio-1.2.5.tgz

Enable internal debugging in Eio [no] : Just hit enter

Do add "extension=eio.so" to php.ini afterwards manually with Your favourite text editor

Install event extention

sudo yum groupinstall "development tools"

Hit y on a question

sudo yum install pecl-event php-devel libevent-devel



MYSQL fix duplicates saving duplicated data with new id

DROP PROCEDURE `max_wid`;
DELIMITER ;;
CREATE PROCEDURE `max_wid` (OUT `y` int)
SQL SECURITY INVOKER
BEGIN
SELECT MAX(wid) into y from works;
END;;
DELIMITER ;
DELIMITER ;;
CREATE PROCEDURE `first_dup` (OUT `t` int)
SQL SECURITY INVOKER
BEGIN
SELECT wid into t FROM works GROUP BY wid HAVING ( COUNT(wid) > 1 ) LIMIT 0,1;
END;;
DELIMITER ;

The procedure itself - finding first duplicated data - and updating it to maximum possible id
After running this code till ZERO duplicates just create unique Primary key for Your table


Syndicate content Syndicate content

Propeople Expert

експерименти

Rambler's Top100