Skip to content

Instantly share code, notes, and snippets.

View alexlehm's full-sized avatar

Alexander Lehmann alexlehm

View GitHub Profile
verbose: true;
foreground: true;
inetd: false;
numeric: true;
transparent: true;
timeout: 2;
#user: "sslh";
pidfile: "/home/alexlehm/run/sslh.pid";
#chroot: "/var/empty";
@alexlehm
alexlehm / deploy.ps1
Created September 24, 2023 01:44
Post a file to a URL with Powershell
# upload file with form-data to a URL using powershell
# this works with binary files, no conversion happens to the file
#
# this can be used to deploy files on Appveryor
$File='result.zip';
$FilePath = Get-Item -Path $File;
$URL = "https://example.com/upload.php";
$fileBytes = [System.IO.File]::ReadAllBytes($FilePath);
@alexlehm
alexlehm / fact.pl
Last active October 25, 2018 19:23
720! calculation with Perl and bigint
#! /usr/bin/perl
use bigint;
$f=1;
for($i=1;$i<=720;$i++) {
$f*=$i;
}
@alexlehm
alexlehm / gist:b5726ded353eaafd14f4
Last active September 16, 2018 03:16
vertx http download
import org.junit.Test;
import org.vertx.java.core.AsyncResult;
import org.vertx.java.core.Handler;
import org.vertx.java.core.file.AsyncFile;
import org.vertx.java.core.http.HttpClient;
import org.vertx.java.core.http.HttpClientResponse;
import org.vertx.java.core.streams.Pump;
import org.vertx.testtools.TestVerticle;
public class DownloadTest extends TestVerticle {
#!/bin/bash
###################################################################
# check_postfix_mailqueue is developped with GPL Licence 2.0
#
# GPL License: http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#
# Developped by : Bjoern Bongermino
#
###################################################################
# This program is free software; you can redistribute it and/or
@alexlehm
alexlehm / AsyncTest.java
Last active May 25, 2017 10:38
AsyncTest.java
package cx.lehmann.vertx;
import org.junit.Test;
import org.junit.runner.RunWith;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
@alexlehm
alexlehm / HttpKeepAliveClientTest.java
Created May 14, 2017 11:44
HttpKeepAliveClientTest.java
package cx.lehmann.vertx;
import org.junit.Test;
import org.junit.runner.RunWith;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
@alexlehm
alexlehm / HttpKeepAliveClientTest.java
Created May 10, 2017 21:18
HttpKeepAliveClientTest.java
package cx.lehmann.vertx;
import org.junit.Test;
import org.junit.runner.RunWith;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientOptions;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
diff --git a/src/test/java/httpclientpool/HttpClientPoolTest.java b/src/test/java/httpclientpool/HttpClientPoolTest.java
index 9a0e7d0..e5d0abe 100644
--- a/src/test/java/httpclientpool/HttpClientPoolTest.java
+++ b/src/test/java/httpclientpool/HttpClientPoolTest.java
@@ -21,6 +21,7 @@ import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
+import static org.mockserver.matchers.Times.exactly;
@alexlehm
alexlehm / Log4j2LogDelegate.java
Created September 21, 2016 20:41
Log4j2LogDelegate.java
/*
* Copyright (c) 2011-2015 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*