Monday, 4 March 2013

Get Lucky with JRebel

Get Lucky with JRebel
Win an all expense trip for 2 to Ireland

Hello Rebel,
Feeling lucky? We are offering an all expense paid trip for two to Ireland for St. Patricks Day 2014. Everyone who activates a JRebel trial in the month of March will be entered to win. So if you've never tried JRebel, or it's been a while since you've tried it, download your trial, put an end to redeploys, and get a chance to win a trip.

Activate your JRebel trial here

Just a few points to note:
  1. For this giveaway to become active we must reach 3000 JRebel trial activations.
  2. In order to enter you need to be a java developer or managing java developers
  3. You must provide complete and accurate contact info (we will be contacting the winner)
  4. Multiple sign-ups will result in you being disqualified
  5. Each person you get to activate a JRebel trial gives you an additional entry in the contest
  6. If you tweet @JRebel with a picture of your St. Patty’s Day celebration we will also throw your name in the hat to win 
Good Luck & Happy Coding!

Oliver

--
Oliver White
Prize Guy
ZeroTurnaround


As the winner you will be free to pick which city you would like to visit for St Patrick's Day 2014 (Ireland or Boston - both known for their St. Patricks Day celebrations) If for whatever reason St. Patricks Day does not work as a travel date for you, then ZT agrees to discuss changing the dates, given the cost center stays the same The cost cap for this trip is $5000 USD
ZeroTurnaround, 545 Boylston, 4th floor, Boston MA 02116
Contact Us

Saturday, 1 September 2012

fun with self-signed certs and java and maven again :S

I've been deploying maven artifacts all day and suddenly it stopped working (later I realized that I happen to apt-get update java in between).

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project browser-cookies: Failed to deploy artifacts/metadata: No connector available to access repository xxx.xxx of type default using the available factories WagonRepositoryConnectorFactory -> [Help 1]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

So after googling a bit I though wagon might be the problem again so I added the following to my pom:


...


org.apache.maven.wagon
wagon-ssh
2.2

...


But my problems didn't go away:(
Then I realized that since I just upgraded my java, that my company maven repo's certificate may not be installed anymore..

I tried to install it with the normal way:
java -jar import-ssl.jar server [https://YOURSERVERURL] 

java -jar import-ssl.jar server maven.example.com $JAVA_HOME/jre/lib/security/cacerts

But this resulted in the following error:

Loading KeyStore /usr/lib/jvm/java-7-oracle/jre/lib/security/cacerts...
Setting up SSL...
Opening connection to https://maven.example.com:443...
java.net.UnknownHostException: https://maven.example.com

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
at sun.security.ssl.SSLSocketImpl.(SSLSocketImpl.java:407)
at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88)
at com.sonatype.component.ssl.imprt.ImportServerCertificates.doImport(ImportServerCertificates.java:154)
at com.sonatype.component.ssl.imprt.ImportServerCertificates.run(ImportServerCertificates.java:66)
at com.sonatype.component.ssl.imprt.Main.main(Main.java:51)

I was puzzled because this worked fine with java-6-openjdk-amd64,  but not with java-7-oracle. For kicks I tried the IP address and guess what it worked!!!!

java -jar import-ssl.jar server 192.0.2.1 $JAVA_HOME/jre/lib/security/cacerts 

Loading KeyStore /usr/lib/jvm/java-7-oracle/jre/lib/security/cacerts...
Setting up SSL...
Opening connection to 192.0.2.1:443...
Starting SSL handshake...

Some SSL certificates appear to be missing. Adding missing certificates...

Server sent 1 certificate(s):
 1 Subject CN=maven.example.com, O=MyCompany, L=Johannesburg, ST=Gauteng, C=ZA
   Issuer  CN=maven.example.com, O=MyCompany, L=Johannesburg, ST=Gauteng, C=ZA

Added certificate to keystore using alias: '192.0.2.1'


But alas I could still not deploy :'(
I threw my toys out of my cot, took a deep breath, bathed my 19 month old son, came back and realized what my problem was:

I put a nasty safety mechanism into my corporate poms to prevent us from deploying stuff to the wrong repository (eg. deploying private source files to a public repository!). Anyways I now added a BIG glaring message for myself for when this happens again:

 NB!


 NB! REMEMBER TO SPECIFY -Dew.deploy-public TO DEPLOY THIS PUBLICLY OR -Dew.deploy-private TO DEPLOY THIS PRIVATELY


Don't say I didn't try to tell you!!!!?! 

Sunday, 10 June 2012

Simple Digital On Off Cycler V1-A30m in Beta

On my Saturday I made this device which is the first actually useful thing I made with my Arduino (aside from a tiny programmer and a energylogger which haven't really been used).

It is a VERY simple thing that just switches some 220V AC power on and off on a 30 minute cycle. In beta testing I'm just turning a light on and off:

The main reason I made this is that the Vaporizer in my son's room empties halfway through the night on it's minimum setting, so with this I can switch it on on a half-hourly cycle so that it will last the night.

Let me know if you want one, I'll sell these if there is interest :)


It even has 2 LED's for debugging. The green one is on while it gives power out. The yellow one blinks 100 times each cycle (so if the cycle is 30 minutes, it is on for 9 seconds and then off for 9 seconds and so on).


I tested and measured over and over again to make sure it is safe, but I'm just an amateur electronics guy hacking away, so I should get this reviewed to make sure I don't burn my house down when leaving it on over night.


To my wife's dismay I made quite a mess, but I cleaned up nicely afterwards :)


When I did the tiny programmer I went straight from the breadboard to veroboard, this time I wrote down the design and I think in future I should really try to draw and lay it out on DipTrace first. This is open hardware, so here is the design and code so far:


==
#define BLINK_PIN 13
#define RELAY_PIN 12
#define MULTIPLIER 100

int cycleSeconds = 30*60;
int sleepMS = round(cycleSeconds * 1000 / MULTIPLIER / 2);
int counter = 0;
int blinkLevel = LOW;
int relayLevel = HIGH;

void setup() {                
  pinMode(BLINK_PIN, OUTPUT);     
  pinMode(RELAY_PIN, OUTPUT);     
  digitalWrite(RELAY_PIN, relayLevel); // start on
}

void loop() {
  if (blinkLevel == LOW)  {
    blinkLevel = HIGH;
    counter += 1;
  } else {
    blinkLevel = LOW;
  }
  digitalWrite(BLINK_PIN, blinkLevel);    
  
  if (counter >= MULTIPLIER) {
    counter = 0;
    if (relayLevel == LOW)  {
      relayLevel = HIGH;
    } else {
      relayLevel = LOW;
    }
    digitalWrite(RELAY_PIN, relayLevel);    
  }
  
  delay(sleepMS);       
}
==


For next versions I'll use an ATTINY85 in stead of the arduino, I can add some knobs to control the cycle times and maybe rather build it into a multi adaptor.