07 September 2013

Resuming Download from Depositfiles

Don't know if someone has wrote this before (cause it's so simple). This weekend I desperately need several downloads from one of major filesharing survivor DepositFiles. The files are big and my ISP is slow (worse with shared IP). Don't want to mess with eternal redownload or mess around with onion network, I'm looking for a way to resume the download (without their downloader of course).

I found at least two ways: First to use free URL uploader service which offer resumable download or secondly using wget (or whatever downloader with resume ability).

We will need to get Depositfiles' actual link to do it, as we know the url is in this kind of form http://fileshare*depositfiles* we can use source view or built-in browser inspector to get it. Of course we should never click the download button.

Free URL uploader is probably quite risky business, I have seen this kind service very hard to survive in the past. This time I found http://d-h.st/, the site seems clean and modest but not without problem. As expected, the download is very unstable, keep broken every 1 MB. Don't worry wget will deal with it. Interestingly registration appear to be optional. Just upload and the resumable download link will be provided.

The second way need tool to kill specific TCP connection ala task manager or taskkill, I'm not aware of the availability of the tools under Windows out of box but 3rd party tools such Sysinternals TCPView or ProcessHacker will do.

Essentially what happened is when wget issue resume command the server will get "stuck" but only initially, this is when we need to close wget tcp connection. FYI, closing tcp connection is treated as disconnection from the server so wget will do retry instead of giving up. Upon retrying the "stuck" is "unlocked" and download become resumable.

Enjoy!

21 August 2013

Weeks of Maps and TPX

I've been spending 2 weeks dealing with maps for several related projects, exploring several (new to me) better projections such Cahill-Keyes-Waterman and Fuller. Probably GIS guys already knew this stuff but in case anyone (newly) interested in maps I have some tips.

OK first what about google maps, google earth or wikimapia? well if you ever find a reason for not using online resources then read on.

Since many Earth datasets has fall under public use, there are many efforts to bring "open source" friendly yet highly detailed maps for mere mortals. Unless you're GIS guys you may not need SRTM, Landsat, VMAP, WVS, CDC's shapefiles and others as there are several ready to use (or easy to setup) maps for people with zero GIS experience.

Vector maps:
- Wikipedia users have made accessible vector maps here (the most detailed svg): http://commons.wikimedia.org/wiki/File:World98%2B.svg
- Duncan Webb's Cahill-Keyes World Map (draft) : http://www.genekeyes.com/DW/DW-1.html
- Gene Keyes's map sources also made available in OOo draw format (need GIS knowledge) : http://www.genekeyes.com/MEGAMAP-BETA-2/
- CIA's factbook (less detailed but up to date) : https://www.cia.gov/library/publications/download/‎

Raster maps (not ready to use but easy to setup) :
- http://www.paulillsley.com/gia/index.html

Among above vector maps, wikipedia map probably the one that readily editable. For inkscape users, 15MB file is quite common/average but 15MB of just polyline is really heavy one! I have been using Tpx for some months now and it fulfill my need of semi-technical drawing. When I try to open World98+ map above, I thought it will suffocated but Tpx handle this file with just 60MB of RAM. Trying to do this with inkscape will freeze your computer winamp's playback -_-! But then how to edit this file efficiently?

Well in Tpx the drawing area is "barely" movable and zoomable, redraw takes several seconds (at any zoom) but no redraw for undo though. So maybe with more powerful CPU it may do. But there is easier way. Since Tpx spend little memory, you don't need to worry of running out of memory (how convenient).

Tpx don't have layering system like inkscape nor understand xref like CAD. So we do chunked file management.

- break the groups

 - copy-paste each region into new session of Tpx


remember that copy-pasted chunk will preserve coordinate/location, so to merge back simply use copy paste operation again.

- the ideal editing workspace is at country/states level:



Lesson learned:

Good application is the one that have good combination of stability and features not bloatness, and part of the stability is smart memory management. Tpx may lack much of SVG features such as gradient ramp/mesh but talk about mission critical apps: "before you can edit you need to open it!". Sorry if I sounds like making a dig to inkscape, but damn they sure know how to make bloat. I want my old sodipodi back!

 Additional note: In case you wonder how the world98+.svg created from http://commons.wikimedia.org/wiki/File:World98.svg. The metadata says:

"Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363)"

yeah a real world app huh!?

19 July 2013

The Moluccas 0.8

Version 0.8 is here. I now called it Moluccas (not to be confused as some kind of mollusca).  It can be grabbed at https://sourceforge.net/projects/tumagcc/files/0.8/

The installer is M08.exe and you can pick up which 7z packages to install (categorized) but at least "base" is mandatory. Put all in the same folder and you're ready to install. There is brief overview of what's inside in each package at the link above. It still lack of documentation though only man included.

Enjoy my biggest OSS Collection with build environment!
All suggestions are welcome.

Main changelog:

- Fixes many typos and silly mistakes when tested in Windows 7
- All executable flagged with LAA
- Simplified startup: run conemu to start (old mode console, no longer supported though possible)
- Isolation: this version use ReactOS's cmd completely so it can be run independently of Windows' cmd.
- Installation speedup: Installer will use all cores (1 core/package)
- Explorer integration is disabled to provide zero host modification during startup (can be enabled by invoke molumenu). But many gui apps still write registry entries especially MFC based one.
- Fix integration with MSVS 2010 or (later?)
- Lots of manual tweaking in GUI apps to make it tight and blend in
- Small fixes in mingw headers and xtraposix libraries

06 July 2013

Preparing version 0.8

I knew it will be more belated than previous version, this is getting bigger... Tuma MinGW 0.8 will focus on integration fixes and aim to become more established collection. On gcc side there is very little changes and will be the last with 4.7.x series (barebone 4.8.1 is provided though), originally I want to bundle static gtk libraries, but decided that's not worthy enough (I will put it up separately).

This version will have serious GUI apps addition and I have evaluate dozens of FOSS each weekend to find apps that lean and fast (avoiding .net/java whenever possible). But they're just alternative workflow from commandline counterpart which has considerable advatage. I still not quite done with cleanup so I dumped those in extratool package.

Oh yeah I want to drop the name, I think it's not a problem since it's not popular at all anyway. Candidates: celebes, moluccas or rangrang (the last is meaningful cause I love ants, they are the oldest architect)

I hope could finish it on sunday tomorrow.

27 June 2013

Node.js with posix path support

It was Mat Sutcliffe who sent me a patch to compile node.js with mingw last weekend, if I recalled node.js used to be compilable with mingw via scons but apparently they switch to gyp entirely and mingw support became broken since then. I though it was a bit weird to sent it to me, but it turn out the process would involve msys python (needed by gyp to work properly).

The patch itself is a win-win solution as it will build native win32 binary but with support for posix path (MSYS and CYGWIN) via generic mount mechanism. He further explain why he choose mount over cygpath, that is because node.js operate asynchronously so by using mount path would settled once rather repeatedly as with cygpath.

This is binary of node.js 0.10.12 (built as ./configure --gdb --without-etw --without-perfctr)
nodejs-0.10.12.7z
original patch for mingw by Mat -> replace msysmnt with mount
modified patch for mingw-w64
python msys

The functionality is implemented in path.js which is bundled inside the executable. So actually you could modify (if you wish) that part (look for mingwToWindowsPath resolvedPath) with your favorite hex editor if you don't want to recompile. Just make sure you don't add and reduce the string block length. Or if you think mingw is such mundane task feel free to apply patch only to path.js and then compile it with M$VS as usual :-)

How to build with mingw:
1. extract the source file for node.js homepage
2. download python for msys and extract to msys installation
3. download one of appropriate patches (above) put in source tree
3. start mingw, navigate to source tree and apply patch
4. ./configure [your options] (make sure that python for msys is the active one)
5. python tools/gyp_node -f make
6. LINK=g++ make -C out BUILDTYPE=Release V=1

Notes:
- I'm not sure about etw and perfctr whether those compilable with mingw but both don't compile out of box. 
- The download is contain official installation hierarchy with node.exe replaced. Since it's not installer (it make no sense anyway) I'll assume you know what to do next ;-)

Enjoy!

16 June 2013

Pinpoint, another approach for presentation

Previously I've tried fluxus for live presentation using a basically game engine + scheme scripting. Due to unresolved issue and the need to learn new language, I'm giving up and looking for much simpler alternative despite I still consider fluxus as a novel apps with no equal alternative.

Pinpoint is small, light and opengl accelerated presentation tool with a kind of magicpoint approach (you write down tagged text representation). It's similar to OSG's Present3D which is between pinpoint and fluxus in term of features, but Present3D require you to write a not-that-readable XML file instead which is nasty without the help of WYSIWYG editor. Pinpoint is simple, it has no advanced timeline/layer like in office software and geared for quick and dirty presentation. Pinpoint also feature extendable transition FX system (powered by clutter) by writing your own FX via loadable json file.

Here you go:

Static build win32, patched to make it more standalone :-)
download: pinpoint and sample+patch

notes:
- to test just drag and drop introduction.pp to pinpoint.exe
- no video support (I'm still figuring out how to build gst-ffmpeg statically) seems played but not rendered by cluttersink
- image support: png, jpg, gif
- basic FX are bundled in the executable, if you make new fx put the json file alongside the executable
- export: pdf only
- pinpoint.exe has console window, pinpointw.exe doesn't
- if you want to compile it yourself, please use gnome libraries released circa 2011 and avoid cairo 1.12.x

see their homepage to learn how to write a presentation file https://live.gnome.org/Pinpoint
Enjoy!


28 May 2013

CMD restriction bypass

Alright since I have skipped nearly the whole month, I need to buzz something at least. The tittle isn't that real, I mean I'm bored with black hack stuff at my age anyway, so this one is too obvious, legal and easy too.

How to bypass CMD restriction? Well, by using another compatible cmd of course, like the open source ReactOS (wine?) cmd.exe replacement from the ISO file (version 0.3.14 works with XP and 7). However the problem soon arise when COMSPEC get tangled in the way, for example standard system() call will still use system-wide COMSPEC (not session one). So things like for /f ... ('command') do ... wont work since it will ask blocked system's cmd.exe to launch something a.k.a %windir%\system32\cmd.exe /c bla bla.

I stumble on this case when I use my previous 7z-sfx wrapper for bat files. So I decide to put ReactOS's cmd.exe inside the sfx as workaround.

That also apply to regedit restriction which ReactOS also has the replacement, but of course there is no "such restriction" to just access registry whatsoever.


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.