20 April 2013

Make your FFmpeg talk back

Yeah tonight I just realize ffplay can talk lol! ffplay can talk when it have flite capability (see my FFmpeg aoTuV build). It's quite old fashioned and amusing, in ffmpeg it can serve as either for auto narration or as text to speech synth.

Via ffplay just do this:
ffplay -f lavfi flite=text='Whats up Doc?'

Might can be used with zenity as text reader or reminder or whatever fun

SHC 3.8.9 MSYS port

To continue previous post, I actually port shc-3.8.9 quite long time ago for fun. But now I want to see if it can act as a wrapper for shellscript (bash/perl) under plain cmd box. And boom it failed :-))

SHC is actually an encryptor not compiler, with time trial feature (not tested). I don't quite remember anymore how I patched this little tool. But as usual MSYS is lacking this and that so it need bandage or cutoff :)

SHC however does need compiler (msysdev-gcc) to build its decryptor along the launcher itself. I have tested it under bash and it works fine. Under cmd box things are bit vague, it seems like:

decryptor -> look for shell (based on shebang?) -> found, sh launched -> ...WTF?... -> launch new cmd.exe session (again) instead

Hmmm

anyway it works for MSYS :-p

Download: http://osspack32.googlecode.com/files/shc-3.8.9.7z

Note make sure msysdev-gcc is ready and always use the -T option of shc

A Simple BAT to EXE Wrapper

I'm looking for a straightforward way to execute bat file inside bash and vice versa (execute shellscript in cmd box). At first I thinking about an encrypter that store content of batch file as string that later feed into shell invocation. But that's appear to be daunting to me right now :-D

I look around sourceforge and codeplex for existing solution, as expected there are several project based on 7z sfx but all of them (sorry if I missed) popped up new cmd window and can't work when called from PATH environment (aka different Curernt Directory).

So I decide to take 7zip SFX source code and apply some patches:

- To have 3 predefined environment variables replacement at RunProgram:
   %%T=temp directory where bat file extracted (supplied by oficial 7zip)
   %%S=path where sfx module located that is the exe file (similar to 7zsfxmod)
   %%W=path of current directory where sfx called (this is what I need)
- Assign CreateProcess's ApplicationName as COMSPEC environment
- Disabling progress bar, thus no need to set Progress="no"
- Redirect IO and prevent popped up windows as described in SO question here
- Finally, Change the sfx's submodule from gui to console using editbin or postw32 (of freepascal)

And it works :) (for my case)

Here you go:
http://osspack32.googlecode.com/files/7zSDcon.sfx

the patched main.cpp of SFXsetup (CPP) and the example converted bat (my old app Cabit, a Cabinet archiver):
http://osspack32.googlecode.com/files/cabit.exe
it use config file:

;!@Install@!UTF-8!
RunProgram="/c cd /d %%W && %%T\\cabit.bat "
;!@InstallEnd@!

Meaning after extraction run cabit.bat under the corrected working directory. Also note the extra space after the bat filename is important otherwise argument will not passed.
Then as usual do copy /b  7zSDcon.sfx+config.7z+cabit.7z cabit.exe

Unfortunately Igor Pavlov haven't publish the source code of his super small sfx (only 27kb) otherwise it would be neater.

I might gonna make sfxmaker or sort of with PE resource/icon insertion ability. Should be easy using wrc and linkres2exe tools.

07 April 2013

To collaborate Tuma MinGW

I'm reflecting on Tuma MinGW future at the moment. I could push another point release for sure, but unlikely reach 1.0 milestone. Few weeks ago a developer offer me a help to turn Tuma MinGW into something like Gentoo, a self construct distro with fully automated updating/rebuild concept which I half heartedly had to reject as it will goes "by developer for developer" way. But the main reason is because I doubt its feasibility. There are many attempt with similar ideas in the past, but most went niche or failed. Me too want to go niche, making it console oriented distro (something that "nicely" oppose the Windows way).

The buildbot,  I used to make buildscript to compile stuff (still for some case) but after see how diverse is build systems under Windows, I'm quite overwhelmed.

My plan is if it goes 1.0 I want to put it like msysgit repo at github, rebranding it with new name (I call it cbonk, english: tadpole) and invite collaboration. But github only offer 1GB of realistic space. Sourceforge IMO is the best at hosting big files (even ISO files) and have rsync too. I once complain at git irc about how git doing initial clone by tarballing and fetch it in plain non-resumable and inefficient http download but they had no answer for that, quite a hell for people like me. Yesterday I tried this "Github for Windows" which turn out to be a "slow motion" application based on .NET which emptied my RAM after about 100 files of 10 MB commit. I'm thinking of distribute Tuma MinGW into several repos with one as base and the rest as module. Does this need a trick?

I realize that it's bad to have repo of binaries especially at this scale maybe I should packed each application as tarball and use spkg to install/remove this way it might fit to the 1GB barrier, or maybe just get rid several compilers? I still have several to do lists to be addressed for 0.8, mostly integration work, going further I want to pimp many things using zenity to make it much friendlier without going GUIsh. hmm... clueless

Another dropbox failed

Ah I'm not learning from past experience to stop using dropbox for crucial files in this blog, look now, many images are goner. >,<

Yeah I finally lose another dropbox account few days ago.

I really wish Google stop their menacing "chrome 'em all" campaign, first blogger's image uploader always fail under Opera browser (otherwise I'd not use dropbox), then translate.google.com behave infinite recursed iframe  under non-chrome browse, then they stop providing pr0n friendly google image too, ok the latter is irrelevant.

But dear Google, I'd never use your browser until it could run under Guest account (or much restricted one if any)! I'm a privacy freak, I'll eliminate all updater (*pointing at google and others) that try to run without my consent, I visit sites with multiple level of proxy (stupid government, they put most of global internet access redirected to Singapore) and I mostly browse in private mode with alias of course. Oh and I avoid "please invade my privacy by default" OS such as Windows 8.

Back to dropbox, I have made backup to several place although wont do it to all files. Sorry

02 April 2013

Stardict console native version

Console version of StarDict http://sdcv.sourceforge.net/

The application itself is quite old but still usable (suitable for non-unicode and non-html dicts). Here is single executable native version sdcv.exe

example:

Enter word or phrase: tuma
Found 3 items, similar to tuma.
-->The CMU Pronouncing Dictionary
-->tuma

'tu:m\u0259

-->Kamus Besar Bahasa Indonesia, Edisi III (2005)
-->tuma

tu.ma
[n] kutu (di kepala dsb)

-->P\u0101li-English Dictionary (Pali Text Society)
-->tuma

(pron.–adj.) [most likely apostrophe form of \u0101tuma =att\u0101, Sk. \u0101tman self; cp. alsoSk. tman oneself. See Oldenberg, KZ. XXV.319. Less likely=Sk. tva one or the other (Kern, Toev. s.
 v.). Expl d) by Com. to A III.124 as esa.] oneself, himself, etc.; every or anybody (=quisque) ya\u1e43 tumo karissati tumo va tena paññ\u0101yissati (quid quisque faciat) Vin II.186=A III.124; Sn 890 (cp. \u0101tum\u0101na\u1e43 V.888), 908; Pv III.2 (4) (=att\u0101na\u1e43 PvA 181).

Enter word or phrase:

Download: http://osspack32.googlecode.com/files/sdcv.exe

you'll need to set environment variable STARDICT_DATA_DIR pointing to your dic folder (of Stardict) or use --data-dir option.

Enjoy!

oh and to quit press Ctrl-d not the usual Ctrl-c