Skip to content

Instantly share code, notes, and snippets.

View fbricon's full-sized avatar
🖖

Fred Bricon fbricon

🖖
View GitHub Profile
browser.registerBrowserFunction("openInIDE", new IBrowserFunction() {
@Override
public Object function(Object[] browserArgs) {
String function = browserArgs[0].toString();
String arg = browserArgs[1].toString();
switch (function) {
case "quickstart":
openQuickstart(parent.getShell(), arg);
break;
case "wizard":
ERROR: org.eclipse.equinox.p2.engine code=4 An error occurred while collecting items to be installed
at org.eclipse.oomph.util.OomphPlugin.coreException(OomphPlugin.java:249)
at org.eclipse.oomph.p2.internal.core.ProfileTransactionImpl$2.commit(ProfileTransactionImpl.java:488)
at org.eclipse.oomph.p2.internal.core.ProfileTransactionImpl.commit(ProfileTransactionImpl.java:323)
at org.eclipse.oomph.setup.p2.impl.P2TaskImpl.perform(P2TaskImpl.java:701)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.doPerformNeededSetupTasks(SetupTaskPerformer.java:2903)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performNeededSetupTasks(SetupTaskPerformer.java:2847)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performTriggeredSetupTasks(SetupTaskPerformer.java:2828)
at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.perform(SetupTaskPerformer.java:2759)
at org.eclipse.oomph.setup.ui.wizards.ProgressPage$9.run(ProgressPage.java:539)
@fbricon
fbricon / nodejs-build-config.json
Created December 9, 2015 17:20
nodejs-build-config.json
{
"metadata" : {
"name" : "nodejs-example",
"namespace" : "fred",
"selfLink" : "/oapi/v1/namespaces/fred/buildconfigs/nodejs-example",
"uid" : "3a0364f0-9c5f-11e5-b172-5254002560a2",
"resourceVersion" : "37755",
"creationTimestamp" : "2015-12-06T21:20:51Z",
"labels" : {"template" : "nodejs-example"},
"annotations" : {"description" : "Defines how to build the application"}
@fbricon
fbricon / gist:f3f62631290b125ff5c6
Created February 23, 2016 22:37
oc new-app kubernetes/guestbook
➜ souk oc new-app kubernetes/guestbook --loglevel=8
I0223 17:35:53.816765 68173 loader.go:241] Config loaded from file /Users/fbricon/.kube/config
I0223 17:35:53.818840 68173 loader.go:241] Config loaded from file /Users/fbricon/.kube/config
I0223 17:35:53.822502 68173 debugging.go:99] GET https://10.1.2.2:8443/oapi
I0223 17:35:53.822526 68173 debugging.go:106] Request Headers:
I0223 17:35:53.822533 68173 debugging.go:109] User-Agent: oc/v1.1 (darwin/amd64) openshift/1904cc3
I0223 17:35:53.822539 68173 debugging.go:109] Authorization: Bearer RK0Dgj4x42z2sGa9eCoyXYsttEMAuPxflxvF55408EM
I0223 17:35:53.852285 68173 debugging.go:124] Response Status: 200 OK in 29 milliseconds
I0223 17:35:53.852311 68173 debugging.go:127] Response Headers:
I0223 17:35:53.852318 68173 debugging.go:130] Content-Type: application/json
package org.jboss.tools.openshift.core.server.behavior;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServerAttributes;
import org.jboss.ide.eclipse.as.wtp.core.server.behavior.ISubsystemController;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
import org.jboss.tools.as.core.internal.modules.ModuleDeploymentPrefsUtil;
import org.jboss.tools.as.core.server.controllable.subsystems.internal.ModuleDeployPathController;
import org.jboss.tools.openshift.core.server.OpenShiftServerUtils;
@fbricon
fbricon / count_tests.sh
Created July 5, 2016 18:03
count JUnit tests
echo "Total, Run, Failures, Errors, Skips :: path/to/surefire-reports/class-file.txt"
num=0; tot=0; tests=$(find */*/*/target/surefire-reports/ */*/target/surefire-reports/ -mindepth 1 -maxdepth 1 -name "*.txt" 2>/dev/null|sort); for d in $tests; do (( num++ )); cnt=""; cnt=$(cat $d | grep -v "Tests run" | grep "Time elapsed" | wc -l); tot=$(( tot + cnt )); cat $d | grep "Tests run" | sed "s#Tests run: \([0-9]\+\), Failures: \([0-9]\+\), Errors: \([0-9]\+\), Skipped: \([0-9]\+\), Time elapsed: .\+ in \(.\+\).*#\1 ${cnt} \2 \3 \4 :: ${d}#"; done; echo ""; echo "Total classes: $num"; echo "Total tests run: $tot"
@fbricon
fbricon / gist:9f291ef3c1d9546bf6da6012c2fb0e32
Created August 9, 2016 19:59
oc cluster up (1.3.alpha3)
v1.3.0-alpha.3 ./oc cluster up
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v1.3.0-alpha.3 image ...
Pulling image openshift/origin:v1.3.0-alpha.3
Pulled 0/3 layers, 3% complete
Pulled 1/3 layers, 70% complete
Pulled 2/3 layers, 96% complete
Pulled 3/3 layers, 100% complete
This file has been truncated, but you can view the full file.
curl http://localhost:6060/debug/pprof/goroutine?debug=2
goroutine 7863 [running]:
runtime/pprof.writeGoroutineStacks(0x7fc894588510, 0xc20c33d5e0, 0x0, 0x0)
/usr/lib/golang/src/runtime/pprof/pprof.go:511 +0x8d
runtime/pprof.writeGoroutine(0x7fc894588510, 0xc20c33d5e0, 0x2, 0x0, 0x0)
/usr/lib/golang/src/runtime/pprof/pprof.go:500 +0x4f
runtime/pprof.(*Profile).WriteTo(0x4eca7e0, 0x7fc894588510, 0xc20c33d5e0, 0x2, 0x0, 0x0)
/usr/lib/golang/src/runtime/pprof/pprof.go:229 +0xd5
net/http/pprof.handler.ServeHTTP(0xc20f1bad91, 0x9, 0x7fc8945884d8, 0xc20c33d5e0, 0xc20fe60d00)
@fbricon
fbricon / lifecycle-mapping-metadata.xml
Created September 8, 2016 17:27
lifecycle-mapping-metadata.xml for che projects in Eclipse
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.google.code.sortpom</groupId>
<artifactId>maven-sortpom-plugin</artifactId>
<versionRange>[2.3.0,)</versionRange>
<goals>
<goal>verify</goal>
<wb-module deploy-name="utility-project-name">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>