Saturday, March 1, 2008

DVD read trouble

Is in many cases due do missing decryption. As root do:

apt-get install libdvdcss2
/usr/share/doc/libdvdread3/install-css.sh

Starting hidden Cygwin apps

For example the X server is nice to have started without an extra annoying console window.

Before you do anything else, make sure you have your cygwin bin directory in you Windows system PATH. Cygwing programs expects certain .dll files to be found, which are stored in there.

Download the great little utility hstart

Copy your C:\cygwin\Cygwin.bat to another bat file (C:\cygwin\Cygwin_hidden.bat). Alter it as follows.

@echo off

C:
chdir C:\cygwin\bin

C:\your_personal_bin_bath\hstart.exe /NOWINDOW "bash --login -i %1"

..or since the hstart utility is small and self-contained, just slip it into the C:\WINDOWS\system32 directory and replace the last line with this:

hstart.exe /NOWINDOW "bash --login -i %1"

Please note the quotes. Now change the Cygwin link you want to start hidden (X-Cygwin for example) to point to the new bat file instead.

If you want to start X-Cygwin completly hidden (i.e. even without the xterm), edit the file /usr/X11R6/lib/X11/xinit/xinitrc and replace the line

#exec xterm -e /usr/bin/bash -l
exec xclock -geometry 100x130+1700+0

(You seem to need at least one X application to prevent the X server from terminating).

Tune your start app with standard X command line options.

If you drag X-Cygwin link to your autostart, you'll end up having X running in the background and combined with the hints in the previous post you have something almost Linux like ;)

Staring Linux apps on your Windows host.

Staring Linux apps on your Windows host.

  • First of all, install Cygwin (and make sure that you've included X).
After installation, alter your system path to the Cygwin bin directory. This is needed for Windows to find Cygwins .dll files. Right-click on "your computer" on the desktop, select the advanced tab and click on "environment variables". In the "system" section, find the Path variable and add the new path last (C:\cygwin\bin;).
  • Create a directory ~/bin and a file ~/.bash_profile and in the latter add (at least) the following lines:

export PATH=~/bin:$PATH
export DISPLAY=:0.0


  • Create a ssh key binding to the machine you want to use (see previous post)

  • Make an association in windows to .sh files with bash (right-click on any .sh.file and select "open with")
To associate bash scripts with Cygwing you'll need to alter the key in regedit. Find the key:

HKEY_CLASSES_ROOT\sh_auto_file\shell\open\command

  • Change it's default value from:

"C:\cygwin\bin\bash.exe" "%1"

to:

"C:\cygwin\bin\bash.exe" "-l" "%1"

  • Now create some start scripts in ~/bin. For each command/application you want to run on the remote mashine, create a .sh script with the same name in the form:

~/bin/acommand.sh
===============
#!/bin/bash

ssh -X server acommand

(replace "acommand" with your application/command name and "server" with the name of your server)

  • Drag a shortcut to you desktop and click it - voilĂ ! (make sure you've started X first though, in case you want to run graphical apps).