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 

result:

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

Then:
* Ubuntu 11.04 – with gdm

sudo vim /etc/gdm/custom.conf

File contents:

[security]
DisallowTCP=false

* Ubuntu 11.10 – with lightdm

sudo vim /etc/lightdm/lightdm.conf

File contents:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
xserver-allow-tcp=true

Other useful params of lightdm.conf file:
http://hmontoliu.blogspot.com/2011_10_01_archive.html

Sample rdesktop launcher

#!/bin/bash
#*************************************************
#	2011-10-10 By Piotr Zuk
#*************************************************
# Needed 3rdparty: 
# - http://www.semicomplete.com/projects/xdotool/
#*************************************************

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
TITLE="MyWindowsRemoteDesktop"

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

rdesktop -u piotr.zuk -g 1280x1024 -a 24 -D -T $TITLE 10.2.135.133 &
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
done

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]
“AllowFontAntiAlias”=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations]
"AllowFontAntiAlias"=dword:00000001

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
http://forum.xda-developers.com/showpost.php?p=16261675&postcount=220
http://forum.xda-developers.com/showthread.php?t=710805

FB VNC server
http://code.google.com/p/android-vnc/

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.