Skip to content

Instantly share code, notes, and snippets.

@helix84
helix84 / AboutPage.java
Created June 15, 2012 23:18 — forked from peterdietz/dspace-add-about.diff
DSpace adding a java page to /about
/**
* AboutPage.java
*
* Basead on the code by Peter Dietz:
* https://gist.github.com/842301#file_dspace_add_about.diff (acessed 11-05-23)
*
* Modified to work with internationalization (i18n locales) and breadcrumbs
* by Andre Nito Assada e Josi Perez Alvarez on 11-05-23
*/
@helix84
helix84 / gist:4331294
Created December 18, 2012 19:50
This appeared in my today's Tomcat logs, no apparent reason so far. Nothing in DSpace log at that time, everything looks normal. Running on DSpace 3.0 with ElasticSearch enabled. This was there in the morning. It's now evening. DSpace was running and responding just a while ago, but now is not responding (I get TCP connection and can send HTTP r…
INFO: [search] webapp=/solr path=/select params={facet=true&facet.mincount=1&facet.offset=0&f.subject_tax_0_filter.facet.sort=count&wt=javabin&rows=0&version=2&f.subject_tax_0_filter.facet.limit=11&start=0&f.author_filter.facet.limit=11&f.dateIssued.year.facet.sort=index&q=*:*&f.dateIssued.year.facet.limit=10&f.author_filter.facet.sort=count&facet.field=author_filter&facet.field=subject_tax_0_filter&facet.field=dateIssued.year&fq=NOT(withdrawn:true)&fq=dateIssued_keyword:2010&fq=location:l9&fq=read:(g0)} hits=5 status=0 QTime=5
Exception in thread "elasticsearch[search]-pool-10-thread-200" java.lang.NoClassDefFoundError: org/elasticsearch/common/io/ThrowableObjectOutputStream
at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:87)
at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:361)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExe
@helix84
helix84 / gist:6219252
Created August 13, 2013 09:01
copy an ID3v1 tag from input.mp3 to output.mp3 (which has no tag) * find out the size of input.mp3 * subtract 128 bytes * dd the last 128 bytes and append them to output.mp3
i=input.mp3; dd bs=1 count=128 if=$i of=output.mp3 skip=$((`ls -l $i | cut -d ' ' -f 5` - 128)) oflag=append conv=notrunc
#!/bin/sh
#
# Author: Ivan Masar, 2015
# License: public domain
#
# list running VMs by name
# for each VM print selected fields from vminfo
# format it into a table (using "column")
print_header=1
-- preview change
SELECT *, regexp_replace(handle, '123456789/(.*)', E'123/\\1') FROM handle
WHERE handle LIKE '123456789/%'
LIMIT 50;
-- change 123456789/ to 123/
UPDATE handle SET handle = regexp_replace(handle, '123456789/(.*)', E'123/\\1') WHERE handle LIKE '123456789/%';
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-18 11:39+0200\n"
"PO-Revision-Date: 2015-10-20 00:46+0200\n"
"Last-Translator: x <[email protected]>\n"
"Language-Team: x\n"
"Language: sk\n"
"MIME-Version: 1.0\n"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import requests
import json
import xml.etree.ElementTree as ElementTree
from javax.servlet.http import HttpServlet
class ImpactServlet(HttpServlet):
#!/bin/bash
# Don't put duplicate lines in the history
export HISTCONTROL=ignoredups
# Store a lot history entries in a file for grep-age
shopt -s histappend
export HISTFILE=~/long_history
export HISTFILESIZE=50000
# this list is not exhaustive
sed \
-e 's/\\u00c4\\u00be/ľ/g' \
-e 's/\\u00c5\\u00a1/š/g' \
-e 's/\\u00c4\\u008d/č/g' \
-e 's/\\u00c5\\u00a5/ť/g' \
-e 's/\\u00c3\\u00a4/ť/g' \
-e 's/\\u00c5\\u00be/ž/g' \
-e 's/\\u00c3\\u00bd/ý/g' \
-e 's/\\u00c3\\u00a1/á/g' \
procedure ShowText(Canvas: TCanvas; Text: string)
var
LogFont: TLogFont;
begin
GetObject(Canvas.Font.Handle, SizeOf(LogFont), Addr(LogFont));
with LogFont do
begin
lfQuality := ANTIALIASED_QUALITY;
lfOutPrecision := Out_TT_Only_Precis;
end;