Skip to content

Instantly share code, notes, and snippets.

View allixender's full-sized avatar

Alex Kmoch allixender

View GitHub Profile
@allixender
allixender / parallel-transcode.sh
Created August 29, 2015 10:32
Parallel for Tesseract OCR and lulti-page pdfs
#!/bin/bash
#ocrpdftotext
# adjusted implementation of http://ubuntuforums.org/showthread.php?t=880471
DPI=300
TESS_LANG=eng
FILENAME=${@}
TMP_NAME=`basename "$FILENAME" .pdf`
OUTPUT_FILENAME=${TMP_NAME}-out-${DPI}.txt
library(gstat)
library(sos4R)
gwl.converters <- SosDataFieldConvertingFunctions(
"http://resources.smart-project.info/gemet/groundwaterlevel" = sosConvertDouble,
"http://www.opengis.net/def/property/OGC/0/SamplingTime" = sosConvertTime,
"http://www.opengis.net/def/property/OGC/0/FeatureOfInterest" = sosConvertString)
gwl <- SOS(url = "http://portal.smart-project.info/52nSOSv3.5.0/sos",
dataFieldConverters = gwl.converters)
# summary(gwl)
gwl_offerings <- sosOfferings(gwl)
# demo sos 400
library(sos4R)
g1.converters <- SosDataFieldConvertingFunctions(
"http://vocab.smart-project.info/sensorweb/phenomenon/Temperature" = sosConvertDouble,
"http://www.opengis.net/def/property/OGC/0/SamplingTime" = sosConvertTime,
"http://www.opengis.net/def/property/OGC/0/FeatureOfInterest" = sosConvertString)
myopts <- curlOptions(ssl.verifyhost=FALSE, ssl.verifypeer=FALSE, followlocation=TRUE)
handle <- getCurlHandle( .opts= myopts)
# wps.des: sos4R_wps_gwl_horo, title = interp mean gw levels per Foi per year via SOS,
# abstract = A Simple and useless demo WPS Process just summing the meaausrements for a given Foi;
# wps.in: year, string;
# calculate something... variable "input" don't has to be initialized
library(sos4R)
library(akima)
library(fields)
gcloud compute --project "cloud-project1" ssh --zone "us-central1-f" "cloud-instance1"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openjdk-7-jdk git
sudo apt-get install libgdal-java libgdal-dev gdal-bin netcdf-bin libnetcdf-dev
@allixender
allixender / zoo-orfeo-buildscript.sh
Last active April 14, 2016 23:22
ZOO-Project WPS offers integration with the Orfeo Remote Sensing and Image Manipulation Toolbox. The build chain takes some time an has a few traps. This build has shown to work with the example request, however a few spurious errors still show up in operations.
#!/bin/bash
# ZOO-Project WPS offers integration with the Orfeo Remote Sensing and Image Manipulation Toolbox.
# The build chain takes some time an has a few traps. This build has shown to work with the example request,
# however a few spurious errors still show up in server operations. I have been able to work through
# http://zoo-project.org/docs/kernel/orfeotoolbox.html and execute the example request. A black result PNG
# is returned.
# tail -f /var/log/apache2/error.log
--
@allixender
allixender / zoo-sagagis-buildscript.sh
Created April 15, 2016 00:57
ZOO-Project WPS offers integration with the SAGA GIS. The build chain takes some time an has a few traps. This build completes and the example request Garden_Fractals works, but a GRID sum causes a few spurious errors.
# ZOO-Project WPS offers integration with the SAGA GIS.
# The build chain takes some time an has a few traps.
# My build completes and the example request Garden_Fractals works,
# but a GRID sum causes SIGSEV11 errors and complete successfully
# .. although somestuff is working along the operation..
# apache2 log
## snip
error: line 18: character not allowed ';'
error: line 18: character not allowed ';'
cluster_name: 'Test Cluster'
hinted_handoff_enabled: true
max_hint_window_in_ms: 10800000 # 3 hours
hinted_handoff_throttle_in_kb: 1024
max_hints_delivery_threads: 2
batchlog_replay_throttle_in_kb: 1024
authenticator: AllowAllAuthenticator
authorizer: AllowAllAuthorizer
permissions_validity_in_ms: 2000
partitioner: org.apache.cassandra.dht.Murmur3Partitioner
package controllers;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import play.Logger;
import play.mvc.Controller;
@allixender
allixender / README-tomcat-as-systemd-service.md
Created September 10, 2018 06:35 — forked from drmalex07/README-tomcat-as-systemd-service.md
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/tomcat@.service: