VNC Server displays blank grey screen

If you connect to vncserver and get a blank grey screen with a consol window then this means that the ~/.vnc/xstartup script is not initializing the windows manager correctly.

For ubuntu, edit the script (comment out lines) to the following…

#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
export XKL_XMODMAP_DISABLE=1 #require for proper keyboard mapping
gnome-session
#twm &

Then, run ‘vncserver’ to create a new session based on the above script!

Search multiple phrases in a document with Grep

The below command will show all files, recrusively for the phrases “phrase1” and “phrase2” in the / filesystem.

$ sudo grep -rl “phrase1|phrase2” /