Working on a project where I'm printing really long prints on epson thermal printers (80mm x 18000mm) (length is variable per print).
My documents are set up as 1000mm long pages ie 14000mm print is 14 pages.
I'm able to print a correct length document with this command
lp -d 10_0_0_11 -o media=Custom.80x18000mm -o PageSize=Custom.80x1000mm -o TmtPaperSource=DocNoFeedCut -o landscape -o fit-to-page -o outputorder=reverse -o TmtSpeed=1 -o TmtPaperReduction=Both example/url/to/document
But this is really slow and don't want to use the command line for convenience.
When printing the document via Preview MacOS it only prints a portion of the document at the printer's max print size of 80x297mm. I have a custom page size of 80x1000mm setup but it seems to be ignoring that.
Any better workaround to gain the extra speed printing without the command line?
Related
One of our printing applications runs an external program which does some magic and sometimes returns a barcode in EPS format to be printed on the document.
if [ ... some magic ]
then
gnu-barcode -b $1 -c -e code39 -u mm -t 1x3 > $TMP.ps
ps2epsi $TMP.ps $TMP.eps
cat $TMP.eps
rm -f $TMP.eps $TMP.ps
else
cat /dev/null
fi
This works OK. However, it generates an annoying warning on the printing application side about not receiving a valid EPS when the else ... runs and we do cat /dev/null. I need to return a blank but valid EPS instead of the cat /dev/null. How can I accomplish this?
The EPS format is defined in Adobe Technical note 5002, its available on the web but it moves around so much I won't attempt to post a URL. However, unless you are a PostScript programmer that probably won't help you.
The simplest possible valid EPS would be something like:
%!PS-Adobe-2.0 EPSF-3.0
%%BoundingBox:0 0 0 0
That's the only required content in an EPSF. Of course, a real printing application might not like a BoundingBox of 0 0 0 0.
I have a new label printer (Brother QL 570) wich supports endless paper. My thought was, that I will be able to save paper by printing just as much paper as I need - wrong!
The printer comes with paper sizes of 63mm x 100mm and 63mm x 29mm (and some others) but I need 63mm x 'felxible lenght' or something like 63mm x 40mm.
How can I change that? I will print from OpenOffice.
Thanks!
(Driver is CUPS, using Mint 17.1)
The CUPS drivers that come with the printer include a utility for adding custom paper sizes.
Open a terminal and type:
brpapertoollpr_ql570
And you will see the usage examples for adding and removing custom sizes:
===========================
LPRng Paper Size Tool (v 0.1) Copyright by 2005
Usage: brpapertoollpr_xxxx -P QL-xxxx Printer Name [-n add a Lable Format Name (<=32 bytes) -w Media Width(unit:mm) -h Media Height(unit:mm)]/[-d delete Lable Format Name]
For example:
1. Add a new Label Format with "New Label Format" name and 29mm width and 70mm length:
"brpapertoollpr_ql570 -P QL-570 -n New\ Label\ Format -w 29 -h 70" [enter]
2. Remove the Label Format with "New Label Format" name:
"brpapertoollpr_ql570 -P QL-570 -d New\ Label\ Format" [enter]
===========================
As an example, I did
brpapertoollpr_ql570 -P QL-570 -n long_label -w 62 -h 200
to set up a custom paper size called "long_label" which prints on 62mm continuous roll, a 200mm long label
I have literally been at this for 5 hours, I have busybox on my device, and I unfortunately do not have -X in grep to make my life easier.
edit;
I have two list both of them have mac addresses, essentially I am just wanting to achieve offline mac address lookup so I don't have to keep looking it up online
list.txt has vendor mac prefix of course this isn't the complete list but just for an example
00:13:46
00:15:E9
00:17:9A
00:19:5B
00:1B:11
00:1C:F0
scan will have list of different mac addresses unknown to which vendor they go to. Which will be full length mac addresses. when ever there is a match I want the line in scan to be output.
Pretty much it does that, but it outputs everything from the scan file, and then it will output matching one at the end, and causing duplicate. I tried sort -u, but it has no effect its as if there is two different output from two different methods, the reason why I say that is because it will instantly output scan file that has everything in it, and couple seconds later it will output the matching one.
From searching I came across this
#!/bin/bash
while read line; do
grep -F 'list' 'scan'
done < list.txt
which displays the duplicate result when/if found, the output is pretty much echoing my scan file then displaying the matched pattern, this creating duplicate
This is frustrating me that I have not found a solution after click on all the links in google up to page 9.
Please someone help me.
I don't know if the Busybox sed supports this out of the box, but it should be easy to do in Awk or Perl instead then.
Create a sed script to print lines from file2 which are covered by a prefix in file1 by transforming each line in file1 into a sed command to print a match for that regular expression:
sed 's%.*%/&/p%' file1 | sed -n -f - file2
The same in Awk:
awk 'NR==FNR { a[++i]="^" $0; next }
{ for (j=1; j<=i; ++j) if ($0 ~ a[j]) print }' file1 file2
Ok guys I did a nested for loop (probably very in efficient) but I got it working printing the matching mac addresses using this
#!/usr/bin/bash
for scanlist in `cat scan | cut -d: -f1,2,3`
do
for listt in `cat list`
do
if [[ $scanlist == $listt ]]; then
grep $scanlist scan
fi
done
done
if anyone can make this more elegant but it works for me for now. I think the problem I had was one list contained just 00:11:22 while my other list contained 00:11:22:33:44:55 that is why I cut it on my scanlist to make same length as my other list. So this only output the matches instead of doing duplicate output.
I have a 64 byte hex stream of a frame-
000A959D6816000A959A651508004500002E000000004006AF160A010101C0A8000A11D71EC6000000000000000050000000AD840000000102030405CC904CE3
How can I import it into Wireshark and see the whole packet?
The option of importing hex dump doesn't seems to work in my case, if I save this stream into a text file and load it.
Since this hex stream is in hex, and for hex to hexdump conversion, od doesn't seems to work. So the solution would be to convert this hex back to binary, and then use od -Ax -tx1 -v [file] on that binary file.
xxd -r -p [hexfile] [binaryfile]
od -Ax -tx1 -v [binaryfile]
Note: Use the combination -r -p to read plain hexadecimal dumps without line number information and without a particular column layout.
A hex stream can be transformed into an od-like format filtering through a couple coreutils. The output can be fed into text2pcap, for example, to also set a link-layer type.
{ echo -n "0000 "; echo $hex_stream | fold -w 2 | paste -sd ' '; } | text2pcap -l 147 - $file
hex_stream is the data to be dissected and file is the pcap file to be written by text2pcap. I use this as part of a script that generates a temporary pcap from a hex stream and invokes tshark to dissect it - this gives me the dissection result immediately with no manual intervention.
How to Dissect Anything page in the Wireshark wiki has further information on dissection of arbitrary data.
If you format your hex string as shown in this page, you should be able to use the Import from Hex Dump dialog to import the file you've created.
I have to print Java code that some times reaches 300 columns (characters per line) in A3 paper and whatever editor I use (e.g. textmate) wraps the lines in order to fit in A4 paper.
Any suggestions?
cheers,
Asterios
Your editor undoubtably has either a Page Setup dialog or a Preferences dialogue as part of the Print Dialogue which will allow you to set the Paper Size to use for printing.
Even Notepad supports this
I finally made it to print using enscript. Here is the command I used to print Java code into PDF (and the used the pdf to print).
enscript -r -Ejava -M A3 -C -f "Courier8" input.java -o - | ps2pdf - output.pdf
where:
-r prints in landscape mode
-C prints the line numbers
-f changes the font and size
-M sets the output media to A3 (default is A4)
-Ejava adds syntax highlighting (you can also use --color if you need
colors in syntax highlighting but
they are not nicely printed in
greyscale)
It seems unlikely that every editor tries to format for A4. Which other editors have you tried? Does textmate not have a page size option? (Hmm... seems not)
Try a different editor that does let you set page size. Word, even.