Sunday, November 15, 2015

Linux Mint 17.2 on a fancy pants Dell XPS 15 9550

items you need before you start:
usb mouse
USB 3 to Ethernet adapter (recommend startech.com or trendnet TU3-ETG) or usb wifi adapter supported oob by linux
LinuxMint 17.2 loaded on a flash drive via 'create bootable usb drive'
patience :)


I got the chance to get my hands on a new Dell XPS 15 9550, model 10000SLV. What a beauty! 4k touch display, Skylake quad core i7 6700HQ, 15" screen in a 14" body(they call this infinity edge because of the tiny bezel), carbon fiber palmrests/deck. The thing is 4.4 lbs with the 87 wh battery and the 1TB ssd. It's width is much slimmer than that of the E7450, which I love, but it only a has dual core ultrabook i7 broadwell chip. This new machine is a true developer machine, basically a macbook pro on steroids for those who like to carve their own path with their OS of choice.

I couldn't find a guide in a single place to get this all working so I'll post all this together and show the sources I got bits of info off at the end for your reference. I found the best discussion for XP15 9550 owners here http://ubuntuforums.org/showthread.php?t=2301071 .

If you want to keep your Windows install, follow these instructions on on how shrink down the partition as small as possible. You can get it down to 128 gig or less easy following these instructions: http://ubuntuforums.org/showthread.php?t=2087466

Next write the LM 17.2 iso onto a thumb drive.

First of all, before you start get yourself a usb 3 to ethernet dongle, like the Startech.com or the Trendnet (I usually use the Starttech but the Trendnet was half the price, and had it on my door in 8 hours via prime now). The model I used is TU3-ETG. If you have an old usb wifi adapter lying around that linux supports, that will do as well.

next hit f2, boot into bios. Turn off secure boot, turn on legacy rom boot support. Go to the system preferences and change the sata controller to AHCI from RAID.

Next boot off your USB drive with LM 17.2 on it. When the dell logo appears hit f12 until you get a message its making boot menu. Under UEFI boot, choose the usb thumb drive, not the one under legacy boot. This lets LM/Ubuntu fix the partition tables and do the UEFI stuff for you so you're dual boot isn't wrecked.

If you get freezes during use or boot, try to add this to the end of the 'linux' line in grub (hit e at the grub menu) 'nouveau.modeset=0'. This didn't happen to be until I updated the kernel in a later step.

Now install 4.3 kernel. This has skylake support for our machine's chipset - it also gets the dell (broadcom) wifi working (although 2.4ghz only for now) see directions here: http://ubuntuhandbook.org/index.php/2015/11/linux-kernel-4-3-released/

after that your touchpad will stop working - you have to do these steps (found in the first post) use steps 8, 9, and 10.
----------------
8) Fix touchpad problem. Apparently the wrong kernel module (driver) is loaded. It's loading i2c_hid instead of i2c_designware_*.
lsmod | grep i2c #check what's loaded
echo "blacklist i2c_hid" | sudo tee -a /etc/modprobe.d/blacklist.conf
#apparently just blacklisting isn't good enough, for me it was also hiding in initramfs
sudo depmod -a
sudo update-initramfs -u
reboot

9) Graphics will be weird and flaky. The Nvidia drivers in the standard repositories are also a bit too old and will be flaky. I found that the new graphics-driver PPA worked well. Didn't try downloading from Nvidia directly. Bumblebee didn't work for me, giving a black screen, so Nvidia PRIME is recommended.
sudo apt-get purge nvida-*
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-355 nvidia-prime
sudo service lightdm restart

10) Add an indicator so you can tell whether Intel or Nvidia is being used.
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install prime-indicator

--------------
This will use Nvidia drivers the whole time. This works with dual monitors via HDMI but if you plug in and unplug it several times it will stop working until you reboot. Every attempt to use skylake intel video results in a 'software rendering being used' warning after login - So there is more work to do there. Once Dell finishes their 'developer edition XPS13' support they should fix the XPS15 drivers next. It's weird because the XPS15 seems more like a developer machine to me.


references:
http://ubuntuforums.org/showthread.php?t=2301071

Quirks - wifi doesn't see 5G hotspots
reboots - sometimes it hangs on the linuxmint logo, power down and it comes back. Other times it reboots in a loop on the dell logo (must be a bios bug in 1.000.5)
switching prime profiles crashes the video driver requiring a reboot - keep it on Nvidia full time for now (seems to use 25 watts like this while pretty much idle)

Webcam, sounds, microphone, chrome+hangouts all work. Keyboard shortcuts for volume, keyboard backlight, and screen brightness work too.


Feel free to contact me on twitter @RyanVanderwerf if you find any other revelations like 5G band wireless or steps to switch between Skylake intel video and nvidia smoothly.

Tuesday, July 14, 2015

How to publish Grails 3 plugin snapshots to your local Artifactory server

One my co worker Rob Bugh got stumped on this for a while and eventually threw it over to me. I was stumped as well but I finally figured this out.

In this case we're trying to make a custom fork of the Grails 3 plugin - we had to tweak it a bit to work with Terracotta OS, because it only supports Quartz 2.1:

I ran into a couple tidbits of info, but mostly the solution in part lies with a part of Grails 3:

https://raw.githubusercontent.com/grails/grails-profile-repository/master/profiles/plugin/templates/grailsCentralPublishing.gradle


If you look in there you see a bit of this code:

maven(MavenPublication) {
            pom.withXml {
                def pomNode = asNode()
                pomNode.dependencyManagement.replaceNode {}

                // simply remove dependencies without a version
                // version-less dependencies are handled with dependencyManagement
                // see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions
                pomNode.dependencies.dependency.findAll {
                    it.version.text().isEmpty()
                }.each {
                    it.replaceNode {}
                }
            }



The part with pom.withXml is part of the magic witchery here - all of the spring   boot dependencies don't include version numbers which makes gradle very angry and  confused. However I couldn't get the maven(MavenPublication) to work with the      latest Artifactory plugin. It appears they are just using maven publish instead in Grails, unless it's using the Bintray support. What it is doing here is stripping out all of the stuff without versions on it - those are managed by Grails 3/Boot. It seems like a bit of a hack, until there is a profile called 'artifactoryPublishing' this will have to do.

You also can't use these types of plugins as 'apply: plugin' - you need to reference them under dependencies like Benoit mentioned in his blog: https://medium.com/@benorama/how-to-publish-your-grails-3-plugin-to-bintray-c341b24f567d .

So let's bring those pieces together in your plugin like so:

publishing {
        publications {
            mavenJava(MavenPublication) {
              pom.withXml {
                def pomNode = asNode()
                pomNode.dependencyManagement.replaceNode {}

                // simply remove dependencies without a version
                // version-less dependencies are handled with dependencyManagement
                // see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions
                pomNode.dependencies.dependency.findAll {
                    it.version.text().isEmpty()
                }.each {
                    it.replaceNode {}
                }
            }
            from components.java
            def descriptor =
                artifacts = ["build/libs/quartz-${version}.jar",sourcesJar]
                
           }
        }
}
artifactory {
  contextUrl = 'http://your.artifactory.server/artifactory'

  publish {
    defaults {
      publications('mavenJava')
      publishArtifacts = true
      publishPom = true

    }
    repository {
      repoKey = 'plugins-snapshot-local'
      username = 'yourusername'
      password = 'password'
    }
 }

}


also don't forget to include your Artifactory plugin in your build.gradle file:
```
plugins {
    id "io.spring.dependency-management" version "0.3.1.RELEASE"
    id "com.jfrog.bintray" version "1.1"
    id "com.jfrog.artifactory" version "3.1.1"
}


And then in your app (or another Grails 3 plugin) don't forget your private repo:

repositories {
      maven { url "http://your.artifactory.server/artifactory/plugins-snapshot-local" }
}


And also your dependency:

dependencies {
    compile("org.grails.plugins:quartz:2.0.1-SNAPSHOT") {
    exclude group: 'slf4j-api', module: 'c3p0'
  }
}


Now I'll build my plugin that uses this local version of the quartz grails 3 plugin:

 $ gradle assemble
[buildinfo] Not using buildInfo properties file for this build.
:assetCompile
Download http://xxx.xxx.xxx:8081/artifactory/plugins-snapshot-local/org/grails/plugins/quartz/2.0.1-SNAPSHOT/quartz-2.0.1-20150714.194739-4.pom
Download http://xxx.xxx.xxx:8081/artifactory/plugins-snapshot-local/org/grails/plugins/quartz/2.0.1-SNAPSHOT/quartz-2.0.1-20150714.194739-4.jar
Processing File 1 of 1 - manifest.properties
Compressing File 1 of 1 - manifest
Finished Precompiling Assets
:compileAstJava UP-TO-DATE
:compileAstGroovy UP-TO-DATE
:processAstResources UP-TO-DATE
:astClasses UP-TO-DATE
:compileJava UP-TO-DATE
:configScript UP-TO-DATE
:compileGroovy

Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
:copyAstClasses UP-TO-DATE
:copyAssets UP-TO-DATE
:copyCommands UP-TO-DATE
:copyTemplates UP-TO-DATE
:processResources UP-TO-DATE
:classes
:compileWebappGroovyPages UP-TO-DATE
:compileGroovyPages
:jar
:findMainClass
:startScripts
:distTar
:distZip
:bootRepackage
:assemble

BUILD SUCCESSFUL

Yes! We are in business!

follow up. On some versions of OS Artifactory you might get this error first time you publish:

Failed while reading the response from: PUT http://artifactory.aws.reachforce.com:8081/artifactory/plugins-snapshot-local/com/reachforce/plugins/mmdp-quartz/0.5-SNAPSHOT/mmdp-quartz-0.5-SNAPSHOT.jar;build.timestamp=1436911730122;build.name=mmdp-quartz;build.number=1436911734140 HTTP/1.1
org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@1a4ae53d; line: 1, column: 2]
at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433)
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521)
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442)
at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1198)
at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:485)
at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2770)
at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2691)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1286)
at org.codehaus.jackson.JsonParser.readValueAs(JsonParser.java:1337)
at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:209)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.tryChecksumDeploy(ArtifactoryBuildInfoClient.java:649)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:607)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:330)
at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.deployArtifacts(BuildInfoBaseTask.java:409)
at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.prepareAndDeploy(BuildInfoBaseTask.java:284)
at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.collectProjectBuildInfo(BuildInfoBaseTask.java:363)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:306)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:169)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)

Not to worry, just run the command again and it works. Appears to be a bug in Artifactory :)

Tuesday, July 29, 2014

Lego Mindstorms EV3: LeJOS and Groovy - how to get started!



I've recently given a workshop for Lego Workshop at Gr8Conf.eu and Gr8Conf.us this year showing how to integrate Groovy and Mindstorms together. I have slides available here, however they don't have a getting started (I pre-setup the robots and microSD cards before the workshop) tutorial: So how do I set  this up with my Lego EV3 I just ran home to buy after seeing this? Baruch Sadogursky (@jbaruch) asked me to write this post and and kindly offered to post the ISOs in Bintray so when people get home they are ready to roll with their Groovy Robots! here is the download link https://t.co/PEqmSYZNoI

Step 1: Buy a Edimax 7811un wireless adapter like this one. They are less than $10USD on Amazon and Newegg. Likely you don't find these at the local store. They are very tiny and cause least amount of issues with building the robots.

Step 2: Get a 2GB or larger microsd card. Delete all of the partitions. Create 2 partitions (I use gparted on Linux):
1) 477 MB fat32 partition
2) 600 MB ext2 partition

Use the dd command in linux (I think this will work with MacOSX too).
dd if= lejos-part1-fat32-477mb-lba.iso.iso (Get this from bintray) /of=/dev/XXXX

where XXX=destination device partition  (mounted on your computer)

Also
dd if=lejos-part2-ext2-600mb.iso (Get this from bintray) /of=/dev/XXXX

where XXX=destination device partition  (mounted on your computer)

If you SD card is larger, you can expand the 600MB partition to fill your SD card if you like without much risk.

Step 3: Check out my lejos fork:
git clone git://git.code.sf.net/u/ryanv78665/lejos u-ryanv78665-lejos

Step 4: build the "EV3GroovyTest" file with the following command:
'gradlew ":EV3GroovyTest:jar"

Step 5: Boot robot up with the Edimax adapter and setup on your wifi network using the menu.

Step 6: scp the jar (under EV3GroovyTest/build/libs) to root@x.x.x.x:/home/lejos/tools(fastest) or  /home/lejos/samples or /home/lejos/programs (safest)

Step 7: if you want to tweak ev3classes libs or DBusJava you can build those with gradle too, and update the jars on the sd card via SCP if you'd like.

Follow the slides for more in depth info!

Webrover1 repo: https://github.com/rvanderwerf/webrover1/

Bintray repo for ISOs: https://t.co/PEqmSYZNoI

Happy Groovy Roboting! Thanks @ALittleOfJoe for the robot selfie pic from the US workshop! And @rappelg for the robot pic.

Friday, October 11, 2013

Installing LinuxMint or Ubuntu on my XPS 14 ultrabook - what worked for me

I've also done these same steps for other UEFI laptops like the newer ASUS machines. Other than the BIOS tweaks, the same pattern should work for most newer UEFI computers.

UEFI seemed like a great idea and first, but it sorted of hozed things for people who want to run open source systems like many Linux flavors who do not have the ability to get a secure boot key (read tax for people with money).  Read more about UEFI here.

 I just installed LinuxMint 15 on my refurb I just got from the 30% off sale at dell outlet. Everything works, I didn't need a special kernel to make the keyboard backlight controls working, or screen dimmer.

I downloaded the Ubuntu secure remix from here onto a usb stick.

Items needed: 2 usb sticks, one with Secure Ubuntu Remix, and the other with the linux flavor of your choice Go here http://sourceforge.net/projects/ubuntu-secured/ to get the image.


 Steps I did:

 1) Disable secure boot in bios, disable intel rapid start and caching. (My system has the 500gb + 32gb msata ssd)

2) boot into windows 8(newer machines with UEFI probably have windows 8 installed). Shrink partition down as low as it will go (it let me drop it down by 230gb or so). while holding down shift, click restart, keep holding it down until boot options appear, pick other/usb stick

3) ubuntu remix boots - click install, format 32gb ssd as target install, set boot loader to /dev/sda (it will default to that) to 500gb. It will make a grub partition there out of a small piece of free space

4) after reboot, ubuntu should boot. Go to boot repair icon it has, it pick auto-fix options. next reboot will give you a grub menu and let you choose UEFI loader or linux

5) both OSs should boot - At this point you can boot off another USB of your choice and replace the ubuntu install (I did linux mint) on the 32gb ssd.

After install, you'll have to manually add or download the boot repair tool again, it will fix grub so you can get both linux and windows After that I installed bumblebee to get my power consumption down to 15 watts or less. Before that its higher, as the nvidia 630 is always running. Everything works, battery life is good. Suspend/resume for me has not caused any issues yet, I've done it about 5 times today and wifi comes back and all. So far I am digging the machine!

 If you just want Linux installed and no Windows 8, in step 2, boot on the secure ubuntu image, and click on the icon for OS remover. You can then just erase the windows partition, then run boot repair and continue with rest of the steps.

 If you only have one hard disk, you'll just need to direct ubuntu to install on a new partition out of the free space on the drive you just made from either killing Windows or shrinking the partition. Tip: if you run a defrag util in windows first, you will be able to shrink the partition down more then as it comes. 

Good luck enjoying your new computer, free of Windows!

Thursday, July 25, 2013

My Gr8Conf.us 2013 Wrap Up

What a great year for the US Gr8Conf! It was so great meeting everyone again (and folks I had not met yet)for my 2nd year speaking. The weather the perfect, Shaun and his volunteers kept everyone running without a hiccup, talks were great, after hours events were fun. I was excited to share what I have learned with tech I have been working with lately in my talks. It was great to attend the talks as well, which such a good balance of different kinds of topics all related in some way to Grails or Groovy. What was also the benefit above all others, is to network with speakers and attendees. That's when the real world stuff comes out, problems people face, things people are trying, as well as talking with the committers themselves on many projects. Watching videos of talks is great (They recorded them this year to appear later on InfoQ), but actually GOING to these conferences (like Gr8, GGX, S2GX and others) and talking to people is where at least half the value lies. What I love about this community is everyone is approachable and humble, and helpful. I've never seen anyone act snobby or 'too good' to talk to anyone. I hope that attitude always continues, which is one of the many reasons I love this great community. Thank you sponsors OPI, Target, Bloom, and others for the wonderful events, food, and drinks. The hackathon was great, but if we had it so our API keys worked through the conference and turned our submissions morning of the last day, and possibly allow 4 person teams, even cooler stuff would come out. I personally had too elaborate of an idea, and I didn't come close to finish it for submission in 4 hours. Thanks Jeff Beck for the lovely beer gift and for our beverage ingredients, thanks to Rob Fletcher for our drink exchange. Thanks Luke for the Dave and Busters cards! If there is one thing I DEFINITELY learned, was that Dan fixed the Grails twitter notifier plugin - or something :) Hope to see everyone next year in Minneapolis!

Tuesday, March 26, 2013

Austin Groovy and Grails Meetup April 4!

Come meet up with the Austin Groovy and Grails User Group meetup @ Mister Tramps, April 4! http://www.meetup.com/Austin-Groovy-and-Grails-Users/events/110935792/ I will give a talk on clustering Quartz in Grails! (Same from gr8conf.us last year!). This event sponsored by New Iron. ( http://www.newiron.com

Monday, January 28, 2013

When GVM

Love GVM for switching between Grails versions. However my install in Ubuntu stopped working a few weeks ago and I've been puzzled ever since. If you run gvm, and it stops working where the command 'gvm' returns nothing, run this: source ~/.gvm/bin/gvm-init.sh then you can do 'gvm selfupdate' to bring it up to date. Working like a champ now! If you do Groovy/Grails/Griffon/Gradle/Vertx development and don't use GVM you should. Check it out at http://gvmtool.net/

Wednesday, October 24, 2012

AWS & VPC - OpenVPN setup with private subnets...

I have finally battled the beast of getting Openvpn set up on VPC to access both public AND private subnets. There is one thing not mentioned in any of the tutorials I found that is critical. When you install OpenVPN, and it is configured for NAT, it will use a private subnet for the vpn clients on 5.5.16.0/20, which you must add a route for under VPC-> route tables -> new -> destination -> 5.5.16.0/20 -> associate (enter your subnet ID) Now when clients VPN in with openVPN, they can contact everyone on both subnets. Don't forget to allow the traffic in using the security groups both inbound and outbound as well, such as ICMP ping, so you can test communications properly (and whatever services you need). helpful links: Using from linux: http://openvpn.net/index.php/access-server/docs/admin-guides/182-how-to-connect-to-access-server-with-linux-clients.html video tutorial (great, except the route part is missing) http://dbsgkhvbz3k7m.cloudfront.net/AmazonVPC/AmazonVPC.html happy routing!

Thursday, October 18, 2012

SpringOne2GX Wrap up

Great conference this year, it was very good to see some familiar faces and finally meet more in person. I hope my talks where useful to everyone! The big takeaway I got is Grails is moving to be more client capable and more social with the new platform core event bus technology as well as more mobile (jquery-mobile-scaffolding). Less and less are MVC types of systems being relevant with such rich Javascript and HTML5 capabilities of browsers. Users expectations are changing to rich client interfaces, single page apps, and quick deployments as well. Plugins are more important that ever, and user plugin contributions are one of the big things that make Grails so great. Also if weren't for all of the advancements with Groovy and Spring libraries Grails wouldn't be what it is today. Another thing I like about the Grails, Groovy, and Spring teams is every is so friendly, helpful, and willing to chat with everyone - that makes it feel like a big family even to outsiders to Springsource. Of course Jay Zimmerman is the master of these conferences, everything was so well done, professional, and smooth. I've uploaded sample apps to my github account at https://github.com/rvanderwerf and if you look in the doc folders it will include PDFs of my slides as well. During the conference I release a new version of the struts1 plugin to work with Grails2 th made numerous improvements to the GVPS (Grails Video Pseudo Streamer) plugin as well. You can go to http://www.grails.org/plugin/gvps to see the latest version. Special thanks and shoutouts goes out to Burt Beckwith, Sebastian Blanc, Soren Glasius, Peter Ledbrook, Colin Harrington, Cedric Champeau, Luke Daley, Graeme Rocher, Jeff Brown, Stefan Ambruster, Guillaume Laforge, Jay Zimmerman and everyone else who shared drinks and conversation. I especially want to thank those who attended my talks. I hope to see everybody next year, wherever it is at! Also according to Peter Ledbrook and S0ren Glasius, everytime someone calls Grails 'Groovy on Grails', a puppy dies ;)

Sunday, October 14, 2012

SpringOne2GX

Heading out to speak at SpringOne2GX in DC today. I'll be giving 2 talks, 'Streaming Video in Grails' (Using the formerly 'grails-video' plugin now called 'gvps'(Grails Video Pseudo Streaming Plugin). I'll go over the plugin, how ffmpeg, and basic streaming works, flowplayer and jw-flv integrations, and a little about quartz to help distribute video processing load. The second talk is 'Clustering Grails 2 with Terracotta' which is a dive into what you need to do and how to figure a total clustering solution with Grails 2 that uses Ehcache, HTTP Session Clustering, and Quartz. I'll give examples of each, and demo a Grails 2 app that uses all of these at once at the end. Of value you will find a library compatibility matrix of what you need to add to your BuildConfig to make everything work. There are so many great speakers and topics I'm going to have a hard time choosing what talks I will attend myself!

Friday, August 10, 2012

Learned a interesting lesson with Grails today.....

Learned a interesting lesson with Grails today..... NEVER give plugins a name in all caps(Or more than 1 capital letter in a row). I had 2 plugins I made, called 'SPP' and 'RFCORE' which (due to JIRA wanting to name the svn repos this way) cause an interesting breakdown in Grails. I publish these plugins to Artifactory via the release plugin in Grails, and bind them to the app in the plugins {} closure. The other day I added my fork of Weceem (I fixed it to work on Oracle and send a pull request back to them) to the plugins{} block. Works fine via inline plugin mode with my (all caps) plugin names. Once I deploy a WAR file, suddenly Grails has no idea where my plugins are (war is made, however the plugins are missing from the war). What threw me off was that if I uninstall the weceem plugin, my (all caps) plugins are now built into the war. So I step through the code in the Grails PluginBuildSettings class in the method 'getSupportedPluginInfos' and find that the plugin registry has my plugins like this 'SPP-0.1-SNAPSHOT' but the maven resolution is looking for them as 'spp-0.1-SNAPSHOT' and automatically lower casing it for me. If those don't match (it is case sensitive, I personally think it should not be), Grails acts like the plugin basically doesn't exist and doesn't package it up. Now I refactor my plugin class files from SSPGrailsPlugin to sppGrailsPlugin and it works. I'm not sure if this is a bug in Grails (2.x) or not, or it just doesn't support plugins with more than one capital letter in a row in it. If it's a bug I can patch it and submit a pull request. Moral of the story, don't make Grails plugins with more than 1 capital letter in a row, or you will spend all day figuring out what is going wrong ;)

Monday, July 30, 2012

Posted the slides for my #Gr8Conf Enterprise Talk on my github page: https://github.com/rvanderwerf/GR8Conf-slides

Wednesday, July 25, 2012

I Love GitHub!

We messed around with the new Grails plugin called 'Ajaxflows' at http://www.grails.org/plugin/ajaxflow and found a big bug stopping us from using it at all. I fork the GitHub repo, clone it, load it on my box and fix the bug. I sent a pull request to the plugin author (Jeroen Wesbeek) and within 2 hours a new version is released. That's the power of collaboration, between people who don't even know each other, and it's better than any commercial support money can buy :)

Friday, June 29, 2012

Netflix and Grails...

Good to see they've let this out to share with others!

Friday, June 22, 2012

Ran into a rather nasty Grails 2.0.4 bug the other day...

After deploying my first real production Grails 2.x application, which uses 2 plugins I also wrote, I got the lovely error trying to start the war file in Tomcat 6:


SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Lgrails/test/mixin/services/ServiceUnitTestMixin; at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.NoClassDefFoundError: Lgrails/test/mixin/services/ServiceUnitTestMixin; at java.lang.Class.privateGetDeclaredFields(Class.java:2308) at java.lang.Class.getDeclaredField(Class.java:1897) ... 1 more Caused by: java.lang.ClassNotFoundException: grails.test.mixin.services.ServiceUnitTestMixin ... 3 more There is some magic combination of plugins I think is causing this. It originates from one of my plugins, but I can't find anything wrong with it, other than Grails did not package the class (It shouldn't be looking for it AFAIK). So here is my workaround solution, which is working for now (Add to BuildConfig.groovy): grails.war.resources = { stagingDir, args -> // Manually copy the grails-plugin-testing-2.0.4.jar into war due to bug in Grails 2.0.4 // For some reason grails is making the war depend on this jar from the grails distro copy(file: "lib/grails-plugin-testing-2.0.4.jar", tofile: "${stagingDir}/WEB-INF/lib/grails-plugin-testing-2.0.4.jar") } You can find this in your Grails 2.x distro, under the dist folder. I currently can't re-create it from a scratch project, it happens when I add more complex things to the mix like a maven dependency to another grails plugin coming from my artifactory server.

Wednesday, June 6, 2012

Auto nested property extraction...

I ran into the need for a Grails supported select box with 'optgroup'. I was suprised to find out Grails didn't support this, but I did find a JIRA ticket where a guy added the code but it appears it was forgotten and never included. Here's the link with the code: http://jira.grails.org/browse/GRAILS-3961 However I found the example:


<g:selectWithOptGroup name = "song.id" 
                      from = "${Song.list()}" 
                      optionKey = "id" 
                      optionValue = "songName" 
                      groupBy = "album" />

groupBy doesn't support a tested property I'd expect. For example, say album is a parent 
property domain class, and you really want it to group by the parent's property of 'album.name'.
It will blow up when you do this. So I've modified this bit of code, learning from the Groovy class 'Eval'.

I added this around line 40 of the MyAppTagLib.groovy file:

 if (groupBy instanceof String && groupBy.indexOf(".")) {

                groupKey = Eval.x(el,"x."+groupBy)
 }
This will expand a dot notated nested property to give you the correct string value to sort on. Hopefully this will be merged in the Grails core soon, it seems like people expect this sort of thing these days.

Tuesday, May 29, 2012

gr8conf us discounts available!


I am speaking at the GR8Conf in Minneapolis, which is July 29-31. If you are interested in Groovy and Grails technologies, I highly recommend you come join us!

I have  a discount code you can use, enter code 'GR8RyanVanderwerf' to get the $399 price through July 1. With the price of the NFJS and Spring 2GX conferences continually going up each year, this is a great price!
more info at http://gr8conf.us/index


Tuesday, May 22, 2012

Keeping tidy table and columns in Oracle and Grails

Keeping tidy table and columns in Oracle and Grails...


Found I keep having to match your existing oracle schema (It's not case sensitive, but they create all of their tables and columns in all caps with underscored separating words). This doesn't jive with Grails defaults, where it makes tables and columns in lower case seperated by underscores. For example, of I have a domain object PizzaToppings, grails makes it 'pizza_toppings'.

You can fix it like this in your domain class:

static mapping = {
     table name: 'PIZZA_TOPPINGS'
}

But that gets very tedious, especially if you have to do the same for columns. So why not make it automatically do it for you?

So to fix this you can implement or extend the hibernate 'DefaultNamingStrategy' class:


class MyNamingStrategy extends DefaultNamingStrategy {
    @Override
    String classToTableName(String className) {

        return covertFromCamelCase(super.classToTableName(className))
    }

    String covertFromCamelCase(String input) {
       
        GrailsNameUtils.getNaturalName(input).replaceAll("\\s", "_").toUpperCase();
    }
}

Now add this to your DataSource.groovy:

hibernate {
   
    naming_strategy = com.mycompany.database.oracle.MyNamingStrategy

}

Somehow I remember Oracle being better than it was 15 years ago(10g). Now I find it's obtuse error codes and 31 character column/table name limits highly annoying and antiquated. I think I prefer MySQL 5+ now - and the price, just perfect. I'm guessing 80%+ of people running Oracle don't even need it these days, on small to medium installations. And installing on Ubuntu 64bit current versions, Oracle is just a huge mess. The only give you an RPM for 11g, and for 10g just a 32bit deb file - come on Oracle, what are you doing. Please don't ruin Java like this, or maybe it's too late.


Damn you Android camera app/gallery!

Ok so mad at the Android camera app today. My SD car was full, and the gallery and the app flip out when that happens. If you go into the camera app (while sd card is full), and try to go to the last picture (appears black), then delete it, it will delete ALL of your pictures. Argh! I saved a lot of them with an undelete tool, but I think it's time to go from CM7 to CM9 and see if that helps. Maybe it will help, or maybe it will have more bugs (likely). It seems when the sd card is full, the 'Camera' folder disappears in gallery, but if you free up some space, it re-appears. Not this time, it actually deleted all of my pics. Argh!!

Thursday, May 17, 2012

Groovy web scraping

Groovy web page scraping the easy way. I found this from an example on http://www.maclovin.de/2010/02/robust-html-parsing-the-groovy-way/ and it works quite well even today on Grails 2. This uses Tag Soup 1.2.1 and Groovy's XMLSlurper.

In about 10 lines if code I can scrape the form fields (this one only does inputs and selects) off a web page:


 def tagsoupParser = new org.ccil.cowan.tagsoup.Parser()
        def slurper = new XmlSlurper(tagsoupParser)
        def htmlParser = slurper.parse(config.clientUrl)
        ArrayList inputs = new ArrayList();

        htmlParser.'**'.findAll{
            it.name() == 'input' || it.name() == 'select'
        }.each {
            if (it.attributes().get(id) ) {
                inputs.add(it)
            }
        }