Friday, May 8, 2026

Claude

Claude for Academics — A Research Companion
Research & Academia

Claude as Your Research Companion

A practical guide to using AI across literature reviews, writing, data analysis, and study design

Claude.ai · Academic Use Guide · May 2026

i.

What Claude offers researchers

Academic research is cognitively demanding at every stage — from making sense of a mountain of literature to writing up results in the exact register a journal expects. Claude functions as a thinking partner across all of these stages: not replacing scholarly judgment, but compressing the time it takes to get from rough thinking to polished work.

The six areas where researchers get the most value are laid out below, each with concrete prompts and realistic examples of what Claude actually produces.

Use case 01

Literature review

Summarise, synthesise, and spot gaps across dozens of papers.

Use case 02

Writing & editing

Tighten arguments, match journal tone, fix transitions.

Use case 03

Data & statistics

Choose tests, write R/Python code, interpret output.

Use case 04

Study design

Compare methodologies, identify confounds, plan sampling.

Use case 05

Grant writing

Draft specific aims, strengthen significance sections.

Use case 06

Concept understanding

Explain dense theory, build intuition, Socratic Q&A.

ii.

Literature review & synthesis

This is one of the most time-intensive parts of any research project. Claude can read abstracts or excerpts you paste, produce structured summaries, and — crucially — reason across sources to identify where they agree, contradict each other, or leave questions open.

"The synthesis that typically takes days to develop — Claude surfaces it in seconds as a scaffold you then verify and refine."

The workflow typically moves through five stages:

  1. Triage and summarise. Paste abstracts; Claude produces structured 2–3 sentence summaries covering study design, population, and key finding.
  2. Find patterns and contradictions. Ask Claude to map consensus, conflicts, and understudied areas across your paper set.
  3. Map theoretical frameworks. Identify which theories your papers use — and which adjacent frameworks are absent.
  4. Identify research gaps. Claude pinpoints understudied populations, methods, or timeframes your review could address.
  5. Draft the narrative. With your synthesis in hand, Claude writes a structured prose section for you to edit and verify.
Example exchange — climate & mental health literature
Prompt: "Across these 12 papers, what do they agree on, where do they contradict each other, and what seems understudied?"
Consensus: All studies agree that acute climate events elevate rates of depression, anxiety, and PTSD in directly affected populations. Effect sizes are consistently larger in low-income communities and among women.

Contradictions: Three papers find that community social cohesion buffers mental health impacts; two others find no significant buffering effect — the difference tracks whether cohesion was measured before or after the event.

Gaps: Only two papers examine slow-onset stressors (drought, sea-level rise). Pre-existing mental health conditions as a moderator is rarely controlled for. Almost no longitudinal studies extend beyond 18 months post-event.
!

Stay alert: Claude cannot access papers you don't share with it, and can occasionally misremember a detail. Treat its summaries as a first draft to verify, not a finished product. Never let Claude fabricate citations.

iii.

Academic writing & editing

Claude helps at every stage of the writing process — from strengthening an argument's logical structure through to a final proofread. The key distinction from a spell-checker is that Claude engages with the argument, not just the surface of the text.

  1. Argument structure critique. Claude identifies logical jumps, unsupported claims, and evidence that doesn't quite match the assertion it's meant to support.
  2. Clarity and concision. Dense academic prose gets tightened without losing the substantive argument — often 20–40% shorter.
  3. Journal tone matching. Claude adjusts hedging language, spelling conventions, and register to match a specific outlet's house style.
  4. Transitions and flow. Produces linking paragraphs that connect sections and signal to the reader what's coming next.
  5. Final proofread. Flags grammatical errors, inconsistent terminology, passive constructions, and sentences that are hard to parse on first read.
Before & after — concision edit
Before: "The implementation of standardized assessments within educational institutions has been demonstrated, through a variety of empirical investigations conducted across different geographical and demographic contexts, to produce outcomes that are not uniformly distributed across the socioeconomic spectrum…"
After: "Empirical studies across diverse contexts consistently show that standardized test scores are unevenly distributed by socioeconomic status, with lower-income students performing below their wealthier peers."

Same argument. 60% of the words. Sharper impact.
iv.

Data analysis & statistics

Claude is a strong reasoning partner for quantitative research — it knows the methods, can write correct code in R or Python, and interprets output accurately in most standard cases. It functions like the first statistical consultant you'd call, not the last.

"Claude is best used as the first expert you consult, not the last."

  1. Choosing the right test. Describe your data type, research question, and constraints; Claude recommends the appropriate test and explains why, including what to check first.
  2. Writing analysis code. Produces annotated, ready-to-run R or Python code — not just the functions but an explanation of each step.
  3. Debugging errors. Paste in an error message; Claude diagnoses the cause and provides a fix with an explanation.
  4. Interpreting output. Walks through regression tables, ANOVA results, or model summaries in plain language, flagging anything unexpected.
  5. Checking assumptions. Explains what a fan-shaped residual plot means, whether VIF values are concerning, and what to do about it.
  6. Writing up results. Produces APA-style results paragraphs from your model output, ready to paste and verify.
Example — interpreting regression output
Researcher pastes regression table; asks: "Walk me through what this means."
Your model explains about 31% of variance in anxiety scores (R² = 0.31). Sleep quality is your strongest predictor (β = −0.42, p < .001): each 1-point improvement predicts a 0.42-point anxiety reduction, holding other variables constant. The income–high coefficient is in the expected direction but doesn't reach significance (p = .07) — your sample may be underpowered for that comparison. VIF values are all under 2.5, so multicollinearity is not a concern here.
v.

Research methodology & study design

Methodology decisions made early shape everything that follows. Claude functions as a methods advisor — one who knows the literature on design trade-offs, speaks the language of internal validity and power calculations, and doesn't let you get away with vague framing.

The crucial difference from a textbook is that it reasons about your specific constraints: your number of schools, your age group, your budget, your ethics committee's likely concerns.

  1. Sharpen the research question. Claude pushes vague interests toward PICO-structured, testable hypotheses using Socratic questioning.
  2. Compare study designs. Lays out RCT vs quasi-experimental vs observational options with honest trade-offs given your real constraints.
  3. Identify confounds and threats. Maps internal validity risks — contamination, attrition, Hawthorne effects, seasonal confounds — before data collection begins.
  4. Sampling and power. Accounts for clustering, ICC, and design effects; catches underpowered designs before it's too late to fix them.
  5. Choose measurement instruments. Surveys validated scales for your population, comparing burden, cost, and psychometric properties.
  6. Ethical considerations. Flags consent requirements, safeguarding protocols, GDPR obligations, and control-group ethics that ethics boards will scrutinise.
  7. Pre-registration draft. Produces a structured pre-registration document covering hypotheses, analysis plan, and exclusion criteria in the format OSF and AsPredicted expect.
Example — power calculation for a cluster RCT
Prompt: "How many children do I need if I'm randomising at classroom level?"
You can't just calculate individual-level sample size — you need to inflate for the intraclass correlation (ICC). In school-based studies, ICCs for attention outcomes typically run 0.05–0.15. Using ICC = 0.10 with 25 children per class, the design effect is 1 + (25−1) × 0.10 = 3.4. If you'd need 80 children for 80% power in a simple two-group design, you actually need 272 — about 11 classrooms per arm. With 14 classrooms total you'll be underpowered. Options: recruit more classrooms, or frame this explicitly as a feasibility trial.
vi.

Where to stay alert

Claude is a genuinely useful research partner, but it has real limits that matter in an academic context.

1

Citations can be fabricated. Never include a reference Claude generates without verifying it exists. Always check author, year, journal, and DOI against an actual database.

2

It cannot access papers. Claude works from what you share in the conversation. It has no live access to PubMed, JSTOR, or your institutional library.

3

Statistical advice needs expert review. For high-stakes analyses — clinical trials, policy reports — have a qualified statistician review the approach. Claude is the first expert you consult, not the last.

4

Check your institution's AI policy. Permissible uses of AI assistance in coursework and research vary by institution and by journal. Know your boundaries before you use Claude's output in submitted work.

"The researcher still makes every decision. Claude surfaces the considerations, explains the trade-offs, and catches the problems early — which is exactly when they're cheapest to fix."

Written with Claude · Anthropic · claude.ai

For research, education, and academic use.

Saturday, April 25, 2026

header

 https://drive.google.com/file/d/1mpzmkC076I19jr5UkjGz7rVheu3HWTbS/view?usp=sharing

Wednesday, April 22, 2026

Enhancing Your Koha OPAC: A Modern Book Display side by side location

Enhancing Your Koha OPAC: A Modern Book Display with Location Tracking

The default search results in Koha are functional, but they don't always offer the "at-a-glance" clarity that modern library patrons expect. By using XSLT (Extensible Stylesheet Language Transformations), we can turn standard MARC data into a clean, professional, and responsive display.

This guide will show you how to apply a custom stylesheet to Koha 25.11 that highlights book locations, call numbers, and online access buttons.


Key Features of This Customization

  • Two-Column Layout: Separates bibliographic info from real-time availability.

  • Visual Cues: Includes item type icons and clear "Online Access" buttons.

  • Direct Call Numbers: Shows exactly where the book is on the shelf without clicking through to details.

  • Responsive Design: Uses CSS Flexbox to ensure it looks great on both desktops and smartphones.


Step-By-Step Implementation

Step 1: Access the Koha Administration

Log in to your Koha Staff Interface and navigate to: Koha Administration > Global System Preferences > OPAC > Appearance.

Step 2: Locate the XSLT System Preference

Look for the preference named OPACXSLTResultsDisplay. This preference controls how search results are rendered.

Note: By default, Koha uses a built-in file. To use your custom code, you will need to host this .xsl file on your server or paste the logic into a custom stylesheet field if your version supports it.

Step 3: Prepare the XSLT Code

Copy the code provided below. It is specifically designed to pull MARC tags:

  • 245 a/b: Title and Subtitle

  • 100/700: Author information

  • 260/264: Publication details

  • 856: Electronic links

  • 942c: Item Type

Step 4: The Code

XML
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:marc="http://www.loc.gov/MARC21/slim"
  xmlns:items="http://www.koha-community.org/items"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:exsl="http://exslt.org/common"
  xmlns:str="http://exslt.org/strings"
  exclude-result-prefixes="marc items str" extension-element-prefixes="exsl">
    <xsl:import href="MARC21slimUtils.xsl"/>
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>

    <xsl:template match="/">
            <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="marc:record">
        <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
        
        <div class="record-flex-wrapper" style="display: flex; flex-wrap: wrap; gap: 15px; padding: 10px 0; border-bottom: 2px solid #f0f0f0; align-items: flex-start;">
            
            <div class="book-info-col" style="flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px;">
                
                <div style="display: flex; align-items: center; gap: 6px; margin-bottom: 4px;">
                    <xsl:variable name="itype" select="normalize-space(marc:datafield[@tag='942']/marc:subfield[@code='c'])"/>
                    <span style="font-size: 0.8em; background: #eef1f5; color: #444; padding: 1px 6px; border-radius: 4px; font-weight: bold; border: 1px solid #ccd1d9; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-top: -3px;">
                        📘 <xsl:value-of select="$itype"/>
                    </span>
                </div>

                <h3 style="margin: 0; font-size: 1.2em; line-height: 1.3;">
                    <a href="/cgi-bin/koha/opac-detail.pl?biblionumber={$biblionumber}" style="text-decoration: none; color: #0056b3; font-weight: bold;">
                        <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='a']"/>
                        <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='b']">
                            <xsl:text> </xsl:text><xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='b']"/>
                        </xsl:if>
                    </a>
                </h3>

                <xsl:if test="marc:datafield[@tag=100] or marc:datafield[@tag=700]">
                    <div style="color: #333; font-size: 0.95em; font-weight: 500; margin-top: 2px;">
                        <span style="color: #777;">by </span>
                        <xsl:value-of select="marc:datafield[@tag=100 or @tag=700]/marc:subfield[@code='a']"/>
                    </div>
                </xsl:if>

                <xsl:variable name="publication" select="marc:datafield[@tag=260 or @tag=264][1]"/>
                <xsl:if test="$publication">
                    <div style="color: #666; font-size: 0.85em; line-height: 1.4; margin-top: 2px;">
                        <span>
                            <xsl:if test="$publication/marc:subfield[@code='a']">
                                <xsl:value-of select="$publication/marc:subfield[@code='a']"/>
                                <xsl:text> </xsl:text>
                            </xsl:if>
                            <xsl:if test="$publication/marc:subfield[@code='b']">
                                <xsl:value-of select="$publication/marc:subfield[@code='b']"/>
                                <xsl:text>, </xsl:text>
                            </xsl:if>
                            <xsl:if test="$publication/marc:subfield[@code='c']">
                                <xsl:value-of select="$publication/marc:subfield[@code='c']"/>
                            </xsl:if>
                        </span>
                    </div>
                </xsl:if>

                <xsl:if test="marc:datafield[@tag=856]">
                    <div style="margin-top: 8px;">
                        <xsl:for-each select="marc:datafield[@tag=856]">
                            <xsl:variable name="url" select="normalize-space(marc:subfield[@code='u'])"/>
                            <a href="{$url}" target="_blank" style="display: inline-block; font-size: 0.75em; background: #28a745; color: #fff; padding: 4px 10px; border-radius: 4px; text-decoration: none; font-weight: bold;">
                                🌐 Online Access
                            </a>
                        </xsl:for-each>
                    </div>
                </xsl:if>
            </div>

            <div class="availability-col" style="flex: 1 1 240px; max-width: 100%; background: #fdfdfd; border: 1px solid #e1e4e8; border-radius: 6px; padding: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
                <xsl:variable name="available_items" select="items:items/items:item[not(items:onloan) and not(items:withdrawn)]"/>
                
                <xsl:choose>
                    <xsl:when test="count($available_items) > 0">
                        <strong style="color: #22863a; display: block; margin-bottom: 6px; font-size: 0.75em; border-bottom: 1px solid #eee; padding-bottom: 3px; letter-spacing: 0.5px;">
                            📍 AVAILABLE AT:
                        </strong>
                        <xsl:for-each select="$available_items">
                            <div style="display: flex; justify-content: space-between; font-size: 0.85em; margin-bottom: 4px; padding-bottom: 3px; border-bottom: 1px dashed #f0f0f0; gap: 10px;">
                                <div style="font-weight: bold; color: #24292e; flex: 1;">
                                    <xsl:value-of select="items:homebranch"/>
                                </div>
                                <div style="font-family: 'Courier New', monospace; color: #d73a49; font-weight: bold; white-space: nowrap;">
                                    <xsl:value-of select="items:itemcallnumber"/>
                                </div>
                            </div>
                        </xsl:for-each>
                    </xsl:when>
                    <xsl:otherwise>
                        <div style="color: #6a737d; font-style: italic; font-size: 0.8em; text-align: center; padding: 5px 0;">
                            No physical copies.
                        </div>
                    </xsl:otherwise>
                </xsl:choose>
            </div>
        </div>
    </xsl:template>
</xsl:stylesheet>

Troubleshooting Tips

  • Missing Icons: If the 📘 or 🌐 emojis don't show up, ensure your Koha database and web server are set to UTF-8 encoding.

  • Clear Cache: After saving the changes in System Preferences, clear your browser cache or try an Incognito window to see the new layout.

  • Availability Logic: The "Available At" section is set to hide items that are On Loan or Withdrawn. You can adjust the not(items:onloan) logic if you want to show checked-out items as well.

Tuesday, April 21, 2026

Complete Guide: Replace “Online resources: Click here to access online” with “🌐 Access Online” in Koha 25.11 (Full Code Included)

 

🔧 Complete Guide: Replace “Online resources: Click here to access online” with “🌐 Access Online” in Koha 25.11 (Full Code Included)

If you're customizing your Koha OPAC and want a cleaner, modern interface, one common improvement is replacing the default text:

Online resources: Click here to access online

with a simple, user-friendly button:

🌐 Access Online

This guide provides a complete working solution for Koha 25.11, including full XSLT code you can directly use.


🎯 What You Will Achieve

✔ Remove default repetitive text
✔ Show a clean 🌐 Access Online button
✔ Avoid duplication
✔ Keep Koha structure intact


📍 Where to Apply This

You need to edit:

MARC21slim2OPACResults.xsl

Path:

opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl

👉 OR (if active):

System Preference → OPACXSLTResultsDisplay

⚠️ IMPORTANT BEFORE YOU START

Check:

👉 System Preference

OPACXSLTResultsDisplay
  • If NOT EMPTY → edit code there

  • If EMPTY → edit file


🧩 COMPLETE WORKING CODE (ITEM TYPE + ONLINE BUTTON)

👉 Paste this in place of your existing 942 + 856 display block

<!-- ================= ITEM TYPE DISPLAY START ================= -->

<xsl:variable name="itype" select="normalize-space(marc:datafield[@tag='942']/marc:subfield[@code='c'])"/>

<span class="itemtype-label" style="font-weight:bold;">

    <xsl:choose>

        <!-- E-BOOK -->
        <xsl:when test="$itype='EBK' or $itype='EBOOK' or $itype='Ebooks' or $itype='E-Book'">
            📱 E-Book
        </xsl:when>

        <!-- E-THESIS -->
        <xsl:when test="$itype='ETHES' or $itype='E-Thesis'">
            🎓💻 E-Thesis
        </xsl:when>

        <!-- THESIS -->
        <xsl:when test="$itype='THES' or $itype='Thesis'">
            🎓 Thesis
        </xsl:when>

        <!-- ARTICLE -->
        <xsl:when test="$itype='AR' or $itype='Articles' or $itype='Article'">
            📰 Article
        </xsl:when>

        <!-- MANUSCRIPT -->
        <xsl:when test="$itype='MAN' or $itype='Manuscript'">
            📜 Manuscript
        </xsl:when>

        <!-- BOOK -->
        <xsl:when test="$itype='BK' or $itype='Books' or $itype='Book'">
            📘 Book
        </xsl:when>

        <!-- PERIODICAL -->
        <xsl:when test="$itype='SER' or $itype='Periodicals' or $itype='Periodical' or $itype='Serial'">
            📖 Periodical
        </xsl:when>

        <!-- DEFAULT -->
        <xsl:otherwise>
            📂 Other
        </xsl:otherwise>

    </xsl:choose>

</span>

<!-- ================= ITEM TYPE DISPLAY END ================= -->


<!-- ================= ONLINE ACCESS (REPLACEMENT OF DEFAULT 856) ================= -->

<xsl:if test="marc:datafield[@tag=856]">
    <span class="results_summary online_resources">

        <xsl:for-each select="marc:datafield[@tag=856]">

            <xsl:variable name="url" select="normalize-space(marc:subfield[@code='u'])"/>
            <xsl:variable name="linktext" select="normalize-space(marc:subfield[@code='z'])"/>

            <xsl:if test="$url != ''">

                <a href="{$url}" target="_blank"
                   style="display:inline-block;
                          padding:5px 10px;
                          margin-top:4px;
                          background:#28a745;
                          color:#fff;
                          border-radius:5px;
                          text-decoration:none;
                          font-size:12px;">

                    <xsl:choose>

                        <!-- SMART LABELS -->
                        <xsl:when test="contains($url,'.pdf')">
                            📄 View PDF
                        </xsl:when>

                        <xsl:when test="contains($url,'youtube') or contains($url,'youtu.be')">
                            🎥 Watch Video
                        </xsl:when>

                        <!-- DEFAULT -->
                        <xsl:when test="$linktext != ''">
                            🌐 <xsl:value-of select="$linktext"/>
                        </xsl:when>

                        <xsl:otherwise>
                            🌐 Access Online
                        </xsl:otherwise>

                    </xsl:choose>

                </a>

            </xsl:if>

        </xsl:for-each>

    </span>
</xsl:if>

<!-- ================= END ONLINE ACCESS ================= -->

🧹 IMPORTANT CLEANUP STEP

👉 You MUST remove the original default block:

Search and DELETE:

<span class="label">Online resources: </span>
<xsl:text>Click here to access online</xsl:text>

Otherwise duplication will remain.


🔄 APPLY CHANGES

Run:

sudo koha-plack --restart <your-instance>
sudo systemctl restart apache2

Then browser:

Ctrl + Shift + R

✅ FINAL RESULT

❌ Before:

Online resources: Click here to access online

✅ After:

🌐 Access Online

(or dynamic labels like 📄 View PDF / 🎥 Watch Video)


🚀 BONUS IMPROVEMENTS (Optional)

You can further enhance:

  • 🎨 Bootstrap badges for item types

  • 📂 Icons instead of emoji

  • 📊 Show availability + online button in one row

  • 🔍 Auto-detect DOI links


🎉 Conclusion

By replacing the default Koha 856 display instead of adding a new one, you:

✔ Eliminate duplication
✔ Improve user experience
✔ Modernize OPAC interface


If you want, I can help you:
👉 Align icons + buttons in one professional layout
👉 Add colors, hover effects, or tooltips
👉 Customize for thesis, PDFs, videos, etc.

Just let me know 👍

Tuesday, April 14, 2026

How to Install Elastic Search


📚 Why Elasticsearch + Unicode Matters

Traditional search engines struggle with:

  • Diacritics (e.g., زبر، زیر)

  • Word variations

  • Complex scripts like Arabic and Urdu

Elasticsearch, combined with the ICU analyzer, solves this by:

  • Normalizing Unicode text

  • Ignoring diacritics

  • Improving tokenization for non-Latin scripts

👉 Result: Users can search “اسلام”, “الإسلام”, or even slightly misspelled variants and still get accurate results.


⚙️ Step 1: Install Elasticsearch

Install Java (Prerequisite)

sudo apt update
sudo apt install openjdk-11-jdk -y

Install Elasticsearch (Compatible Version)

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.0-amd64.deb
sudo dpkg -i elasticsearch-7.17.0-amd64.deb

🌐 Step 2: Configure Elasticsearch

Edit configuration:

sudo nano /etc/elasticsearch/elasticsearch.yml

Add:

cluster.name: koha-cluster
node.name: koha-node-1
network.host: 127.0.0.1
http.port: 9200

🌍 Step 3: Enable Unicode Support (ICU Plugin)

This is the most critical step for multilingual libraries.

sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
sudo systemctl restart elasticsearch

🔍 Why ICU?

The ICU plugin enables:

  • Unicode normalization

  • Proper handling of Arabic/Urdu morphology

  • Diacritics-insensitive search


🔗 Step 4: Connect Koha with Elasticsearch

Install integration package:

sudo apt install koha-elasticsearch -y

Enable Elasticsearch in Koha:

sudo nano /etc/koha/koha-sites.conf

Add:

elasticsearch: 1

🧠 Step 5: Configure Unicode Analyzer in Koha

Edit mapping file:

/etc/koha/sites/library/elasticsearch/mappings/biblios.yaml

Add a custom analyzer:

analyzer:
  my_unicode_analyzer:
    type: custom
    tokenizer: standard
    filter: [lowercase, icu_normalizer]

🔄 Step 6: Rebuild Index

sudo koha-elasticsearch --rebuild -v -f library

This step ensures all bibliographic records are indexed with Unicode support.


⚡ Step 7: Enable Plack for High Performance

Koha without Plack reloads Perl for every request—this slows everything down.

With Plack:

  • Faster OPAC

  • Reduced server load

  • Persistent processes

Install Plack

sudo apt install libplack-perl -y

Enable Plack

sudo nano /etc/koha/koha-sites.conf

Add:

plack: 1

🔧 Step 8: Configure Plack Workers

Edit:

/etc/koha/sites/library/koha-conf.xml

Add:

<plack_workers>5</plack_workers>

▶️ Step 9: Start Plack

sudo koha-plack --enable library
sudo koha-plack --start library

Restart everything:

sudo systemctl restart apache2
sudo systemctl restart elasticsearch
sudo koha-plack --restart library

🧪 Testing Your Setup

Try searching in OPAC:

  • اسلام

  • القرآن

  • Hadith / حدیث

✔ Expected results:

  • Diacritics ignored

  • Variants matched

  • Faster response


⚠️ Common Issues & Solutions

Elasticsearch not responding

curl http://localhost:9200

Unicode search not working

  • Check ICU plugin installation

  • Rebuild index

Plack not running

sudo koha-plack --status library

📈 Performance Optimization Tips

  • Set Elasticsearch memory:

/etc/elasticsearch/jvm.options
-Xms1g
-Xmx1g
  • Use 4–8 Plack workers depending on RAM

  • Schedule regular indexing for large catalogs


🔬 Advanced Enhancements

Take your Koha to the next level:

  • Synonym filters for Islamic terminology

  • Autocomplete using edge-ngram

  • Authority control integration

  • Relevance ranking (boost title fields)


📖 Conclusion

By integrating Elasticsearch with Unicode support and enabling Plack, your Koha becomes:

  • Multilingual

  • Faster

  • More intelligent

This setup is especially critical for institutions dealing with Islamic studies, Arabic, and Urdu collections, where traditional search fails to deliver precision.


📚 Further Reading (For Deeper Understanding)

  • Multilingual Information Retrieval Systems

  • Unicode Normalization and ICU Standards

  • Elasticsearch Indexing & Ranking Algorithms

  • Koha Architecture (Zebra vs Elasticsearch)

  • PSGI/Plack Performance Engineering


📑 References

  • Koha Community Documentation (Elasticsearch Integration)

  • Elasticsearch Official Documentation (Analysis Plugins)

  • Unicode ICU Documentation

  • PSGI/Plack Perl Framework Guides


If you want, I can also prepare:

  • A fully optimized Urdu/Arabic biblios.yaml file

  • A ready-to-deploy Koha DevOps script

  • Or a research paper-style write-up for publication

Monday, April 13, 2026

How to Fix “Connection Refused” Error in PuTTY While Accessing a Virtual Machine

Abstract

When attempting to access a virtual machine using PuTTY, users often encounter the error “Network error: Connection refused.” This issue indicates that the target system is reachable, but the SSH service is either not running or not accepting connections on the specified port. This blog provides a clear, practical, and technically grounded guide to diagnose and resolve the problem effectively.


Introduction

Secure remote access is a fundamental requirement in modern system administration. Tools like PuTTY allow users to connect to Linux-based virtual machines using the SSH protocol. However, connection errors can interrupt workflows, especially in environments such as Koha library systems or cloud-based servers.

One of the most common issues is:

PuTTY Fatal Error: Network error: Connection refused

Understanding the root cause is essential for resolving it quickly.


What Does “Connection Refused” Mean?

This error occurs when:

  • Your system successfully reaches the server’s IP address

  • But the server rejects the connection request on the specified port

Technically, this means:

  • No service (like SSH) is listening on that port

  • Or a firewall is actively blocking the connection


Step-by-Step Troubleshooting Guide

1. Verify SSH Service Status

The most common cause is that the SSH service is not running.

Log in to your VM locally (or via console) and run:

sudo systemctl status ssh

If inactive, start it:

sudo systemctl start ssh
sudo systemctl enable ssh

If SSH is not installed:

sudo apt update
sudo apt install openssh-server

2. Confirm SSH Port Configuration

SSH runs on port 22 by default, but it may be changed for security reasons.

Check configuration:

sudo nano /etc/ssh/sshd_config

Look for:

Port 22

If the port is different (e.g., 2222), update PuTTY accordingly.


3. Check Firewall Settings

On Ubuntu (UFW):

sudo ufw status

Allow SSH if needed:

sudo ufw allow 22
sudo ufw reload

A blocked port will prevent SSH connections even if the service is running.


4. Ensure SSH Port is Listening

Run:

ss -tulnp | grep :22

Expected output:

LISTEN 0 128 0.0.0.0:22

If no output appears, SSH is not active.


5. Test Connectivity from Client Machine

From your local computer:

ping 10.40.3.125
telnet 10.40.3.125 22

Interpretation:

  • Ping works → Network is fine

  • Telnet fails → SSH service issue


6. Check Virtual Machine Network Configuration

If using VMware or VirtualBox:

  • NAT mode may restrict access

  • Switch to Bridged Adapter for direct network access

This is a frequent issue in local virtual environments.


7. Restart SSH Service

After changes:

sudo systemctl restart ssh

8. Reconnect Using PuTTY

In PuTTY:

  • Host Name: 10.40.3.125

  • Port: 22 (or custom)

  • Connection Type: SSH

Click Open and log in.


Practical Insight: Why This Happens in Koha Environments

In systems like Koha (as seen in your case running on port 8080):

  • Web interface works → server is active

  • SSH fails → service not enabled or blocked

This often occurs in:

  • Fresh installations

  • Minimal Linux setups

  • Security-hardened environments


Security Considerations

  • Prefer key-based authentication over passwords

  • Restrict SSH access using firewall rules

  • Disable root login in production

  • Consider changing the default SSH port


Conclusion

The “Connection refused” error is not a network failure but a service-level issue. By systematically verifying SSH service status, port configuration, firewall rules, and VM networking, the problem can be resolved efficiently. Mastering these diagnostics is essential for anyone working with virtual machines, especially in research, library systems, and cloud environments.


Suggested Further Reading

To deepen your understanding, explore:

  • SSH Key-Based Authentication and Security

  • Linux System Services (systemctl)

  • Firewall Management (UFW and iptables)

  • Virtual Machine Networking (NAT vs Bridged)

  • Remote Server Administration Best Practices

  • Koha System Deployment and Server Configuration


References

  1. Barrett, D. J., Silverman, R. E., & Byrnes, R. G. SSH, The Secure Shell: The Definitive Guide. O’Reilly Media.

  2. Nemeth, E., Snyder, G., & Hein, T. UNIX and Linux System Administration Handbook. Pearson.

  3. Ubuntu Documentation. OpenSSH Server Guide.

  4. Ylonen, T., & Lonvick, C. (2006). The Secure Shell (SSH) Protocol Architecture. RFC 4251.


Monday, April 6, 2026

Enhancing Koha OPAC: Display Item Types with Icons (Koha 25.11 Guide)

Enhancing Koha OPAC: Display Item Types with Icons (Koha 25.11 Guide)

If you're using Koha 25.11 and want to improve your OPAC interface, one powerful customization is displaying item types (Book, Thesis, Article, etc.) with icons alongside each bibliographic record.

This improves usability and gives your OPAC a more modern, professional look.

In this guide, we’ll walk through a complete, working solution to achieve this.


🚀 Why Display Item Types?

By default, Koha OPAC may not clearly highlight the type of material in search results. Adding item types helps users quickly identify:

  • 📘 Books

  • 🎓 Theses

  • 📰 Articles

  • 📜 Manuscripts

  • 📖 Periodicals


🔍 Understanding the Data

Koha stores item types in two places:

  • Database (itemtypes table) → codes like BK, THES

  • MARC field 942$c → often contains descriptions like Books, Thesis

⚠️ Important:
XSLT reads MARC data, so you must match values like:

Books (not BK)

🛠️ Step 1: Add Icon Files

Create a folder for item type icons:

/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/images/itemtypes/

Add your icon images:

book.png
thesis.png
article.png
manuscript.png
periodical.png
default.png

🧩 Step 2: Modify XSLT File

Open the OPAC XSLT file:

/usr/share/koha/opac/htdocs/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl

Inside the template:

<xsl:template match="record">

Insert the following code where you want the item type to appear (usually near the title):

<!-- ===== ITEM TYPE WITH ICON START ===== -->

<xsl:variable name="itype" select="normalize-space(marc:datafield[@tag='942']/marc:subfield[@code='c'])"/>

<span class="itemtype-label">

    <xsl:choose>

        <xsl:when test="$itype='Books'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/book.png" class="itemtype-icon"/>
            Book
        </xsl:when>

        <xsl:when test="$itype='Thesis'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/thesis.png" class="itemtype-icon"/>
            Thesis
        </xsl:when>

        <xsl:when test="$itype='Articles'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/article.png" class="itemtype-icon"/>
            Article
        </xsl:when>

        <xsl:when test="$itype='Manuscript'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/manuscript.png" class="itemtype-icon"/>
            Manuscript
        </xsl:when>

        <xsl:when test="$itype='Periodicals'">
            <img src="/opac-tmpl/bootstrap/images/itemtypes/periodical.png" class="itemtype-icon"/>
            Periodical
        </xsl:when>

        <xsl:otherwise>
            <img src="/opac-tmpl/bootstrap/images/itemtypes/default.png" class="itemtype-icon"/>
            <xsl:value-of select="$itype"/>
        </xsl:otherwise>

    </xsl:choose>

</span>

<!-- ===== ITEM TYPE WITH ICON END ===== -->

🎨 Step 3: Add Styling

Go to:

Koha → Administration → System Preferences → OPACUserCSS

Add:

.itemtype-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.itemtype-icon {
    width: 18px;
    height: 18px;
}

🔄 Step 4: Restart Services

Run:

sudo systemctl restart koha-common
sudo systemctl restart apache2

Then refresh your browser (Ctrl + F5).


🎯 Final Result

Your OPAC search results will now display clean, visual item types like:

  • 📘 Book

  • 🎓 Thesis

  • 📰 Article

  • 📜 Manuscript

  • 📖 Periodical

Each with a matching icon and label.


⚠️ Troubleshooting

Icons not showing?

  • Check file path:

/opac-tmpl/bootstrap/images/itemtypes/book.png
  • Test in browser:

http://your-koha/opac-tmpl/bootstrap/images/itemtypes/book.png

Wrong item type showing?

  • Verify MARC field:

942$c
  • Ensure values match exactly:

Books, Thesis, Articles, Manuscript, Periodicals

💡 Pro Tips

  • Use SVG icons for better quality

  • Keep icon sizes consistent

  • Avoid hardcoding too many conditions — keep it maintainable


🎉 Conclusion

With just a small XSLT customization, you can significantly enhance the user experience of your Koha OPAC. Clear item type labels and icons make browsing faster, easier, and more visually appealing.


🚀 What’s Next?

You can further enhance your OPAC by:

  • Adding filters by item type

  • Grouping results (Books / Theses / Journals)

  • Customizing the detail page layout


If you need help with advanced customization, feel free to explore further or extend this implementation.

Happy customizing! 🎯

Claude

Claude for Academics — A Research Companion Research & Academia Claude as Your Research Companion A practical gui...