Skip to content

Instantly share code, notes, and snippets.

@ari
ari / Syns2Syms.java
Created August 29, 2011 22:43 — forked from bradfordcp/Syns2Syms.java
Converts a WordNet prolog file into a flat file useful for Solr synonym matching.
/**
* Based off of the Lucene prolog parser in the wordnet contrib package within the
* main Lucene project. It has been modified to remove the Lucene bits and generate
* a synonyms.txt file suitable for consumption by Solr. The idea was mentioned in
* a sidebar of the book Solr 1.4 Enterprise Search Server by Eric Pugh.
*
* @see <a href="http://lucene.apache.org/java/2_3_2/lucene-sandbox/index.html#WordNet/Synonyms">Lucene Sandbox WordNet page</a>
* @see <a href="http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/wordnet/">SVN Repository of the WordNet contrib</a>
* @see <a href="https://www.packtpub.com/solr-1-4-enterprise-search-server/book">Solr 1.4 Enterprise Search Server Book</a>
*/
https://github.com/jenkinsci/svnkit/commit/1b5bdd882c3b0f6ff9292fc98b852c899496c211
SVNKit has a weird error handling abstraction. It has 'SVNErrorMessage',
which can form a chain (just like exceptions can), and it has most of
the details of the errors. This object is also the one that's created at
the point of an error (thus its stack trace would be of great interest
although it doesn't keep it.)
Then it has SVNException, which is used to wrap SVNErrorMessage into an
Exception.
@ari
ari / watering.py
Created November 10, 2014 05:56
watering system
#!/usr/bin/python
import json
import urllib
import time, sys, getopt, subprocess
from decimal import *
from simpleusbrelay import simpleusbrelay
def main(argv):
# set all decimal math to 4 sig fig
getcontext().prec = 4
@ari
ari / Transaction export.groovy
Created November 25, 2014 22:34
onCourse transaction export
import com.sun.mail.smtp.SMTPMessage
import ish.export.ExportParameter
import ish.oncourse.server.AngelServer
import ish.oncourse.server.PreferenceController
import ish.oncourse.server.cayenne.AccountTransaction
import ish.oncourse.server.export.XsltExport
import org.apache.cayenne.exp.ExpressionFactory
import org.apache.cayenne.query.Ordering
import org.apache.cayenne.query.SelectQuery
import org.apache.cayenne.query.SortOrder
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {
@ari
ari / +MANIFEST.template
Created July 16, 2015 09:11
Create onCourse package script
{
"name": "onCourseServer",
"version": "__version__",
"origin": "misc/onCourseServer",
"comment": "ish onCourse Server for FreeBSD",
"arch": "freebsd:9:x86:64",
"www": "http://www.ish.com.au",
"maintainer": "support@ish.com.au",
"prefix": "/usr/local",
"licenselogic": "single",
Message Queues:
T ID KEY MODE OWNER GROUP CREATOR CGROUP CBYTES QNUM QBYTES LSPID LRPID STIME RTIME CTIME
Shared Memory:
T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME
m 131072 2013294940 --rw------- zabbix zabbix zabbix zabbix 23 16777216 86857 86857 1:12:54 no-entry 1:12:54
m 131073 1728082268 --rw------- zabbix zabbix zabbix zabbix 23 7130317 86857 86857 1:12:54 no-entry 1:12:54
m 131074 1929408860 --rw------- zabbix zabbix zabbix zabbix 23 1258291 86857 86857 1:12:54 no-entry 1:12:54
m 131075 1392537948 --rw------- zabbix zabbix zabbix zabbix 23 5752 86857 86857 1:12:54 no-entry 1:12:54
m 131076 1744859484 --r
'''
SSL/TLS certificate generator
This script will either create a new key + csr for a new ssl domain or just a new csr, if you already have a key and
you are just renewing a cert
'''
from __future__ import absolute_import
import salt.pillar
@ari
ari / build.gradle
Last active August 17, 2019 22:18
Docbook gradle build
/*
Copyright 2015 Aristedes Maniatis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@ari
ari / hs_err_pid.log
Created May 30, 2016 11:20
JVM crash in ZIP_GetEntry
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000803c3e17a, pid=25276, tid=0x00000000000195b3
#
# JRE version: OpenJDK Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: OpenJDK 64-Bit Server VM (25.92-b14 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libzip.so+0x517a] ZIP_GetEntry+0x11a
#