Skip to content

Instantly share code, notes, and snippets.

@sandbergja
sandbergja / Local authorities report - corporate bodies
Last active February 27, 2017 18:46
Local authorities report - corporate bodies
heading | thesaurus
-----------------------------------------------------------------------------------------------------------------------------------------+-----------
110_-_L a alaska marine highway system | L
110_-_L a america online inc x history | L
110_-_L a american league of professional baseball clubs x history | L
110_-_L a americas test kitchen firm | L
110_-_L a andersonville prison v fiction | L
110_-_L a aol time
@sandbergja
sandbergja / Montly cataloging reports
Created August 27, 2016 23:09
Montly cataloging reports
---monthly: report of items missing 245
SELECT DISTINCT b.id as tcn, ou.name as library, cn.label as call_number, c.barcode, 'Missing 245 (title) field' as issue
FROM biblio.record_entry b
INNER JOIN asset.call_number cn ON cn.record=b.id
INNER JOIN asset.copy c ON c.call_number=cn.id
INNER JOIN actor.org_unit ou on ou.id=c.circ_lib
WHERE b.deleted=FALSE
AND b.marc NOT LIKE '%tag="245%'
AND b.id != -1
ORDER BY library;
@sandbergja
sandbergja / PROCRUN commands
Last active May 19, 2016 16:41
PROCRUN commands
$JAVA_PATH="C:\Program Files\Java\current"
$JAR="C:\jetty\start.jar"
$LOGS="C:\jetty\logs"
$STARTPATH="C:\jetty"
.\SolrService.exe //IS//SolrService --DisplayName="SolrService" --StartMode=java --StopMode=java --Classpath=$JAR --StartPath=$STARTPATH --StopPath=$STARTPATH --JavaHome=$JAVA_PATH --LogPath=$LOGS --LogLevel=Debug --StdOutput=auto --StdError=auto ++JvmOptions=-Xdiag --StartClass=org.eclipse.jetty.start.Main --StopClass=org.eclipse.jetty.start.Main ++JvmOptions=-DSTOP.KEY=[[[[[]]]]] ++JvmOptions=-DSTOP.PORT=8079
@sandbergja
sandbergja / unimported.sql
Created May 16, 2016 04:19
Unimported vandelay records
SELECT q.id, q.name, COUNT(b.id) AS unloaded
FROM vandelay.queued_bib_record b, vandelay.bib_queue q
WHERE q.id=b.queue AND q.id>1542 AND b.imported_as IS NULL
GROUP BY q.id
ORDER BY unloaded DESC;
@sandbergja
sandbergja / walkouts.survey.html
Created May 11, 2016 21:21
personality survey about the 1968 East LA Walkouts
<!doctype html>
<html lang="en">
<!-- To add questions to this quiz, go to line # 160, near the bottom of this file -->
<head>
<meta charset="utf-8">
<title>Personality quiz: East L.A. walkouts</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
@sandbergja
sandbergja / metrics.sql
Created May 11, 2016 17:54
Find It metrics
--monthly count of unique visitors
SELECT COUNT(DISTINCT visitor_id) FROM visits WHERE started_at > "2016-01-01" AND started_at < "2016-02-01";
--monthly count of unique searches
SELECT COUNT(id) FROM searches WHERE created_at > "2016-01-01" AND created_at < "2016-02-01";
-- Average length (in minutes) for each session
-- Not available at this time (without adding end_time to session)
-- A quarterly list of searches that return 0-5 results
@sandbergja
sandbergja / holdable_from_other_libs.sql
Created May 3, 2016 21:32
Count of items that LBCC patrons can request via resource sharing
SELECT COUNT(c.id) FROM asset.copy c
WHERE
c.circ_modifier NOT IN (SELECT DISTINCT h.circ_modifier FROM config.hold_matrix_matchpoint h WHERE h.circ_modifier IS NOT NULL AND (h.user_home_ou=8 OR h.user_home_ou=1) AND h.active AND NOT h.holdable)
AND NOT c.deleted
AND c.circ_lib !=7
AND c.circ_lib !=6 -- LPL
AND c.status != 2 -- Bindery
AND c.status != 3 -- Lost
AND c.status != 4 -- Missing
AND c.status != 10 -- ILL
@sandbergja
sandbergja / ACRL circ stats
Last active April 28, 2016 22:12
ACRL circ stats
SELECT COUNT(circ.id) AS renewal
FROM action.circulation circ, asset.copy c, asset.call_number cn, metabib.rec_descriptor mb
WHERE xact_start > '2014-07-01' AND xact_start< '2015-07-01'
AND circ.circ_lib=7
AND (opac_renewal OR phone_renewal OR desk_renewal)
AND copy_location != 229 AND copy_location != 238
AND circ.target_copy=c.id AND c.call_number=cn.id AND mb.record=cn.record
AND mb.item_type != 'r';
SELECT COUNT(circ.id) AS circ
@sandbergja
sandbergja / display_copy_alerts.sh
Last active April 27, 2016 01:07
Applying "Display Copy Alert During In-House-Use" by Jason Stephenson to our local system
#!/bin/bash
dbname="db" #change this to appropriate value
username="user" #change this to appropriate value
original_js_file="/openils/var/web/xul/server/circ/in_house_use.js"
new_js_file="display_copy_alerts.js"
psql -d $dbname -U $username << EOF
BEGIN;
INSERT INTO config.org_unit_setting_type
@sandbergja
sandbergja / test.asc
Last active March 16, 2016 04:18
eg docs

Working with the MARC Editor

You can use the MARC Editor to edit MARC fields, sub-fields, and indicators.

Editing MARC Records

  1. Retrieve the record.

  2. Actions for this Record → MARC Edit .