Friday, July 10, 2009

Compiz giving me a headache

A while ago after disabling compiz to do some troubleshoot on some applications, I got some trouble trying to enabling it again, I was constantly getting the following message:

/usr/bin/compiz.real (core) - Error: Could not acquire compositing manager selection on screen 0 display ":0.0"
/usr/bin/compiz.real (core) - Fatal: No manageable screens found on display :0.0

after some googling I came to this solution:

- run in the terminal
gconftool-2 --set --type=bool /apps/metacity/general/compositing_manager false

- logout/in and we're ready to re-enable the wonderful desktop effects!

Tuesday, June 30, 2009

Vim in hexadecimal mode

To set your favourite text editor to edit your files in hexadecimal you may use in normal mode:

:%!xxd

and to get back to ascii mode:

:%!xxd -r

Thursday, May 28, 2009

Dump terminal output to a file

Easy way to redirect the output of a command to both file and terminal:

bash$ my_command 2>&1 | tee my_log.txt

Great =)

Monday, May 25, 2009

Killing processes started in the current terminal

Imagine you're running some application, lets call it "foo", using an unix user shared with your work colleagues, and this application is also launched by them at the same time you're working. So along the time you may have several instances of this application, several processes with distinct PIDs. And all the sudden you need to kill all the instances that you previously launched but you need to avoid to kill the ones being used by your fellow colleagues. This is one way to do the trick.

Start by retrieving your tty (teletypewriter),

bash$ tty
/dev/pts/4

And then kill the process "foo" for the current "tty" you're using,

bash$ kill `ps -le | grep foo | grep "pts/4" | cut -d" " -f6 `


PS: If know a way to include the retrieval of the tty inside the grep command let know =)

Wednesday, April 29, 2009

Rename all files in one folder

This is a little tip for you, and a remider for me :P
bash $ for i in *;do mv $i `echo $i | sed 's/pattern/newpattern/'`; done

Sunday, April 26, 2009

Ubuntu 9.04

Have you noticed a image on the right of this blog saying that Ubuntu 9.04 is out?!
Well it is, so go and check it out, it has a lot of new stuff, is has a faster boot time than ever, and it's free, and open source!

So move your bottoms and download it!

Tuesday, April 14, 2009

CodeCodex

Good site that i found the other day when i was searching some solutions for some code i was doing at work.

CodeCodex is a online shared code repository for people that don't want to reinvent the whe

(I love quoting site descriptions)

What is CodeCodex?

CodeCodex is a wiki for finding and improving code. Stop reinventing the wheel. Use CodeCodex to:
Browse and use pre-written code.
Learn new algorithms and methods for common programming tasks.
Use code in your own projects and submit new code for the community.
Improve performance of code in the repository and the organization of the library.

What's different about CodeCodex?

CodeCodex isn't just another code repository; it's a place where developers can actively engage with others to improve quantity and quality of the library. CodeCodex is the first online code library that captures the infinitely iterative nature of a wiki and uses it to constantly increase the quality of the library.

http://codecodex.com/
http://codecodex.com/wiki/index.php?title=Category:Java (Java category)

If you're into software coding you can help improving this site sending your own solution and algorithms!