Všetky príspevky miro

Various helpful commands in unix/linux

MP3 to WAV using ‚mplayer‘:

for i in *.mp3; do mplayer -ao pcm:file="${i}.wav" "$i" ; done

Computer timed Shutdown

shuts down in a hour:
sudo shutdown -Ph +60
cancel shutdown
sudo shutdown -c

Create thumbnails from images using ‚convert‘

mkdir thumbs
for file in `ls -1 * 2>/dev/null`
   echo $file
   convert $file -resize 25% thumbs/$file

2009-10-24 13:52:41
Various kinds of loop on files in directory

for file in <directory>/*
   echo $file
   mv -f $file <another dir>

The is a problem with this for loop : if the directory is empty body of the loop is executed nevertheless with the variable file set to ‚<directory>/*‘

Another solution with the for loop :

for file in `ls -1 <directory>/* 2>/dev/null‘
   echo $file
   mv -f $file <another dir>

You can also use a while loop :

ls -1 <directory>/* 2>/dev/null |
while read file
   echo $file
   mv -f $file <another dir>

2009-10-24 21:19:37
Samba – mount remote dir

K krusaderovi napisat do prikazoveho riadku:

vypyta si login / pwd – zadaj uzivatela s heslom


Ciel bude napr:  smb://share@

2009-11-04 22:00:15
Get audio track from movie

mplayer -vc null -vo null -ao pcm:fast source.avi

put audio track back into the movie:

mencoder source.avi -o destination.avi -ovc copy -audiofile noveaudio.mpeg2 -oac copy

Change movie audio track codec from AC to MPEG:

mencoder source.avi -o destination.avi -ovc copy -oac mp3lame

list of supported audio codecs:
mencoder -oac help

2010-10-05 22:36:42

skus cez wget, do shellu hod: wget –save-cookies=./kolace "https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi" -O /dev/null
–post-data="login=krasko&password=123456" so svojim loginom a heslom.
Nasledne sa ti vytvori subor kolace, potom si sprav subor zoznam do ktoreho si nakoporuj linky a spustis to takto: wget –load-cookies=./kolace -c -i zoznam .
A tot vse 😉

ja pouzivam command-line ‚wget‘, ten vie so spravnymi prepinacmi spravit jednoducho pekny komplet mirror webstranky.

wget -m -l 1 -k -c "http://stranka"
-m : mirror (shortcut for -N -r -l inf –no-remove-listing.)
-l : max depth level 1
-k : convert links to local
-c : continue if you broken download

2010-12-01 10:07:14
How to find unix distribution

works mostly:
CYGWIN_NT-5.1 <pc_name> 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin

if not then try:
lsb_release -a
LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Release:        5.4
Codename:       Tikanga

or try:
cat /etc/issue
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel r on an m

How to setup project in KDevelop

novy projekt:

zalozka vpravo – Automake manager
 – v hornej casti klikni na ikonku ‚add new subproject‘ a zadaj jeho meno, napriklad ‚src‘. Bez subprojektu by sa linky
    na cpp subory pridavali priamo do projektoveho adresara. Takto budu pridavane do podadresara ‚src‘
 – v hornej casti vyber projekt ‚src‘ a klikni na ikonku ‚add target‘ a zadaj meno cieloveho executable
 – v dolnej casti sa zobrazi <meno exe>( Program in bin ), okrem povodneho (header in noinst) (ale ten tam nebude kedze sme v podprojekte)
 – cpp ktore pridas do tohoto noveho itemu sa budu kompilovat
 – v menu / Project /  Project Options nastav Configure Options pre tvoj config, pravdepodobne ‚debug‘. Do C/C++
    preprocessor daj cesty ku libkam, do Linker flags daj libky. V zalozke C++ mozes pridat definy,
    napr "-O0 -g3 -D_UNIX -D_DEBUG"
    Tieto nastavenia netreba nastavovat v Automake manageri cez ikonku kluca. Netreba tam nic vyplnat, vsetko
    sa nastavuje v Project options.
 – spusti Build / run Automake & friends
 – spusti Build / run Config
 – spusti Build / Build project
 – po kompilacii nastav v zalozke Run options nastav parametre pre spustanie. Napriklad
    executable: /home/mirex/work/biturn_svn/BiturnGtkmmKdev/debug
    Debug arguments: 002131080.C3 002131080.lwo -log 3 –general-owauto 1
    Working directory: /home/mirex/work/biturn_svn/BiturnGtkmmKdev/debug/src

2010-02-12 23:43:44
Error: "collect2: ld returned 1 exit status"
Can mean: you don’t have disk space left for linking the library.

Gamedev.net contacts

15.7. – 24.7.
2D sidescrolling comic-fighting: programmer needed = http://www.gamedev.net/community/forums/topic.asp?topic_id=542063
Comic-style graphic designer available = http://www.gamedev.net/community/forums/topic.asp?topic_id=542080 ( Pehkis_FIN )
Need Programmer for 2d Platformer = http://www.gamedev.net/community/forums/topic.asp?topic_id=541993 ( Rusty Knight X )
Composer / Producer looking for work = http://www.gamedev.net/community/forums/topic.asp?topic_id=541824 ( Hargne )
Programmer wanted. = http://www.gamedev.net/community/forums/topic.asp?topic_id=541491 ( Subterfuge , 2d platformer )


 I’m programmer who wants to make a platformer game. Here I can show you some details on a 2D engine I’m making: http://tery.mypage.sk/dokuwiki/doku.php?id=tery:features and here you can see a downloadable one-level-demo: http://tery.mypage.sk/public_temp/Tery_080610.rar

Write me back and tell me if you’re interested.

 Cheers !

2009-07-25 22:23:20
8.7. – 14.7.

PARPG – isometric 2d RPG looking for programmers, artists & game mechanics designers = http://www.gamedev.net/community/forums/topic.asp?topic_id=524199 ( mvBarracuda , post-apocalyptic RPG )

2D GameEditor = http://game-editor.com/wiki/Features

2D Artist Looking for a Project = http://www.gamedev.net/community/forums/topic.asp?topic_id=540669 ( cybertronics )

2d Shooter Needs Art, Music Content = http://www.gamedev.net/community/forums/topic.asp?topic_id=540545

Looking for Programmer for Indie Action Game!! = http://www.gamedev.net/community/forums/topic.asp?topic_id=540449 ( MurnauGames )

2009-08-04 02:03:19
another resume?


I’d like to apply. I’m a programmer, who has been programming for a long time and also tried to develop a game. I did try it with team of people but it has died on lack of interest from other team-members. I would like to create a platformer game.

I have already started a old-school platformer engine. Here are the specs so you can see if it suits your needs:
– runs on PC, possible to run on Windows/Linux, Mac
– has in-game level editor and scripts editor
– variable screen resolutions available, color depth is limited to 8 bits (256 colors)
– uses sprite bitmap graphics ( so no special effects are possible, like blur, precise rotations, transparencies etc )

Here is wiki webpage of the engine http://tery.mypage.sk where you can see screenshots and information on it. And try to download and play one level of simple platformer I made http://tery.mypage.sk/public_temp/Tery_080610.rar .

2009-08-15 10:28:18
25.7 – 11.8

Pixel Art Workshop – Art Shop – http://workshop.blodyavenger.com/# (BloodyAvenger) – http://www.gamedev.net/community/forums/topic.asp?topic_id=542868
free sprites / sprites to buy / to do.

2D Action-Shooter Game Looking for Lead Artist and Lead Programmer – http://www.gamedev.net/community/forums/topic.asp?topic_id=542934 (Game_Architect)

Team for 2D platformer shoot’emup – http://www.gamedev.net/community/forums/topic.asp?topic_id=540216 ( Penguz )

[indie] 2d artist seeks awesome programmer! – http://www.gamedev.net/community/forums/topic.asp?topic_id=543958 (mockra)

Positioning device

VisioMax – reseller company for technology – http://www.visionmaxint.com/html/01_company/03-partners.htm
VrLogic – producing tracking devices – http://vrlogic.com/html/tracking_systems.html
xsens.com – tracking devices, MTi-G and MTx , mailed them, they replied.
Wear it at work – http://hackedgadgets.com/2008/11/17/precision-position-system-not-based-on-gps/

diskusia – /id/4729311

Segfaults in MSVC9, does not in KDevelop

Biturn segfaulted on 3d file preview, but only in winxp. Solved by setting main class to static in main(). Reason ? There is some memory allocation at the place where it segfaults, and it probably taken up all memory.


malloc() are using memory from stack. They should be replaced with calls to new() which allocs from heap.

2009-06-03 18:01:30
< tdb> mirex: Windows has a considerably smaller stack than Linux, so
             it’s very much possible that your object is causing a stack
             overflow.  Static local variables go in the data section and not

MS VS Express 2008

– it does not contain MFC ( CWnd, CString etc. )
– you can’t call win32 api functions from Windows API ( SYSTEMTIME, GetSystemTime )

For win32 api possibilities install PlatformSDK 2003Server –


After Platform SDK installation run "Windows SDK Configuration Tool" from start-menu and select SDK version 6.1, so from now on VS will use this SDK.

2009-03-23 22:03:55
– in VS 2008 Express there is used  "_vsnprintf", so in Tery it makes conflicts. "_vsnprintf" has to be defined only for VS8.

    #if ( _MSC_VER >= 1400 )
        #define snprintf _snprintf
    // only required for Visual Studio 8
    #if ( _MSC_VER == 1400 )
        #define vsnprintf _vsnprintf

– when including windows.h I have to be sure to use #define WIN32_LEAN_AND_MEAN so that some includes are not processed. They generate "#define PlaySound PlaySoundA" and that conflicts with my code.