Posts

Showing posts from March, 2009

ssh login failure - keys changed

Edit .ssh/known_hosts

Offending key in /home/ccm/.ssh/known_hosts:46
[...]
Host key verification failed.
$ sed -i "19 d" .ssh/known_hosts



troy@troy-laptop:~$ ssh <username>@<hostname>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
94:13:56:13:8b:1c:51:19:d7:14:2d:fa:7f:0c:ab:a4.
Please contact your system administrator.
Add correct host key in /home/troy/.ssh/known_hosts to get rid of this message.
Offending key in /home/troy/.ssh/known_hosts:19
RSA host key for <hostname> has changed and you have requested strict checking.
Host key verification failed.

Solaris setup

BigAdmin has patch info and howtos

Get software from www.sunfreeware.com

Solaris Admin and HOWTOs

Install:
  wget
  gnu tar
  lsof -> or use pfiles <pid>
  top -> or use prstat [-a]
  vim

For gnu tar:
gunzip libgcc package: gzip -d ...
pkgadd libgcc: pkgadd -d ...

Check install:
pkginfo | grep tar
Check details:
pkginfo -l SMCtar

to remove: pkgrm SMCtar

create link in /usr/local/bin for gtar
cd /usr/local/bin
ln -s /usr/sfw/bin/gtar gtar

Check patch level:
ls -l /var/sadm/patch
OR
showrev -p

uname -X (release, number of CPUs)
/usr/sbin/psrinfo [-v] (cpu status, type, and speed)
listusers (lists all users)
/etc/passwd file format
groupadd -g 400 develop (add group 'develop' with GID 400)
usermod -G develop existing_user (add existing_user to group develop)

grpck (check consistency of group file)
pwck (check consistency of passwd file)

useradd -d /export/home/username -m -s /usr/bin/bash -c "some comment" username

Recursive, change encountered Links, Prevent following links
chown -R -L -P…

JavaScript paint

Swing tips

From Swing Hacks Joshua Marinacci & Chris Adamson

Enable dynamic window resize repainting and check if supported
Toolkit.getDefaultToolkit().setDynamicLayout(true);
Toolkit.getDefaultToolkit().isDynamicLayoutActive();

Ubuntu with Compiz Fusion isn't supporting dynamic JFrame resizing by default, maybe there is a switch for it.

Customizing JTable


Variable Height JTable Column Renderer


Custom JTable Header Renderer


Borders and Insets:

In a Swing application, you should not set the insets property directly. Instead, just create an EmptyBorder object, and then set its border property to display whatever amount of white space you want your component to have.


JXLayer - glass panes on component level, solves lots of problems

Patochkins (SP) Java Swing articles - Greg Kedge

Nimbus Swing

Changing JMV NetBeans executes on

Update the JDK home below in:

C:\Program Files\NetBeans 6.5\etc\netbeans.conf

netbeans_jdkhome="C:\java\jdk1.6.0_12"

Reconfiguring Ubuntu

dpkg --configure -a

reconfigure xserver:

  dpkg-reconfigure xserver-xorg

reconfigure gdm:

  dpkg-reconfigure gdm

backup xorg.conf:

  sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Hibernate scalar query select into non-JPA Entity Java Objects

Constructor Expression

Query query = session.createQuery(
"new Foo(prop1, propN)
FROM FOO f
WHERE f.whatever = whatever");

Collection<Foo> foos = query.list();

JSP fails to compile because method too large

When trying to access a jsp receive: _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit.

Traced it to a generated jsp.java file in the jboss server work directory.
It was a very large file with a that method consuming almost the entire file.

Fix the issue by altering the jbossDir/server/serverNameYouPicked/deploy/jboss-web.deployer/conf/web.xml



Add the following lines after org.apache.jasper.servlet.JspServlet


mappedfile
false


This makes the file smaller so it compiles.