Tuesday, 17 January 2023

Dspace 6.3 Statistics

 Run the following commands in terminal one by one

sudo /dspace/bin/dspace stat-initial

sudo /dspace/bin/dspace stat-monthly

   sudo /dspace/bin/dspace stat-general

   sudo /dspace/bin/dspace stat-report-initial
   sudo /dspace/bin/dspace stat-report-monthly
  sudo /dspace/bin/dspace stat-report-general

Then visit dspace home page, login to your dspace, then click on Statistics tab in Administer page


Monday, 9 January 2023

Reset Password for mariadb 10.4 or Later

 

 Check mysql --version 

MariaDB output mysql Ver 15.1 Distrib 10.4-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 

Stop MariaDB

sudo systemctl stop mariadb  

Configuring MariaDB to Start Without Grant Tables 

sudo systemctl set-environment MYSQLD_OPTS="--skip-grant-tables --skip-networking" 

sudo systemctl start mariadb (ensure it started with "sudo systemctl status mariadb") 

sudo mysql -u root -p 

MariaDB prompt Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 

MariaDB [(none)]> (reload the grant tables by issuing the FLUSH PRIVILEGES command) 

MariaDB [(none)]>FLUSH PRIVILEGES; 

MariaDB [(none)]>SET PASSWORD FOR root@localhost = PASSWORD ('NEWPASSWORD'); 

Output Query OK, 1 row affected (0.00 sec)

Friday, 27 November 2020

Canon LBP printers drivers installer for Ubuntu

Script for installing the Linux CAPT Printer Driver for Canon LBP printers on Ubuntu (both 32-bit and 64-bit)

Install

$ wget https://github.com/hieplpvip/canon_printer/raw/master/canon_lbp_setup.sh
$ chmod +x canon_lbp_setup.sh
$ ./canon_lbp_setup.sh 
 
 
 
 
 
 

Original Script

http://help.ubuntu.ru/wiki/canon_capt

VuFind Installation on Ubuntu and Koha integration

VuFind

     VuFind is a library resource portal designed and developed for libraries by libraries. The goal of VuFind is to enable your users to search and browse through all of your library's resources by replacing the traditional OPAC.

It is assumed that koha is already installed in your  system. Otherwise you need to follow some more steps.

 
 
I. Install php
   sudo apt-get -y install libapache2-mod-php php-mbstring php-pear php php-dev php-gd php-intl php-json php-ldap php-mysql php-xml php-soap 
 

II. Installation of Vufind

a. Download vufind

sudo su
 cd /tmp
wget https://github.com/vufind-org/vufind/releases/download/v7.0.1/vufind_7.0.1.deb
sudo dpkg -i vufind_7.0.1.deb
sudo mv vufind-7.0.1 /usr/local/vufind 

 

b. Install vufind

cd /usr/local/vufind
php install.php
 
##set some permissions to allow Apache to write configuration and cache files to disk: 
 
sudo chown -R www-data:www-data /usr/local/vufind/local/cache
sudo chown -R www-data:www-data /usr/local/vufind/local/config 
 
Note: (not mandatory) If you plan to use VuFind's command line tools, you also need a separate cache for that
 
 
mkdir /usr/local/vufind/local/cache/cli
sudo chmod 777 /usr/local/vufind/local/cache/cli
 

c. Linking with Apache and setting up environment variables

 
sudo ln -s /usr/local/vufind/local/httpd-vufind.conf /etc/apache2/conf-enabled/vufind.conf
sudo /etc/init.d/apache2 reload 
 
##Settingup environment variable
sudo sh -c 'echo export JAVA_HOME=\"/usr/lib/jvm/default-java\" > /etc/profile.d/vufind.sh'
sudo sh -c 'echo export VUFIND_HOME=\"/usr/local/vufind\"  >> /etc/profile.d/vufind.sh'
sudo sh -c 'echo export VUFIND_LOCAL_DIR=\"/usr/local/vufind/local\"  >> /etc/profile.d/vufind.sh' 

d. final configuration

##After creating the file, you must load it manually for the changes to take effect without forcing you to log out and back in again:
 
source /etc/profile.d/vufind.sh 

III.Configuring and Starting VuFind

a. Start Solr

cd /usr/local/vufind/
./solr.sh start
 
b. Open a web browser, and browse
 
http://your-server-name/vufind/Install/Home
 
Note: If you don't want to have to manually start and stop Solr every time you
 turn on or shut down your server, you can set it up to run 
automatically. 
edit the file
sudo gedit /etc/init.d/vufind 
 copy and paste the following line 
 #!/bin/sh
### BEGIN INIT INFO
# Provides: vufind
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VuFind init script
### END INIT INFO
cd /usr/local/vufind
./solr.sh $*
 
then, Make the script executable

chmod +x /etc/init.d/vufind

Add the script to the Ubuntu startup

update-rc.d vufind defaults
 
Solr commands
service vufind start
service vufind stop
service vufind restart
service vufind check 

 

IV. Connecting koha with vufind

 
a. Indexing Koha with VuFind

Copy your marc_local.properties

cp /usr/local/vufind/import/marc_local.properties /usr/local/vufind/local/import/ 
b. Add following line in the file,

        id = 999c, first
$ sudo gedit /usr/local/vufind/local/import/marc_local.properties
 
      #collection = "collection"
       institution = "My University"
      #building = "Library A"
       id = 999c, first 
 
c. set driver for koha
$sudo gedit /usr/local/vufind/local/config/vufind/config.ini 
 
Make sure that following lines in the file, 
 
 [Catalog]

driver = "Koha" 
d. change koha connection set up
$sudo gedit /usr/local/vufind/local/config/vufind/Koha.ini
 
[Catalog]
host        = localhost
port        = 3306
username    = mysqluser
password    = mysqlpass
database    = koha_database
url         = http://library.myuniversity.edu/
[Location_Codes]
AV          = "Audio Visual"
CART        = "Book Cart"
CHILD       = "Children's Area"
DISPLAY     = "On Display"
FIC         = "Fiction"
GEN         = "General Stacks" 
 
Note:The Koha username may not be the MySQL root user.  It is safest to have 
an alternate user for such things.  This MySQL user needs to have access
 to the Koha database.
The MySQL password should be the MySQL password that corresponds to the 
MySQL username.  If you want to test this, from the command line you can
 run: 
$mysql -u [mysqluser] -p [kohadatabase] 
 
 
e. Export MARC record

Open Koha Go to Tool > Export Data 
koha.mrc will be downloaded

Import into VuFind

cd /usr/local/vufind
./import-marc.sh koha.mrc 
 
 
f. Restart solr

cd /usr/local/vufind/

./solr.sh status


  





 

Tuesday, 9 June 2020

DSpace installation on Ubuntu 20.04

Installation of prerequisite applications
1. Java Development Kit (JDK)
2. PostgreSQL Database
3. DSpace Software
4. Apache Ant (Pure Java Build Tool)
5. Apache Maven (Apache Build Automation Tool for Java Projects)
6. Apache Tomcat (Web Server for hosting Dspace)
Open  Applications > Accessories > Terminal and execute following commands.sudo su
apt-get update
apt-get upgrade
apt-get install openjdk-8-jdk postgresql ant maven
 
Create the database user
sudo su postgres
createuser -U postgres -d -A -P dspace

Enter password for new role: [Enter a password e.g. dspace]

Shall the new role be allowed to create more new roles? (y/n) n

[Enter n and press enter button]

Type exit

Allow the database user (dspace) to connect to the database

[If the following command not open, check the postgresql version number and apply in the command]

sudo gedit /etc/postgresql/12/main/pg_hba.conf

Add this line to the configuration file at the end:

local all dspace md5
save and close the file

Restart PostgreSQL :

 
sudo su
/etc/init.d/postgresql restart

 

Create Dspace user

sudo useradd -m dspace
sudo passwd dspace
 [enter a password for the new user dspace]
sudo mkdir /dspace
sudo chown dspace /dspace

Create the PostgreSQL 'dspace' database

sudo -u dspace createdb -U dspace -E UNICODE dspace



Login to the database as a superuser, and enable the pgcrypto
extension on this database
sudo su postgres
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"


exit

sudo /etc/init.d/postgresql restart
Create Dspace directory
sudo mkdir /build
sudo chmod -R 777 /build
cd /build

Download Dsapce to /build directory
Copy paste following line in the terminal,
wget https://github.com/DSpace/DSpace/releases/download/dspace-6.3/dspace-6.3-src-release.tar.gz
You can find latest version from this page and copy the link to download latest version.
Extracting Dspace package
tar -zxf dspace-6.3-src-release.tar.gz
cd /build/dspace-6.3-src-release

Open the pom.xml file and remove the following code

sudo gedit /build/dspace-6.3-src-release/dspace-api/pom.xml

#Remove the following code

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions><execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>

#Save and exit

mvn -U package 

Enter into Dspace package folder to download packages.

cd /build/dspace-6.3-src-release/dspace/target/dspace-installer
sudo ant fresh_install

Installation of Tomcat
Download the and extract the Tomcat package,

cd /opt

wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz

tar xvzf apache-tomcat-8.0.37.tar.gz


Rename folder "apache-tomcat-8.0.37" to "tomcat"

mv apache-tomcat-8.0.37 tomcat

Delete the package file from /opt folder

rm apache-tomcat-8.0.37.tar.gz
Open following file, 

gedit /etc/profile
 
Setup environment variables

Environment variables to find JAVA.
Add following lines at the bottom of the file,

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CATALINA_HOME=/opt/tomcat

Copy Dspace webapps files to Tomcat folder 

sudo cp -r /dspace/webapps/* /opt/tomcat/webapps

Running Tomcat automatically
You can set up to start the Tomcat server start automatically at the time of system turn on.

Open following file in a Terminal,

gedit /etc/init.d/tomcat

Add following lines in the file,

#!/bin/bash
### BEGIN INIT INFO
# Provides:        tomcat7
# Required-Start:  $network
# Required-Stop:   $network
# Default-Start:   2 3 4 5
# Default-Stop:    0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

start() {
 sh /opt/tomcat/bin/startup.sh
}

stop() {
 sh /opt/tomcat/bin/shutdown.sh
}

case $1 in
  start|stop) $1;;
  restart) stop; start;;
  *) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac
save and close the file.
Apply following commands too;

chmod +x /etc/init.d/tomcat
update-rc.d tomcat defaults
Start Tomcat server,
service tomcat start
Now you can start and stop Tomcat server using following commands;
service tomcat start
service tomcat stop
service tomcat restart

Make an initial administrator account (an e-person) in DSpace:
Apply following command in a terminal,
sudo /dspace/bin/dspace create-administrator

It will ask to enter email address for user login.
Enter an email address (e.g. dspace@localhost).
Enter First name and surename (e.g. dspace)
Enter a password.


Inorder to avoid buil error during maven package running please follow 

may be the version of java will be openjdk-11.. you may pls change it. by executing following command.

update-alternatives --config javaand select openjdk-8 as default.probably 2nd one will be openjdk-8 then re-run maven. will be successful.

Tuesday, 1 October 2019

INOUT MANAGEMENT SYSTEM

Installation:
PHP Installation: (Optional)
Open a terminal and enter following commands.

sudo apt-get update
sudo apt install -y php libapache2-mod-php php-{bcmath,bz2,intl,gd,mbstring,mysql,zip,cli,fpm,opcache,xml,curl,intl,xsl,soap,json,apcu,imap}
 
 Php7.4 installation
php -v
  sudo apt -y install software-properties-common
 sudo add-apt-repository ppa:ondrej/php
  sudo apt-get update
 sudo apt -y install php7.4
  sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath
 2004  history

 
 
Download the latest version of in out management system.

https://github.com/omkar2403/inout/releases/


Cause

This is issue occurring because of user restriction for root.

Solution

There are two solutions. One is modify root user (Which is risky) and second is to create new user.

I'm giving solution 2 that is how to create a new user for inout system.

Please follow the instructions

Open Terminal

sudo su

[Enter Password]

mysql -uroot -p

[Enter Mysql Password]

CREATE USER 'inout'@'%' IDENTIFIED BY 'password_here';

Replace password_here with your own password

GRANT ALL PRIVILEGES ON *.* TO 'inout'@'%' WITH GRANT OPTION;

FLUSH PRIVILEGES;

quit;

And thats it. Now exit from sudo mode by entering Exit command.

Test your user by entering following command.

mysql -uinout -p

[Enter Password for Inout User mentioned above]

Note: Now edit dbconn.php in inout directory. Replace the username to inout and password to respected password.

 

Update Your College Institution Logo on Display Screen

There are two logos by default on the left & the right side of the display interface. If you want to update your own logo follow the steps.

Note : Logo should be in square size.

Rename the logo file as "logo.jpg" (Left Side Logo) .

Rename the 2nd logo file as "iso.png" (Right Side Logo)

Copy both the files in to "inout/img/" location. (Replace the existing files)

Open the index.php file in any editor.

Uncomment the code the line number "from 23 to 25" and "from 31 to 33" which is looks like as follows.

23 <!-- <div class="col-xs-2 col-md-2 col-lg-2">

24 <img src="img/logo.jpg" height="125" width="125">

25 </div> -->

31 <!-- <div class="col-xs-2 col-md-2 col-lg-2" >

32 <img src="img/iso.png" style="float:right;" height="125" width="125">

33 </div> -->

Now replace the below line on the line number 26.

<div class="col-xs-8 col-md-8 col-lg-8 text-center main_title" >

All set. Refresh your interface.

 

Logout After 20 Minute Issue

You have to change default session time in php.ini file.

To Open the file.

sudo nano /etc/php/5.6/apache2/php.ini

[Enter password]

A text editor will open. To find variable session.gc_maxlifetime Press Ctrl + W and paste this variable then press ENTER.

It'll find the session.gc_maxlifetime.In front of that the default value is 1440 second that is 24 Minutes.

Change this value to 7200 that is 2 hours.

After changing values Press Ctrl + O then ENTER. It'll save the file. Then exit by Pressing Ctrl + X.

 

PDF is not working on some systems

In the LAN pdf generator is not working. PDF generator are using the directory "cache" present in the "inout" directory. This directory should have full access/permission. Follow the steps to give permission.

Open terminal in inout directory and type following commands.

sudo su

[Enter Password]

chmod 765 -R cache

chmod 777 pdfexport.php

exit

 

 

 

 

Language Searching

 Inorder to enable regional language searching the following file need to be modofied.
 

sudo gedit /etc/koha/zebradb/etc/default.idx

comment the line "charmap word-phrase-utf.chr" ( Put # mark at the beginning of the line) 

add the following line after the commented line

"icuchain words-icu.xml "

Rebuild the Zebra index

sudo koha-rebuild-zebra -v -f library