27 December 2010

Playing MIDI with Gstreamer

Yay this is cool! I finally understand how to use wildmidi.cfg :lol and playing pachelbel canon midi.


This is GPL Gravis Ultra Sound pats: http://freepats.zenvoid.org/ (download freepats-20060219.zip)
edit: and someone will release CC-BY 3.0 GM set here
for reference the original wildmidi binary can be found here

gstwildmidi (already patched, see update)

Now take a look at ".wildmidirc" inside wildmidi.7z for a while, this is a modified wildmidi.cfg from freepats which contain standard instrument channel assignment with optional tweak (amplification, sound panning etc.) at the top you'll find "dir C:\Users\Public\APPLIC~1\WildMidi" which told wildmidi where you put GUS pat (the freepats). This path by default is "C:\Documents And Settings\All Users\Application Data\WildMidi" in english Windows XP. This file need to be placed in C:\Documents And Settings\[username] a.k.a %USERPROFILE% or %HOME% or what whatever equal in your Windows.

Making a self contained PyGTK installation

Tired of figuring out dependencies? Me too
PyGTK *could* be easier to install if they adopted the way WxPython or PySide installed, which sadly this is inherently impossible. However I think there is a trick for this!

Look at pygtk.pth under [Python]\lib\site-packages folder, a pth (stand for path?) is read by python interpreter as initialization before user start importing stuff. The idea is inject PATH insertion in pygtk.pth. Note that unlike py file pth file accept only oneliner script like in "python -c" command.

Here is my modified pygtk.pth:
for python 2.7:

gtk-2.0
import sysconfig; pygtkpath=sysconfig.get_path('platlib')
import os; os.putenv("PATH", os.path.join(pygtkpath,"
gtk-2.17.2") + ";" + os.environ["PATH"])
gtk-2.0
import distutils.sysconfig, os; os.putenv('PATH', os.path.join(distutils.sysconfig.get_python_lib(),'gtk-2.17.2;') + os.getenv('PATH'))




Now put GTK runtime in [Python]\lib\site-packages\gtk-2.17.2 and you're done!
note that if you keep bin folder of GTK (not put it outside) then use "gtk-2.17.2/bin" instead of "gtk-2.17.2"

Therefor a true all-in-one installer is possible by put GTK runtime (just the dlls without redundant C devel files) together, maybe one day I'll make one...

26 December 2010

Better lockup your ftp.exe

The trend of trojan now is to download chain of actual virus (many directed to .cn domain) initiated by short innocent-look batch file then bang a fresh trojan break lose and your AV just unable to detect them :D. The use of ftp.exe (ftp command line tool in C:\Windows\System32) become more prevalent being ftp is part of Windows.

But we could still lock this downloader from being executed by applying deny (execute) rule from security tab to not only all users type but also system (hopefully the virus wont reset the acls :s). For Windows Home Edition users they must use cacls.exe command line tool to provide the same effect. Renaming or deleting it wont helped cause this operation will trigger Windows' protected system files restoration.

16 December 2010

Chrome OS soon to be released?

At least for the first time today Chromium OS reach 0.9.x version which naturally smells like beta/rc to me, visit hexxeh's snapshot build here and try it. Still downloading... this would be my first experience with Chrome/Chromium OS :)

Oh when it fully done I desperately hope SketchUp will get ported there! umm no? oh it's netbook OS not workstation :sigh:

02 December 2010

An optimistic dmraid?

It's great when ubuntu lucid detected my fakeraid several months ago though I have slight suspect it was also broke my one of array disk later. Now for stupid reason I need to move my ubuntu from dedicated OSes disk into one of my storage disks (now non-RAID). Surprise! it can't find root partition... The RAID is gone (from BIOS) but finally after googling a while there is a metadata that written in array disk that need to be cleared.

OK so how I able to type dmraid if I got no accessible Ubuntu? Tell me if I can use Ubuntu rescue mode... but I already use OpenRC liveCD instead. And here is how:

dmraid -r
--> this should show where raid metadata written in the affected disks
dmraid -r /dev/sda -E
--> this should strip metadata on each disks mentioned before

you need sudo if not root already

At first I was scare to enter those commands as I've no backup supply at the moment (what if it erase my partition table / bootloader?) but hey it works! it's totally safe :)