Wednesday Nov 12, 2008

OpenSolaris x86 Triple Heading

So I finally got tired of gentoo and emerge -pvDp world. Since I was running so many unstable packages (I like the latest gnome, netbeans, video drivers, etc) it got to be a dependency nightmare. It didn't help that I wouldn't regularly emerge either. But thats how I used it so....

I installed OpenSolaris yesterday. Installed just fine, and then the customization starts :)

I have an AMD64 box (Asus A8NSLI) with two geforce 6800 video cards (not sli'ed) setup to triple head. (left and center monitors run off card0 vga out and card0 dvi out, right monitor runs off of card1 vga out)

So I grabbed my xorg.conf from my old configuration, copied it over and voila :) Triple head no problem with xinerama and the nvidia drivers.

Here's a pic:


Photo 26.jpg

Here's the xorg.conf:

Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" Screen "Screen2" RightOf "Screen1" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "SendCoreEvents" Option "Xinerama" "on" EndSection

Section "Files"
EndSection

Section "Module"
Load "freetype"
# Load "xtt"
Load "extmod"
Load "glx"
#Load "dri"
Load "dbe"
Load "record"
Load "xtrap"
Load "type1"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "evdev"
Option "Name" "Logitech USB Receiver"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "XkbModel" "microsoft"
Option "XkbLayout" "us"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Samsung"
ModelName "SyncMaster 171V"
HorizSync 31.5 - 64.3
VertRefresh 56.0 - 76.0
Option "dpms" #from phoronix - try it
EndSection

Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 31.5 - 80
VertRefresh 60.0 - 75.0
Option "dpms" #from phoronix - try it
EndSection

Section "Monitor"
Identifier "Monitor2"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 31.5 - 80
VertRefresh 60.0 - 75.0
Option "dpms" #from phoronix - try it
EndSection

Section "Device"
#left and center monitor
Identifier "Card0a"
Driver "nvidia"

Option "RenderAccel" "true"
Option "UseEdidFreqs" "true"
Option "IgnoreEDID" "false"
Option "AllowGLXWithComposite" "true"

BusID "PCI:1:0:0"
EndSection

Section "Device"
#left and center monitor
Identifier "Card0b"
Driver "nvidia"

Option "RenderAccel" "true"
Option "UseEdidFreqs" "true"
Option "IgnoreEDID" "false"
Option "AllowGLXWithComposite" "true"

BusID "PCI:1:0:0"
Screen 1
EndSection

Section "Device"
# right monitor
Identifier "Card1"
Driver "nvidia"

Option "RenderAccel" "true"
Option "UseEdidFreqs" "true"
Option "IgnoreEDID" "false"
Option "ConnectedMonitor" "CRT"

BusID "PCI:3:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0a"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "Card0b"
Monitor "Monitor1"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen2"
Device "Card1"
Monitor "Monitor2"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 8
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

#Section "DRI"
# Mode 0666
#EndSection

Friday Nov 07, 2008

Change the default JDK for NB 6.x

While its easy enough to change the default JDK for a project, in our current project we have around 5 services using 3 or 4 apis and changing the JDK for each is a PITA. Besides, all our builds are setup for command line ant (we build on Solaris, I dev on Linux, OS X and Solaris, and our production boxes are Solaris) and the ant build is setup for JDK 1.6.

So what I really wanted to do was be able to use the ant command line build to build the api's, then pull up the services that I'm working on in NB and not get a library version mismatch.

The file I needed to modify was the netbeans.conf. On a windows box (I think - from the info out there) The file is located in C:\\Program Files\\netbeans-?.?\\etc\\netbeans.conf. On a mac the file is located in Applications/NetBeans/NetBeans ?.?app/Contents/Resources/NetBeans/etc/netbeans.conf

To change the default modify the line:

# Default location of JDK, can be overridden by using --jdkhome <dir>:netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home

Tuesday May 27, 2008

SOAP message handler for logging inbound SOAP results

I recently had the need to log the results of some calls to soap service my app was making. I attached the SimpleHandler to the xml.rpc.client.BasicService

public class SimpleHandler extends GenericHandler {
...
    @Override
    public boolean handleResponse(MessageContext context) {
        try {
            // get the soap header
            SOAPMessageContext smc = (SOAPMessageContext) context;
            SOAPMessage soapMessage = smc.getMessage();
            
            // Create transformer
            TransformerFactory tff = TransformerFactory.newInstance();
            Transformer tf = tff.newTransformer();
            
            // Get reply content
            Source sc = soapMessage.getSOAPPart().getContent();
            
            // Set output transformation
            ByteArrayOutputStream streamOut = new ByteArrayOutputStream();
            StreamResult result = new StreamResult(streamOut);
            tf.transform(sc, result);

            String strMessage = streamOut.toString();
            log.info("SOAP MESSAGE:\\n"+strMessage+"\\n");
        } catch (Exception e) {
            log.error("Exception in SimpleHander!");
            throw new JAXRPCException(e);
        }
        return true;
    }
...
}

Tuesday May 20, 2008

wap54g client ap fun

I've got a wap54g v1 that I use to connect one of our desktops that doesn't have a wireless card. So I use it in client ap mode. Recently I encrypted our network (I was just using MACID filtering) and I couldn't get the wap54g to see the network.

I installed the latest official firmware and was still having issues until I found a post that said I needed to turn on SSID broadcast from the wireless router (wrt54g). I did that, and then walked through enabling all the encryption and it worked just fine :)

Thursday Mar 06, 2008

MacBook Pro - resetting external display refresh rates

So I've been using Sun Displays as a second display above my MBP display while I'm in the office or at home and its been working pretty well.... but ;)

Today in the office I was playing around with the sync frequencies for the monitor (I run non-mirrored 1280x1024 over 1680x1050) and I got the crt accidentally set for a freqency it couldn't handle.

There was no way that I found that I could undo the setting manually.

Until I googled a post that mentioned blowing away the windowserver.plist.

I found I had to delete both plists and reboot to get it to work.

The files are:

  • Library/Preferences/com.apple.windowserver.plist
  • /Users/YOURUSERNAMEHERE/Library/Preferences/ByHost/com.apple.windowserver.SOMENUMBERHERE.plist

Monday Feb 18, 2008

Making posters of large images

Here's the real reason I went searching for a blog client. Wanted to jot down my re-findings on how to take a large image and turn it into a poster.

I used this for printing db ERD's and making a "pin the hook on the mater" game for my son's sixth birthday party.

Use the open source app PosterRazor it'll take a large image and turn it into a multipage pdf doc which can then be printed on any printer and cut and pasted together with minimal effort.

Blogging with Ecto

I've been setting up a new mac book pro and I figured I'd try out some of the new blogging clients instead of using scribefire for firefox. The Linux clients just didn't cut it for me.

So here's the first go with ecto. An earlier test failed when the date posted as GMT time in the future and I couldn't view the entry :)

Here's a quick pic test:


Photo 16.jpg

And some trackback entries, and some tags.

Wednesday Jan 16, 2008

Injecting JNDI datasources for JUnit Tests outside of a container

I was working on some webservices that we're moving into libraries the other day, and needed to run a full set of tests using junit, but outside of a container. I didn't want to create and deploy an entire test harness, I just wanted to run the junit tests in the nb ide. But I couldn't get the test to inject the datasource resource so it was usable. I finally got it working, but I'll spare you all the pain I went through to get here. Here's how I did it in my test class:
    @BeforeClass
    public static void setUpClass() throws Exception {
        // rcarver - setup the jndi context and the datasource
        try {
            // Create initial context
            System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                "org.apache.naming.java.javaURLContextFactory");
            System.setProperty(Context.URL_PKG_PREFIXES, 
                "org.apache.naming");            
            InitialContext ic = new InitialContext();

            ic.createSubcontext("java:");
            ic.createSubcontext("java:/comp");
            ic.createSubcontext("java:/comp/env");
            ic.createSubcontext("java:/comp/env/jdbc");
           
            // Construct DataSource
            OracleConnectionPoolDataSource ds = new OracleConnectionPoolDataSource();
            ds.setURL("jdbc:oracle:thin:@host:port:db");
            ds.setUser("MY_USER_NAME");
            ds.setPassword("MY_USER_PASSWORD");
            
            ic.bind("java:/comp/env/jdbc/nameofmyjdbcresource", ds);
        } catch (NamingException ex) {
            Logger.getLogger(MyDAOTest.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
As you can see, in this case I used the OracleConnectionPoolDataSource, you should use the datasource for your db connection. Don't forget to link in the appropriate db jar (in my case it was ojdbc14.jar) The code that is used to retrieve the datasource (which works for test and production) looks like this:
        Context initContext = new InitialContext();
        Context webContext = (Context)initContext.lookup("java:/comp/env");

        DataSource ds = (DataSource) webContext.lookup("jdbc/nameofmyjdbcresource");
viola!

Monday Oct 08, 2007

Gnome Evolution and the Sun Java System Calendar Server

One of my machines at home is a amd64 triple head running gentoo.   I use gnome, and consequently, the gnome evolution mail/calendar/todo client.   Through work I use the Sun Java System Calendar Server which can be connected to evolution via the JESCS connector.

I recently rebuilt my system and thought I'd post up how easy it is to install this component (it doesn't install by default).
  1. Download the appropriate source from ftp.gnome.org.
  2. Unpackage the source tarball.
  3. Run ./configure in the unpackaged directory.
  4. Run make install
  5. Copy the file GNOME_Evolution_SunOne_Storage.server from the ./storage directory in the make tree to the bonobo server files directoy.  In my case the bonobo server files can be found in /usr/lib/bonobo/servers, ymmv :)
  6. shut down evolution and kill ALL evolution processes (pkill evo)
  7. Restart evolution and configure as per the JESCS page above.


Technorati Tags:

Wednesday Sep 26, 2007

Blogging with Scribefire

The Scribefire blogging plugin for firefox is working fairly well.   I can't delete old posts, but I can edit.   And the self-promotion link is removable :)

Get it here.


Technorati Tags: ,

Monday Sep 24, 2007

Testing Bleezer blogging client

This is a sample posting with Bleezer. I've also tested Drivel, but for some reason the blogger 2 interface won't work (it wants to grab a list of tags and fails). The Drivel blogger 1 inteface does not provide a subject line and so I end up with the wierd formatting on the title you see below.

Anyhoo - trying out Bleezer, but it gets a cast exception and won't download previous posts....

So - what blogging client to use :) I wish ecto was available for linux :)

Technorati:

Powered by Bleezer

Howto install SJWS7 on amd64 Gentoo

The Sun Java Web Server 7.0 install is only available for RH linux, but I use gentoo on amd64 for one of my home machines.

Unfortunately its a 32 bit binary and it needs the 32 bit libstdc++.so.5. To solve the dependency simply emerge the app-emulation/emul-linux-x86-compat package. Note that the sys-libs/libstdc++-v3 contains the 64 bit version of libstdc++.so.5 and won't work. You need the emul-linux-x86-compat package

Sunday Sep 23, 2007

Trying out netb...

Netbeans for gentoo amd64

I'm in the process of trying out the latest netbeans gentoo ebuild for my home machine. I use it integrated with Sun Java Webserver 7 for some work projects.

The 5.5 ebuild has been marked stable for amd64, and there is an overlay for the 6.0 beta (it looks like a nightly build) here

About

Randy Carver

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today