25 July 2012

rsync to copy only new files

copy only new files (keep old files on server) to server.
rsync -avz -e 'ssh -i id_rsa' from/* server:~/to/
for just printing, not executing, of what it will do
-avzn

notes
  • works with local folders as well
  • auto create folder for you, no need mkdir

23 July 2012

bash script: copy to server, files that are modified today

(all in one line)

find * -mtime 0 -printf "%p " | 
awk '{print "scp -i sshid "$0" user@hostname:/path"}' | sh

copy files modified after 13 days ago
find * -mtime -13 -printf "%p " | awk '{print "cp -p "$0" ~/folder "}' | sh

20 July 2012

editing mov files in virtualdub

to be installed:
x264: x264vfw_37_2200bm_33968.exe
xvid: Xvid-1.3.2-20110601.exe
ffdshow: ffdshow_rev4422_20120409.exe
virtualdub quicktime plugin: Quicktime_VD_v0.2.0.0_bin.zip (place .vdplugin in plugins and edit Quicktime.ini line to Mode=2)
Apple Quicktime
avisynth


create a file.avs:
make sure you write the full path!!
DirectShowSource("c:\locationto\video.mov")

You can now open a .mov file in virtual dub. (ぱちぱち)
For compression, I currently use xvid, which converts a 22 minutes-ish .mov 1.9Gb video file to a 361mb .avi (resolution is 640x480).

Any Video Converter is a good encoder, though it has a suspicious name... but i need more compression, virtualdub may do it... i guess.

source

17 July 2012

valgrind

there are times when the code works in mac while it breaks in ubuntu.
munmap_chunk(): invalid pointer
the problem was that i was trying to set a minus array id.
this was found by
valgrind --leak-check=full --memcheck:leak-check=full --show-reachable=yes -v ./programName

21 June 2012

Compiling in Emacs (MacOSX 10.6)

when compiling gtkmm (installed with MacPorts) in emacs, command not found message appeared.
solution:
in ~/.emacs
;;; A quick & ugly PATH solution to Emacs on Mac OSX
(if (string-equal "darwin" (symbol-name system-type))
  (setenv "PATH" (concat "/opt/local/bin:/opt/local/sbin:" (getenv "PATH"))))
restart emacs

source

11 June 2012

pybotwar 0.7

must use pygame 1.9.1
I uses 64 bit install
SDL framework from Xcode build, make sure it's for MacOSX 10.6, uses Standard DMG, and x86_64, copy SDL.framework at build/Release/ to /Library/Frameworks
SDL_* frameworks from http://www.libsdl.org/
smpeg, universal means 32 bit and 64 bit both installed
sudo port install smpeg +universal
source

ld: framework not found SDL
problem is:
/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/Frameworks -> /Library/Frameworks
so:
cd /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks/
ln -s Frameworks/*.framework .

source

06 June 2012

pybotwar

to work in ubuntu karmic 9.10

versions:
pybotwar-0.7
pybox2d-2.0.2b2
python 2.6.4

download http://code.google.com/p/pybox2d/downloads/list
unzip pybox2d-2.0.2b2.zip
cd Box2D-2.0.2b2
sudo python setup.py install

download http://code.google.com/p/pybotwar/downloads/list
change in world.py to work with Box2D-2.0.2b2
self.turretjoint = w.CreateJoint(jointDef)#.getAsType()

run game
cd pybotwar
python main.py