Skip to content

Instantly share code, notes, and snippets.

@olivergondza
olivergondza / gcalcli
Last active March 29, 2023 11:27
gcalcli
$ pacman -Ql gcalcli
gcalcli /home/ogondza/code/my-project/.myproject.venv/
gcalcli /home/ogondza/code/my-project/.myproject.venv/bin/
gcalcli /home/ogondza/code/my-project/.myproject.venv/bin/gcalcli
gcalcli /home/ogondza/code/my-project/.myproject.venv/lib/
gcalcli /home/ogondza/code/my-project/.myproject.venv/lib/python3.10/
gcalcli /home/ogondza/code/my-project/.myproject.venv/lib/python3.10/site-packages/
gcalcli /home/ogondza/code/my-project/.myproject.venv/lib/python3.10/site-packages/gcalcli-4.3.0-py3.10.egg-info/
gcalcli /home/ogondza/code/my-project/.myproject.venv/lib/python3.10/site-packages/gcalcli-4.3.0-py3.10.egg-info/PKG-INFO
gcalcli /home/ogondza/code/my-project/.myproject.venv/lib/python3.10/site-packages/gcalcli-4.3.0-py3.10.egg-info/SOURCES.txt
@olivergondza
olivergondza / lib.sh
Created October 25, 2021 12:15
bats-safemode-reproducer
function foo() {
echo "$1" | grep bar # Fail if the input does not contain 'bar'
echo "end"
}
@olivergondza
olivergondza / test.groovy
Created November 28, 2019 21:18
openstack4j/openstack4j groovy tester
@Grapes([
@Grab('com.github.openstack4j.core:openstack4j-core:3.4-SNAPSHOT'),
@Grab('com.github.openstack4j.core.connectors:openstack4j-httpclient:3.4-SNAPSHOT'),
@Grab('org.slf4j:slf4j-jdk14:1.7.7')
])
import org.openstack4j.openstack.OSFactory
import org.openstack4j.model.compute.*
import org.openstack4j.model.common.*
import org.openstack4j.core.transport.Config
java.nio.file.AccessDeniedException: /tmp/forbidden/atomicXXXXXXXXtmp -> /tmp/forbidden/test
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:396)
at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
at java.nio.file.Files.move(Files.java:1395)
at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:191)
at hudson.util.AtomicFileWriterTest.test(AtomicFileWriterTest.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
master50756|SEVERE: Failed to install ruby-runtime
master50756|java.io.IOException: Failed to dynamically deploy this plugin
master50756| at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2016)
master50756| at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1708)
master50756| at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
master50756| at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
master50756| at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:112)
master50756| at java.base/java.lang.Thread.run(Thread.java:834)
master50756|Caused by: java.io.IOException: Failed to install ruby-runtime plugin
master50756| at hudson.PluginManager.dynamicLoad(PluginManager.java:915)
FATAL: null
java.lang.ClassNotFoundException: java.lang.UNIXProcess
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at hudson.util.ProcessTree$UnixReflection.<clinit>(ProcessTree.java:778)
Moved to a repo: https://github.com/olivergondza/bash-strict-mode/blob/master/strict-mode.sh
java.lang.Error: Local error
at hudson.FilePathTest.simulateFailure(FilePathTest.java:865)
at hudson.FilePathTest.avoidDuplicatedCallSite(FilePathTest.java:856)
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:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
@olivergondza
olivergondza / logging.properties
Created February 5, 2018 08:41
Turn on Java logging from console
# java -Djava.util.logging.config.file=logging.properties ...
handlers=java.util.logging.ConsoleHandler
.level=FINEST
java.util.logging.ConsoleHandler.level=FINEST
@olivergondza
olivergondza / gist:ffb54b9660584aba578a6d9fc6b88f83
Created September 8, 2017 08:15
Get recent jobs with SCM link
import hudson.scm.*
def MAX_AGE = 1000 * 60 * 60 * 24 * 7
def notOlderThan = new Date(System.currentTimeMillis() - MAX_AGE)
Jenkins.instance.getAllItems(hudson.model.Job.class).grep { it instanceof TopLevelItem }.each {
lb = it.lastBuild
if (lb == null) return // not build