Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Thursday, May 03, 2007

Downgrade default JRE on windows XP

When installing Blackberry signature keys yesterday, I need to downgrade my default JRE on windows XP from 1.6 to 1.5. (Java is so good at maintaining backward compatibility, I seriously want to figure out what made the installation process not working in Java1.6. If you have a clue, please comment. Thanks.)

The complexity of this process caught me off guard. As a linux user, I instinctively went to My Computer --> Properties --> Advanced --> Environment Variables, and set the pathes. It doesn't work this way though. (Gentoo users, enjoy your java-config util and laught at me)

After some digging, here are the steps worked for me.

  1. Copy java.exe, java2.exe, javaws.exe from C:\Program Files\Java\jdk1.5.0_??\bin to C:\WINDOWS\system32\ to overwrite existing 1.6 version files.
  2. Open registry editor, goto Start --> Run, type in "regedit" and enter.
  3. Do a search for "JavaSoft", you should find something under HKEY_LOCAL_MACHINE -->SOFTWARE --> JavaSoft --> Java Runtime Environment, modify "CurrentVersion" key to "1.5" or the version you want.
  4. Update the correspondent environment variables.

Monday, April 23, 2007

Accessing remote X-window from windows box

This is not pretty, but it's needed sometimes. (Yeah, I know, your company made you use windows)

There is a good deal of information on this wiki page about Cygwin/X. But to me it seems like too much information so I simplified it for my own reference.

Here are three simple steps to access remote X after you get Cygwin with X installed:

  1. open a Cygwin window and start X server: X -multiwindow &
  2. export DISPLAY=127.0.0.1:0.0
  3. ssh -X username@remote.server
  4. run xclock (personally I prefer xeyes) to test
One thing to keep in mind is that the remote server has to enable X11 forwarding. It is configed in sshd config file /etc/ssh/sshd_config. Search for X11Forwarding.

That is it. If you prefer putty which is another nice tool I use occationally. You can do this:
  1. open a Cygwin window and start X server: X -multiwindow &
  2. Open putty, in Connection --> SSH --> X11 tab, check the box "Enable X11 Forwarding".
  3. Login and you are done, now open an X app like xclock or xeyes, you should see it.

Thursday, December 07, 2006

Copy files from windows to linux

Setting up a cron job to transfer files among linux boxes is easy. But when you mix some windows boxes into the picture, things get complicated. That is because most windows boxes don't have ssh daemon setup.

But one thing you can do is to run pscp on windows to fetch files from Linux. You can download pscp here http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

To get started you make a .bat file like this on your windows box: c:\path\to\pscp.exe –pw password username@host.of.linux:/path/to/file c:\path\to\destination
Then you use windows scheduler to schedule a task to run this batch file.

Of course to make it more secure (or just for the peace of mind) you want to hide your password, you can use a public/private key pair. For details reference this doc: http://www.tartarus.org/~simon/puttydoc/Chapter5.html