Skip to content

Instantly share code, notes, and snippets.

View mcantelon's full-sized avatar

Mike Cantelon mcantelon

View GitHub Profile
'title',
'alternate_title',
'edition',
'extent_and_medium',
'archival_history',
'acquisition',
'scope_and_content',
'appraisal',
'accruals',
'arrangement',
<?php
/**
* Remove HTML tags from various i18n information object fields.
*
* To execute script (from AtoM root directory):
*
* php symfony tools:run remove-html.php
*/
class i18nRemoveHtmlTags
#!/bin/bash
mkdir /tmp/installtemp
cd /tmp/installtemp/
sudo apt-get install -y wget
wget http://nodejs.org/dist/v0.10.35/node-v0.10.35.tar.gz
tar zxvf node-v0.10.35.tar.gz
cd node-v0.10.35
sudo apt-get install -y python
sudo apt-get update
sudo apt-get install -y build-essential
vagrant@atom ~/atom-moma (qa/devel) $ sudo ./symfony tools:gearman-workerFailed loading opcache.so: opcache.so: cannot open shared object file: No such file or directory
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/xsl.so' - /usr/lib/php5/20090626/xsl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Fatal error: require(): Failed opening required '/home/vagrant/atom-moma/plugins/arElasticSearchPlugin/lib/vendor/Elastica/lib/Elastica/Transport/Memcache.php' (include_path='/home/vagrant/atom-moma:/home/vagrant/atom-moma/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor:/home/vagrant/atom-moma/vendor/symfony/lib/plugins/sfPropelPlugin/lib/task:/usr/share/php:/usr/share/pear') in /home/vagrant/atom-moma/vendor/symfony/lib/autoload/sfSimpleAutoload.class.php on line 123
Fatal error: require(): Failed opening required '/home/vagrant/atom-moma/plugins/arElasticSearchPlugin/lib/vendor/Elastica/lib/Elastica/Transport/Memcache.php' (includ
SELECT Related.originalLocation AS 'derivedFromOriginalLocation',
Current.originalLocation, Current.sipUUID
FROM Files AS Current
LEFT OUTER JOIN Derivations ON Current.fileUUID = Derivations.derivedFileUUID
LEFT OUTER JOIN Files AS Related ON Derivations.sourceFileUUID = Related.fileUUID
WHERE Current.removedTime = 0
AND Current.currentLocation like '%transfer-AAAA%';
No uuid for file: " %SIPDirectory%objects/submissionDocumentation/transfer-BBBBBBB-7c4c07c9-b90c-4e30-bc94-e80724208dcf/METS.xml "
@mcantelon
mcantelon / gist:6033205
Last active December 19, 2015 23:18
AJAX group creation
**************************************************
Django template:
**************************************************
<form id='group_selector_form'>
<select id='group_selector'>
{{ for group in groups }}
<option value='{{ group.id }}'>{{ group.name }}</option>
{{ endfor }}
</select>
@mcantelon
mcantelon / gist:6023063
Created July 17, 2013 18:22
Example transcript
mike@mike-VirtualBox:~/archivematica/src/archivematicaCommon/lib/utilities$ ./linktool insertafter 8a0bc7c6-f7c2-4656-a690-976660c66a8a
Creating new standard task config entry SQL...
Command?
elasticSearchIndex_v0.0
Arguments?
\"%SIPDirectory%\" \"%SIPUUID%\"
Creating new task entry SQL...
Task type UUID?
36b2e239-4a57-4aa5-8ebc-7a29139baca6
Description?
@mcantelon
mcantelon / gist:5651722
Created May 26, 2013 04:36
ElasticSearch date detection disabling
try:
conn.create_index(index)
except:
pass
conn.put_mapping(doc_type=doc_type, mapping={'widget': {'date_detection': False}}, indices=[index])
docData = {
'text': 'hey now',
'date': '2000-03-01'
demo@archivematicaDev:~$ ls -l /usr/share/elasticsearch/bin/
total 16
-rwxr-xr-x 1 demo demo 5511 Mar 25 04:24 elasticsearch
-rwxr-xr-x 1 demo demo 2099 Mar 25 04:24 elasticsearch.in.sh
-rwxr-xr-x 1 demo demo 740 Mar 25 04:24 plugin
demo@archivematicaDev:~$ ls -l /usr/share/elasticsearch/lib
total 16360
-rw-r--r-- 1 demo demo 10653931 Mar 25 04:24 elasticsearch-0.20.6.jar
-rw-r--r-- 1 demo demo 865400 Oct 13 2012 jna-3.3.0.jar
-rw-r--r-- 1 demo demo 770462 Oct 13 2012 jts-1.12.jar