The officially official Devuan Forum!

You are not logged in.

#1551 Re: Hardware & System Configuration » CUPS accounting [Solved] » 2020-02-26 12:25:30

Hello:

Altoid wrote:

Hello:
There seem to be some discrepancies ...
I'll check and report back.

I've done some manual accounting and found this:

While the output of the awk command to find the total pages printed gives a result of 601 ...

groucho@devuan:~$ awk '/A4/{pages += $6} END {print pages}' /var/log/cups/page_log
601
groucho@devuan:~$

... my manual accounting shows that a total of 1033 pages were actually printed.

The 1033 (via-a-vis 601) figure is more in line with the expected number of pages that could actually be printed with the original cartdrige that came with this HP printer.
(cheap bastards ... )

This is the output of the relevant parts of /var/log/cups/page_log:

groucho@devuan:~$ cat /var/log/cups/page_log
--- snip ---
Samsung_M2020_Series groucho 84 [02/Nov/2018:10:50:45 -0300] 1 1 - localhost
Samsung_M2020_Series groucho 85 [08/Nov/2018:18:10:50 -0300] 1 1 - localhost
Samsung_M2020_Series groucho 86 [27/Nov/2018:16:41:51 -0300] 1 1 - localhost
Samsung_M2020_Series groucho 87 [30/Nov/2018:10:44:10 -0300] 1 1 - localhost
Samsung_M2020_Series groucho 88 [05/Dec/2018:08:29:39 -0300] 1 1 - localhost
Samsung_M2020_Series groucho 88 [05/Dec/2018:08:29:42 -0300] 2 1 - localhost
Samsung_M2020_Series groucho 89 [08/Dec/2018:19:12:32 -0300] 1 1 - localhost 
--- snip ---

For some reason the print job numbering starts at 84, which at 1 page per job, would take the number of printed pages to 1117.
I may have deleted/edited the log file after finding strange characters in some lines due to some ISO issue (?), cannot recall.

I've struck out the data after localhost as for my use I have no need for the printed page metadata nor the page size as I think this printer only takes A4, the only size I am using.
I have no need for the printer data or the user data either as there's only one printer and only one user allowed to print or use the rig (me) but I have left that part of the output string to show how it is formed.

Samsung_M2020_Series
groucho
84  <--- job number
[02/Nov/2018:10:50:45 -0300]  <--- job date
1  <--- pages printed
1  <--- pages in job
localhost

The thing is that only the data in bold is of any use to me.

What would have to be added/changed to the awk stanza to get this to work?
I have the idea that whatever the working awk stanza is, it will be good for this particular setup as a change in the printer name or user could throw off the results.

Is this so?

Thanks in advance,

A.

#1552 Re: Hardware & System Configuration » CUPS accounting [Solved] » 2020-02-25 12:32:40

Hello:

Head_on_a_Stick wrote:

Try these instead ...

These two worked a charm.

This string awk '/A4/{print $4$5 " " $6}' /var/log/cups/page_log > trimmed_log.txt got me a list of what would seem to be all the print jobs up to today (172 between 30/11/18 and 13/02/2020). I'd just have to trim the ones up to the cartdrige change/refill.

groucho@devuan:~$ cat trimmed_log.txt
[30/Nov/2018:10:44:10-0300] 1
[08/Dec/2018:19:12:32-0300] 1
--- snip ---
13/Feb/2020:16:57:53-0300] 14
groucho@devuan:~$

And this other one awk '/A4/{pages += $6} END {print pages}' /var/log/cups/page_log gave me what would seem to be the sum of the pages printed (601). 

groucho@devuan:~$ awk '/A4/{pages += $6} END {print pages}' /var/log/cups/page_log
601
groucho@devuan:~$

No spreadsheet, which is a relief even though I would only do this once every so often.

Thank you both for taking the time to help me out with this, I will try harder to spruce up my CLI basics as I am (again, after so long) finding it to be not only interesting but very usefull.
So many years of GUI usage ...  =-/

Once again, thanks a lot.

Best,

A.

Edit:
There seem to be some discrepancies between the actual log and the output from the awk commands.
I'll check and report back.

#1553 Re: Hardware & System Configuration » CUPS accounting [Solved] » 2020-02-23 12:40:01

Hello:

ToxicExMachina wrote:

Maybe I can help ...

Thank you very much. =-)

ToxicExMachina wrote:

... but I need a sample of log.
... not sure /var/log/cups/page_log is the correct log ...
... it has no any contents ...

It seems that CUPS can be quite informative.
I have three logs: access_log, error_log, and page_log, but I think logging/log level has (?) to be set in the configuration file.

If I remember correctly, I'm using the default file which you can set in http://localhost:631/admin/.
The first entry is LogLevel and it is set to warn.

Also, in http://localhost:631/admin/ -> Server Settings -> Advanced you can choose to preserve job history.
I have it set to 50 jobs max.

With respect to the page_log format, I found this ...

Page Logging

CUPS can log every page that is printed on a system to the page_log file. Page logging must be enabled by setting the PageLogFormat directive in the cupsd.conf file and is only available for drivers that provide page accounting information, typically all PostScript and CUPS raster devices. Raw queues and queues using third-party solutions such as Foomatic generally do not have useful page accounting information available.

... and this:

Access Log File Format

The access_log file lists each HTTP resource that is accessed by a web browser or client. Each line is in an extended version of the so-called "Common Log Format" used by many web servers and web reporting tools:

   host group user date-time "method resource version" status bytes ipp-operation ipp-status

It seems that the default page_log format (apparently set in cupsd.conf) is this ...

PageLogFormat format-string
    Specifies the format of PageLog lines. Sequences beginning with percent (%) characters are replaced with the corresponding information, while all other characters are copied literally. The following percent sequences are recognized:

        "%%" inserts a single percent character.
        "%{name}" inserts the value of the specified IPP attribute.
        "%C" inserts the number of copies for the current page.
        "%P" inserts the current page number.
        "%T" inserts the current date and time in common log format.
        "%j" inserts the job ID.
        "%p" inserts the printer name.
        "%u" inserts the username.

The default is the empty string, which disables page logging. The string "%p %u %j %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}" creates a page log with the standard items.

... but my /etc/cups/cupsd.conf dos not have a PageLogFormat entry.

In any case, the /var/log/cups/page_log format in my log file is this:

Samsung_M2020_Series groucho 109 [27/Dec/2018:08:37:02 -0300] 1 1 - localhost H:\Desktop\flower_sm.jpg A4 -

I have to see how to trim this a bit as I really have no use for so much information as (at least for now) it is one rig, one user and no external sharing or network access and I only need to know how many pages I have been able to print by the time my cheap HP printer with an expensive toner cartridge needs to be reloaded.

Thanks a lot for your input.

Cheers,

A.

#1554 Re: Hardware & System Configuration » CUPS accounting [Solved] » 2020-02-23 00:01:48

Hello:

ToxicExMachina wrote:

... use grep and/or awk for getting only necessary information from that log file.

Hmmm ...

The data I'm looking for is the sum of a set of numbers whose values I ignore and are (in this case) listed in 400 consecutive lines, one line per print job.
I don't see how grep could help me.

I thought there could be some script or front end I have not been able to find that would use the log file as input and get the total pages printed.

Thanks for your input.

Cheers,

A.

#1555 Re: Hardware & System Configuration » CUPS accounting [Solved] » 2020-02-18 10:43:14

Hello:

ToxicExMachina wrote:

.... in completed jobs of the printer ...

Yes, I know.

Like I mention in my post:

There's the log at http://localhost:631/admin/log/page_log which is read from /var/log/cups/page_log ...

But there are more than 400 completed jobs and I only need the amount of pages printed which I cannot seem to be able to get without some time consuming editing of the log file.

Thanks for your input.

A.

#1556 Hardware & System Configuration » CUPS accounting [Solved] » 2020-02-17 19:55:25

Altoid
Replies: 15

Hello:

I'm looking for a way to quickly be able to know how many pages my Samsung M2020W has printed at any point in time.
Although not really at any point, just when I see that the print density is falling.

The original cartdrige lasted for few pages (I know that is the usual thing) and I have had it refilled and would like to keep a tab on how well it works.

There's the log at http://localhost:631/admin/log/page_log which is read from /var/log/cups/page_log but I don't see how to weed out the data without some time consuming editing.

Thanks in advance,

A.

#1557 Re: Devuan » Debian has fallen. What now? » 2020-01-19 15:31:25

Hello:

Altoid wrote:

Hello:
The writing has been on the wall for a long time now.
And it's well past the time to heed the warning.

Just to reinforce what I wrote previously / further illustrate just what is going on Linux/MS wise, I invite members to check out this YouTube chat from almost two years ago by a chap called Lunduke.
https://www.youtube.com/watch?v=TVHcdgrqbHE

... and this other one.

https://www.youtube.com/watch?v=9MflUrykPaY

I think they are worth watching.
Of course, YMMV.

Cheers (?),

A.

#1558 Re: Installation » installing nvidia drivers on ascii 2.1 » 2020-01-09 11:43:36

Hello:

steve wrote:

... edited my sources.list file ...

For those (more knowledgeable than I) able to opine, it would probably be important to see the contents/output of cat /etc/apt/sources.list.

Edit:

The output of cat /var/log/Xorg.0.log would be useful also.

Cheers,

A.

#1559 Re: Installation » "Warning": Failed to connect to lvmetad » 2019-12-31 10:45:47

Hello:

turbo wrote:

Any suggestions ?

I have not come across this and from what I have read, if the system boots without issues, it is just a harmless warning.
Maybe someone else knows better.

Cheers,

A.

#1560 Re: Devuan » Debian has fallen. What now? » 2019-12-29 13:52:44

Hello:

fsmithred wrote:

It could have been worse.

Indeed ...
But I fear that (eventually) it will get worse.
To me it's just a question of time.

Why?
Because not enough people are paying attention to what is going on.

I've clocked roughly 20+ years of MS software use, ~5 years as a regular -> advanced user, the rest as first -> second tier support and on-site hardware service when needed, all at the different places where I made a living and from home when out of a job.

So my background is not that of a coder/developer or packager but someone who started late but who has seen all this first hand as a privileged/advanced user, like many others here.

IMO, there is a striking parallel between systemd in Linux and the registry in Windows OSs.

Systemd in Linux brings back memories of my difficult transition from W3.11 to W95, with the end of the familiar and usually well documented *.ini files I understood (and could tweak when things went foul) to the obscure workings of *the registry*, which took me a few years to get a minimal hold of, basically through unending trial and error grief.

After a few years (W95 to XPSP3) I understood what it was all about: a developer sanctioned virus running inside the OS, constantly changing and going deeper and deeper into the OS with every iteration and as a result, progressively putting an end to the possibility of knowing/controlling what was going on inside your box/the OS as it became more and more obscure.

When systemd appeared in Debian (I was already running Ubuntu) and saw what and how it did it, I realised that systemd was nothing more than a registry class virus which was infecting the Linux ecosystem at the behest of the developers involved and the complicity or indifference of most of the others.

So I moved from Ubuntu to PCLinuxOS and then on to Devuan.

Paranoid?

No. Just strongly convinced that there are people both inside and outside IT that actually want this systemd takeover to happen and are quite willing to pay shitloads of money to push that agenda, Poettering being a prime suspect but surely not the only recipient.

I don't see this MS cozying up to / barging into Linux and areas of influence (GitHub acquisition, WSLinux (!), etc.) in various ways as a coincidence: these things do not happen just because or on a senior manager's whim.

What I do see (YMMV) is systemd being a sort of a putsch to generate a convergence Windows with or into Linux, which is not good for Linux and will be its undoing.

But there's really nothing new here: it's just the well known MSbrace at work.
It's been going on for more than 30 years.

And no, I don't have an answer to this problem.

But I do think that it would probably be a good thing that the awesome manpower behind all the Linux projects scattered out there team up to find common ground instead of everyone of them wanting to do their own thing while mindlessly waving the flag of choice, a flag which they are set to lose if they do not react fast enough.

The writing has been on the wall for a long time now.
And it's well past the time to heed the warning.

Of course, nothing but my $0.02 and as always, YMMV.

To all Dev1  members/guests: Have a Happy New Year 2020.

Cheers,

A.

#1561 Re: Installation » Keyboard configuration issue » 2019-12-28 14:37:23

Hello:

HevyDevy wrote:

... does many things well ...

Like all the other mainsream desktops out there these days.

HevyDevy wrote:

... fails in some areas ...

I'd say far too many, but as I suffer its shortcomings I cannot be objective enough.

HevyDevy wrote:

... has the multi monitor display working well ...

Just like Mate or Cinnamon or Gnome (which I have not tried).
But that is probably because X is working reasonably well and when it does not, some *.orx/layouts get it fixed quick enough.

For example: I've been waiting years for Xfce to be able to line up/organise/keep the desktop icons where I bloody put them.
It's the one thing I miss from XP.

I have been seriously thinking about getting rid of Xfce once and for all but never get around to doing so, probably for fear of breaking my Devuan ASCI .

Cheers,

A.

#1562 Re: Installation » Keyboard configuration issue » 2019-12-28 13:27:28

Hello:

HevyDevy wrote:

... put the command in your autostart file ...

Done.

Applications -> Settings -> Session and Startup -> Application Autostart -> Add

Name: keyboardmap (or whatever)
Description: sets kb layout (or whatever)
setxkbmap latam

Thank you very much for your help.

That this issue is still a problem after so many years is not a good omen, not for Xfce and certainly not for the Linux ecosystem.

Cheers,

A.

#1563 Re: Installation » Keyboard configuration issue » 2019-12-28 12:52:49

Hello:

HevyDevy wrote:

... tried setxbmap as a workaround ...

Yes, it works.
I can set the layout with setxkbmap.

But it does not survive a reboot.
Where can I set it to make it permanent?

Thanks for your input

Cheers,

A.

#1564 Re: Installation » Keyboard configuration issue » 2019-12-28 11:21:07

Hello:

Altoid wrote:

rant
This is the type of thing that gets on Linux users' nerves: a straightforward configuration glitch in something that (at this stage in Linux time) should not be happening.
After all, how long has Xfce been a desktop option?
/rant

The issue I am having with the keyboard settings in Xfce seems to be related to a well known bug from back in 2010.
Nine (9) years ago and counting ....

https://askubuntu.com/questions/66096/h … er-reboots

Like someone else posted on that thread:

... u understand now why linux share in desktops is ~1%
A simple stupid language switcher applet is bugged for years...

I'll see if I can make one of the workarounds (evidently considered a permanent fix by the developers) work for me.

Cheers,

A.

#1565 Re: Installation » Keyboard configuration issue » 2019-12-27 21:13:46

Hello:

HevyDevy wrote:

... configure the keyboard with setxbmap ?

Hmm ...
What I want is to be able to configure it via the desktop settings like it should be done.
ie: Applications -> Settings -> Keyboard -> Layout

rant
This is the type of thing that gets on Linux users' nerves: a straightforward configuration glitch in something that (at this stage in Linux time) should not be happening.
After all, how long has Xfce been a desktop option?
/rant

So if it wants to use the system defaults (the previous setting), I guess I'll have to try setting the system defaults to what I want.

Any other ideas?

Thanks for your input.

Cheers,

A.

#1566 Re: Installation » Keyboard configuration issue » 2019-12-27 13:00:36

Hello:

Head_on_a_Stick wrote:

... Xfce?

Yes.

Head_on_a_Stick wrote:

... desktop is overriding your configuration.

Thought that could be the case, so tried Applications -> Settings -> Keyboard -> Layout, un-checked Use system defaults and chose Generic 105-key PC (intl.) with Spanish (Latin American) layout and Spanish (Latin American, no dead keys) variant.

But no, no cigar.

Thanks for your input.

A.

#1567 Installation » Keyboard configuration issue » 2019-12-26 16:40:39

Altoid
Replies: 12

Hello:

My Sun 7 keyboard went south, the second one this year.
Nice but not so trusty after all.

So I pulled an old Lenovo backup from the closet: KU-0225 / P/N: 41A5312
It's a standard 105-key Latin American layout keyboard.

But something is not right and I cannot figure out what it is.

I have set the layout with dpkg-reconfigure keyboard-configuration and my /etc/default/keyboard file reads accordingly.

# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="latam"
XKBVARIANT="nodeadkeys"
XKBOPTIONS="lv3:ralt_switch,compose:menu,terminate:ctrl_alt_bksp"

BACKSPACE="guess"

It seems that the keyboard configuration setting is being ignored and the keyboard is working as if it were a Spanish layout (like if it had a ç / Ç at the end of the third row).

eg: The key that should give me an accent ` or two types of brackets { or } and [ or ] gives me a ç or a Ç.

Rather annoying.

Any idea what might be happening here?

Thanks in advance,

A.

#1568 News & Announcements » Merry Christmas » 2019-12-24 21:43:46

Altoid
Replies: 9

Hello:

A hearty season's geeting (Merry Christmas / other celebrations, etc.)  to all here at Dev1, especially to those who keep the Devuan project moving forward.

Cheers,

A.

#1569 Re: Other Issues » [SOLVED] Apt-get show one package per line? » 2019-12-17 02:29:19

Hello:

golinux wrote:

... always been overwhelmed by the blob of text too.

+1

Yes, it is a pity.
Keeps me from being more confident in using apt-get.

Maybe maintainers could find a way to make the output (more) readable by default, like dnf?

A.

#1570 Re: Installation » Refracta Snapshot VM mount points question. » 2019-12-07 15:15:10

Hello:

fsmithred wrote:

I use optical media, too.
... directories under /media that are needed get created automatically. I think udev takes care of that.

OK

fsmithred wrote:

... directories you made under /media, take a look at the rsync excludes ...
... comment out one or more of the following lines, as needed.
Like this:

#- /cdrom/*
#- /media/*

Do the same with /usr/lib/refractainstaller/installer_exclude.list

Great ...  =-)

fsmithred wrote:

To add a line to fstab in the installer, you just need to add this line:

echo -e "/dev/sr0\t/media/cdrom\tauto\tnoauto,owner,ro,users\t0\t0" >> /target/etc/fstab

... right after the section that adds the swap line to fstab.
... starts around line 1430 in /usr/bin/refractainstaller and around line 1570 in /usr/bin/refractainstaller-yad.

The last two lines in the following code block are what you need to add.

# add entry for swap to fstab if needed
if [[ $use_existing_swap = "yes" ]] ; then
        if [[ $use_uuid = yes ]]; then
                swap_part="$(/sbin/blkid -s UUID $swap_dev | awk '{ print $2 }' | sed 's/\"//g')"
        else
                swap_part="$swap_dev"
        fi
        echo -e $"\n Adding swap entry to fstab...\n"
        echo -e "$swap_part\tswap\tswap\tdefaults\t0\t0" >> /target/etc/fstab
else
        echo -e "/swapfile\tswap\tswap\tdefaults\t0\t0" >> /target/etc/fstab
fi

# Make entry for cdrom in fstab
echo -e "/dev/sr0\t/media/cdrom\tauto\tnoauto,owner,ro,users\t0\t0" >> /target/etc/fstab

Thank you so much for taking the time to explain/write all this up.

I'll try it and see how it goes.
Just in case, this time I'll have a snapshot of the VM available.

Fortunately, I have backintime installled so I did not have to redo all my previous work after I went edit-happy with /ect/fstab.

With respect to seeing the devices in Xfe, I remembered gnome-disk-utility and decided to try it out on the VM and things got easier.
Not too heavy on the file system but certainly dangerous to use without the proper attention.

eg: that readily available delete selected partition button ...

Have a good week-end.
Cheers,

A.

#1571 Re: Installation » Refracta Snapshot VM mount points question. » 2019-12-06 22:55:03

Hello:

fsmithred wrote:

fstab is excluded in the rsync copy ...
... gets created when you install with refractainstaller.

OK.
Sort of makes sense.
The live *.iso would take a large portion of boot time figuring out why it was not being able to mount what fastab said was there and may not be.

But what I am referring to is the fact that the mount points I generated in /media ie: /media/cdrom and /media/usb on the VM are not copied over to the *.iso.
ie: there are no files in /media on the live *.iso.

They survive a reboot of the VM and belong to root.
And I can mount a cdrom or usb to them as root.

If they do not get carried over to the live *.iso, I have to generate them everytime I boot the *.iso file.
Make sense?

fsmithred wrote:

There's no entry for cdrom.
I haven't needed that in years.

I still have a score or so of DVDs and CDs with data and need to access them every so often. 

fsmithred wrote:

... you'd need to add a line of code to refractasnapshot.

That's rather over my head.

Would it be possible to (eventually) add an option for that to refractasnapshot.conf?

--- ot ---
One of the very good things that TinyCore linux has is an application called mount tool.

A very simple desktop panel with a button for each of the drives in the system you are booting into.
Click on a drive and it gets mounted, click again, it gets unmounted.

I wonder if it was specially written for TCore or it has its origins in some linux application.
--- ot ---

Thanks in advance,

A.

#1572 Re: Installation » Refracta Snapshot VM mount points question. » 2019-12-06 21:31:57

Hello:

ralph.ronnquist wrote:

... is that a typo in this post, or a typo in "fstab"?

It's a typo in fstab.
But the cdrom gets automatically mounted in the VM nevertheless.

[Changing it now]

Done.

groucho@devuan:~$ cat /etc/fstab
rootfs    / rootfs                              rw         0   0
/dev/sr0   /media/cdrom    auto    noauto,owner,ro,users   0   0
groucho@devuan:~$ 

Thanks for the heads up.

Best,

A.

#1573 Installation » Refracta Snapshot VM mount points question. » 2019-12-06 16:41:42

Altoid
Replies: 6

Hello:

I have set up two mount points in my Devuan ascii 2.0.0 VM ...

/media/cdrom and /media/usb, the first one listed in /etc/fstab:

groucho@devuan:~$ cat /etc/fstab
rootfs    / rootfs                             rw         0   0
dev/sr0   /media/cdrom    auto    noauto,owner,ro,users   0   0
groucho@devuan:~$ 

... but when I boot the *.iso image made with RS, the mount points are not there.

Is this how it is supposed to be or am I missing something with respect to Refracta Snapshot's configuration or VMs in general?

Thanks in advance,

A.

#1574 Re: Installation » Xfe + isomount question » 2019-12-05 21:25:55

Hello:

fsmithred wrote:

... you could make a hookscript that will run when you boot the live iso and inject the necessary lines into /etc/fstab.

No idea how to do that.

fsmithred wrote:

... won't work for a rescue usb that you're booting on some other box.

It's always the same box but as this *.iso (fortunately) is not used with any frequency, the disk configuration is likely to change so to all effects and purposes it is/could well be another box.

fsmithred wrote:

... better off doing it manually in a root terminal.
... fdisk, df and blkid to get information ...
... figure out which one you want to mount.

Yes, you might be right.
I have found that doing things in the terminal is helping me become, slowly albeit steadily, a bit more proficient with in use of the command line.

But it is hard to shed years point&click muscle memory and the apparent convenience it brought along.

I'll see what I can rig up.

Thanks for your input.

Best,

A.

#1575 Re: Installation » Xfe + isomount question » 2019-12-04 22:54:55

Hello:

fsmithred wrote:

... can set up the boot menu before or when you make the snapshot.

OK

fsmithred wrote:

... set up the extra partitions in fstab with 'noauto,user' options, then you can mount/unmount by right-clicking on the mountpoint.

Yes, that should do it.

Excuse my ignorance, but how do I set that up in a live *.iso when I don't know what drives will be in the box when I use it?

fsmithred wrote:

If xfe won't do what you want ...

Xfe is really lean, quick and most importantly, desktop agnostic.
I'd rather stay with Xfe.

Thanks for your input, much appreciated.

Best,

A.

Board footer

Forum Software