Posts

Showing posts from February, 2011

Useful for commands : find, grep

Sample use of 'find' >> find location -name ' string name or something ' >> find location -name ' string name or something ' | xargs command >> find / -type f | xargs grep -l pattern or from current working dir >> find . -type f | xargs grep -l ' string that you want ' Sample use of 'grep' >> grep -r ' string you want ' # -l that display only filename. >> grep -rl 'string you want'

New Python Expression (for me) :P

1. >>> if 2 <= len(something) <= 3: oppp 2. >>> var1 = var2 if condition true else var 3 It means > IF condition true: var1 = var2 ELSE: var1 = var3 oh man , just like ruby syntax or ruby like this :P

About datetime module and JSON

import datetime import simplejson as json >> Encoder dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime.datetime) else None json.dumps(datetime.datetime.now(), default=dthandler) >> Decoder try: v = datetime.datetime.strptime(v, '%Y-%m-%dT%H:%M:%S.%f) except ValueError: try: v = datetime.datetime.strptime(v, '%Y-%m-%d').date() except ValueError: ..........

SVN Something to do when CONFLICT appear.

(p) postpone - mark the conflict to be resolved later (df) diff-full - show all changes made to merged file (e) edit - change merged file in an editor (r) resolved - accept merged version of file (mf) mine-full - accept my version of entire file (ignore their changes) (tf) theirs-full - accept their version of entire file (lose my changes) (l) launch - launch external tool to resolve conflict (h) help - show this list

Resolved between kvm and virtualbox

I'm already install virtualbox and happy with it, but some bad accident I damnly install kvm for unknown purpose! and I dont wanna use it , then I sweetly go back to virtualbox , So sadly it shout at me by 'something not work with kvm and you need to recomplie kernel.......' and dont work for me, ..... here is solution!!! >>> modprobe -r kvm_intel from Munzir Taha (https://bugs.launchpad.net/ubuntu/+source/virtualbox-ose/+bug/292588) Very Thank

How to use SCREEN app from Red Hat Magazine

http://magazine.redhat.com/2007/09/27/a-guide-to-gnu-screen/ I think Its great stuff , so Very Thank RedHat Magazine