thecore_print_commons 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cea20e24856567e20ee36861bba025a17b815c31
4
- data.tar.gz: da3bf35622bc21199a659781e0f5c936312fd50d
3
+ metadata.gz: 3a4c926689a8f257f2b336b1d078630adaa7e391
4
+ data.tar.gz: 28ba64ba6858a3293d9d1561a4c662628ab95d40
5
5
  SHA512:
6
- metadata.gz: f27f1f283b55159b1186871fa847511fdfba52ebfa2951251aef6bc0f3aeead9a5df12a8432d688b23cb2a6282698b5401c67d6874e29654900348933f90cf22
7
- data.tar.gz: 1abf80959ae5cbcbeaaaa9156e56ca60751738820f9989350dc3df2e8aea210425a78a7a7c4102ec0fad3892c9443a387402a3be9ad6c7f016df3a5c11660e39
6
+ metadata.gz: 484ab705254babd17265d0e097f30f9e33a0bb9c6e7500cc47811b5902e262cd31472e458e01d9184cf39393a15b8654d9c56d993cf108b0b321f09470381b56
7
+ data.tar.gz: 86a92d189f2a3e3a4d56ad084b6c3683b9aabc2a4b3bd3c9814233c619d2f4f8a6d3ed2904f705abb6c5a3803d80cb41aed16a4ef255e684ad47cf1696c1639e
data/README.md CHANGED
@@ -8,6 +8,41 @@ the authentications needed for adding printers, to do so, please edit /etc/cups/
8
8
 
9
9
  When you enter the printers section and add a new printer in Thecore backend, you'll just see available (through cups) printers and you can just select one of these.
10
10
 
11
+ Otherwise, if you prefere to go the shell way, you can add it using lpadmin, say you'd like to install a samba printer:
12
+
13
+ First of all add current user to lpadmin group:
14
+
15
+ ```shell
16
+ sudo apt install cups libcups2-dev gridsite-clients smbclient
17
+ sudo adduser $(whoami) lpadmin
18
+ newgrp lpadmin
19
+ ```
20
+
21
+ Then you can use lpadmin commands without sudo (example for samba shared printer, must be adapted for other protocols):
22
+
23
+ ```shell
24
+ echo "Printer label:"; read PRINTERLABEL;
25
+ echo "Printer workgroup or Domain:";read WORKGROUP;
26
+ echo "Printer ip or netbios address:";read SHARE_IP_ADDRESS_OR_NETBIOS_NAME;
27
+ echo "Printer share name:";read SHARENAME;
28
+ echo "Printer share username:"; read USERNAME;
29
+ echo "Printer share password:"; read PASSWORD;
30
+ lpadmin -p "$PRINTERLABEL" -E -v "smb://$(urlencode $USERNAME):$(urlencode $PASSWORD)@$(urlencode $WORKGROUP)/$(urlencode $SHARE_IP_ADDRESS_OR_NETBIOS_NAME)/$(urlencode $SHARENAME)" -m everywhere
31
+ ```
32
+
33
+ To list shares on that remote machine:
34
+
35
+ ```shell
36
+ smbclient -L $(urlencode $SHARE_IP_ADDRESS_OR_NETBIOS_NAME) -U $(urlencode $USERNAME)%$(urlencode $PASSWORD) -W $(urlencode $WORKGROUP)
37
+ ```
38
+
39
+ To test from shell, prior to start using the rails ui:
40
+
41
+ ```shell
42
+ echo "Hello" > testprint
43
+ lp -d "$PRINTERLABEL" -o raw testprint
44
+ ```
45
+
11
46
  ## Installation
12
47
  First of all, please install libcups2-dev:
13
48
 
@@ -10,7 +10,7 @@ class PrintWorker
10
10
  end
11
11
  printer.print_data text, 'text/plain'
12
12
  rescue
13
- Rails.logger.debug("PRINTER #{printer_cups_name} ERROR: TIMEOUT")
13
+ Rails.logger.debug("PRINTER #{printer_cups_name} ERROR: #{printer.state}")
14
14
  end
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module ThecorePrintCommons
2
- VERSION = '0.1.8'.freeze
2
+ VERSION = '0.1.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_print_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni