This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ran488.samples.annotation; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Target; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Documented; | |
/** | |
* Custom annotation type used to annotate classes with the SCM version id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.XXXXX.XXX.plsql | |
import static org.junit.Assert.* | |
import org.junit.After | |
import org.junit.Before | |
import org.junit.Test | |
import groovy.sql.Sql | |
class XXXWriteApplLogTest { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.XXXXX.XXX.plsql | |
import groovy.sql.Sql | |
description """ | |
Prototype of PL/SQL unit testing using Easyb. | |
Have full access to the Groovy libraries so we can avoid the messy JDBC baggage. | |
""" | |
scenario "Writing log message to APPL_LOG table via XXX.WRITE_APPL_LOG procedure",{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.XXXXX.XXX | |
import static org.junit.Assert.* | |
import groovy.mock.interceptor.* | |
import java.util.List | |
import org.junit.* | |
class StubTest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.XXXX.XXX.common.util; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.Properties; | |
import org.apache.commons.logging.Log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import java.lang.management.* | |
import javax.management.ObjectName | |
import javax.management.remote.JMXConnectorFactory as JmxFactory | |
import javax.management.remote.JMXServiceURL as JmxUrl | |
def serverUrl = 'service:jmx:rmi:///jndi/rmi://localhost:9987/jmxrmi' | |
String beanName = "com.somecompany.Scheduler:k=ScheduledTasks" | |
def server = JmxFactory.connect(new JmxUrl(serverUrl)).MBeanServerConnection | |
def gmxb = new GroovyMBean(server, beanName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show locks in Oracle | |
select owner||'.'||object_name obj | |
,oracle_username||' ('||s.status||')' oruser | |
,os_user_name osuser | |
,machine computer | |
,l.process unix | |
,s.sid||','||s.serial# ss | |
,r.name rs | |
,to_char(s.logon_time,'yyyy/mm/dd hh24:mi:ss') time | |
from v$locked_object l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group='commons-net', module='commons-net', version='2.0') | |
import org.apache.commons.net.ftp.FTPClient | |
println("About to connect...."); | |
new FTPClient().with { | |
connect "some-server.some-domain.com" | |
enterLocalPassiveMode() | |
login "your-username", "your-password" | |
changeWorkingDirectory "/var/appl/some/remote/dir/" | |
def incomingFile = new File("some-file-to-retrieve.log") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for when you encounter this crap in your dev or troubleshooting... | |
// java.security.cert.CertificateException: No name matching somedomain.com found | |
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier( | |
new javax.net.ssl.HostnameVerifier(){ | |
public boolean verify(String hostname, | |
javax.net.ssl.SSLSession sslSession) { | |
return true; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(args){ | |
def url = args[0] | |
def text = url.toURL().text | |
println text | |
} | |
else { | |
println "USAGE: gget url" | |
} |
OlderNewer