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 / no_oclc_es
Last active January 8, 2017 12:54
Spanish materials no OCLC
tcn | call_number | barcode | title
--------+-------------------------------+----------------+--------------------------------------------------------------------------------------------------------------------------------------------------
261020 | E121 .A713 1986 | 38813000020893 | {"America in Europe :"}
261063 | CB103 .O72 | 38813000029829 | {"The revolt of the masses;"}
261357 | F864 .V53 V.1 | 38813000099194 | {"A natural and civil history of California."}
261997 | E184.M5 D85 | 38813000634354 | {"Introduction to Chicano studies;"}
262906 | NK4123 .L47 1974 | 38813000322794 | {"Spanish folk ceramics of today."}
264971 | F1230 .G62 | 38813000327702 | {"The conquest of the Weast India."}
265206 | E125.O6 D4713 1988 | 38813000036659 | {"The discovery of the Amazon /"}
266701 | D20 .H56 2000 V.4
@sandbergja
sandbergja / 035_not_oclc_multiple_libs
Last active August 27, 2016 23:21
035 not OCLC affecting multiple libraries
2 | 260843
2 | 250742
2 | 264195
2 | 262666
2 | 265558
2 | 255010
2 | 266134
2 | 273281
2 | 252790
2 | 265212
@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