Translate

Mittwoch, 19. Mai 2010

scan2google

I asked myself how to archive all my paper documents in an onlione storage available everywhere from the internet.

Here's the solution: scan2google
A small script on Ubuntu to upload multiple pages (one PDF) from your ADF scanner to your google documents account.

Tools needed:
scanadf
convert
pdfjoin


Source:
  1. #!/bin/bash
  2. # Configuration:
  3. # Obtain device name from scanadf -L
  4. devname=pixma:04A91712_10FA81
  5. guser=yourgoogleuser
  6. gpass=yourgooglepassword
  7. set -x
  8. cd /tmp
  9. mkdir scanadf
  10. chmod 770 scanadf
  11. cd scanadf
  12. rm -Rf *
  13. googfile="$(date +%Y%m%d-%Hh%Mm%Ss)-scanned.pdf"
  14. # Parameters below are for grayscale lettersize paper at 150dpi
  15. resolution=150
  16. scanmode=gray
  17. ###################################################
  18. #echo Start page number?
  19. #read startp
  20. #echo Nbr of pages
  21. #read nbrp
  22. echo "Scanning pages..."
  23. if [ "$1" == "--noadf" ]
  24. then
  25.         scanadf -d $devname -o p%d.pbm --mode $scanmode --resolution $resolution -e 1
  26. else
  27.         scanadf -d $devname -o p%d.pbm --mode $scanmode --resolution $resolution --source "Automatic Document Feeder"
  28. fi
  29. echo "Converting bitmapped images to PDF..."
  30. rm -f *.pdf
  31. for i in $(ls -rt *pbm)
  32. do
  33.     convert -compress jpeg $i $(basename $i.pdf)
  34.     rm -f $i
  35. done
  36. echo "Merging PDF file..."
  37. pdfjoin --outfile $googfile $(ls -rt *.pdf)
  38. rm -f *.pbm.*
  39. echo "Uploading to google docs"
  40. java -jar /usr/local/bin/google-docs-upload-1.2.jar "$1" --without-folders --username $guser --password $gpass "$(pwd)"

UPDATE 25/4/2012:

Since 2011, the google docs upload was broken, now i found another nice way to fix this:

1) Install cloudprint explained by this post:
http://www.niftiestsoftware.com/cups-cloud-print/

2) Replace line 45 by this one:
cat $googfile | lpr -P $PRINTER -T"$(date +%Y%m%d-%Hh%Mm%Ss)-$(zenity --entry --text="Document keywords").pdf"

I've included a zenity dialog to include some meaningful text describing the document

Dienstag, 18. Mai 2010

Simple Javascript Datepicker

If you need a simple Javascript DatePicker, here is one:
http://javascriptcalendar.org/

It can be used as a Popup and as an Inline datepicker.

Of course, it's published under GPL and free of charge

2 Euro 3D Screen and Glasses

I just received my 3D glasses bought on ebay.
These are simple Red/Cyan Anaglyph glasses , for 2 euro only.

They are working great with the free 3D Anaglyph driver from iZ3D.

The only drawback, Punkbuster seems to have problems with the driver, i got kicked from several servers because they detected unauthorized 3d functions :(