Jun 4, 2011

Speed up your searching (in large data) by fulltext index and copy your youtube from tmp folder

Inspiring from my trouble in copying a video from youtube, then i get the solution. Linux only, the previous version (flash 9, with karmic or lusty) it can be copy the the video directly from /tmp, but in flash 10 with mavric its disappear. so use my trick or downgrade your flash.

Basic concept for this trick is searching for PID of process then grep-ing the stream in directed to a file, the result is un-extension files, but it can be played on totem or other audio player. Just run it on console, go to /tmp, then copy your video that has been watched. .. :D





1. Copy your video in /tmp
for i in $(pgrep -f libflashplayer.so); do ls -l /proc/$i/fd/* | grep '/tmp/Flash' | grep -o "/proc/$i/fd/\\S*" | xargs cp -t /tmp/  ; done

A lady asking me for some hadith which is difficult to get the original source, i just remember on my brain while my hadith source is to large to be traced with common searching such as "LIKE" or "%" or RLIKE, then i make a new indexing with new methods, FULLTEXT Index. It can be faster then.


2. Speed up your searching (in large data) by fulltext index
create FULLTEXT INDEX fullbukhori on had_bukhari(isi_arab, isi_indonesia, isi_arab_gundul);
set global key_buffer_size = 600*1024*1024;
load index into cache had_bukhari index(fullbukhori);

SELECT *, MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('tenang') AS score
        FROM `had_bukhari`
        WHERE  MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('+diri+tenang');

SELECT *, MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('سكينة') AS score
        FROM `had_bukhari`
        WHERE  MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('سكينة');

.
Inspiring from my trouble in copying a video from youtube, then i get the solution. Linux only, the previous version (flash 9, with karmic or lusty) it can be copy the the video directly from /tmp, but in flash 10 with mavric its disappear. so use my trick or downgrade your flash.

Basic concept for this trick is searching for PID of process then grep-ing the stream in directed to a file, the result is un-extension files, but it can be played on totem or other audio player. Just run it on console, go to /tmp, then copy your video that has been watched. .. :D





1. Copy your video in /tmp
for i in $(pgrep -f libflashplayer.so); do ls -l /proc/$i/fd/* | grep '/tmp/Flash' | grep -o "/proc/$i/fd/\\S*" | xargs cp -t /tmp/  ; done

A lady asking me for some hadith which is difficult to get the original source, i just remember on my brain while my hadith source is to large to be traced with common searching such as "LIKE" or "%" or RLIKE, then i make a new indexing with new methods, FULLTEXT Index. It can be faster then.


2. Speed up your searching (in large data) by fulltext index
create FULLTEXT INDEX fullbukhori on had_bukhari(isi_arab, isi_indonesia, isi_arab_gundul);
set global key_buffer_size = 600*1024*1024;
load index into cache had_bukhari index(fullbukhori);

SELECT *, MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('tenang') AS score
        FROM `had_bukhari`
        WHERE  MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('+diri+tenang');

SELECT *, MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('سكينة') AS score
        FROM `had_bukhari`
        WHERE  MATCH(isi_arab, isi_indonesia, isi_arab_gundul) AGAINST ('سكينة');

No comments:

Post a Comment