Skip to content

Instantly share code, notes, and snippets.

View andsel's full-sized avatar

Andrea Selva andsel

  • Trento area
View GitHub Profile
@andsel
andsel / bombing_client.rb
Created October 5, 2020 14:44
client flood TCP request
#!/usr/bin/env ruby
require 'socket'
host = "localhost"
port = 5043
PAYLOAD = "System.Runtime.InteropServices.COMException (0x80004005): Error recived. at UiPath.UiNodeClass.Get(String bstrAttr) at UiPath.Core.UiElement.IsElementReady()\r"
def request_close(host, port)
client = TCPSocket.open(host, port)
@andsel
andsel / QueuePerfTest.java
Created March 30, 2020 09:52
queue throughput perf check
import org.eclipse.jetty.toolchain.perf.PlatformTimer;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.io.IOException;
import java.util.concurrent.*;
@andsel
andsel / CustomSuiteAS.java
Created December 11, 2019 11:15
Test sequence
@RunWith(Suite.class)
@Suite.SuiteClasses({
org.logstash.AccessorsTest,
org.logstash.ackedqueue.CheckpointTest,
org.logstash.ackedqueue.HeadPageTest,
org.logstash.ackedqueue.io.FileCheckpointIOTest,
org.logstash.ackedqueue.io.FileMmapIOTest,
org.logstash.ackedqueue.io.IntVectorTest,
org.logstash.ackedqueue.io.LongVectorTest,
org.logstash.ackedqueue.io.MmapPageIOTest,
@andsel
andsel / copy_twbs_scaffold.sh
Created June 15, 2012 09:00
Simple script to copy twitter bootstrap scaffolding in a new project
#!/bin/sh
#Usage copy_twbs_scaffold scaffoleding_git_cloned destination_prj
echo "Coping twitterbootstrap scaffold files \n from: $1 \n to: $2"
mkdir -p $2/src/templates/scaffolding
cp $1/src/templates/scaffolding/* $2/src/templates/scaffolding;
cp $1/web-app/css/scaffolding.css $2/web-app/css/
echo "WARN overwriting of your existent conf iguration, please re-check it!!"
cp -Rf $1/grails-app/conf $2/grails-app/
class abstract Geometry {
abstract Geometry envelope();
}
clas Rect extends Geometry {
public Rect(int height, int width) {...}
}
class Circle extends Geometry {
public Geometry envelope() {