My one line usefull commands

convert png file, keeping full color (either convert will reduce color space to 1bit our colormap) if it do not loose anything
Apply convert @ -crop 600x580+100+0 -gravity Center -auto-level -define png:format=png32 output/@ to *

Copy a webpage for local viewing, recursive but not the entire www 😉

wget -r -k -Dhost.com http://www.host.com/webpage

ubuntu package related :

dpkg -l nvidia* #list all package starting with nvidia
dpkg -S /usr/include/GL/glext.h #find which package provide a file

libGL.so compil problem

From time to time, on my ubuntu 11.10, i have link error like “undefined reference to glGetQueryObjectui64v”.
This is because an unidentify package update break libGL.so symlink in
/usr/lib or /usr/lib/x86_64-linux-gnu

The best solution I found is to manually
“sudo rm libGL.so libGL.so.1”
and to “ln -s nvidia-current/libGL.so .” in usr/lib
and “ln -s ../libGL.so .” in /usr/lib/x86_64-linux-gnu
and so on with libGL.so.1 if needed ..

Title Capitalization

Not to myself : how to capitalize an English paper title :
Rule 8
Always capitalize the first and last words of titles of publications regardless of their parts of speech. Capitalize other words within titles, including the short verb forms Is, Are, and Be.
Exception:
Do not capitalize little words within titles such as a, an, the, but, as, if, and, or, nor, or prepositions, regardless of their length.

Examples:
The Day of the Jackal
What Color Is Your Parachute?
A Tale of Two Cities
From :
http://www.grammarbook.com/punctuation/capital.asp
and referenced by Siggraph publications instructions

Release and Debug with Cmake and QtCreator

I have used qmake for a while and the debug_and_release facilities to have both debug and release version of my code (with different executable, different build tress …)
Now I use cmake and qtcreator on a regular basis, to obtain the same behavior I have found the following approach :

in my CMakeLists.txtm something like

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib-debug)
set(LIB_INSTALL_DIR ${CMAKE_SOURCE_DIR}/lib-debug)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin-dbg)
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
set(LIB_INSTALL_DIR ${CMAKE_SOURCE_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
endif()

in QtCreator :
First time you open a CMakeLists.txt, simply choose a build dir (some thing like XXX/qtcreator-build) and run cmake,
then go to Tab projects->edit build configuration -> add -> clone selected
Chage build dir (something like XXX/qtcreator-build-dbg) and click “Run cmake”
In the Arguments edit line enter -DCMAKE_BUILD_TYPE=Debug
You can check that in run settings, working directory has changed to the new bin-dbg directory …

Install (and develop in) cuda under ubuntu 11.10

What you need for cuda with ubuntu 11.10 :

Download and install cudatoolkit (4.1.28) and gpucomputingsdk nvidia download page
You also need last driver (either with a ppa package or direct from nvidia).

chmod +x cudatoolkit_4.1.28_linux_64_ubuntu11.04.run
./cudatoolkit_4.1.28_linux_64_ubuntu11.04.run
#-> /home/XXX/cuda for instance
chmod +x gpucomputingsdk_4.1.28_linux.run
./gpucomputingsdk_4.1.28_linux.run
#-> /home/XXX/NVIDIA_GPU_Computing_SDK
# indicate cuda install dir

I choose to install both in my home dir. Cuda need gcc 4.4 (not 4.6 which is default in ubuntu 11.10) if not installed
sudo apt-get install gcc-4.4 g++-4.4
then the simplest solution i’ve found is

ln -s /usr/bin/gcc-4.4 ~/cuda/bin/gcc
ln -s /usr/bin/g++-4.4 ~/cuda/bin/g++

Add lib and bin dir to path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH/XXX/cuda/lib64; export PATH=$PATH:XXX/cuda/bin

cuda sdk needs also Xi Xmu and glut
sudo apt-get install libxi-dev libxmu-dev freeglut3-dev
and I don’t know why, but libcuda.so wasn’t linked from /usr/lib/nvidia-current to /usr/lib/ so you need to add the symlink
sudo ln -s nvidia-current/libcuda.so .

And to compile NVIDIA_GPU_Computing,
one need also to modify common.mk to use g++-4.4/gcc-4.4 in place of g++/gcc
in ~/NVIDIA_GPU_Computing_SDK/C/common/common.mk
~/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/common_cudalib.mk common_npplib.mk
~/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/UtilNPP/defines.mk
change
CXX := g++ -fPIC
CC := gcc -fPIC
LINK := g++ -fPIC

into
CXX := g++-4.4 -fPIC
CC := gcc-4.4 -fPIC
LINK := g++-4.4 -fPIC

A last thing is cuda sdk provides GL/* headers which are not compatible with some of my code, so I need to remove the directory found here ~/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/inc/GL

SIGGRAPH deadline

A SIGGRAPH deadline can be tough, here is my desk in “normal time” and “right after the deadline” (pass your mouse on the image).

Install non-free latex fonts

sudo getnonfreefonts-sys --all
It includes luximono (and luximono.sty) for latex, a nice fixedwidth font with all typeface included (blod, italics) I use this one for listings (lstlistings, algorithmic etc …)

And now for something completly different :
Install ms font in linux :
sudo apt-get install msttcorefonts ttf-ms-fonts
sudo fc-cache -f -v

Blogs I follow

Here is a list of blog I follow on a regular basis (by rss syndication)

Some are very active (several post a day) some less (one post a year) but worse it 😉
Beautiful Pixels [RSS]

Beyond3D News [RSS]

c0de517e [RSS]

Chris Hecker’s Website – Recently Changed Articles [RSS]

Confetti Special FX [RSS]

Deano’s Home From Home [RSS]

Diary of a Graphics Programmer [RSS]

DirectX Developer Blog [RSS]

Gamasutra Feature Articles [RSS]

GameDev.net – Latest Articles and Columns [RSS]

GameDevKicks.com [RSS]

Gates 381 [RSS]

Geeks3D.com [RSS]

GT Rendu [RSS]

Guru3d Latest Headlines [RSS]

Guru3d.com Latest Articles [RSS]

Humus [RSS]

I Get Your Fail [RSS]

Icare3D Blog [RSS]

Industrial Arithmetic [RSS]

John Ratcliff’s Code Suppository [RSS]

Ke-Sen Huang’s Conference Paper List [RSS]

Legalize Adulthood! [RSS]

level of detail [RSS]

Lost in the Triangles [RSS]

MeshLab Stuff [RSS]

NVIDIA Developer News [RSS]

On the path with a ramblin’ man, by jollyjeffers [RSS]

Pandemonium [RSS]

PC Perspective Articles Feed [RSS]

PC Perspective News Feed[RSS]

Pete Shirley’s Graphics Blog[RSS]

Pixels, Too Many..[RSS]

Ray Tracing News [RSS]

Real-Time Rendering [RSS]

realtimecollisiondetection.net – the blog [RSS]

Recherche : Evénements et manifestations [RSS]

Recherche : Tous les communiqués [RSS]

Recherche : Tous les discours [RSS]

TomF’s Tech Blog [RSS]

bash prompt

my current simple prompt was

PPWD=”pwd | awk ‘{print \”…\” substr(\$0,length()-25,26)}'”
PS1=”::[\033[01;34m]\$($PPWD)[\033[00m]\$ ”
in .bashrc

but I found another more complicated 😉 one here which gives nicer results (do not cut a directory name in the middle
https://wiki.archlinux.org/index.php/Color_Bash_Prompt

##################################################
# Fancy PWD display function
##################################################
# The home directory (HOME) is replaced with a ~
# The last pwdmaxlen characters of the PWD are displayed
# Leading partial directory names are striped off
# /home/me/stuff -> ~/stuff if USER=me
# /usr/share/big_dir_name -> ../share/big_dir_name if pwdmaxlen=20
##################################################
bash_prompt_command() {
# How many characters of the $PWD should be kept
local pwdmaxlen=32
# Indicate that there has been dir truncation
local trunc_symbol="..."
local dir=${PWD##*/}
pwdmaxlen=$(( ( pwdmaxlen < ${#dir} ) ? ${#dir} : pwdmaxlen ))
NEW_PWD=${PWD/#$HOME/\~}
local pwdoffset=$(( ${#NEW_PWD} - pwdmaxlen ))
if [ ${pwdoffset} -gt "0" ]
then
NEW_PWD=${NEW_PWD:$pwdoffset:$pwdmaxlen}
NEW_PWD=${trunc_symbol}/${NEW_PWD#*/}
fi
}
bash_prompt() {
case $TERM in
xterm*|rxvt*)
local TITLEBAR='\[\033]0;\u:${NEW_PWD}\007\]'
;;
*)
local TITLEBAR=""
;;
esac
local NONE="\[\033[0m\]" # unsets color to term's fg color

# regular colors
local K=”\[\033[0;30m\]” # black
local R=”\[\033[0;31m\]” # red
local G=”\[\033[0;32m\]” # green
local Y=”\[\033[0;33m\]” # yellow
local B=”\[\033[0;34m\]” # blue
local M=”\[\033[0;35m\]” # magenta
local C=”\[\033[0;36m\]” # cyan
local W=”\[\033[0;37m\]” # white

# emphasized (bolded) colors
local EMK=”\[\033[1;30m\]”
local EMR=”\[\033[1;31m\]”
local EMG=”\[\033[1;32m\]”
local EMY=”\[\033[1;33m\]”
local EMB=”\[\033[1;34m\]”
local EMM=”\[\033[1;35m\]”
local EMC=”\[\033[1;36m\]”
local EMW=”\[\033[1;37m\]”

# background colors
local BGK=”\[\033[40m\]”
local BGR=”\[\033[41m\]”
local BGG=”\[\033[42m\]”
local BGY=”\[\033[43m\]”
local BGB=”\[\033[44m\]”
local BGM=”\[\033[45m\]”
local BGC=”\[\033[46m\]”
local BGW=”\[\033[47m\]”

local UC=$W # user’s color
[ $UID -eq “0” ] && UC=$R # root’s color

PS1=”$TITLEBAR${EMY}::${EMB}\${NEW_PWD}${EMY}]${UC}\\$ ${NONE}”
# without colors: PS1=”[\u@\h \${NEW_PWD}]\\$ ”
# extra backslash in front of \$ to make bash colorize the prompt
}

PROMPT_COMMAND=bash_prompt_command
bash_prompt
unset bash_prompt