Force Default messaging preferences on Patron Categories #Koha

By abhisheknagar

Oh, I was sending Notifications to Patrons on Item Issue, but suddenly the management have instructed to send notifications on Item Return, Renewal etc as well or they have asked to send Notifications as SMS/WhatsApp in addition to Email, and now i realise that this will ge a pain to implement as i will need to implement this for each patron.

NO NO

This can be done automatically here is the solution

Step 1 ) Modify Messaging Preference for each  Patron Categories

For Each Patron Category set the Default Message Templates from the link  http://<your-library-staff-panel>/cgi-bin/koha/admin/categories.pl

 

Step 2) Use the following commands on the Koha Server Terminal

sudo su

export PERL5LIB="/usr/share/koha/lib"

export KOHA_CONF="/etc/koha/sites/library/koha-conf.xml"

cd /usr/share/koha/bin/maintenance

perl borrowers-force-messaging-defaults.pl --doit

 

You are Done !!!

The Script borrowers-force-messaging-defaults.pl  will force update messaging preference of all Patrons

Ensure that the koha-conf.xml PATH is correctly set in Step 2 in case your library name is other than library.


This will be useful if you have just implemented my New Module to send Notifications via WhatsApp Business API

 

Koha SMS Driver for WhatsApp Business API (GupShup)

By abhisheknagar

Screemshot

Koha already have a feature to Push Notices via SMS

Koha uses SMS Drivers to push these Notices to a Service Provider

SMS Driver can be written which can Push Notices using an External API (Gupshup WhatsApp API) in this case which can inturn send the Notice as WhatsApp Messages.

Requirements

  1. Facebook Business Account
  2. GupShup Account with WhatsApp Business API
  3. GupShup API Key
  4. Approved Templates for CHECKOUT, CHECKIN, DUE
  5. GupShup Endpoint URL for API
  6. SOURCE Number as Registered in Facebook Business Account and Mapped in Gupshup

How to Install

  1. Download the Package File (.KPZ) from this github Repository
  2. Upload the Package File in the Koha Plugins
  3. Configure the Plugin by entering the Information already stated in Requirements
  4. Modify the SMSSendDriver Value to SMS::Send::Gs in the System Preferences in Koha
  5. Enable Notices via SMS in Koha for desired category of Patrons
  6. Configure the messages cron if not already configured on Koha Server

Configuration

Step 1

Step 2

Step 3


Assumptions of this Driver

Template for CHECKOUT, CHECKIN, DUE is already approved by Facebook and contains 2 Variables/Parameters

eg Template

==================================================

Screemshot

Dear {{1}},

The following books have been issued to you as per your request in Library

{{2}}

Thank you for visiting The Institute Library.

==================================================

The Driver will replace {{1}} with the Patron First Name & {{2}} will be replaced with the SMS Template Data as recieved from KOHA eg {{2}} can contain Barcode of Books issued which will convert the Template to the following and send

==================================================

Dear Abhishek,

The following books have been issued to you as per your request in Library

6754, 5754

Thank you for visiting The Institute Library.

Github Repository : https://github.com/abhisheknagar/gupshup-wa-koha-driver

 

Need Help in Configuration

Koha Notices via Custom Self Hosted End Point

By abhisheknagar

#Idea

Use the SMS Service present in Koha to send Notices to Patrons

SMS Plugin which send Notices as JSON Data to an Endpoint using POST, Endpoint can be yours own endpoint or a service provided by a service provider. Handle the JSON data in Endpoint and send the Notice using your Custom Code or Service Provider to WhatsApp / Telegram / Whatever

GIT Repository : https://github.com/abhisheknagar/wa

 

JSON POST made by this Koha Plugin to Endpoint will look as follows : 

{
           "api_key"        => $api_key,
           "customerFirstName" => $patron->firstname,
           "customerLastName"  => $patron->surname,
           "phone"             => $patron->smsalertnumber || $patron->phone,
           "code"              => $m->letter_code,
           "messageBody"       => $m->content,
    }

 

What is Koha ?

Community Driven world's first free and open source library system, Koha https://koha-community.org/ powers major libararies around the world. 

Utilizing Off Time in Internet Radio

By abhishek

No one likes a silence when tuning to a radio station, and for a radio manager its tough to have 24*7 programmes, in case you are running an Internet Radio Station using Airtime you probably would be programming your shows and in Offtime your radio is always silent i would suggest you to play some random tracks in this Offtime and also include a track which tells when your station plays live so here is how to achieve this

  1. Put some MP3 files in a folder of your server, please also record a message with the showtimings etc or what ever you want this folder may contain any number of files which you want to play in off time (Folder used in the below script /store00/rand)
  2. Edit /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq (below is the patch) the modified lines are in bold

@@ -150,14 +150,14 @@
 #                "read_stop_all",
 #                fun (s) -> begin log("dynamic_source.read_stop") destroy_dynamic_source_all() end)

-default = amplify(id="silence_src", 0.00001, noise())
+#default = amplify(id="silence_src", 0.00001, noise())
 ref_off_air_meta = ref off_air_meta
 if !ref_off_air_meta == "" then
     ref_off_air_meta := "Airtime - offline"
 end
-default = rewrite_metadata([("title", !ref_off_air_meta)], default)
-ignore(output.dummy(default, fallible=true))
-
+#default = rewrite_metadata([("title", !ref_off_air_meta)], default)
+#ignore(output.dummy(default, fallible=true))
+default = playlist(mode='random', "/store00/rand/")
 master_dj_enabled = ref false
 live_dj_enabled = ref false
 scheduled_play_enabled = ref false

Once you have modifed you are good to go restart the services, upon restarting you will listem random tracks in offtime from the folder you have set in the script.

Tested on Airtime 2.5.1, do listem to VMOU's stream @ http://vmou.ac.in/stream

Resize Multiple Images

By abhishek

I am sure you would have come to a situation when you would have to resize multiple images say you copied 200 images from your Digital Camera and now need to upload them and need to resize them all, now doing this using GIMP would take ages here is a easy way.

Step 1) Install ImageMagick

sudo apt-get install imagemagick

Step 2) Change to the Directory where all Images are Present

Step 3)

a) If you need to reduce images to a specific Percentage

mogrify -resize 20% -format jpg *

b) If you need to reduce to Specific Width & Height

mogrify -resize 800x600 -format jpg *

c) If you need to reduce to Specific Width

mogrify -resize 1024x -format jpg *

Further Reading Click Here !!!

Broadcom 43xxx on Linux (openSUSE)

By abhishek

Hopefully there would be many like me who have struggled in configuring Broadcom Wifi Cards on Linux due to their proprietory drivers, now a days it works fine in Ubuntu if you download the drivers available but still it doesnot work with various other distros. so here is a 3 step guide to configure Broadcom Wifi on your linux box these steps have been tested on openSUSE but would work on any distro Step 1 ) Download a file from here. Step 2) Install bcm43xx-fwcutter it is commonly avaiable for all distros Step 3 ) follow the commands

# bcm43xx-fwcutter wl_apsta-3.130.20.0.o

(bcm43xx-fwcutter is the application which u have installed wl_apsta-3.130.20.0.o is the file which you have downloaded from this blog:)  preferably create a directory and copy wl_apsta-3.130.20.0.o there and execute the command in the directory)

# cp *.wl /lib/firmware

(*.wl are the files which were generated from the command above there would be some 16 files)

And you are done use the network manager to configure Wireless Netwoks :) this was really simple. Desclaimer: code/commands given in the posts worked fine for the author please use them on your own risks they may damage your system.

Reblog this post [with Zemanta]

GNUnify 09

By abhishek

GNUnifyGNUnify is one of the biggest FOSS event which is completely managed and organized by the students of Symbiosis Institute of Computer Studies & Research. Each batch of MSc (CA) only gets one opportunity to organize it last time we "RESPAWN" organized and the tradition continued with the current batch which organized the 7th GNUnify. It was sponsored by Mozilla, they also presented a few talks this year which were great. I also got an opportunity to conduct a workshop this year which  went on well the participants were able to create websites on their local machines atleast :) this was the second time when i got the opportunity to be a speaker @ gnunify.

This year we had more then 50 speakers covering topics in various areas of software development, administration the new addition this year was the FOSS in academics Track where in teachers from various colleges came up and discussed about FOSS.
[ad#460]
 

GNUnify '09

By abhishek
GNUnify enters 7th Year
What it is? GNUnify, an annual technical extravaganza is organized by the students of Symbiosis institute of computer studies and research (SICSR) GNUnify, the name symbolizes GNU / Linux, the philosophy behind Free/Open source, unifying and strengthening the free / open source movement, sharing and spreading knowledge with the help of IT. GNUnify initiated in the year 2003 is an international convergence of open minds who aspire to unfold their knowledge for the benefit of widespread I.T., providing a platform for students and IT professionals all over the world of free / open software. It is an effort to explore the abundant information of a domain, which believes in free/open source software and has no bounds. Techie-talk, GNU/Linux install fest, workshops, boot up and Q&A forum, this festival has it all.
When is it? 13th & 14th Feb 2009
Where is it? Symbiosis Institute of Computer Studies and Research, Atur Centre, Gokhale Cross Road, Model Colony, Pune -16.
[caption id="attachment_111" align="alignright" width="200" caption="Symbiosis Institute Of Computer Science & Research"]Symbiosis Institute Of Computer Science & Research[/caption]
 
 
About SICSR Computer Science is at the intellectual forefront of the Digital Revolution that will define the 21st Century. That revolution is in its infancy but is visible all around us. New scientific, economic and social paradigms are arising from computing science and being felt across all sectors of the economy and society at large. The Symbiosis Institute of Computer Sciences (SICSR) is a recognized leader in the creation of Scientific Knowledge and Practical Technologies that are defining this historic transformation. Our mission is to facilitate ideas that will shape this new frontier. Innovation requires dedication to learning, in the classroom, in the research laboratory, and throughout one’s professional career. At SICSR, we offer a unique educational opportunity for students to achieve excellence in both through rigorous classes and participation in cutting edge research.
Please feel free to discuss on these topics at http://groups.google.com/group/gnunify09 You can also add your own topic here Planning to have a talk as last year @ GNUnify and a Workshop.

Ichalkaranji Workshop Day three - July 9th 2008

By abhishek

I and Gaurav Pant from PLUG (Pune Gnu/Linux Users Group) were the faculty for Day 3 @ IchalkaranjiWorkshop.

Ichalkaranji Workshop was organized at D.K.T.E.'s Textile & Engg Institute, Ichalkaranji by NRCFoss and was co-sponsored by Ministry of Information Technology, Govt of Inida

The first half of day's was conducted by Gaurav. The Schedule was introduction to the PHP scripting and how to embed it in HTML, Accepting data from forms, writing to files and communication to MySQL database for retrieving and storing data, through PHP. This session was covered in the first half of the day. Connecitivity to MySQL was also show using the command line MySQL client. The whole session was done as a hands on activity and participants were given small assignments to be done on the spot for the same.

The second half was covered by me, I empasised on the role of Content Management System (CMS) in website developments. and also gave a demonstration of installing the popular PHP based CMS drupal. The aim of demonstration was to show how using the CMS one can get a website ready in 10 to 15 minutes. Drupal also supports various modules and themes which can be directly incroprated without much difficulty to customize the website, which could be clearly understood by the demo.

Few of the participants downloaded and CMS and installed the same successfully on their machines.

for more information of this workshop visit the live wiki @ http://nrcfosshelpline.in/code/wiki/IchalkaranjiWorkshop