Wednesday, October 31, 2007

C/C++ Show macros

In gcc or g++, to show all of the macros that are defined for a given platform:
gcc -dM -E test.c
or
g++ -dM -E test.cpp

Sunday, October 28, 2007

Ubuntu - core dump

From https://answers.launchpad.net/ubuntu/+question/10616
It appears that resource limits (which include the maximum size of a core dump file) are set by PAM on login. The settings for these limits are in /etc/security/limits.conf, which on my system (which is unmodified) is comments only. A quick look at the source code suggests that the default core dump limit is 0 (zero), which means no dump at all is created (even though the message suggests otherwise).

In summary: edit /etc/security/limits.conf, set the core limit to be non-zero (measured in kilobytes), and log in again.

I hope that works!

Thursday, October 11, 2007

VIM - omnicppcomplete

I had to put these in my ~/.vimrc to get omnicppcomplete to work
autocmd BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main

"ctags
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>

"omnicppcomplete
imap <C-Space> <C-x><C-o>
let OmniCpp_MayCompleteDot = 0
let OmniCpp_MayCompleteArrow = 0

VIM - NERDTree plugin

Good file explorer.

plugin: link

Add this to ~/.vimrc
"NERDTree Toggle
noremap <Leader>][ :NERDTreeToggle

Tuesday, October 9, 2007

Ubuntu - Install dev man pages

sudo apt-get install manpages-dev manpages-posix-dev

Tuesday, October 2, 2007

Linux - xbindkeys for Logitech G5

This is my ~/.xbindkeysrc for my Logitech G5:
"/usr/bin/xvkbd -xsendevent -text "\[Return]""
m:0x0 + b:8
"/usr/bin/xvkbd -xsendevent -text "\[Alt]\[Left]""
m:0x0 + b:7
"/usr/bin/xvkbd -xsendevent -text "\[Alt]\[Right]""
m:0x0 + b:6

Additional help: link