This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| sudo apt-get install python-software-properties | |
| sudo add-apt-repository ppa:chris-lea/zeromq | |
| sudo add-apt-repository ppa:chris-lea/libpgm | |
| sudo apt-get update | |
| sudo apt-get install -y python-pyzmq python-setuptools python-dev python-pip libevent-dev | |
| sudo pip install gevent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while read line | |
| do | |
| declare -a arr=( $line ) | |
| curl --url "http://localhost:8983/solr/us_patent_grant/update/?commit=false" \ | |
| -H "Content-Type: text/xml" -d "<add><doc><field name='id'>0${arr[0]}</field><field name='page_count_int' update='set'>${arr[2]//[[:space:]]/}</field></doc></add>" | |
| done |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0014317 USP2009w20 2 | |
| 0015257 USP2009w20 1 | |
| 0028699 USP2009w43 3 | |
| 0032450 USP2009w20 2 | |
| 0032451 USP2009w20 2 | |
| 0056575 USP2009w12 3 | |
| 0066524 USP2009w12 3 | |
| 0072873 USP2009w19 4 | |
| 0087053 USP2009w19 4 | |
| 0087923 USP2009w19 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| maxdocs=743364 | |
| while (( numFound < maxdocs )) | |
| do | |
| numFound=`curl -s "http://solr.demo.dir.o19s.com:8983/solr/us_patent_grant/select?q=+invention_title_html:*%20AND%20+page_count_int:%5B1%20TO%20*%5D&qt=lucene&fl=id,invention_title_html,page_count_int&rows=0&indent=true&omitHeader=true" | grep numFound | awk -F '"' '{print $4}'` | |
| echo $numFound $((100*${numFound}/${maxdocs}))"%" | |
| sleep 60 | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| node default { | |
| class { 'nodejs': | |
| version => 'stable', | |
| } | |
| package { 'git': | |
| ensure => 'installed', | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vagrant up | |
| vagrant ssh | |
| sudo npm install -g yo | |
| sudo chown -R vagrant:vagrant .npm | |
| cd /vagrant | |
| mkdir myproj | |
| cd myproj | |
| npm install generator-angular | |
| yo angular | |
| sed -i 's/localhost/0.0.0.0/' Gruntfile.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python -x | |
| import pysolr | |
| import sys | |
| from nltk.corpus import wordnet as wn | |
| class Indexer: | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from urllib.parse import urlencode | |
| from urllib.request import Request, urlopen | |
| solr_url = 'http://localhost:8983/solr/gettingstarted/schema' | |
| luke_file = open('luke-json-output.json', 'r') | |
| luke_json = json.load(luke_file) | |
| luke_file.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| solr-6.6.2 | |
| solr start -c -e cloud | |
| curl "http://localhost:8983/solr/gettingstarted/select?q=*:*" | |
| curl "http://localhost:8983/solr/gettingstarted/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>' | |
| cat > security.json <<EOM | |
| { |
OlderNewer