How to enable remote access to Xserver on Ubuntu 11.04 and Ubuntu 11.10

First of all remove -nolisten tcp from /etc/X11/xinit/xserverrc file:

cat /etc/X11/xinit/xserverrc 


#exec /usr/bin/X -nolisten tcp "$@"
exec /usr/bin/X "$@"

* Ubuntu 11.04 – with gdm

sudo vim /etc/gdm/custom.conf

File contents:


* Ubuntu 11.10 – with lightdm

sudo vim /etc/lightdm/lightdm.conf

File contents:


Other useful params of lightdm.conf file:


Sample rdesktop launcher

#	2011-10-10 By Piotr Zuk
# Needed 3rdparty: 
# -

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

#kill previous instance
WID=`xdotool search "$TITLE" | head -1`
for id in $WID; do
  xdotool windowkill $id

rdesktop -u piotr.zuk -g 1280x1024 -a 24 -D -T $TITLE &
usleep 800000
WID=`xdotool search "$TITLE" | head -1`
for id in $WID; do
  echo $id
  #xdotool windowsize $id 500 500
  xdotool windowmove $id 0 0

to enable sound, just add -rsound:local param.

How to set 24bit colors and antialiasing on WindowsXP client using rdesktop on Linux

Add Keys to Windows registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations]

Run Group Policy Editor (exec gpedit.msc)
In the GPE:
Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Terminal Services
Once you click on Terminal Services look in the right TAB and search for Limit Maximum Color Depth. It will probably have status Disabled by default. Right click on it and go Properties. The Properties window will open up. On the Setting TAB select Enable and at Color Depth select whatever you want (i.e. 24 bit)

How to run VNC server on Android mobile device

There are two familiar VNC servers for Android devices:

Droid VNC server

FB VNC server

to run fbvncserver on real not rooted device you must do:

1. copy fbvncserver to /data/local
2. run fbvncserver: type adb shell data/local/fbvncserver (now server is running on port 5901). Maybe you will see permission denied error, so type adb shell, than cd to data/local and type chmod 777 fbvncserver
3. run adb forward tcp:5901 tcp:5901
4. run for example xvncviewer or any VNC viewer, and connect to localhost::5901

Printing to PDF with cups-pdf

Printing to PDF like to regular printer is very easy. To prepare such a printer we need to follow by few steps:

Install cups-pdf by using:
$ sudo apt-get install cups-pdf

Edit configuration file /etc/cups/cupsd.conf and set:

RunAsUser No

Restart cupsys:
$ sudo /etc/init.d/cupsys restart

Add a new printer. Click System->Administration->Printing. Choose “Add Printer”, then select “Generic CUPS-PDF Printer” and click “Forward”. Input name of your printer and click “Apply”.

Now you should have well configured and working new printer in your system. To test it open any text file and try to print it.
Newly created PDF files are stored in your $HOME/PDF folder.