Skip to content

Instantly share code, notes, and snippets.

@nithril
nithril / Script CRON 1
Last active December 29, 2015 14:29
Sauvegarde Elasticsearch
#!/bin/bash
_now=$(date +"%Y_%m_%d_%H_%M");
curl -X POST "http://localhost.fr:9200/_export?target=/usr/local/lilactu/save/${_now}.tar.gz"
@nithril
nithril / gist:6094771
Last active December 20, 2015 07:39
Why groovy does not complain ? https://jira.codehaus.org/browse/GROOVY-5168
@TypeChecked
File doSomething(){
//Oops, return nothing explicitly
}
assert doSomething() == null
[DEBUG] effective simulationsFolder: C:\Users\nlabrot\Projet\AgileViewer\tools\stress\src\test\scala
[DEBUG] resolved simulation classes: [basic.BasicExampleSimulation]
[DEBUG] plugin jar to add :c:\maven\repo\net\alchim31\maven\scala-maven-plugin\3.1.3\scala-maven-plugin-3.1.3.jar
[DEBUG] cmd: C:\Program Files\Java\jdk1.7.0_09\jre\bin\java -classpath C:\Users\nlabrot\Projet\AgileViewer\tools\stress\target\test-classes;C:\Users\nlabrot\Projet\AgileViewer\tools\stress\target\classes;c:\maven\repo\com\excilys\ebi\gatling\highcharts\gatling-charts-highcharts\1.4.6\gatling-charts-highcharts-1.4.6.jar;c:\maven\repo\com\excilys\ebi\gatling\gatling-app\1.4.6\gatling-app-1.4.6.jar;c:\maven\repo\com\excilys\ebi\gatling\gatling-http\1.4.6\gatling-http-1.4.6.jar;c:\maven\repo\com\ning\async-http-client\1.7.12\async-http-client-1.7.12.jar;c:\maven\repo\org\glassfish\grizzly\grizzly-websockets\2.2.16\grizzly-websockets-2.2.16.jar;c:\maven\repo\org\glassfish\grizzly\grizzly-framework\2.2.16\grizzly-framework-2.2.16.jar;c:
@nithril
nithril / gist:1893519
Created February 23, 2012 16:22
Intellij TestNG integration
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1838)
at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1747)
at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:226)
at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(SerializedMessageSender.java:24)
at org.testng.remote.strprotocol.MessageHub.sendMessage(MessageHub.java:44)
at org.testng.remote.strprotocol.RemoteTestListener.onTestSuccess(RemoteTestListener.java:92)
@nithril
nithril / gist:1276426
Created October 10, 2011 20:31
Plan with element value
<plan>
<operation name="SELECT STATEMENT" id="0" depth="0" pos="18911">
<card>9597</card>
<bytes>220731</bytes>
<cost>18911</cost>
<io_cost>18901</io_cost>
<cpu_cost>141769650</cpu_cost>
<time>00:03:47 </time>
</operation>
<operation name="FILTER" id="1" depth="1" pos="1">
<plan>
<operation name="SELECT STATEMENT" id="0" depth="0" pos="1843">
<card>9287</card>
<bytes>35076999</bytes>
<cost>1843</cost>
<io_cost>1809</io_cost>
<cpu_cost>482733685</cpu_cost>
<time>00:00:23 </time>
</operation>
<operation name="FILTER" id="1" depth="1" pos="1">
<div>
${toolbar()}
</div>
<div>
${table()}
</div>
<ui:composition template="/table">
<ui:define composition="${it}" name="toolbar">
[Toolbar content]
</ui:define>
<ui:define composition="${it}" name="table">
[Table content]
</ui:define>
</ui:composition>
class Composition {
Map defines = new HashMap()
}
class UICompositionTagLib {
static namespace = 'ui'
def out
def composition = { attrs, body ->
if (!attrs.template) {
throwTagError("Tag [composition] is missing required attribute [template]")
}
Composition composition = new Composition()