Blog Posts

DNS configuration – Ubuntu Server with Static IP

I was trying to install Ubuntu Server 12.10 on my shiny new HP ProLiant Microserver. The installation went smoothly with a couple of hiccups that are as follows: First of all, beware of the tiny grey rectangle that shows at the bottom left of your screen when you boot from a USB disk. I was looking at it wondering why this is happening, is it a hardware issue, a disk issue? I created the Ubuntu Server 12.10 image on multiple disks, tested it on multiple machines, then did the same with Ubuntu Server 12.04 LTE. However, every time I boot from the USB disk, all I see is the small grey rectangle at the bottom left of the screen. A bit of Googling helped and I realised that all you need to do is to leave the grey rectangle on the screen for a couple of minutes, then press “Enter”, then leave the next screen for a couple of minutes, and press “Enter” again, and magically the Ubuntu server installation screen would be in front of you. Ubuntu installation used to be easier than this, and to be fair, the rest of the installation was a breeze. Secondly, as with most server installations, I wanted to assign

Continue Reading

IGeLU 2012 – A brief perspective

The 2012 International Group of Ex Libris Users Conference (IGeLU 2012) was hosted by the Swiss Federal Institute of Technology, Zurich (ETH, Zurich) from the 11th to the 13th of September 2012. I had the pleasure of attending the conference, the pre-conference meetings, and the post-conference PWG meeting. During the hectic schedule of these meetings, I also had two talks to give, for details, see the Talks page. The conference itself was very useful, both from a personal and professional growth point of view. It clarified to us Ex Libris’s vision, the direction they are heading towards as a company, and how Oxford systems fit in their vision. It also gave us the opportunity to see Alma in action, speak to people who are moving towards Alma, and understand what we need to work on to have a smooth transition to Alma when the time comes for it. The other great thing about the conference was that I finally got to meet a lot of people in person that I knew virtually before. Another great component of IGeLU 2012 were the excellent talks given by numerous people. This included the excellent keynote speeches and the individual presentations on different topics. One of the things

Continue Reading

Parsing XML with lxml in Django – Multiple Namespaces and XPath

A few days ago, I was trying to figure out how to parse XML with multiple namespaces and get information using XPath in Django. I came across lxml which I think is really good. You don’t have to csrf_exempt this procedure as it is GET based and thus safe. I am doing it for consistency with the rest of my code. I am using Primo Webservices basic search here as an example, but you may not be able to open this URL as it is a protected URL. Also, this may not be the best way to do this, so if you can think of improvements, please let me know. from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt import simplejson as json import urllib from lxml import etree   @csrf_exempt def brief_search(request):     errors = []     if request.method == 'GET':         searchTerms = request.GET.get('query')         bulkSize = request.GET.get('pageSize')         indx = request.GET.get('start')         if indx:             indx = int(indx) + 1             DEFAULT_NS = 'http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib'             query = 'any,contains,' + searchTerms             url = 'http://solo.bodleian.ox.ac.uk/PrimoWebServices/xservice/search/brief?institution=OX&onCampus=false&dym=false&highlight=false&lang=eng&query=' + query + '&indx=' + str(indx) + '&bulkSize=' + bulkSize             content = urllib.urlopen(url)             xml = etree.parse(content)             docset = xml.getroot().xpath('//sear:SEGMENTS/sear:JAGROOT/sear:RESULT/sear:DOCSET', namespaces={'sear': 'http://www.exlibrisgroup.com/xsd/jaguar/search', 'def': DEFAULT_NS})             totalhits = docset[0].get("TOTALHITS");             docs = xml.getroot().xpath('//sear:SEGMENTS/sear:JAGROOT/sear:RESULT/sear:DOCSET/sear:DOC/def:PrimoNMBib/def:record', namespaces={'sear': 'http://www.exlibrisgroup.com/xsd/jaguar/search', 'def': DEFAULT_NS})  

Continue Reading

Configuring AWStats for Response Time Parameters

Recently I was looking at various web log analysers that I can use with Apache to generate standard and custom statistics. The package that seemed most promising was AWStats. AWStats does a great job, especially with standard statistics. It is also very easy to install. However, if you want to see performance related attributes in AWStats, you need to use the “Extra Sections” in AWStats. I was interested in the response time parameter for a query in Apache. As a result, my Apache LogFormat looks something like: >LogFormat “%h %u %l %t ”%r” %>s %b ”%{Referer}i” ”%{User-Agent}i” %T %D” 443_combined Where %T represents the response time in seconds (useless as most requests are performed in under a second) and %D represents the response time in microseconds. The 443_combined is the nickname you can give to your LogFormat string, and then use this nick name to format when defining log files. You can call it anything. Equivalent AWStats log format is: >LogFormat=”%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot %other %extra1″ And to show the %extra1 parameter in the graphical page, you use the EXTRA SECTIONS. ExtraSectionName1="Response Time (in microseconds)" ExtraSectionCodeFilter1="200 304" ExtraSectionCondition1="URL,/" ExtraSectionFirstColumnTitle1="Response Time" ExtraSectionFirstColumnValues1="extra1,([0-9]*)$" ExtraSectionFirstColumnFormat1="%s" ExtraSectionStatTypes1=P ExtraSectionAddAverageRow1=0 ExtraSectionAddSumRow1=0

Continue Reading

Primo Central – Oxford’s Experience

Many of us working on the library systems side already know about Primo Central index. For those who don’t, here is an excerpt from Ex Libris’s official site. The Primo Central index is a mega-aggregation of hundreds of millions of scholarly e-resources of global and regional importance. These include journal articles, e-books, reviews, legal documents and more that are harvested from primary and secondary publishers and aggregators, and from open-access repositories. Ex Libris works with the world’s leading providers of global and regional information to benefit its customer community. The Primo Central index fully exploits the richness of the underlying data to facilitate fast and easy search. Oxford went live with Primo Central in September 2010. We made Primo Central index part of our resource discovery platform SOLO based on Ex Libris’s Primo, and introduced it as a new tab called “Journal Articles (beta) [Now called Articles & More]” . We tagged it as beta, because we still believe that there are areas where Primo Central is not as comprehensive as it could be, e.g. Law resources. We also provided a brief description of the limitations and the advantages of Primo Central on SOLO’s home page so that people don’t think

Continue Reading

Primo Enrichment Plugin for Nielsen Data

Primo, the Ex Libris resource discovery platform, provides an architecture to write plug-ins on top of it. One of these plug-ins is the Enrichment plug-in. I have recently written one of these plug-ins, which enhances Oxford’s resource discovery platform called SOLO (based on Primo). The plug-in searches Nielsen data against every record in Primo and enriches the record (more precisely record’s PNX) with table of contents, short descriptions and long descriptions (whichever available). The enriched data is displayable and searchable. Nielsen data is indexed in Apache’s Solr search server and request for the data are made through a web service call from within the plug-in. More details about the plug-in along with source code and installation instructions can be found here. http://www.exlibrisgroup.org/display/PrimoCC/Nielsen+Enrichment+Plug-in+for+Primo

Bash script to read data from a file into an array

I was asked to write a small shell script which can read the difference of two files (which extracts filenames) and pass the extracted filenames to another shell script. It is not too complicated but posting it for other people’s benefit. Here is a quick explanation. Line 5 takes a difference of files file1.txt and file2.txt, cuts the output from characters 3 to 13, and writes it into a file. Line 7 opens temporarylist.txt as file descriptor 3 for reading. Line 9 runs a loop till there is nothing further to read from file descriptor 3. Line 11 passes the read data to a different shell script (named othershellscript in this case). Line 15 closes the file descriptor 3. #!/bin/bash cd /home/masud diff file1.txt file2.txt | cut -c3-13 > temporarylist.txt exec 3< “temporarylist.txt” || exit 1 while read i <&3; do scripts/othershellscript $i done exec 3<&-

Site Footer

Sliding Sidebar

About Me

About Me

Strategy, Leadership, Innovation and Code Monkeyism

Social Profiles

Tweets

  • Masud Khokhar RT @UoYLibrary: #ThrowbackThurday The university library looking a little different in 1972! We're updating our library services all the ti…

Currently Reading