Skip to content

Instantly share code, notes, and snippets.

Avatar

Javier Delgado witokondoria

View GitHub Profile
@witokondoria
witokondoria / init.gradle
Created Oct 27, 2017
A simple init.gradle close to a maven global parent pom
View init.gradle
projectsEvaluated {
rootProject {
task version {
println project.version
}
task changeVersion {
ant.replaceregexp(file: "build.gradle", match: "\\sversion\\s+?=\\s+?[\"|\'](${project.version})[\"|\']", replace: " version = \"${System.getProperty('newVersion')}\"", byline: true, flags: "s")
}
task listrepos << {
println "Repositories:"
View gist:c87148e67af73243fa7d0238ec5a99d5
try {
sh "mvn test"
} catch (terr) {
throw new GroovyRuntimeException("Exception on tests", terr)
} finally {
archive "**/surefire-reports/*.xml"
try {
junit allowEmptyResults: true, keepLongStdio: true, testResults: "**/target/${crossbuild}/surefire-reports/*.xml"
} catch (juterr) {
mail X
@witokondoria
witokondoria / gpg-import-and-export-instructions.md
Created Aug 24, 2017 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys
View gpg-import-and-export-instructions.md

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
View gist:865eb2cbcdb682f57a05b69df3205245
java.util.ConcurrentModificationException
at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1211)
at java.util.TreeMap$EntryIterator.next(TreeMap.java:1247)
at java.util.TreeMap$EntryIterator.next(TreeMap.java:1242)
at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:75)
at com.thoughtworks.xstream.converters.collections.TreeMapConverter.marshal(TreeMapConverter.java:59)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
@witokondoria
witokondoria / pipeline.log
Created Jun 15, 2017
Mockito NotSerializableException
View pipeline.log
java.io.NotSerializableException: org.mockito.internal.creation.DelegatingMethod
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
View docker-staging-cleanup.groovy
import org.sonatype.nexus.repository.storage.StorageFacet
def dockerRepository = repository.repositoryManager.get('docker-staging')
def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName)
def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get()
try {
storageTx.begin()
dockerRepository.stop()
def bucket = storageTx.findBucket(dockerRepository)
@witokondoria
witokondoria / switcher.coffee
Created Nov 8, 2016
switcher dashing widget
View switcher.coffee
# Switcher widget written by Juha Mustonen / SC5
# Switches (reloads to another address) the dashboards in periodic manner
# <div id="container" data-switcher-interval="10000" data-switcher-dashboards="dashboard1 dashboard2">
# <%= yield %>
# </div>
#
class DashboardSwitcher
constructor: () ->
@dashboardNames = []
@witokondoria
witokondoria / 99-btautoconnect.rules
Last active Aug 17, 2018
Amlogic S905 Libreelec bluetooth autoconnect udev rules
View 99-btautoconnect.rules
ACTION=="remove", SUBSYSTEMS=="input", ATTRS{name}=="YOUR_BT_MAC", RUN+="/storage/.config/bluetoothHandler.sh remove"
ACTION=="add", SUBSYSTEMS=="input", ATTRS{name}=="YOUR_BT_MAC", RUN+="/storage/.config/bluetoothHandler.sh add"
View A Jenkins scripts collection
scripting console reachable at ${JENKINS_HOME}/script allows us to perform multiple maintenance operations
Raw
@witokondoria
witokondoria / jenkinsmeter.coffee
Last active Sep 15, 2016
Awesome jenkins job dashing widget
View jenkinsmeter.coffee
class Dashing.Jenkinsmeter extends Dashing.Widget
@accessor 'value', Dashing.AnimatedValue
constructor: ->
super
@observe 'value', (value) ->
$(@node).find(".meter").val(value).trigger('change')
ready: ->
You can’t perform that action at this time.