Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
unix
FI printers over Samba on Linux
Commits
4ae2b993
Commit
4ae2b993
authored
Jan 13, 2021
by
Martin Klimes (k11m1)
Browse files
better readme and language
parent
6cd16e2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.org
View file @
4ae2b993
#+TITLE: Readme
* FI printers
* Fi printers - Install script for printers under Linux with samba
Script for installing fi printers on Linux via Samba print server.
** Advantages:
** Advantages:
+ Pure IPP printing allows only printing via Ethernet cable. This restriction does not apply to samba.
+ You can print on WiFi with Samba. (Pure IPP printing allows only printing via Ethernet cable)
+ You can use your current cups settings and just add fi printers. (For example if you use your laptop you don't have to switch cups configuration)
+ You can add a FI printer to your existing cups instance. This way, you don't have to switch configurations.
+ Printing is not bound to your username on your computer.
+ You don't need to have the same login on your computer as your faculty login.
** Files/Folders:
| File | Description |
|--------------------------+--------------------------------------------------|
| ~install.pl~ | The main install script |
| ~filters~ | folder with filters for cups |
| ~ppds~ | folder with ppds for cups |
| ~PyPDF2~ and ~reportlab~ | folder with python 2 dependencies for ~TA5007ci~ |
** Pre-requirements:
** Pre-requirements:
+ root access (or sudo)
+ root access (or sudo)
+
Local
print server
(~cups~)
+
running local [[https://www.cups.org/][CUPS]]
print server
+ samba (~smbclient~)
+ samba
client
(~smbclient~)
+ for ~TA5007ci~ python2
+ for ~TA5007ci~ python2
*** Note
*** Note
If you have previously used pure IPP printing, you might want to cancel printing from you machine.
If you have previously
have
used pure IPP printing
before
, you might want to cancel printing from you
r
machine.
If that is the case, send a request to unix@fi.muni.cz.
If that is the case, send a request to unix@fi.muni.cz.
**** Warning
**** Warning
if you are using cups with IPP printing or Kerberos printing you are using cups with ~/etc/cups/client.conf~.
If you are printing with pure IPP or Kerberos, you will have to remove client configuration for cups, which is located at ~/etc/cups/client.conf~.
This makes it impossible to print via samba.
** Usage
** Usage
usage: ~./install.pl <printer-name>~
where ~<printer-name>~ is valid printer name:
Usage: ~./install.pl <printer-name>~ , where ~<printer-name>~ is valid printer name.
For example to install printer ~lj2b~ run
#+begin_src bash
./install.pl lj2b
#+end_src
After running the script, you will be prompted for you faculty login.
Available printers:
| Printer name | Model | Location |
| Printer name | Model | Location |
|--------------+-------------+----------------------------------------------|
|--------------+-------------+----------------------------------------------|
...
@@ -47,9 +48,10 @@ where ~<printer-name>~ is valid printer name:
...
@@ -47,9 +48,10 @@ where ~<printer-name>~ is valid printer name:
| lj5c | hplj-600 | Building C, 5th floor, next to copy |
| lj5c | hplj-600 | Building C, 5th floor, next to copy |
* Current status:
** Repo structure:
- [X] hp laserjet 600
| File | Description |
- [X] HP LaserJet P4515x
|--------------------------+--------------------------------------------------|
- [X] HP LaserJet P4015x
| ~install.pl~ | main install script |
- [X] TA 4505ci
| ~filters~ | folder with filters for cups |
- [X] TA 5007ci
| ~ppds~ | folder with ppds for cups |
| ~PyPDF2~ and ~reportlab~ | folder with python 2 dependencies for ~TA5007ci~ |
install.pl
View file @
4ae2b993
...
@@ -195,12 +195,12 @@ sub print_printers() {
...
@@ -195,12 +195,12 @@ sub print_printers() {
}
}
sub
usage
()
{
sub
usage
()
{
say
"
Script
to
install FI printers on linux.
";
say
"
Script
for
install
ing
FI printers on linux.
";
say
"
Requires local CUPS server running and SAMBA client installed.
";
say
"
Requires local CUPS server running and SAMBA client installed.
";
say
"
usage: $0 <printer-name>
";
say
"
usage: $0 <printer-name>
";
say
"
Must be run as root.
";
say
"
Must be run as root.
";
say
"
Triumph-Adler 50007ci needs Python 2.7 as a dependency
";
say
"
Triumph-Adler 50007ci needs Python 2.7 as a dependency
";
say
"
and will install 2 python modules automatically.
";
say
"
and will install 2
additional
python modules automatically.
";
print
"
\n\n
";
print
"
\n\n
";
print_printers
();
print_printers
();
...
@@ -216,13 +216,11 @@ sub check_python {
...
@@ -216,13 +216,11 @@ sub check_python {
return
"
python
";
return
"
python
";
}
}
# TODO FIXME ADD python2
say
"
[ERROR] Python 2.7 is not present
";
say
"
[ERROR] Python 2.7 is not present
";
# TRY python2 command
my
$s_output
=
qx/python2 -V 2>&1/
;
my
$s_output
=
qx/python2 -V 2>&1/
;
if
(
$?
==
0
&&
$s_output
=~
$regex
)
{
if
(
$?
==
0
&&
$s_output
=~
$regex
)
{
say
"
[OK] Python 2.7 is present as python2
";
# TODO OTESTOVAT
say
"
[OK] Python 2.7 is present as python2
";
return
"
python2
";
return
"
python2
";
}
}
...
@@ -232,10 +230,10 @@ sub check_python {
...
@@ -232,10 +230,10 @@ sub check_python {
sub
python_package
{
sub
python_package
{
(
my
$package_name
,
my
$python
)
=
@_
;
(
my
$package_name
,
my
$python
)
=
@_
;
say
"
[INFO] Installing
$package_name
";
say
"
[INFO] Installing
$package_name
...
";
my
$status
=
chdir
"
$package_name
";
my
$status
=
chdir
"
$package_name
";
if
(
$status
==
0
)
{
if
(
$status
==
0
)
{
die
"
[ERROR] folder
$package_name
is not present
";
die
"
[ERROR] folder
$package_name
is not present
!
";
}
}
my
$output
=
system
("
${python}
setup.py install
");
my
$output
=
system
("
${python}
setup.py install
");
if
(
$?
!=
0
)
{
if
(
$?
!=
0
)
{
...
@@ -243,7 +241,7 @@ sub python_package {
...
@@ -243,7 +241,7 @@ sub python_package {
}
}
$status
=
chdir
'
..
';
$status
=
chdir
'
..
';
if
(
$status
==
0
)
{
if
(
$status
==
0
)
{
die
"
[ERROR] Could not return to the working directory
";
die
"
[ERROR] Could not return to the working directory
!
";
}
}
return
;
return
;
}
}
...
@@ -299,7 +297,4 @@ for my $filter ( @{ ( $models->{$model} // {} )->{filters} // [] } ) {
...
@@ -299,7 +297,4 @@ for my $filter ( @{ ( $models->{$model} // {} )->{filters} // [] } ) {
install_printer
("
$printer_name
");
install_printer
("
$printer_name
");
say
"
[INFO] Installation is completed
";
say
"
[INFO] Installation is completed.
";
say
"
You may alter the printer settings in cups interface.
";
# NOTE usefull?
# hp_laserjet_600($printer_name);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment