Wednesday, February 8, 2012

Reducing the Size of the Roaming Profile

I have a roaming profile for Windows that can be accessed from any computer on the intranet. When the profile is too large, it takes a long time to log in and out, since so much data has to be downloaded and uploaded.

Two apps that affect the size of the profile are NetBeans and Thunderbird. By default, the user files are placed in the profile. A third app is DropBox. That is a real killer.

NetBeans

First, close NetBeans.

To move the user files for NetBeans, navigate to the install dir for NetBeans and modify
/etc/netbeans.conf

Look for
netbeans_default_userdir=.....

Change it to the new location. Use ${varname} to include environment variables.

If an environment variable is used, this will change the location of the file for all new configurations.

Thunderbird

First, close Thunderbird.

To move the user file for Thunderbird, modify the profiles.ini in the AppData folder.
In Windows, type %appdata% from the run... option in the Start menu to open the AppData folder.

Change to the Thunderbird folder. The profiles.ini file is here. Edit it and change two things:
IsRelative=0
Path=C:\........

Move the default profile folder that is in the Profiles folder to the new location.

This only moves a profile that already exists. I do not know how to change the initial location of the profile.

Dropbox

From the Dropbox preferences, select a new location for the Dropbox files. Caution: The Dropbox folder cannot be placed on a network share. Dropbox can not tell the difference between "The share folder is not available" and "The user just deleted all the files in the share".





Check out my other blog post on moving Dropbox out of the roaming profile.

Saturday, February 4, 2012

Connecting X11 without ssh

I have a situation where ssh -X is too limiting for what I need to do.

I have the ability to sudo to any user account on a remote Linux machine.
I am not able to log in as root.

ssh -X works perfectly for connecting as me to the remote machine. I am able to open X windows programs. Once I change to another user, I am unable to execute X windows programs.

I found a solution after reading several helpful posts:
http://hints.macworld.com/article.php?story=20081208062918906
http://dragonwall.net/xdeep-putty.html

I enable X11 listening on my Mac.
defaults write org.x.X11 nolisten_tcp 0
If xwin is running, stop it and restart it.

At first, I opened port 6000 to allow access to the display. After reading the comments about opening port 6000 through the firewall, I realized I needed to connect via the VPN to the remote computer.
http://www.publicvpn.com/support/MacOSX105.php

I connected to my VPN. The link above did not use PPP, so I had to make that modification to the steps. I was able to connect.

I am using a Mac, so I could open a terminal. The prompt at the terminal window indicated that I was connected to the VPN. I issued ifconfig to get the local ip address from the VPN.

I issued ssh to connect to the remote computer. I did not use -X, since tunneling will not work when I change to another user.

At the remote command prompt, I set the display environment variable to the ip address of the local VPN address, adding :0 to the end.
setenv DISPLAY xxx.xxx.xxx.xxx:0

I tested opening an xterm as me. It worked.

I changed to a different user and opened an xterm. It worked.

I checked that the firewall was still blocking port 6000. The port is only accessible through the VPN.

After all this, opening the application that I need takes too much time. It will be faster to drive to the remote location and log into the machine to do the work I need to do.

I will disable X11 listening on my Mac.
defaults write org.x.X11 nolisten_tcp 1



Next attempt.

I have the MS Office suite on my Mac. It has Remote Desktop Connection. I can use it to log into the remote computer.

The remote computer is Windows 7, but it has cygwin installed on it. I followed these steps:
  1. Connect to VPN.
  2. Remote Desktop to remote Windows 7 computer (local.name).
  3. Open cygwin bash shell.
  4. Issue startxwin command in /usr/bin
  5. Open xterm
  6. Enabled xhost connections for remote Linux host (remote.name): xhost +remote.name
  7. ssh without X11 tunneling to remote Linux host.
  8. Set DISPLAY to local.name:0
  9. Change to different user and open xwin application.
  10. The GUI app opened immediately.

Tuesday, January 31, 2012

Installing LXDE in Fedora 16

Installing LXDE in Fedora 16


I used the Add/Remove software application in the Gnome desktop to install LXDE desktop.
From terminal: yum install @lxde-desktop

I used Add/Remove software application to install KDE Login Manager.
KDE Login Manager is not needed, as GNOME manager now has option to change desktop.

I used yum to install system-switch-display-manager-gnome.

I ran the system-switch-displaymanager and used KDE manager.

Restarted X.

Selected LXDE from login manager.

On VirtualBox 4.1.8 on mac, use fn+host+f1-f6 to switch virtual terminal. f1 has first GUI.

Thursday, January 26, 2012

Fedora 16 in VirtualBox

I downloaded the Live Install for Fedora 16.

I created a vdi virtual drive.

I installed Fedora.

All is good.

The install is limited to a small screen. In order to Fedora to use the full screen, the Additions must be installed.

From the VBox Device menu, choose Install Guest Additions.

Authenticate with the su password.

An error appeared about kernel-devel-... missing.

I opened a terminal window and switched to su.

yum install kernel-devel-...

Closed the window for the guest additions, but left the terminal open.

Forced an unmount to the Guest Additions, from the Device->CD menu.

Reran guest additions.

Error: could not find gcc.

Back in terminal window, did following (-y answers yes to all questions):
yum -y update kernel
yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
Reran additions. All OK.

Logged out/logged in. Full screen works.

Host key is right-control key, by default.

Host-F toggles full screen; Host-Home opens VBox menu.

Friday, December 30, 2011

JavaMail

I am using JavaMail to try to send mail.

I am using smtp as the protocol.

I had to add authentication for the connection.

if (mailhost != null)
props.put("mail." + prot + ".host", mailhost);
if (auth) {
props.put("mail.smtp.starttls.enable","true");
props.put("mail." + prot + ".auth", "true");
}

I had to use the keytool program to add a certificate for the server. The easiest way was to open the server authentication in Thunderbird and export the certificate, then use the keytool to import the certificate to the cacerts file.

\Program Files (x86)\Java\jdk1.6.0_20\jre\bin\keytool" -import -file c:\Users\me\server.com.crt -alias myHost -keystore ..\lib\security\cacerts

This worked for one of my mail servers, but did not work for my school server. The error I received was:

ADDRESS FAILED:
com.sun.mail.smtp.SMTPAddressFailedException: 554 : Relay access denied

After reading online, it dawned on me that I cannot use the mail server when I am not on the domain. I connected to the domain with a VPN and the mail was sent.

My third domain still does not authenticate. I have followed the steps for the other two, but I am still receiving the error that a certificate cannot be found. The strange thing is that this is the server for the ISP that I am using to connect to the internet. Maybe I don't need authentication? BINGO!!! It worked without authentication.

Monday, December 26, 2011

Learning Spring

I am using the book Spring in Action, 3rd edition, Walls, to learn about the Spring framework.

I have been following the examples in the book. Everything has worked until the Java configuration at the end of chapter 3. Two jar files are needed to run Spring with Java configuration: asm.jar and cgilib.jar.

Actually, that didn't work. I am using Spring 3.0 and the Java config is now part of the core. The problem is with the cgilib that is used in the library. I added cgilib-nodep.jar at the head of the classpath and it works.

Saturday, August 13, 2011

Hibernate Tools in Eclipse

Hibernate Tools in Eclipse

I am a NetBeans user and am attempting to learn to use Eclipse.

The Hibernate Tools have a package for Eclipse, but I have not found one for NetBeans. This is why I am trying to learn Eclipse.

Eclipse and Ubuntu follow a similar naming device for versions. Eclipse is now up to Indigo. The previous version was Helios.

I have installed Indigo.

I am reading a page about using the JBoss Update link.

I have gone to Help -> Install New Software, selected Web and EE Developement and then Hibernate Tools. After a license screen, the tools installed. The install site is JBoss Tools Requirements - Composite Indigo RC2 Mirror - http://download.jboss.org/jbosstools/updates/indigo/RC2/

When I open the New wizard, I see the Hibernate wizards. So far so good.

I have create a new Dynamic Web Project and will now try to reverse engineer some POJO classes from my database using the Hibernate Tools.

I am following the instructions for reverse engineering POJO files.
  1. Create hibernate config file (File Name: hibernate.cfg.xml)
  2. Parent folder: HibernateReverse/src
  3. Using mysql and com.mysql.jdbc.Driver. (I do not know if this will be found, but it appeared in drop down list. In Helios, this driver did not appear.)
  4. Creating console configuration, for accessing the database without using code. The console allows me to see all the tables, etc, in the database. Good news, the wizard page has the correct appearance from the tutorial. When I tried this before (without JBoss update) the wizard was different.
  5. Added Hibernate Perspective.
  6. Tried to open console configuration, but db driver could not be found (I told you so).
  7. I will try adding an external jar. Opened project properties, selected Build Path, selected Add External Jar, pointed to the driver jar. It worked!!!
  8. I opened the console configuration and am able to view all the tables in the database.
  9. Starting the Hibernate Configuration wizard. There is a new icon for running hibernate and there is a new option under the Run menu.
  10. Double-clicked Hibernate Code Generation to get a new config. Set output folder.
  11. Select Reverse Engineer from JDBC.
  12. Create new Reverse.eng.xml. Include table(s) to process.
  13. Selected Java 5, EJB3 Annotations and Domain code. I did not select a config file option. I think that the annotations will be enough.
  14. Refresh tab: refresh workspace.
  15. Common tab: no change.
  16. Click Run. It worked!!!
Trying again a month later. Needless to say, I have forgotten everything, so I started playing around.

Once the Hibernate tools are added, there is a new icon in the tool strip. It is a green, play arrow like the other Run configurations, but it is for Hibernate. To do a reverse engineering process, select Hibernate Code Generation Configurations from that list. This option is also available at the bottom of the normal Run tool icon.

First create the console configuration for connecting to the database, then create a Hibernate Reverse Engineering configuration. The reverse engineering file can be created from there.

More Blogs

Followers