Skip to content

Instantly share code, notes, and snippets.

@tszpinda
tszpinda / examle.html
Last active July 26, 2016 15:52
wkhtmltopdf
<html>
<body>
Test: Random text
</body>
</html>
@tszpinda
tszpinda / clear-docker.sh
Last active November 17, 2020 11:42
clean docker
sudo docker ps -a | grep 'dom-ni' | awk '{print $1}' | xargs --no-run-if-empty sudo docker rm -f
sudo docker images | grep "<none>" | awk '{print $3}' | xargs --no-run-if-empty sudo docker rmi -f
docker rm `docker ps -a | grep Exited | awk '{print $1 }'`
docker rmi `docker images -aq`
# to always return 0 status add || true at the end
@tszpinda
tszpinda / is-db-ready.groovy
Created October 9, 2015 12:51
groovy-oracle-ready
def url = "jdbc:oracle:thin:system/oracle@localhost:11521:xe"
def username = "system"
def password = "oracle"
@GrabConfig(systemClassLoader=true)
@Grab('com.oracle:ojdbc14:10.1.0.5.0')
driver = "oracle.jdbc.driver.OracleDriver"
import groovy.sql.*
@tszpinda
tszpinda / command-line-execute.sh
Created October 9, 2015 12:55
install maven in jenkins via groovy
# command line to execute.
java -jar jenkins-cli.jar -s http://localhost:8080/ groovy install-maven-in-jenkins.groovy
@tszpinda
tszpinda / mail-sink.sh
Created October 12, 2015 07:05
Mail sink
sudo python -m smtpd -c DebuggingServer -n localhost:25
@tszpinda
tszpinda / rerunEclipseConfig.groovy
Last active October 15, 2015 12:42
eclipse - re run debug config
//used with ease plugin for eclipse
import org.eclipse.debug.core.*;
def manager = DebugPlugin.getDefault().getLaunchManager();
def type = manager.getLaunchConfigurationType(org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants.ID_REMOTE_JAVA_APPLICATION);
def configurations = manager.getLaunchConfigurations(type);
println "starting: ${configurations}";
while(true) {
@tszpinda
tszpinda / scanpom.groovy
Last active October 19, 2015 10:50
read pom.xml
def ant = new AntBuilder();
def scanner = ant.fileScanner {
fileset(dir:'.') {
include(name:"**/pom.xml")
ex
@tszpinda
tszpinda / jenkins-run-non-it-jobs.groovy
Last active October 27, 2015 11:59
run jenkins jobs
//cancel
Jenkins.instance.queue.items.findAll { it.task.name.startsWith('JIRA-1350') }.each { Jenkins.instance.queue.cancel(it.task) }
//schedule
Jenkins.instance.items.findAll { !it.name.contains('-it-') }.each { it.scheduleBuild(); }
@tszpinda
tszpinda / git.sh
Last active November 10, 2015 09:17
git commands
#delete local branch
git branch -D bugfix
#delete remote branch
git push origin --delete bugfix
#remove unstaged files
find . -name '.gitignore' | xargs git clean -f
#remove all unstaged files and dirs
git clean -fdx
@tszpinda
tszpinda / scanpom-find-dependancy.groovy
Created October 20, 2015 09:53
scanpom find dependancy
def ant = new AntBuilder();
def scanner = ant.fileScanner {
fileset(dir:'.') {
include(name:"**/pom.xml")