Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Contributions to ELOG, Page 2 of 6  Not logged in ELOG logo
ID Date Authorup Author Email Category Subject Status Last Revision
  27   Tue Jan 29 23:18:39 2008 Diogo Alvesdiogomiguelalves@gmail.comScriptMultiple file upload for FirefoxStableWed Jan 30 07:56:53 2008 by Stefan Ritt

Here's a firefox extension that works extremely well if one uses drag n'drop to upload several attachment files at once:

 

https://addons.mozilla.org/en-US/firefox/addon/219

 

  12   Wed Feb 23 11:25:51 2005 Emiliano GabrielliAlberT@SuperAlberT.itScriptbash script for thumbnails creation, version: 0.2.0StableMon May 2 14:51:29 2005 by Emiliano Gabrielli
The following script creates a thumbnail for image/ps/pdf files.  
it can be used with "Execute edit" and "Execute new" configuration commands  
in order to get resized thumbs of attachments.  
  
It uses file(1), convert(1) for images, gs(1) is also required for ps and pdf.  
  
You have to start elogd with the "-x" option to enable execution and put  
something similar to the following in you configuration elog file:  
  
Execute new = /path/to/make_thumbs -s 650 -q 95 $attachments  
Execute edit = /path/to/make_thumbs -s 100 $attachments  
  
make_thumbs have to be executable by the user running elogd, of course.  
 
 
ChangeLog: 
* version 0.2.0 Fixes a BUG in PDF creation 
Attachment 1: make_thumbs
#!/bin/bash
#
# Makes thumbnails (a jpeg image) from a given set of input files.
# Supported input file types are those supported by 'convert',
# plus PDF.
# Requires convert(1), gs(1) and file(1)
#
# Usage:      make_thumbs [options] [ file1 file2 ... ]
# Author:     Emiliano Gabrielli
# License:    GPL
# Latest Version at http://SuperAlberT.it/download/command_line_scripts/elog/
#
# $Id: make_thumbs,v 1.7 2005/04/14 10:01:37 albert Exp $

function parse_cmdline()
{
	export OPTERR=1
	while getopts "s:q:Vh" "option" ; do
		case "$option" in
		s)
			MAXSIZE=$OPTARG
			;;
		q)
			QUALITY=$OPTARG
			;;
		V)
			echo "$0 version $VERSION by $AUTHOR"
			exit 1
			;;
		h|*)
			echo -e "\nUsage: make_thumb [options] [ file1 file2 ... ]"
			echo -e "Options:\n"\
			        " -s MAXSIZE  the size of the thumbnail to be created\n"\
			        " -q QUALITY  the quality of the JPEG image created\n"\
				    " -V          print version and exit\n"\
				    " -h          print this help and exit\n"
			exit 1
			;;
		esac
	done
}

function make_thumb()
{
	[ ! -z "$1" ] || exit 1
	FILE="$1"

	# Test if file is readable
	if ! [ -r "$FILE" ] ; then
		echo "ERROR in $0: $FILE is not readable."
		exit 1
	fi
	THUMBFILE="$FILE.thumb"
	EXTENSION="`echo \"$FILE\" | sed 's/.*\.\([^.]*\)$/\1/'`"

	# we need this extension in order to instruct 'convert'
	# will be renamed at the end of the job
	JPEGFILE="$THUMBFILE.jpg"
	ROTATE=""

	# PDF needs special handling
	if [[ `file $FILE | grep "PDF document"` ]] ||
	   [[ `file $FILE | grep "PostScript document"` ]]
	then
	    # look if we should rotate
		DEG=`head -200 $FILE | strings | grep "/Rotate " | head -1 | sed -e 's#.*/Rotate \([0-9]\+\).*#\1#'`
		[ ! -z "$DEG" ] && ROTATE="-rotate $DEG"
		# Extract first page and convert: PDF -> PS -> JPEG (needs 'gs' and 'convert')
		gs -q -dNOPAUSE -dBATCH -r75 -dLastPage=1 -sDEVICE=jpeg -sOutputFile=\|cat "$FILE" | \
		convert - $ROTATE -size ${MAXSIZE}x${MAXSIZE} -resize ${MAXSIZE}x${MAXSIZE} -quality $QUALITY +profile "*" "$JPEGFILE" &&
		mv "$JPEGFILE" "$THUMBFILE" &

	# Else it must be one of the following: postscript, JPEG, GIF, TIFF, RS
	elif [[ `file $FILE | grep "\(JPEG\|GIF\|PNG\|TIFF\) image data"` ]] ||
		 [[ "$EXTENSION" == "rs" ]]   || [[ "$EXTENSION" == "RS" ]]
	then
		convert -size ${MAXSIZE}x${MAXSIZE} "$FILE" -resize ${MAXSIZE}x${MAXSIZE} -quality $QUALITY +profile "*" "$JPEGFILE" &&
		mv "$JPEGFILE" "$THUMBFILE" &
	fi
}


AUTHOR="Emiliano 'AlberT' Gabrielli"
VERSION="0.2.0"
MAXSIZE=600   # default value
QUALITY=70    # default value

parse_cmdline $@
shift `expr $OPTIND - 1`

for file in "$@" ; do
	make_thumb $file
done

# vim:ai:ts=4:sw=4:
  14   Fri Jul 8 17:34:02 2005 Emiliano GabrielliAlberT@SuperAlberT.itScriptJavaScript list auto-refreshStableTue Jul 12 12:36:16 2005 by Emiliano Gabrielli
Here is a simple piece of JS code to accomplish a smart page reload.
We don't reload if in some kind of editing mode.

You can put the code everywhere you like in the elog html page, my suggestion is to put it in Bottom Text (or Top Text):

;auto-refresh
Bottom text = [I]<script language="JavaScript">if (null==window.location.href.match('/[0-9]+$|.*(cmd|select)=.*') ) { window.setTimeout("location.reload();", 2*60*1000); now=new Date(); document.write('<br/>Last reload at '+now.getFullYear()+'/'+(now.getMonth()+1)+'/'+now.getDate()+', '+( ((h=now.getHours())<10) ? '0'+h :h)+':'+( ((m=now.getMinutes())<10) ? '0'+m :m)+':'+( ((s=now.getSeconds())<10) ? '0'+s :s)) }</script>[/I]


the timer is a product of # of minutes, #of seconds and milliseconds... 2 minutes in the above example Smile



Revision Tue Jul 12 12:36:16 2005 wrote:

modified regular expression in order to not activate the auto-refresh in the signle entry view
  15   Thu Jul 28 18:42:48 2005 Emiliano GabrielliAlberT@SuperAlberT.itOther[New Feature]: JS calendar filter BetaThu Aug 4 11:20:36 2005 by Emiliano Gabrielli
NOTE:
it seems that for some strange reason it slows down elog very much when and only when elog is stunneled over ssl!


The attached tarball contains a full featured JavaScript allowing everyone to use a JS calendar (no popup windows, just JS and CSS!) to perform date-based filtering actions. An uncompressed version and the tarball for the last cvs rvision of this script is available at www.SuperAlberT.it

You can browse the ChangeLog here.

A simple way to use it is to uncompress the wall package into the elog data dir, under the "scripts" subdir.

the you can add the following code to your elog.cfg:
Filter Menu text = scripts/calendar_filter/calendar_filter.html

note that this configuration parameter is available in elog starting from
Revision 1.732 2005/07/29

and automagically have the new calendar_filter icon showed Smile

Attachment 2: elog_calendar_filter-1.0.1.tar.gz
  17   Mon Oct 10 18:47:09 2005 Exaos LeeExaos.Lee@gmail.comScriptHow to run elogd on Gentoo LinuxStableTue Oct 11 08:06:55 2005 by Stefan Ritt
I have created some scripts for running elogd on Gentoo Linux. Please untar the attachment and read the file "elogd_gentoo_readme". Any comment is welcomed.
Attachment 1: elogd_gentoo.tar.gz
  20   Wed Jan 10 23:08:27 2007 Exaos LeeExaos.Lee@gmail.comScriptScript for running ELOGD on Ubuntu LinuxStable 
I prepared one init script for ELOGD running on Ubuntu Linux.
Please see the attachment.
Attachment 1: elogd_ubuntu.tgz
  7   Wed Jan 14 18:30:34 2004 Francois CukierFrancois.Cukier@Umontreal.caTheme/SkinBubble for pleasure 1 -- still under developpement but working ;)Beta 
Uncompress "Bubbleforpleasure1.zip" in your Themes\default folder if you want to replace the original elog theme. Otherwise, if you decompress it in another folder, you will need to modify your elogd.cfg file as described at this adress: http://midas.psi.ch/elog/config.html
Attachment 1: Bubbleforpleasure1.zip
Attachment 2: BubbleForPleasure1-theme.GIF
BubbleForPleasure1-theme.GIF
  5   Thu Jul 3 17:04:58 2003 Fred Hooperfhooper@sushisoft.com elog2sql - version 0.99 - scripts to convert an elog logbook to a MySQL database  
Announcing:  elog2sql

elog2sql was created to help translate logbooks created by the program
``elog'' from the native elog flat file format to a MySQL database.  I had a
need to have the elog data in a database, and it appears from the forum that
several others had a similar need.

 I created a set of perl scripts that will allow the translation of elog
logbooks into a MySQL database. The design and implementation of these
scripts are a simple one, and allow the one-time copying of a set of logbooks.

The elog2sql toolkit consists of two scripts. The first script, parsecfg.pl,
reads a elogd.cfg, and creates a sql file that will create a set of db
tables corresponding to elog logbooks. The second script, parselog.pl, takes
a set of elog logfiles, and creates a sql file that will enter the logbook
data into the database. The result is a copy of the elog logbook that can
used as desired inside the framework of MySQL. Attachments are handled by
inserting an entry of the attachment name into an seperate attachment table.
This allows multiple attachments per entry.

You can download the elog2sql program archive at
http://www.davidfannin.com/elog2sql/elog2sql.tar.gz . It contains the
scripts and basic documentation.  You can read the man page at
http://www.davidfannin.com/elog2sql/index.html 


I have also uploaded a copy of the archive here.


email me for questions or comments.
Attachment 1: elog2sql.tar.gz
  8   Wed Feb 4 11:24:14 2004 Fred Hooperfhooper@sushisoft.comScriptJavascript for Bookmark Link for one-click submission to elogAlphaFebruary 04, 2004 by Stefan Ritt
I have created a javascript to be used as a browser link that allows a one
step cut and paste from a web browser into a elog logbook. 

The intended application is allow a user to do a text selection in a web
browser, then click on a bookmark that automagically pastes the selected
text, the current browser page url, and the current browser page title into
a pre-defined elog logbook.   I do some research where I would like to save
some text from a webpage, but also have a record of where the webpage came
from.  However, you should find that you can extend this script in a varity
of ways for your own application.  

The script is a simple one: it uses javascript in a saved bookmark to get
your selected text, title, and url, and then creates a new browser window
with a elog form, and print the document variables into the form, and then
submits the form to elog.   The key advantage to this approach is that you
can use the "post" command, rather than "get", to submit to the text section
of an elog logbook.  The only way I found now to submit to elog via a
bookmark is using the "get" command, and it doesn't allow entry of the
"text" field, only attribute fields.    

The second major advantage to using POST is that you can submit a much 
large quanity of information ; However, some checking on this leads me to 
believe that the limit is browser and server depended, so YMMV.  However, a 
great discussion on the limits of browsers can be found here: 
http://www.squarefree.com/bookmarklets/browsers.html .

One of the major limits is that IE6.0 browsers have a maxium of 508 bytes
per bookmark - This book runs over 800 bytes, so I suspect tha IE6+ will 
not allow it. I tested the link with Mozilla and Firebird 0.7.

This script will need to edited for you to use with your elog logbook.
The script should be fairly self-explainitory, if you are used to html 
forms and have some exposure to javascript.

You will need to modifiy the following fields:

1) in form action = http://<your_domain.com>/elog/<logbook>/?cmd=New
   
   change the link to point to your specific logbook to be used for entry.

2) the attribute fields need match up with the ones in your logbook.

   The ones listed in the template are Author, Email, Title, and URL.

   If you have fixed fields (like Author and Email), then you can
   predefine these fields as shown.  

   I have the page title used as the entry for Title, and the page url is
   use as the URL attribute.

   Finally, I have the text selection used as the entry for the Text field.

   You can add additional fields by creating a new <input ...>  segment
   in the script.  For those more clever than me, you can concatinate the
   title, url and selection to paste into the Text area as well.  

3) once you have a edited version of the script (make sure you keep it as a
single line), you can then create a new bookmark in your browser, and then
paste the script into the properties->location field (for Mozilla/Firebird)
or the properites->url field (IE). Give it a good name like "post to elog"

4) once saved, you can then go a web page, select some text, and then go to
your bookmarks and click on the bookmark. It should then create a new
window in elog with a completed logbook entry.


some notes:

1) again, this may not work on IE6+ browsers due to M$ limitations.

2) You may have to be logged in already to elog for this work - I have not
tested the interaction using a password protected elog

3) You can only post to a single elog logbook - You'll need to have 
multiple bookmarks for multiple logbooks.

__________________________
Note added by Stefan Ritt:

I zipped the attached JavaScript, since our email router does not allow .js 
file name extensions.
Attachment 1: elogsubmit-template.zip
  49   Wed May 11 09:35:23 2016 Hanno Perreyhanno.perrey@nuclear.lu.seScriptRe: Re: Custom input forms implementationStableWed May 11 09:43:34 2016 by Hanno Perrey
Stefan Ritt wrote:

Dear ELOG users,

starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:

Capture.png

And here is how it looks on the iPad:

IMAG0036.jpg

Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.

Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.

 

Thank you very much for this nice example!

I found a little issue with newer ELOG versions: if the authentication is done via session cookies, the submission of the checklist will fail with the error "Cannot open file passwd". This is actually misleading as the cause of the error is the empty user name submitted (since the cookie storing user name and pwd hash is never created) and not the password file itself. This can be worked around by removing the user name and pwd fields in the html form before submitting in case there is a SID cookie around.

The attached shiftcheck.html contains this workaround and seems to be functioning fine on my installation (ELOG 3.1.0).

 

Cheers,

Hanno

Attachment 1: shiftcheck.html
ELOG V3.1.5-2eba886