20070203

voice copy



#!/usr/bin/perl

use File::Copy;

if ($ARGV[0] =~ /\/$/) {
$src = $ARGV[0];
} else {
$src = $ARGV[0] . "/";
}
if ($ARGV[1] =~ /\/$/) {
$dst = $ARGV[1];
} else {
$dst = $ARGV[1] . "/";
}

opendir(DIRHANDLE, $src) || die "Cannot opendir $src: $!";
foreach $fname (readdir(DIRHANDLE)) {
if (!($fname =~ /^\./))
{
$file = $src . $fname;
@t = localtime ( ( ( stat ( $file ) ) [9] ) );
@f = split(/[(.]/,$fname);
$s = sprintf("@f[0]_%04d%02d%02d_%02d%02d%02d.wav",$t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0]);
printf("%s\t%s\n",$file,$dst . $s);
copy($file, $dst . $s) || die "Cannot rename $file to $s: $!";
}
}
closedir(DIRHANDLE);







  • Platform : Unix
  • Script : perl
  • desc :

    An improved version that copies the files from source directory to destination directory after renaming.


voice rename


1 #!/usr/bin/perl
2
3
foreach(@ARGV){
4 @t = localtime ( ( ( stat ( $_ ) ) [9] ) );
5 @f = split(/[(.]/,$_);
6 $s = sprintf("@f[0]_%04d%02d%02d_%02d%02d%02d.wav",$t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0]);
7 printf("%s\t%s\n",$_,$s);
8 rename($_,$s) || die "Cannot rename $_ to $s: $!";
9 }



  • Platform : perl
  • Script : Rename voice files
  • desc :

    This is a script to batch rename the voice calls recorded on my phone to __


20060920

ScrapBook Relink


// ==UserScript==
// @name Relink profile -> scrapbook
// @namespace
// @description

// @include http://www.orkut.com/ScrapBook.aspx*
// ==/UserScript==

(function() {
i=document.lastChild.lastChild.childNodes[7].lastChild.firstChild.childNodes[5].childNodes[7].lastChild.childNodes[2].firstChild.childNodes[1].lastChild.childNodes;

var l = i.length-5;
for (var j=6; j<l; j+=4) {

var link = i[j].childNodes[5].childNodes[1].childNodes[1];
var linkparts = link.getAttribute("href").split("?");

link.setAttribute("href", "/ScrapBook.aspx"+"?"+linkparts[1]);
}
})();



  • Platform : Firefox (independent)
  • Script : JavaScript (Grease monkey)
  • desc :

    This script relinks the names in scrap book point to the authors scrap book than the Profile. The picture is still referenced to the Profile. speeds up orkutting a lot with keyboard lovers.


20060904

Send message to all on trillian


Opt("WinTitleMatchMode", 1)
WinWaitActive ("k_deepu_yadav")
AutoItSetOption ( "SendKeyDelay" , 1000)
While 1
Send("^v{ENTER}!{F4}{DOWN}{ENTER}")
WEnd



  • Platform : windows
  • Script : autoit
  • desc :

    Trillian unlike Y! msgr lacks the send all feature for offline contacts. This script creates a macro to send the msg to all


accept (default) answer for Internet Download accelerator


Opt("WinTitleMatchMode", 1)
While 1
WinWaitActive ("Confirmation")
Send("{ENTER}")
WEnd


  • Platform : windows
  • Script : autoit
  • desc :

    IDA uses 60 second time out to accept default answer but it holds up the slot on job queue. This makes it unsuitable for downloading the file tree like a linux distro. This script reduces the time out to null:P


Reconnect Freedom after Two hour Time out


run("C:\Java\JRE15~1.0_0\bin\javaw.exe -jar C:\Freedom\freedom.jar", "C:\Freedom")
While 1
WinWaitActive("Your Freedom 2006")

ProcessClose ( "javaw.exe" )
ProcessWaitClose ( "javaw.exe" )

run("C:\Java\JRE15~1.0_0\bin\javaw.exe -jar C:\Freedom\freedom.jar", "C:\Freedom")
WEnd


  • Platform : windows

  • Script : autoit

  • desc :

    The 'Your Freedom' servers follow a policy to disconnect the free accounts after 120min(which used to be 240min earlier.) This scripts watches for the warning/info window and reconnects the service by killing and creating another instance of freedom.


  • ToDo :

    You need to select the option to autoconnect in freedom. Also it would be advisable to have the minimise on startup option enabled.


  • alt :

    The process manager shows 3-5% CPU usage, which is quite high for a dormant process. Though it did not slow down my machine, an efficient solution would be to remove the loop and schedule it to runevery 2hrs using scheduled jobs in windows.