27 April 2012

Multiple Google Drive (Do It Yourself)

Google head to cloud! started with Google Drive, a 5GB (free) file synchronization service application based on Python 2.6 and wxWidget (similar to dropbox). If you haven't notice it, google drive during startup extract itself into temporary folder (_MEI???) where python do its stuff.

How? well not too dissimilar from dropbox trick:

Download it first (I hate to download a downloader that claiming as installer, screw it!)
one of mirror:
http://v2.nonxt6.c.pack.google.com/edgedl/drive/1.0.2891.6813/gsync.msi

Once it installed "silently" you will find it in %PROGRAMFILES%\Google\Drive
I believe that's what you get if you're administrator

Copy all files, make a folder [somewhere] and paste there

Copy following text into notepad:

@ECHO OFF
:: NOT FOR EXPLOITATION!
SET USERNAME=Tukul
SET USERPROFILE=%~dp0%USERNAME%
MD "%USERPROFILE%\AppData\Roaming">nul
MD "%USERPROFILE%\AppData\Local\Application Data">nul
MD "%USERPROFILE%\Application Data">nul
MD "%USERPROFILE%\Local Settings\Application Data">nul
MD "%USERPROFILE%\My Documents">nul
MD "%USERPROFILE%\Documents">nul
START googledrivesync


Save above as "gdloader.bat" (you may change "Tukul" to anything else, just be descriptive) in [somewhere]
Run gdloader.bat,  You know what to do next!

make another copies if you want another Google Drive (be sure name different %USERNAME%)


Notes:
- Apparently when google do shell registration (shortly after finishing folder setup), Google Drive will nuke current account like crazy (at least in my XP) but that's okay, no worries
- As usual only one account that get file markings (checked icon etc...)
- Tested in XP go try yourself on other Windows!

15 April 2012

Statistics and Windows users

Not much to say this weekend so I make up this...

Looking at some statistics data sometime can be fun and give you some unexpected conclusion. Here is some trivia about this blog based on Google Analytics.

- "Borderline" article is always popular among Windows users, my two hackish article about two popular apps: sketchup and dropbox prove that. While dropbox article got linked many times the sketchup article traffic is barely came from Google search. Imagine if I wrote another similar hackish articles I bet this blog will no longer an open source blog. But I do intentionally lure visitors to peek on other articles (OSS) in the process however thats doesn't seems quite work according to statistics.

- Blogspot give you a bad name. At least thats what I felt in my country where majority blogs is aggregator or worse a duplicator :-) It's hard to believe the content of a blog is original even for myself. The abundant numbers of "peek and leave" visitors and the very low number of commenter come to mind. Even when the article is valid to their search.

- A portion of commenter and reader are Linux users despite linux platform represent less than 10% of total visitors! quite surprising. Ha ha see what a Windows diehard could attract :-)

- Decreasing Indonesian visitors, quite a sad fact. Somehow I believe I have good rank toward Indonesian googlers, but it's just open source + windows are very unpopular topic. Majority Indonesian open source users are IT students/graduates whom taught to use linux while the rest people like me have the Windows tendency. At some point I even consider to publish article in bilingual format to pump more native visitors but statistics say the targets here is by far lower than those developed countries such as Europe and US.

- Windows users don't/won't download unless something come with line: "This software has been scanned by forty something AV before uploaded even so you must scan it by yourself after download". I need to do comparison with others to came with this conclusion though. Thanks! this is the best heritage for becoming windows users. Be afraid people, be very afraid... virus is everywhere... Wow I must be very lucky still running XP with no active AV (just ClamWin) and still providing clean downloads ho ho.

- Open Source is the domain of developed countries (both developers and users). I hope I'm wrong but thats what the statistics say. Aside Japan/China which might have language barrier most visitors are US and Europe. Kind of irony but the reality show that crackers win the heart of most Windows users in developing countries. Piracy crushed open source in all sensible way :-)) I thought both are practically compatible...

04 April 2012

New mirror available at googlecode

Hi all, due to bandwidth issue that keep hitting this blog,  I decide to mirror several files to code.google.com/p/osspack32. I have use the command line uploader from google and seems I can handle small files myself but big files is will be kindly uploaded by ShoneCheung. If you want to be commiters (uploader) too please contact me.

Thanks

02 April 2012

Continued... PHP and nginx

Tonight I try to resume what I left yesterday: setting up php with nginx. I try to follow http://wiki.nginx.org/PHPFastCGIOnWindows, but since I have single exe php-cgi I would just copy it and php.ini into nginx folder. Thus use non-hardcoded path configuration:

Before that I have to comment about the RunHiddenConsole thing, in PE thingy this is just a matter of using -mwindows or -mconsole during compile. And there is a better tool called postw32 (from freepascal project, I included this in my mingw build) which could turn any console application into consoleless a.k.a "click and nothing seems to happened" (because it was already windowless) or vice versa (back to console again).

so inside conf\nginx.conf instead of:

root c:/www;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}


I just need (merely replace /scripts with  $document_root  from stocked config):

location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}


Both configuration assumed we have virgin php.ini (doc_root has empty value, do not confuse with nginx's   $document_root  above which translate root declaration before it that is "html" which refer to html folder relative to where nginx.exe located). In short we have portable configuration.

Now talk about respawning thingy... in the bottom part of the wiki before describe how to make it run under SYSTEM account. Well let me tell you something:
AFAIK we (as admin) could impersonate to SYSTEM using "at" (scheduler) command then kill "explorer.exe" just before launched and bang Windows P4WN3D and CHR00T3D! no no not that old trick, actually the proper way is to use "sc" command see below:

C:\Users\Administrator>sc create --help
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] ...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= (default = own)
start= (default = demand)
error= (default = normal)
binPath=
group= 
tag=  
depend=
obj= (default = LocalSystem)
DisplayName=
password=


Extra Extremely Important Note: That is an empty space right after equal sign and before the actual value.

Now we could even make php as service too that depends on nginx service, or run them under different credential (a hidden user preferably, you know like postgresql way). Nginx already have respawning (parent - child) facility adding it to relaunching service will increase its reliability more too.

Hmm.. I will make my own stack installer one day maybe came up with tagline: "Install and run in 5 seconds yet takes only 10MB of space" Yeah whatever, but I really hope this will become a fine release and get it's own page in the main menu of my blog. Certainly need more testing


It's Just Wrong: MSYS Python

I thought it would be helpful to have python which understand both posix path and windows path: MSYS version of python that is. In my old review about MinGW python, this kind of build already hampered with incompatibilities especially due to python heavily rely on inconsistent "defines" across modules sometime use uname() then sys.platform then posix or not (os.name).. meh.. this make workaround also inconsistent.

What did I tried is even worse:
- with uname = msys it's unknown system to python fine lets change it to cygwin, well this will create another problem since msys is not cygwin (different runtime unlike MinGW vs MSVC) its c modules should have different suffix to avoid python try to load native win32 module by accident (I set it to .myd meh...). Note: "msys" or "cygwin" or "mingw" is a hardcoded value that returned by sys.platform it can be only changed via hex editing once python.exe compiled
- distutils which used when building extension then would call uname (unlike mingw or msvc) to decide platform / compiler flags etc and what you get is insane name: MINGW32_NT-5.1-1.0.17(0.48/3/2) <- yes there even slashes there :-)
- unlike mingw build which can be changed to win32 (hardcodedly) to provide more compatibility thats not the case for msys which the only possible option is cygwin with above quirks.
- many c-extension tests failed! not really a problem if we just want barebone or purelibs though

In the end I decide to edit ntpath.py and site.py of native msvc python to make it use "/" under msys, this again have its own quirks too: win32 python need to use ";" as path separator which ":" already used as driveletter and because it doesn't know root "/". Meh...

Anyway here is the msys binaries of python 2.6.7: python-2.6.7_msys.7z (sources and patches from cygwin repo)

01 April 2012

NginX-svn4568 MinGW Win32

Want to test more my php-cgi (mingw build) last week but feel bothered to install/setup apache...

Building is quite straightforward, do not download from nginx.org instead take the svn trunk source code at svn://svn.nginx.org/nginx/trunk and modify ngx_atomic.h@24 to include defined __MINGW32__ then depends on which mingw api you use you may encountered conflicting off_t

$ configure --with-pcre=/local/php --with-zlib=/local/php --with-libatomic=/local/php --with-openss
l=/local/php --with-ipv6 --with-http_xslt_module --with-http_geoip_module --with-http_image_filter_
module --with-md5=auto/lib/md5 --with-sha1=auto/lib/sha1 --with-http_ssl_module --with-mail --with-
mail_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with
-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --wit
h-http_random_index_module --with-http_stub_status_module --with-select_module


note:  --with-md5=auto/lib/md5 --with-sha1=auto/lib/sha1  not required if you have openssl

the configure/conf kind a odd though (or it just me?) that I need to edit the final objs/makefile from strayed path including changing NGX_PREFIX into "./" (hmm not sure about it, but kinda works)

Download:
nginx-svn4568.7z
Well at least I'm greeted with "Welcome to nginx!", time to set up with php... oh remind me old days!

26 March 2012

Curl 7.24 with IPv6

cURL is a sophisticated downloader (okay, plus many others) utility that except for spider/batch is way better than wget. I decided to build this one because oddly enough the official build did not support IPv6, I noticed it when building PHP last week which by default when built with MSVC curl will have IPv6 but not with MinGW. The issue is in auto-generated curl_config.h file which have bogus values despite claiming (on screen) that it was configured with IPv6 enabled.

Okay enough talking here is two flavor of cURL:

cURL.exe 773KB with SSH, SSL(OpenSSL 1.0.1), IPv6, Asynchronous-DNS, RTMP, SSPI, IDN (via libidn) and WinLDAP
cURL_vista.exe 739KB same as above except IDN is natively supported that's why it need at least Vista

23 March 2012

Static build PHP 5.4.0 with MinGW

Experimental fully static build of PHP 5.4.0 with moderate bundled extensions compiled with MinGW. Though not supported, PHP turned out can be built with modern GCC under windows as long as we specify the correct  _WIN32_WINNT. Most features can be enabled too with exception dotnet module due to insufficient headers and libraries and also Zend inline optimization need to be disabled.

The CLI version has readline support in interactive mode (good for learning) similar to those linux build.

Configuration:
configure --enable-static --enable-embed=static --disable-fpm --disable-posix --disable-inline-optimization --enable-fd-setsize=256 --enable-maintainer-zts --disable-shared --with-readline --with-openssl --with-zlib --with-bz2 --enable-zip --with-libxml-dir --with-libexpat-dir --with-xsl --enable-wddx --enable-soap --with-xmlrpc --with-gd --with-jpeg-dir --with-png-dir --with-vpx-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-t1lib --enable-exif --enable-calendar --with-curl --with-curlwrappers --enable-ftp --with-libmbfl --with-onig --enable-mbstring --enable-sockets --enable-shmop --enable-bcmath --with-gmp --enable-intl --with-icu-dir --with-pspell --with-iconv-dir --with-gettext --with-mhash --with-mcrypt --with-tidy --with-ldap --with-imap --with-snmp --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pgsql --with-pdo-pgsql --with-pdo-odbc=generic,/usr/local,odbc32 --with-pdo-dblib --with-db4 --enable-dba --with-custom-odbc CUSTOM_ODBC_LIBS=-lodbc32
Autotools configuration should not be used since it missing winsock awareness and can be replaced by supplied win32 config (used for MSVC). Being a static build means all extensions are loaded at startup therefor it's quite a dog for repetitive processing but convenient enough for interactive mode.

CGI: php-cgi.exe 8.45MB
CLI: php.exe 8.44MB

For more detailed info, use php-cgi -i > config.html

update: php-5.4.10 static binary (mingw patch and hints included)

15 March 2012

My Dropbox is choked


Error (509)
This account's public links are generating too much traffic and have been temporarily disabled!


A reader notify me this morning that my dropbox account is not usable. I currently very busy with projects and don't know if I could mirror them to my another dropbox account (that's 2GB upload for my poor 128Kbps connection). This make me wonder whether my blog is popular? for ~300hits/day? I don't think so. Let see if my account could back to normal again or else.. well.. I don't know what to do. Help me? anyone? sourceforge? googlecode? because this issue would hit back again in the future since this is the first time.

If anyone interested to help please email me, I'll give my account credentials

My apology

edit:
according to this thread http://forums.dropbox.com/topic.php?id=52227
my account possibly reach 10GB/day.. seriously? How come?
anyway any volunteer? a very kind person with decent bandwidth :-) just to mirror the files to another free file hosting, I'd be very grateful!

edit:
since no one replied, this weekend I will start move all download links into one page possibly "other builds" then start mirroring to other account (will takes sometime). I believe that 10GB/day quota provided by dropbox is more than sufficient and very generous at it, what happened is probably someone spread a public link recklessly? I need to change the links in the future once in a while deliberately.

edit:
took longer than I thought.. downloads will spread into two dropbox account and now partially available again. Package larger than 50MB will stayed disabled until banning lifted up. Guess I need onr more account to balance the quota

edit:
Apparently it's not a regular 72-hours suspension from dropbox (Sadly my request for inquiry regarding the issue hasn't been replied), I will resume the remaining mirroring and all new download will be passed to goo.gl link shortener so it can be monitored but remained a "direct link"

04 March 2012

Ported LADSPA plugins collection

Hundreds of ladspa plugins for Windows!

Originally I want to try interesting ffmpeg branch here https://gitorious.org/~saste/ffmpeg/sastes-ffmpeg which if works would make ffmpeg a formidable both audio and video editor. Alas after porting many of those plugins, I have no idea how to apply them in ffmpeg :-( with a little change in af_ladspa.c ffmpeg could load and initialize ladspa correctly but that's all it refuse to be applied when input is video (saying invalid src) and completely ignored if input is audio.

Anyhow all is not lost, these plugins still work with audacity or lmms. Few interesting audio effects: rubberband, caps, calf, pvoc and more.. some are generator/synth though

To install
Audacity: copy files inside ladspa folder into [Audacity]\Plug-Ins
LMMS: extract archive to [LMMS]\plugins
FFMPEG: extract archive to the same place where ffmpeg.exe reside (applicable to my ffmpeg-aoutuv build only)


Demo:

Download
ladspa.7z (5.6 MB) enjoy!

Changelog:
16 October 2012

- rebuild some core2 optimized plugins into sse3 optimized, strip debug symbols
- remove some crasher plugins
- add plugins from FAUST, OOM, StudioBlood and axonlib

To port invada-ladspa, I made this small static library containing srand48, drand48 and etc functions taken from libnewlib 1.18 xrand48.7z