« September 2008 | Main | November 2008 »

October 24, 2008

Simple Java code to dump an xml document using DOM

This zip file contains java code and an xml file to test it.
When it is run you will see: [silvi003~/xmlDom_play]$ javac DomEcho01.java [silvi003~/xmlDom_play]$ java DomEcho01 slideSample01.xml <xml version="1.0"> <slideshow author="Yours Truly" date="Date of publication" title="Sample Slide Show"> <slide type="all"> <title>Wake up to WonderWidgets!</title> </slide> <slide type="all"> <title>Overview</title> <item>Why <em>WonderWidgets</em> are great</item> <item></item> <item>Who <em>buys</em> WonderWidgets</item> </slide>

October 14, 2008

Test media filter ... DSPACE UDC side

This media should be filtered:

http://purl.umn.edu/5842

Keywords:

Austin Catholic November physician

October 9, 2008

Check that handle.resource_id=item.item_id

The command:
SELECT handle.* from item, handle where handle.resource_id=item.item_id and handle = 2204;
yields:
handle_id handle resource_type_id resource_id
5 2204 2 2
The command:
SELECT item.* from item, handle where handle.resource_id=item.item_id and handle = 2204;
yields:
item_id submitter_id in_archive withdrawn last_modified owning_collection
2 1 t f 2007-12-13 16:53:15.767-06 1
Finally the command:
select * from itemsbytitle where item_id=2;
yields:
items_by_title_id item_id title sort_title
3727 2 xponentially growing solutions for inverse problems in PDE xponentially growing solutions for inverse problems in pde


All of this implies that the URL:
https://odin.lib.umn.edu:9031/dspace-ir/handle/2204
Will resolve to a record with the title:
xponentially growing solutions for inverse problems in PDE
This is what happens.

October 4, 2008

part of regex to find sql attacks

| grep 'DECLARE.*CHAR.*SET.*CAST' |

sql cmd for dspace

Insert dspace type logs into the University of Minho stats addon

INSERT INTO stats.log (date, logger, priority, message) VALUES
('2008-09-19 11:45:22,672', 'org.dspace.app.webui.servlet.DSpaceServlet', 'INFO',
'anonymous:session_id=85E693CBBCBD74DB561B2D2DBEDD0E2B:ip_addr=128.101.29.84:
view_item:handle=2854');

Find the delta t for an item that has a handle 7113

select ('2008-03-07 21:44:01.797-06' - (select item.last_modified from item, handle where handle.resource_id=item.item_id and handle=7113));

Find handles that have been modified since epoch 1197586394

SELECT handle, EXTRACT(EPOCH FROM item.last_modified) from item, handle where handle.resource_id=item.item_id and EXTRACT(EPOCH FROM item.last_modified) > 1197586394 order by handle;

Bitstream from handle

select bundle2bitstream.bitstream_id from item2bundle, handle, bundle2bitstream where (handle.handle=31045 and handle.resource_id = item2bundle.item_id and bundle2bitstream.bundle_id=item2bundle.bundle_id);
bitstream_id
--------------
3976

handle from Bitstream

dspace_sr=> select handle.handle from item2bundle, handle, bundle2bitstream where (bundle2bitstream.bitstream_id=3976 and handle.resource_id = item2bundle.item_id and bundle2bitstream.bundle_id=item2bundle.bundle_id);
handle
--------
31045
(1 row)

Collections that are children of a given community

SELECT handle FROM community2collection, handle WHERE community2collection.collection_id = handle.resource_id AND handle.resource_type_id = 3 AND community2collection.community_id = (SELECT resource_id FROM handle WHERE resource_type_id=4 AND handle=1);

communities that are children of a given community

SELECT handle FROM community2community, handle WHERE community2community.child_comm_id = handle.resource_id AND handle.resource_type_id = 4 AND community2community.parent_comm_id = (SELECT resource_id FROM handle WHERE resource_type_id=4 AND handle=1);

some ips that wormly uses

We are using wormly to monitor our dspace instances. The apache logs give a few ips that wormly uses

apache_pattern_ip.pl -d -r '\"-\" \"\"' ageconsearch_access.log_2008-09-21
72.51.35.173 node-x2j54.wormly.com.
69.60.118.203 node-sp711.wormly.com.
125.214.66.62 node-aux9e3.wormly.com.
81.171.111.142 node4.wormly.com.
66.228.123.50 clover.wormly.com.
207.210.96.85 node3.wormly.com.


Note the perl script apache_pattern_ip.pl gives the ips of all the log entries that match the given regex.