From 9fa9b24185a08660991db7a7cf33cae185aeae17 Mon Sep 17 00:00:00 2001 From: yomguy Date: Tue, 15 Jun 2010 14:16:05 +0000 Subject: [PATCH] fix deegger bug, add tips git-svn-id: http://svn.parisson.org/svn/tools/trunk@76 457c0346-1240-4656-8a5a-9edca8063506 --- tips/tips.html | 474 +++++++++++++++++++++++++-------------------- tips/tips.txt | 44 ++++- various/deegger.py | 38 ++-- 3 files changed, 329 insertions(+), 227 deletions(-) diff --git a/tips/tips.html b/tips/tips.html index 9ccc767..c68cc81 100644 --- a/tips/tips.html +++ b/tips/tips.html @@ -4,235 +4,289 @@ -YomGuy's Linux Ultra Fast Tips +# YomGuy's Linux Ultra Fast Tips
-

YomGuy's Linux Ultra Fast Tips

+

# YomGuy's Linux Ultra Fast Tips

+

YomGuy's Linux Ultra Fast Tips (1/1)

RENAME

@@ -482,7 +536,7 @@ mysql> QUIT

-

System Message: WARNING/2 (tips.txt, line 259)

+

System Message: WARNING/2 (tips.txt, line 262)

Definition list ends without a blank line; unexpected unindent.

mysql> FLUSH PRIVILEGES;

@@ -510,6 +564,8 @@ transcode -i image_list.txt -x imlist,null -g 720x480 --use_rgb -z -y ffmpeg,nul transcode -z -M 2 -x v4l,v4l -i /dev/video0 --import_v4l 0,38 -p /dev/dsp -y xvid -o test.avi -w 1500 -e 32000 -E 44100 -b 96 -s 7 -c 0-250 -g 360x288 -j 0,4 ffmpeg -i video.mp4 -vn -acodec pcm_s16le -ar 44100 -ac 1 bleriot11.wav + +ffmpeg -ss 80 -t 10 -i test_xvid.avi -f flv -vcodec flv -vb 500k -ab 96k -ar 44100 -y test.flv
@@ -1112,7 +1168,7 @@ sudo su - postgres -c "createuser -q --createdb --adduser parisson"
-

System Message: WARNING/2 (tips.txt, line 884)

+

System Message: WARNING/2 (tips.txt, line 889)

Option list ends without a blank line; unexpected unindent.

/ 20 GB /home 136.7 GB @@ -1156,7 +1212,7 @@ root (hd0,1) setup (hd0)

-

System Message: WARNING/2 (tips.txt, line 925)

+

System Message: WARNING/2 (tips.txt, line 930)

Definition list ends without a blank line; unexpected unindent.

quit

@@ -1286,13 +1342,13 @@ rst2html -stg --stylesheet="lsr.css" --traceback tips.txt tips.html

http://rst2a.com/gallery/html/

+
+

TELEMETA

+

apply the same wav file for all items (mysql):

+
+update media_items set filename = 'items/test.wav';
+
- diff --git a/tips/tips.txt b/tips/tips.txt index 8cc7652..aae8546 100644 --- a/tips/tips.txt +++ b/tips/tips.txt @@ -1,6 +1,9 @@ -============================== -YomGuy's Linux Ultra Fast Tips -============================== +################################ +# YomGuy's Linux Ultra Fast Tips +################################ +====================================== +YomGuy's Linux Ultra Fast Tips (1/1) +====================================== RENAME @@ -107,6 +110,8 @@ SOX _:: for i in *.wav; do sox $i -s -w $i.wav; mv $i.wav converted/$i; done + sox Jano_B-Homosapiens.mp3 -r 44100 -b 16 -s -t wav - | flac - -o Jano_B-Homosapiens.flac + CONVERT ======= @@ -115,6 +120,10 @@ _:: convert -density 150x150 telecaster_video01.eps telecaster_video01.png for i in `ls *.eps`; do convert -density 200x200 $i $i.png; done +crop:: + convert waveform_homosapiens.png -crop 100x50% waveform_homosapiens2.png + http://www.imagemagick.org/Usage/crop/#crop_percent + GCC === _:: @@ -280,6 +289,8 @@ _:: ffmpeg -i video.mp4 -vn -acodec pcm_s16le -ar 44100 -ac 1 bleriot11.wav + ffmpeg -ss 80 -t 10 -i test_xvid.avi -f flv -vcodec flv -vb 500k -ab 96k -ar 44100 -y test.flv + KERNEL CUSTOM ============= @@ -790,6 +801,12 @@ _:: svn propdel svn:executable mp3player.swf svn merge -r 119:head http://svn.parisson.org/svn/deefuzz/trunk/ + svn propedit svn:externals . + + deefuzzer http://svn.parisson.org/svn/deefuzzer/trunk + + + DIFF ==== _:: @@ -1055,4 +1072,23 @@ reStructured text to HTML:: rst2s5 --theme medium-black tips.txt tips.html rst2html -stg --stylesheet="lsr.css" --traceback tips.txt tips.html -http://rst2a.com/gallery/html/ \ No newline at end of file +http://rst2a.com/gallery/html/ + + +TELEMETA +======== + +apply the same wav file for all items (mysql):: + + update media_items set filename = 'items/test.wav'; + + +FUNIONFS +======== +merge multiple dirs :: + + funionfs -o dirs=1001:mama -o allow_other NONE media + + + + diff --git a/various/deegger.py b/various/deegger.py index 4d44032..a214fd7 100755 --- a/various/deegger.py +++ b/various/deegger.py @@ -50,7 +50,7 @@ def prog_info(): Depends on: python, python-simplejson - + Usage : $ ./deegger.py FORMAT TEXT M3U_DIR @@ -81,8 +81,8 @@ class DeeGGer(Thread): os.makedirs(self.m3u_dir) self.m3u_file = self.m3u_dir + os.sep + 'deegger_' + self.text.replace('/', '_') + '.' + self.format + '.m3u' self.m3u = M3UPlaylist(self.m3u_file) - - self.n = range(0,128) + + self.n = 4 self.media_q = 'intitle:"index.of" "parent directory" "size" "last modified" "description" [snd] (%s) -inurl:(jsp|php|html|aspx|htm|cf|shtml|lyrics|index|%s|%ss) -gallery -intitle:"last modified"' % (self.format, self.format, self.format) #self.media_q = 'intitle:"index.of" [snd] (%s) -inurl:(jsp|php|html|aspx|htm|cf|shtml|lyrics|index|%s|%ss) -gallery' % (self.format, self.format, self.format) self.q = '%s %s' % (self.text, self.media_q) @@ -90,7 +90,7 @@ class DeeGGer(Thread): def google_search(self): results = [] - for j in self.n: + for j in range(0,self.n): page = str(j*4) query = urllib.urlencode({'q' : self.q, 'start': page}) url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&%s' % (query) @@ -105,9 +105,22 @@ class DeeGGer(Thread): return results def run(self): + print self.results + print len(self.results) + i = 0 + parsers = [] + media_list = [] for result in self.results: - m = UrlMediaParser(self.format, self.text, result, self.m3u) - m.start() + if result: + parsers.append(UrlMediaParser(self.format, self.text, result)) + try: + list = parsers[i].start() + if list: + i += 1 + self.m3u.put(list) + except: + continue + self.m3u.close() class M3UPlaylist: @@ -116,12 +129,13 @@ class M3UPlaylist: self.m3u_file = m3u_file self.m3u = open(self.m3u_file, 'w') self.init_m3u() - + def init_m3u(self): self.m3u.write('#EXTM3U\n') self.m3u.flush() def put(self, url_list): + #print url_list for url in url_list: info = '#EXTINF:'',%s' % (url +'\n') self.m3u.write(info) @@ -133,12 +147,11 @@ class M3UPlaylist: class UrlMediaParser(Thread): - def __init__(self, format, text, results, m3u): + def __init__(self, format, text, results): Thread.__init__(self) self.format = format self.text = text self.results = results - self.m3u = m3u self.url = self.results['unescapedUrl'] def is_in_multiple_case(self, _string, text): @@ -167,12 +180,9 @@ class UrlMediaParser(Thread): media_list.append(self.url + file_name) except: pass - - if media_list: - #print media_list - self.m3u.put(media_list) - self.m3u.close() + if media_list: + return media_list def main(): if len(sys.argv) == 4: -- 2.39.5