Возможно вы искали: 'Star Wars: Clone Wars ...'

May 15 2025 18:32:01
  • Как сделать 8Gamers.Ru домашней страницей?
  • Игры
    • База данных по играх
    • Игровые новости
    • Игровая индустрия
    • Обзоры на игры
    • Прохождения игр
    • Гайды к играм
    • Превью о играх
    • Игровые тизеры
    • Игровые арты
    • Игровые обои
    • Игровые скриншоты
    • Игровые обложки
    • Игровые трейлеры
    • Игровое видео
    • Вышедшие игры
    • Ближайшие релизы игр
  • Кино и ТВ
    • База данных по кино
    • Статьи о кино
    • Постеры
    • Кадры из кино
    • Кино трейлеры
    • Сегодня в кино
    • Скоро в кино
  • Комиксы и манга
    • Манга по алфавиту
    • База данных по комиксах
    • Читать онлайн комиксы
    • Читать онлайн манга
    • База персонажей
  • Читы и коды
    • Чит-коды для PC игр
    • Чит-коды для консольных игр
    • Трейнеры
    • Коды Game Genie
  • Моддинг
    • Модификации
    • Карты к играм
    • Программы для моддинга
    • Статьи о моддинге
  • Геймдев
    • Всё о создании игр
    • Список движков
    • Утилиты в помощь игроделу
    • Конструкторы игр
    • Игровые движки
    • Библиотеки разработки
    • 3D-модели
    • Спрайты и тайлы
    • Музыка и звуки
    • Текстуры и фоны
  • Рецензии
    • Игры
    • Кино
    • Аниме
    • Комиксы
    • Мангу
    • Саундтреки
  • Саундтреки
    • Лирика
  • Файлы
    • Патчи к играм
    • Русификаторы к играм
    • Сохранения к играм
    • Субтитры к кино
  • Медиа
    • Видео
    • Фото
    • Аудио
    • Фан-арты
    • Косплей
    • Фото с виставок
    • Девушки из игр
    • Рисунки
    • Рисуем онлайн
    • Фотохостинг
  • Юмор
    • Анекдоты
    • Афоризмы
    • Истории
    • Стишки и эпиграммы
    • Тосты
    • Цитаты
  • Флеш
    • Азартные
    • Аркады
    • Бродилки
    • Гонки
    • Для девочек
    • Для мальчиков
    • Драки
    • Квесты
    • Леталки
    • Логические
    • Мультфильмы
    • Открытки
    • Приколы
    • Разное
    • Спорт
    • Стратегии
    • Стрелялки
Статистика

Статей: 87772
Просмотров: 96111483
Игры
Injustice:  Gods Among Us
Injustice: Gods Among Us
...
Dark Souls 2
Dark Souls 2
Dark Souls II - вторая часть самой хардкорной ролевой игры 2011-2012 года, с новым героем, сюжето...
Battlefield 4
Battlefield 4
Battlefield 4 - продолжение венценосного мультиплеер-ориентированного шутера от первого ли...
Кино
Steins;Gate
Steins;Gate
Любители японской анимации уже давно поняли ,что аниме сериалы могут дать порой гораздо больше пи...
Ку! Кин-дза-дза
Ку! Кин-дза-дза
Начинающий диджей Толик и всемирно известный виолончелист Владимир Чижов встречают на шумной моск...
Обзоры на игры
• Обзор Ibara [PCB/PS2] 18357
• Обзор The Walking ... 18801
• Обзор DMC: Devil M... 19879
• Обзор на игру Valk... 15877
• Обзор на игру Stars! 17764
• Обзор на Far Cry 3 17948
• Обзор на Resident ... 16024
• Обзор на Chivalry:... 17508
• Обзор на игру Kerb... 17981
• Обзор игры 007: Fr... 16619
Превью о играх
• Превью к игре Comp... 17960
• Превью о игре Mage... 14464
• Превью Incredible ... 14721
• Превью Firefall 13479
• Превью Dead Space 3 16334
• Превью о игре SimC... 14730
• Превью к игре Fuse 15442
• Превью Red Orche... 15542
• Превью Gothic 3 16343
• Превью Black & W... 17354
Главная » Статьи » Разное » Печать из Linux'а на принтер подключенный к Win95/NT. (samba print win)

Печать из Linux'а на принтер подключенный к Win95/NT. (samba print win)

Ключевые слова: samba, print, win, (найти похожие документы)

_ RU.LINUX (2:5077/15.22) ___________________________________________ RU.LINUX _
From : Michael Bravo 2:5030/10 30 May 97 14:21:02
Subj : Re: Печать из Linux'а на принтер подключенный к Win95/NT.
________________________________________________________________________________
Nick E. Milogradsky (Nick.Milogradsky@mn.vsu.ru) wrote:
>
> - Сервер под Linux'ом c Samb'ой;
> - Есть рабочки с Win95 (или NT) с подключенными
> к ним принтерами, доступными для остальных.

Уф. Hик, у меня твои письма лежат :) извини. У меня есть некий summary по
этому поводу, сейчас я его выдеру из архива.

1) письмо от Владимира Тимохина -

Вот так у меня сделано.
Принтер делится без пароля. Правда samba достаточно старая...

/etc/printcap
------------------------------------------------------------------------
# @(#)printcap 5.3 (Berkeley) 6/30/90

lp|windows remote line printer:
:lp=/dev/null:sd=/var/spool/output/lpwd:lf=/var/log/lpd-errs:
:sh:if=/usr/libexec/lpr/smbprint:
------------------------------------------------------------------------

/usr/libexec/lpr/smbprint
------------------------------------------------------------------------
#!/bin/sh

PRN='\WIN95NAMEPRINTERNAME'

SMBCLIENT="/usr/local/samba/bin/smbclient $PRN -P -N"
CAT="/bin/cat"
TODOS="/usr/local/bin/todos"

raw=0
while [ $# -gt 0 ]
do
case $1 in
-c*) raw=1 ;;
-w*) sw="width"; width=`expr $1 : '..(.*)` ;;
-l*) sw="height"; height=`expr $1 : '..(.*)` ;;
-i*) sw="indent"; indent=`expr $1 : '..(.*)` ;;
-n*) sw="login"; shift; login=$1 ;;
-h*) sw="host"; shift; host=$1 ;;
*) acct=$1 ;;
esac
shift
done

( echo print -
##
## echo : $raw : $width : $height : $indent : $login : $host : $acct :
##
if [ $raw = 0 ]
then
$TODOS
else
$CAT
fi
##
## echo
##
) | $SMBCLIENT
exit $?
------------------------------------------------------------------------

С уважением,
Vladimir Timohin <wowa@vltsb.vladimir.su>; (2:5024/8)

2) письмо от иностранца :)

I'll try to give you as much information as I have, it's been a while since
I installed this thing. I'm running Redhat 4.1 and I'm not sure how much
the config files will help with another version of Linux. I also upgraded
to the latest version of ghostscript that I could find in the contrib
folder at ftp.redhat.com.

If you need anything else, don't hesitate to ask.


First of all, here's my printcap:

---------------------------------------------------------------------------
# /etc/printcap
#
# Please don't edit this file directly unless you know what you are doing!
# Be warned that the control-panel printtool requires a very strict format!
# Look at the printcap(5) man page for more info.
#
# This file can be edited with the printtool in the control-panel.

##PRINTTOOL3## SMB ljet4 600x600 a4 {} LaserJet4 Default {}
lp:
:sd=/var/spool/lpd/lp:
:mx#0:
:sh:
:if=/var/spool/lpd/lp/filter:
:af=/var/spool/lpd/lp/acct:
:lp=/dev/null:
##PRINTTOOL3## SMB cdj550 300x300 a4 {} DeskJet550 1 1
hpdj:
:sd=/var/spool/lpd/hpdj:
:mx#0:
:sh:
:if=/var/spool/lpd/hpdj/filter:
:af=/var/spool/lpd/hpdj/acct:
:lp=/dev/null:
---------------------------------------------------------------------------

Then there's the /etc/smb.conf

---------------------------------------------------------------------------

; The global setting for a RedHat default install
; Make sure and restart the server after making changes to this file, ex:
; /etc/rc.d/init.d/smb stop
; /etc/rc.d/init.d/smb start

[global]
printing = bsd
printcap name = /etc/printcap
load printers = yes
; Uncomment this if you want a guest account
; guest account = pcguest
log file = /var/log/samba
lock directory = /var/lock/samba
share modes = yes

[homes]
comment = Home Directories
browseable = no
read only = no
create mode = 0750

[printers]
comment = All Printers
browseable = no
printable = yes
public = no
writable = no
create mode = 0700

;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes

; A publicly accessible directory, but read only, except for people in
; the staff group
[public]
comment = Public Stuff
path = /home/samba
public = yes
writable = yes
printable = no
write list = @staff

---------------------------------------------------------------------------

And this is the file /var/spool/lpd/lp/general.cfg

---------------------------------------------------------------------------

#
# General config options for printing on this queue
# Generated by PRINTTOOL, do not modify.
#
export DESIRED_TO=ps
export PAPERSIZE=a4
export PRINTER_TYPE=SMB
export ASCII_TO_PS=YES

---------------------------------------------------------------------------

This is the file /var/spool/lpd/lp/postscript.cfg

---------------------------------------------------------------------------

#
# configuration related to postscript printing
# generated automatically by PRINTTOOL
# manual changes to this file may be lost
#
GSDEVICE=ljet4
RESOLUTION=600x600
COLOR=
PAPERSIZE=a4
EXTRA_GS_OPTIONS=
REVERSE_ORDER=
PS_SEND_EOF=NO

---------------------------------------------------------------------------

This is the file /var/spool/lpd/lp/textonly.cfg

---------------------------------------------------------------------------

#
# text-only printing options for printing on this queue
# Generated by PRINTTOOL, do not modify.
#
TEXTONLYOPTIONS=
CRLFTRANS=
TEXT_SEND_EOF=NO

---------------------------------------------------------------------------

This is the file /var/spool/lpd/lp/filter

---------------------------------------------------------------------------

#!/bin/bash
#
#
# New smart print filter
#
#
# determines input file magic
#
# looks in the default filter plugin (FPI) directory
# finds all *.fpi files, then finds a combination that will
# yield the desired file type, or will indicate this is impossible.
#


function filtfrom {
echo -ne ${1%-to-*}
}

function filtto {
echo -ne ${1#*-to-}
}

#
# given filters as input vars, find next level available given the
# first arg is the starting point
#
function nextlvl {

local try
local start
local all
local depth

#
#
# $1 is starting point, find something that will work
#
start="$1"
shift

depth="$1"
shift

all="$@"

#
# get out of here if too deep!
#
if [ $depth -ge $MAX_DEPTH ]; then
return 1
fi
if [ $DEBUG_TREE ]; then
echo "Starting point = $start" >> /tmp/filter.debug
fi

if [ $(filtto $start) = $DESIRED_TO ]; then
echo " DONE"
return 0
fi

while [ $1 ]; do
try=$1
shift
if [ $DEBUG_TREE ]; then
echo "for $start trying $try" >> /tmp/filter.debug
fi
if [ $(filtfrom $try) = $(filtto $start) ]; then
echo -n "$start.fpi:$depth:CONT "

if [ $(filtto $try) = $DESIRED_TO ]; then
echo -n "$try.fpi:$((depth+1)):DONE "
return 0
else
# echo -n $try
nextlvl $try $((depth+1)) $all
# echo "|G is $G| "
if [ $DEBUG_TREE ]; then
echo "|rt is $?|" >> /tmp/filter.debug
fi
if [ "$?" = "0" ]
then
if [ $DEBUG_TREE ]; then
echo "for $start we are done" >> /tmp/filter.debug
fi
# return 0
else
if [ $DEBUG_TREE ]; then
echo "for $start we have failed" >> /tmp/filter.debug
fi
return 1
fi
fi
fi
# echo ""
done
}


#
# MAIN
#
#

#
#
# setup some global variables used by this script
#
#

#
# FPIDIR points to where print filter plug-ins are stored
# Normally these will be installed with a package via RPM
#
FPIDIR=/usr/lib/rhs/printtool

PATH=${FPIDIR}:${PATH}

#
# MAX_DEPTH determines how long a string of filters will be
# tried as a possible printing solution. How many input
# formats will take 6 filters to output Postscript!
# Unlikely this will need to be changed.
#
MAX_DEPTH=6

#
# define these to gets lots of feedback
# output is appended on /tmp/filter.debug
#
DEBUG_TREE=""
DEBUG_FILTER=""

#
# Setup variables available to all filter plug-ins
#
#

#
# SPOOLDIR is directory which lpd is spooling from
#
export SPOOLDIR=$(pwd)

#
# Get queue specific information (which was written by printtool)
#
source ${SPOOLDIR}/general.cfg

if [ "$DEBUG_FILTER" != "" ]; then
echo "Desired print format is $DESIRED_TO" >> /tmp/filter.debug
echo "Paper size is $PAPERSIZE" >> /tmp/filter.debug
echo -n "A form feed will " >> /tmp/filter.debug
if [ "$SEND_EOF" = "" ]; then
echo "not be sent." >> /tmp/filter.debug
else
echo "be sent." >> /tmp/filter.debug
fi
fi

cd $FPIDIR
fpis=$(ls *.fpi 2> /dev/null | tr 'n' ' ' | sed 's/.fpi//g')

#
# let's see if its a compressed file first
#
#
# Figure out the magic of the input file
#
magic=$(file -)
$FPIDIR/rewindstdin
magic=${magic#*: }
if [ "$DEBUG_FILTER" != "" ]; then
echo "Magic is |$magic|" >> /tmp/filter.debug
fi
case `echo $magic | tr 'A-Z' 'a-z'` in
*packed*|*gzip*|*compress* )
DECOMPRESS="gzip -dc";;
* )
DECOMPRESS="";;
esac

#
# Figure out the magic of the input file
#
if [ "$DECOMPRESS" = "" ]; then
magic=$(file -)
else
magic=$($DECOMPRESS - | file -)
fi
$FPIDIR/rewindstdin
magic=${magic#*: }
if [ "$DEBUG_FILTER" != "" ]; then
echo "Magic is |$magic|" >> /tmp/filter.debug
fi
case `echo $magic | tr 'A-Z' 'a-z'` in
"pc bitmap data"* )
startpnt="INPUT-to-bmp";;
"gif image data"* )
startpnt="INPUT-to-gif";;
"jpeg image data"* )
startpnt="INPUT-to-jpeg";;
"tiff image data"* )
startpnt="INPUT-to-tiff";;
"sun raster image data"* )
startpnt="INPUT-to-rast";;
"pgm"*|"pbm"*|"ppm"* )
startpnt="INPUT-to-pnm";;
postscript* )
startpnt="INPUT-to-ps";;
"tex dvi file"* )
startpnt="INPUT-to-dvi";;
"fig image text"* )
startpnt="INPUT-to-fig";;
"troff or preprocessor"* )
startpnt="INPUT-to-troff";;
"rpm"* )
startpnt="INPUT-to-rpm";;
*ascii*|*text*|*english*|*script* )
startpnt="INPUT-to-asc";;
*data*|*escape* )
startpnt="INPUT-to-prdata";;
*pcl* )
startpnt="INPUT-to-prdata";;
* )
startpnt="INPUT-to-unknown";;
esac


#
# here is where we could put in hook to call user routine(s) to
# handle extra magics they've defined filters for
#
# call_user_magic_hook()
#
if [ "$DEBUG_FILTER" != "" ]; then
echo "Type of file is $startpnt" >> /tmp/filter.debug
fi

if [ "$startpnt" = "Dont know" ]; then
echo "Error - input file type is unknown - cannot print"
exit 1
fi

#
# catch some easy cases without having to figure out best path the hard way
#
bestpath=""
foundbest="NO"
if [ $(filtto $startpnt) = "asc" ]; then
if [ "$ASCII_TO_PS" = "NO" ]; then
bestpath="$startpnt | asc-to-printer.fpi"
foundbest="YES"
fi
elif [ $(filtto $startpnt) = "prdata" ]; then
bestpath="$startpnt | cat -"
foundbest="YES"
elif [ $(filtto $startpnt) = $DESIRED_TO ]; then
bestpath="$startpnt | $DESIRED_TO-to-printer.fpi"
foundbest="YES"
fi

if [ "$foundbest" != "YES" ]; then
#
# we go through and find best path
#
G=`nextlvl "$startpnt" "0" $fpis`

if [ "$DEBUG_FILTER" != "" ]; then
echo "$G" >> /tmp/filter.debug
fi

#
# now sort out the best path of all available
#
#
# if no processing required, depth will equal 'DONE'
#
if [ "${G# *}" != "DONE" ]; then
root=""
bestdepth=$((MAX_DEPTH*2))
bestpath=""
curdepth="0"
depth="0"
foundbest="NO"
for i in $G; do
entry=${i%%:*}
depth=${i#*:}
depth=${depth%:*}
if [ $depth -le $curdepth ]; then
while [ $(($depth <= $curdepth && $curdepth >= 0)) -eq 1 ]; do
root=${root%* | *}
curdepth=$(($curdepth - 1))
done
fi
if [ $(($curdepth < 0)) -eq 1 ]; then
root=""
fi
curdepth=$depth
if [ "$root" = "" ]; then
root="$entry"
else
root="$root | $entry"
fi
if [ ${i##*:} = "DONE" ]; then
if [ "$DEBUG_FILTER" != "" ]; then
echo "$root -> depth = $depth" >> /tmp/filter.debug
fi
if [ $depth -lt $bestdepth ]; then
foundbest="YES"
bestdepth=$depth
bestpath=$root
fi
fi
done
fi

if [ "$foundbest" = "YES" ]; then
bestpath="$bestpath | $DESIRED_TO-to-printer.fpi"
fi
#
# end of doing it the hard way
#
fi
#
# we have to add filter to convert desired format to something the
# printer can handle. May be as simple as 'cat'
#
#
# ok we got here, and if input data magic is 'data' we'll let it
# through, hoping it really will work on the printer!
# Note we still reject lots of magics, like ELF, by doing this
# which is what we want
#
#
# getting bad, but trapping all "special" cases here
#
#
if [ "$foundbest" = "NO" ]; then
printf "No way to print this type of input file: $magic 14"
exit 0
else
#
# fix up the best path so we can run it
#
if [ "$DECOMPRESS" = "" ]; then
bestpath="cat - ${bestpath#* }"
else
bestpath="$DECOMPRESS ${bestpath#* }"
fi
fi

#
# any post-filter to run (like smbclient?)
#
if [ "$PRINTER_TYPE" = "SMB" ]; then
bestpath="$bestpath | ${FPIDIR}/smbprint ${SPOOLDIR}/acct"
fi

if [ "$DEBUG_FILTER" != "" ]; then
echo "Best path of depth $bestdepth is $bestpath" >> /tmp/filter.debug
fi

#
# run the command!
#
eval $bestpath

#
#
# see if we need to send a form feed to eject the page from printer
#
# if [ "$SEND_EOF" != "" ]; then
# printf "14"
# fi

exit 0


---------------------------------------------------------------------------

This is the file /var/spool/lpd/lp/.config

---------------------------------------------------------------------------

share='\helgalaser4L'
user=spike
password=insert_password


That's about it :-)
Again, in case you should need anything else feel free to ask.

Oliver J. Albrecht <olli@allcon.net>

--
//ike PGP public key 67C4EA8EEBF67C51
fingerprint 2C8B78790C8ADCDC
--- ifmail v.2.8c
* Origin: The Communication Tube (2:5030/10@fidonet)

513 Прочтений •  [Печать из Linux'а на принтер подключенный к Win95/NT. (samba print win)] [08.05.2012] [Комментариев: 0]
Добавил: Ukraine Vova
Ссылки
HTML: 
[BB Url]: 
Похожие статьи
Название Добавил Добавлено
• Печать из Linux'а на принтер подклю... Ukraine Vova 08.05.2012
Ни одного комментария? Будешь первым :).
Пожалуйста, авторизуйтесь для добавления комментария.

Проект входит в сеть сайтов «8Gamers Network»

Все права сохранены. 8Gamers.NET © 2011 - 2025

Статьи
Рецензия на Pressure
Рецензия на Pressure
Чтобы обратить на себя внимание, начинающие маленькие разработчики, как правило, уходят в жанры, ...
Рецензия на Lost Chronicles of Zerzura
Рецензия на Lost Chron...
Игры, сделанные без любви и старания, похожи на воздушный шар – оболочка есть, а внутри пусто. Lo...
Рецензия на The Bridge
Рецензия на The Bridge
«Верх» и «низ» в The Bridge — понятия относительные. Прогуливаясь под аркой, можно запросто перей...
Рецензия на SimCity
Рецензия на SimCity
Когда месяц назад состоялся релиз SimCity, по Сети прокатилось цунами народного гнева – глупые ош...
Рецензия на Strategy & Tactics: World War 2
Рецензия на Strategy &...
Название Strategy & Tactics: World War II вряд ли кому-то знакомо. Зато одного взгляда на ее скри...
Рецензия на игру Scribblenauts Unlimited
Рецензия на игру Scrib...
По сложившейся традиции в информационной карточке игры мы приводим в пример несколько похожих игр...
Рецензия на игру Walking Dead: Survival Instinct, The
Рецензия на игру Walki...
Зомби и продукция-по-лицензии — которые и сами по себе не лучшие представители игровой биосферы —...
Обратная связь | RSS | Донейт | Статистика | Команда | Техническая поддержка