Slow SSH and SCP connections on Ubuntu January 23, 2010
Posted by idimmu in linux.My home Ubuntu Jaunty installation often takes a good 40-60 seconds to connect to using SSH, none of the other servers I maintain have this same problem, they're pretty much instantaneous, and today, on a Friday evening at 1am this irked me enough to fix it!
The first step is of course to make the SSH connection with debug output on.
Chill:~ idimmu$ ssh -v cordy
OpenSSH_5.2p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /Users/idimmu/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to cordy [192.168.0.10] port 22.
debug1: Connection established.
debug1: identity file /Users/idimmu/.ssh/identity type -1
debug1: identity file /Users/idimmu/.ssh/id_rsa type -1
debug1: identity file /Users/idimmu/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.1p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'cordy' is known and matches the RSA host key.
debug1: Found key in /Users/idimmu/.ssh/known_hosts:7
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
< 30 - 40 second pause occurs here >
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/idimmu/.ssh/identity
debug1: Trying private key: /Users/idimmu/.ssh/id_rsa
debug1: Offering public key: /Users/idimmu/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 433
debug1: read PEM private key done: type DSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Requesting authentication agent forwarding.
Linux Cordy 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686
Last login: Sat Jan 23 01:22:08 2010 from chill.local
idimmu@Cordy:~$
A quick Google for SSH2_MSG_SERVICE_ACCEPT and a read of man sshd_config gave me:
UseDNS Specifies whether sshd(8) should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address. The default is ``yes''.
So I simply added
UseDNS no
to the end of /etc/ssh/sshd_config and issued an sudo /etc/init.d/ssh reload and bamo, instant SSH access and I can sleep peacefully!
Proper use of grails:exec January 7, 2010
Posted by idimmu in grails.Whilst trying to run mvn grails:exec with more complicated requests it kept erroring:
Chill:superted idimmu$ mvn grails:exec -Dcommand="jack-be-nimble net.idimmu User Profile"
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - net.idimmu:gymlife:war:1.0-SNAPSHOT
[INFO] task-segment: [grails:exec] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [grails:exec]
[INFO] Using Grails 1.2.0
Running pre-compiled script
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to start Grails
Embedded error: java.lang.reflect.InvocationTargetException
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14 seconds
[INFO] Finished at: Thu Jan 07 22:49:41 GMT 2010
[INFO] Final Memory: 32M/81M
[INFO] ------------------------------------------------------------------------
After some playing about, I finally found the correct runes
Chill:superted idimmu$ mvn grails:exec -Dcommand="jack-be-nimble" -Dargs="net.idimmu User Profile"
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - net.idimmu:superted:war:1.0-SNAPSHOT
[INFO] task-segment: [grails:exec] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [grails:exec]
[INFO] Using Grails 1.2.0
Running script /Users/idimmu/Documents/stsworkspace/superted/plugins/nimble-0.3-SNAPSHOT/scripts/JackBeNimble.groovy
Environment set to development
Using package net.idimmu to create custom classes
Setting up nimble with custom User domain class: User
Setting up nimble with custom Profile domain class: Profile
[echo] Jack be nimble
[echo] Jack be quick
[echo] Jack jump over
[echo] The candlestick.
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/grails-app/conf
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/grails-app/conf
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/grails-app/conf
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/superted/grails-app/domain/net/idimmu
[copy] Copying 15 files to /Users/idimmu/Documents/stsworkspace/superted/grails-app/views/templates/nimble
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/superted/src/sass
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/src/sass
[copy] Copying 1 file to /Users/idimmu/Documents/stsworkspace/superted/src/sass
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Thu Jan 07 22:56:52 GMT 2010
[INFO] Final Memory: 41M/81M
[INFO] ------------------------------------------------------------------------
Woo hoo!
Latest release information is not available for plugin 'nimble', specify concrete release to install January 7, 2010
Posted by idimmu in grails.Whilst trying to install the Nimble plugin for Grails using Maven I ran in to a spot of bother!
Chill:superted idimmu$ mvn grails:install-plugin -DpluginName=nimble
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - idimmu.net:superted:war:1.0-SNAPSHOT
[INFO] task-segment: [grails:install-plugin] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [grails:install-plugin]
[INFO] Using Grails 1.2.0
Running pre-compiled script
Environment set to development
Reading remote plugin list ...
Reading remote plugin list ...
Latest release information is not available for plugin 'nimble', specify concrete release to install
An investigation in to the available plugins yielded
Chill:superted idimmu$ mvn grails:list-plugins
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
<snip>
nimble <0.3-SNAPSHOT (?)> -- Nimble
<snip>
So a bit of reading and thinking and specifically talking to another Grails developer, I found the solution
Chill:superted idimmu$ mvn grails:install-plugin -DpluginName=nimble -DpluginVersion=0.3-SNAPSHOT
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'grails'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - idimmu.net:superted:war:1.0-SNAPSHOT
[INFO] task-segment: [grails:install-plugin] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [grails:install-plugin]
[INFO] Using Grails 1.2.0
Running pre-compiled script
Environment set to development
Reading remote plugin list ...
Reading remote plugin list ...
[get] Getting: http://plugins.grails.org/grails-nimble/tags/RELEASE_0_3-SNAPSHOT/grails-nimble-0.3-SNAPSHOT.zip
[get] To: /Users/idimmu/.grails/1.2.0/plugins/grails-nimble-0.3-SNAPSHOT.zip
<snip>
Integrating Grails and Maven January 7, 2010
Posted by idimmu in grails.I've started investigating Grails for some projects and have been making some good headway and I like to use Maven for everything as it's amazing, and generating projects is easy.
Chill:stsworkspace idimmu$ mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.2.0 -DgroupId=idimmu.net -DartifactId=superted
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[WARNING] No archetype repository found. Falling back to central repository (http://repo1.maven.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Define value for version: 1.0-SNAPSHOT: :
Confirm properties configuration:
groupId: idimmu.net
artifactId: superted
version: 1.0-SNAPSHOT
package: idimmu.net
Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating OldArchetype: grails-maven-archetype:1.2.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: idimmu.net
[INFO] Parameter: packageName, Value: idimmu.net
[INFO] Parameter: package, Value: idimmu.net
[INFO] Parameter: artifactId, Value: superted
[INFO] Parameter: basedir, Value: /Users/idimmu/Documents/stsworkspace
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 147,column 20] : ${java.version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 149,column 23] : ${java.home} is not a valid reference.
[INFO] ********************* End of debug info from resources from generated POM ***********************
[INFO] OldArchetype created in dir: /Users/idimmu/Documents/stsworkspace/superted
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15 seconds
[INFO] Finished at: Thu Jan 07 21:45:39 GMT 2010
[INFO] Final Memory: 12M/79M
[INFO] ------------------------------------------------------------------------
Then of course we initialise the project
Chill:superted idimmu$ mvn initialize
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - idimmu.net:gymlife:war:1.0-SNAPSHOT
[INFO] task-segment: [initialize]
[INFO] ------------------------------------------------------------------------
[INFO] [grails:validate {execution: default}]
[INFO] No Grails application found - skipping validation.
[INFO] [grails:init {execution: default}]
[INFO] Cannot read application info, so initialising new application.
[INFO] Using Grails 1.2.0
Running pre-compiled script
Environment set to development
Warning, target causing name overwriting of name default
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/src/java
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/src/groovy
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/controllers
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/services
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/domain
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/taglib
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/utils
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/views
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/views/layouts
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/i18n
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/conf
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/test
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/test/unit
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/test/integration
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/scripts
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/web-app
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/web-app/js
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/web-app/css
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/web-app/images
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/web-app/META-INF
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/lib
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/conf/spring
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app/conf/hibernate
[propertyfile] Creating new property file: /Users/idimmu/Documents/stsworkspace/gymlife/application.properties
[copy] Copying 1 resource to /Users/idimmu/Documents/stsworkspace/gymlife
[unjar] Expanding: /Users/idimmu/Documents/stsworkspace/gymlife/grails-shared-files.jar into /Users/idimmu/Documents/stsworkspace/gymlife
[delete] Deleting: /Users/idimmu/Documents/stsworkspace/gymlife/grails-shared-files.jar
[copy] Copying 1 resource to /Users/idimmu/Documents/stsworkspace/gymlife
[unjar] Expanding: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app-files.jar into /Users/idimmu/Documents/stsworkspace/gymlife
[delete] Deleting: /Users/idimmu/Documents/stsworkspace/gymlife/grails-app-files.jar
[copy] Copying 1 resource to /Users/idimmu/Documents/stsworkspace/gymlife/target/integration-files
[unjar] Expanding: /Users/idimmu/Documents/stsworkspace/gymlife/target/integration-files/grails-integration-files.jar into /Users/idimmu/Documents/stsworkspace/gymlife/target/integration-files
[delete] Deleting: /Users/idimmu/Documents/stsworkspace/gymlife/target/integration-files/grails-integration-files.jar
[copy] Copying 3 files to /Users/idimmu/Documents/stsworkspace/gymlife
Created Eclipse project files.
Installing plugin hibernate-1.2.0
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/plugins/hibernate-1.2.0
[unzip] Expanding: /Users/idimmu/.grails/1.2.0/plugins/grails-hibernate-1.2.0.zip into /Users/idimmu/Documents/stsworkspace/gymlife/plugins/hibernate-1.2.0
Resolving plugin JAR dependencies
Executing hibernate-1.2.0 plugin post-install script ...
Plugin hibernate-1.2.0 installed
Installing plugin tomcat-1.2.0
[mkdir] Created dir: /Users/idimmu/Documents/stsworkspace/gymlife/plugins/tomcat-1.2.0
[unzip] Expanding: /Users/idimmu/.grails/1.2.0/plugins/grails-tomcat-1.2.0.zip into /Users/idimmu/Documents/stsworkspace/gymlife/plugins/tomcat-1.2.0
Executing tomcat-1.2.0 plugin post-install script ...
Plugin tomcat-1.2.0 installed
Plug-in provides the following new scripts:
------------------------------------------
grails tomcat
Found events script in plugin tomcat
Created Grails Application at /Users/idimmu/Documents/stsworkspace/superted
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Thu Jan 07 21:46:24 GMT 2010
[INFO] Final Memory: 48M/81M
[INFO] ------------------------------------------------------------------------
Technorati Have Crappy Systems Designers November 24, 2009
Posted by idimmu in reviews.I've signed up to Technorati and to prove I own this blog they want me to post an entry with this code in it:
4VPEAZA86VHN
or maybe this code
7W3G7P94H3PU
They don't seem to be sure and the email they sent me and their website both say something different ..
Most sites that are better, such as Google or even MS Live/Bing/Bling/whatever they're calling it this week ask you to create a file on the server, but noooooooo Technorati are forcing me to actually make a post advertising their service .. I really hope it has a happy ending!!! ;)



