How to check if pdf printing is finished on linux command line
location: linuxexchange.com - date: January 4, 2013
I have a bunch of files that I need to print via PDF printer and after it is printed I need to perform additional tasks, but only when it is finally completed.
So to do this from my python script i call command "lpr path/to/file.doc -P PDF"
But this command immediately returns 0 and I have no way to track when printing process is finished, was it successful or not etc...
There is an option to send email when printing is done, but to wait for email after I start printing looks very hacky to me.
Do you have some ideas how to get this done?
There are a plenty of ways to check if printer is printing something at current moment. Therefore at the moment after I start printing something I run lpq command every 0.5 second to find out if it is still printing. But this looks to m e not the best way to do it. I want to be able get alerted or something when actual printing process is finished. Was it successful or not etc...
RAR Usage in Linux Command Line
location: linuxexchange.com - date: May 10, 2011
I'm using RAR 3.80 (command-line) on CentOS 5.5.
I have a .rar file called example.rar; if I use the following command then I can clearly see that it displays an archive comment and a list of filenames:
rar l example.rar
Name Size Packed Ratio Date Time Attr CRC Meth Ver
google.txt 72 72 100% 13-07-09 17:42 .....A. 0D3BCA05 m0g 2.0
0001.jpg 835119 835119 100% 10-09-07 11:31 .....A. 51139B05 m0g 2.0
I tried to delete google.txt from the archive using the following command:
rar d example.rar google.txt
However it didn't work and says:
Deleting from example.rar
No files to delete
Any ideas what's wrong?
I also want to overwrite the original archive comment with my own comment. I don't know how to do this, as RAR only has a command to add an archive comment, not delete or replace an existing comment. How can I do that?
How to sort files numerically from linux command line
location: linuxexchange.com - date: July 24, 2010
Okay, now this is more a rant about Linux than a question, but maybe someone knows how to do what I want. I know this can be achieved using the sort command, but I want a better solution because getting that to work is about as easy as writing a C program to do the same thing.
I have files, for arguments sake, lets say I have these files: (my files are the same I just have many more)
Now this turns out to be the order I want them sorted in. Incidentally, this is the order in Windows that they are by default sorted into. That's nice. Windows groups consecutive numerical characters into one effective character which sorts alphabetically before letters.
If I type ls at the linux command line, I get the following garbage. Notice the 20 is displaced. This is a bigger deal when I have hundreds of these files that I want to view in a report, in order.
How to Determine if LCD Monitor is Turned on From Linux Command Line
location: linuxexchange.com - date: July 15, 2015
How do you tell if a computer's monitor(s) are turned on/off from the command line in Linux? I've traditionally thought of monitors as output-only devices, but I've noticed the Gnome Monitor Preferences dialog has a "detect monitor" function. Can this be generalized to determine if a monitor is physically turned off?
How to change brightness on CRT display through the Linux command line?
location: linuxexchange.com - date: July 17, 2013
I have a Debian Linux desktop and a CRT display. I want to change the screen's brightness without using the monitor's brightness controls. How can I do this? Is this possible in the command line or is there an application to be installed?
How can I get the resolution (width and height) for a video file from a linux command line?
location: linuxexchange.com - date: May 6, 2009
I've been digging through the mplayer/mencoder and ffmpeg documentation and I can't seem to come up with anything. I'm not especially picky as to the output format as I can use a regular expression to pull it out, I just can't seem to get the data in the first place.
Thanks in advance!
Convert from unixtime at command line
location: linuxexchange.com - date: March 9, 2015
Is there a quick, one-line way to convert a unix timestamp to a date from the unix command line?
'Date' might work, except it's rather awkward to specify each element (month, day, year, hour, etc.), and I can't figure out how to get it to work properly. It seems like there might be an easier way - am I missing something?
Calling a PHP page with get variables from Linux command line
location: linuxexchange.com - date: December 16, 2014
I want to use wkhtmltopdf to convert a web page to a pdf. I have test with a static template and this syntax works perfectly
wkhtmltopdf my.html my.pdf
The problem is the actual page is a dynamic PHP page with tables that rely on 3 get variables.
An example would be http://mypage.php?clientid=SJC&datestart=201201&dateend=201202 .
I can't do this directly like so:
wkhtmltopdf mypage.php?clientid=SJC&datestart=201201&dateend=201202 my.pdf
Someone suggested I needed to call the PHP from the command line with the variables first to get the HTML source code for that set of variables, then convert it using wkhtmltopdf
How do I do this? Can someone provide the process using the above URL as an example?
Writing NonStandard Characters Into Linux Command Line
location: linuxexchange.com - date: December 23, 2013
I've run into a bit of a problem. To do what I'm attempting, I need to be able to enter pure hex values into the standard input of the command line (specifically into a gets() call which is inside of the program) without using IO redirection. I generally have success by using ctrl + u + number to enter ascii characters equivalent to the entered hex value, but I need to be able to enter null chars/backspaces/etc which the terminal either ignores or interprets as an action rather than a character. If I use pipes or IO redirection, I can't interact with the program after the initial input and the program closes. Would anyone have any ideas? I'm thinking possible solutions are either:
Find a way to type the characters in manually and have them preserved
Find a way to enter the characters in that isn't unicode or ascii but will still be accepted as byte information
Find a way to pipe or redirect input to the program that is interpreted as from the command line, and then somehow convince
How to extract all images from a “readprotected” PDF from Linux command line?
location: linuxexchange.com - date: April 30, 2015
I'm trying to extract images from a PDF which is read protected.
With normal PDFs the Poppler library extracts images fine, and from read-protected PDFs it can also extract the text just fine. The images are a different story though. It either doesn't extract all images, or extracts all of them in vague grey or black colors.
On the following PDF (original PDF here) which has as you can see in the thumbnail below a lot of images:
I tried the pdfimages command from the Poppler library:
$ pdfimages -j ticket.pdf i
and the pdftohtml command from mupdf:
$ pdftohtml -nodrm ticket.pdf
But both libs only extract one of the many images. That image is extracted correctly though. From other PDFs I get all images, but all of them are grey or black.
Since read-protection is supposedly only a flag in the PDF document, and not an actual scrambling or encryption of the source (in the end your computer can show the images without putting in a password) it should be possible somehow to ext
Page: 1 2 3 4 5 6 7 8 9 10