Skip to content

Instantly share code, notes, and snippets.

View bdelacretaz's full-sized avatar

Bertrand Delacretaz bdelacretaz

View GitHub Profile
@bdelacretaz
bdelacretaz / Dockerfile.systemd-socket-activate
Created July 5, 2019 11:09
Testing systemd-socket-activate
# Example Dockerfile which uses systemd-socket-activate
# to start an executable when a socket connection is made.
FROM ubuntu:bionic
RUN apt-get update
RUN apt-get install -y systemd
EXPOSE 8080
CMD ["systemd-socket-activate", "-l 8080", "--inetd", "-a", "date"]

Measuring Docker image time to first request

This is a just rough method with rough results...

cat ctest.bash 
URL=http://localhost:8080
while true
do
  curl $URL 2>/dev/null || continue

echo

@bdelacretaz
bdelacretaz / car.js
Last active February 13, 2019 17:41
// OpenWhisk minimal integration Web function example
// Get a car's make from the Icelandic apis.is service
// See https://github.com/apache/incubator-openwhisk/blob/master/docs/webactions.md
//
// Test as follows, on an OpenWhisk setup:
// $ wsk -i action create car car.js --web true
// ok: created action car
// $ export URL=$(wsk -i action get car --url | grep http)
// # Known good prefixes: aa02*, aa03*, aa12*
// $ export prefix=aa12
@bdelacretaz
bdelacretaz / rc3bin.txt
Created July 13, 2018 12:28
Checking binaries in NetBeans 9.0 vc3 release
$ find . -type f | grep -v ' ' | while read f ; do file "$f" | egrep -v 'Java|XML|ASCII|PNG|JPEG|GIF|Unicode text'; done
./ide/launcher/macosx/NetBeansLauncher/netbeans.icns: Mac OS X icon, 168443 bytes, "ic09" type
./ide/launcher/macosx/NetBeansLauncher/English.lproj/MainMenu.nib/objects.nib: NeXT/Apple typedstream data, big endian, version 4, system 1000
./ide/launcher/macosx/NetBeansLauncher/ReadMe.rtf: Rich Text Format data, version 1, Apple Macintosh
./ide/launcher/windows/netbeans.ico: MS Windows icon resource - 5 icons, 16x16, 32 bits/pixel, 32x32, 32 bits/pixel
./projectimport.eclipse.core/test/unit/data/myeclipselibstest.zip: Zip archive data, at least v1.0 to extract
./css.editor/test/unit/data/testfiles/testHtmlApplication/public_html/folder/style2.css: empty
./css.editor/test/unit/data/testfiles/testHtmlApplication/public_html/style.css: empty
./lib.profiler/test/unit/src/org/netbeans/lib/profiler/heap/heapDumpLog.txt: data
./jellytools.ide/test/qa-functional/data/SampleProject/src/sample1/unrecog
@bdelacretaz
bdelacretaz / 90rc1rc1-binaries.txt
Created May 23, 2018 13:01
analysis of binary files for NetBeans 9.0 rc1-rc1 release
$ find . -type f | grep -v ' ' | while read f ; do file "$f" | egrep -v 'Java|XML|ASCII|PNG|JPEG|GIF|Unicode text'; done
./ide/launcher/macosx/NetBeansLauncher/netbeans.icns: Mac OS X icon, 168443 bytes, "ic09" type
./ide/launcher/macosx/NetBeansLauncher/English.lproj/MainMenu.nib/objects.nib: NeXT/Apple typedstream data, big endian, version 4, system 1000
./ide/launcher/macosx/NetBeansLauncher/ReadMe.rtf: Rich Text Format data, version 1, Apple Macintosh
./ide/launcher/windows/netbeans.ico: MS Windows icon resource - 5 icons, 16x16, 32 bits/pixel, 32x32, 32 bits/pixel
./projectimport.eclipse.core/test/unit/data/myeclipselibstest.zip: Zip archive data, at least v1.0 to extract
./css.editor/test/unit/data/testfiles/testHtmlApplication/public_html/folder/style2.css: empty
./css.editor/test/unit/data/testfiles/testHtmlApplication/public_html/style.css: empty
./lib.profiler/test/unit/src/org/netbeans/lib/profiler/heap/heapDumpLog.txt: data
./jellytools.ide/test/qa-functional/data/SampleProject/src/sample1/unrecog
#!/bin/bash
# Script that runs antlr4, the jar can be downloaded
# from https://www.antlr.org/download/antlr-4.7.1-complete.jar
java -jar ~/lib/antlr4/antlr-4.7.1-complete.jar $*
@bdelacretaz
bdelacretaz / no-system-exit.jsp
Created February 21, 2018 15:14
Java: block System.exit() using a SecurityManager
<%--
JSP page that demonstrates blocking System.exit()
with a SecurityManager.
Do NOT use on production systems unless you know
EXACTLY what you are doing!
--%>
<%@page
contentType="text/plain"
pageEncoding="UTF-8"
import="
@bdelacretaz
bdelacretaz / output.txt
Created February 8, 2018 16:32
NetBeans 9.0 beta rc3 binary files analysis
# output of
# find . -type f | grep -v ' ' | while read f ; do file "$f" | egrep -v 'Java|XML|ASCII|PNG|JPEG|GIF|Unicode text'; done
./ant.freeform/test/unit/data/example-projects/extbuildroot/build/built.file: empty
./api.search/test/unit/data/textFiles/latin2file.txt: ISO-8859 text, with no line terminators
./api.search/test/unit/data/textFiles/utf8file.txt: UTF-8 Unicode (with BOM) text
./api.search/test/unit/src/org/netbeans/modules/search/data/0_bytes: empty
./api.search/test/unit/src/org/netbeans/modules/search/data/1_byte: very short file (no magic)
./apisupport.harness/release/etc/applicationIcon.icns: Mac OS X icon, 47580 bytes, "ics#" type
./apisupport.harness/windows-launcher-src/app.ico: MS Windows icon resource - 5 icons, 48x48, 8 bits/pixel, 32x31, 8 bits/pixel
./autoupdate.services/test/unit/src/org/netbeans/api/autoupdate/data/dummy-signed-twice.jar: Zip archive data, at least v2.0 to extract
@bdelacretaz
bdelacretaz / DemoModels.java
Created February 1, 2018 14:56
Initial RTD-X demo models - hardcoded for now
// Actual models would be parsed from YAML, JSON, ...
// current code at
// https://github.com/bdelacretaz/sling-whiteboard/tree/rtdx/rtdx/rtdx-core
class DemoModels {
static Collection<ResourceModel> getModels() {
final List<ResourceModel> list = new ArrayList<>();
list.add(ResourceModel.BUILDER()
.withName("rtdx/root")
@bdelacretaz
bdelacretaz / netbeans-90-beta-rc2-release-binaries.txt
Created January 15, 2018 16:15
NetBeans 9.0 Beta rc2 - any binary files in the release archive?
# output of
# find . -type f | grep -v ' ' | while read f ; do file "$f" | egrep -v 'Java|XML|ASCII|PNG|JPEG|GIF|Unicode text'; done
./ant.freeform/test/unit/data/example-projects/extbuildroot/build/built.file: empty
./api.search/test/unit/data/textFiles/latin2file.txt: ISO-8859 text, with no line terminators
./api.search/test/unit/data/textFiles/utf8file.txt: UTF-8 Unicode (with BOM) text
./api.search/test/unit/src/org/netbeans/modules/search/data/0_bytes: empty
./api.search/test/unit/src/org/netbeans/modules/search/data/1_byte: very short file (no magic)
./apisupport.harness/release/etc/applicationIcon.icns: Mac OS X icon, 47580 bytes, "ics#" type
./apisupport.harness/windows-launcher-src/app.ico: MS Windows icon resource - 5 icons, 48x48, 8 bits/pixel, 32x31, 8 bits/pixel
./autoupdate.services/test/unit/src/org/netbeans/api/autoupdate/data/dummy-signed-twice.jar: Zip archive data, at least v2.0 to extract