Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 Oct 2014, 12:54
All times are UTC - 4
 Forum index » Off-Topic Area » Security
Icon that indicates a drive read or write operation?
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [25 Posts]   Goto page: Previous 1, 2
Author Message
tallboy


Joined: 21 Sep 2010
Posts: 444
Location: Oslo, Norway

PostPosted: Sun 14 Jul 2013, 10:17    Post subject:  

Nice work!

tallboy

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Sun 14 Jul 2013, 10:50    Post subject:  

Karl Godt wrote:
I have compiled xosview with only enabling the diskmeter .

Thanks Karl Smile
Will be invaluable for my Acer AO 722...which has no HDD LED indicator at all!! Evil or Very Mad

@Jasper: check out http://linux.die.net/man/1/xosview
There are some options you may find useful, e.g.:
Code:
./xosview-1.8.3-diskmeter-dyn -xrm "xosview*diskReadColor: green" -xrm "xosview*diskWriteColor: red" -xrm "xosview*diskIdleColor: gray"

Greetings!
Screenshot.png
 Description   
 Filesize   4.86 KB
 Viewed   331 Time(s)

Screenshot.png


_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sun 14 Jul 2013, 11:03    Post subject:  

Hi Jasper !

Glad you like it !

I know of xosview since Suse6.2 on 133MHz P-I .

The source is horrible to read and understand , but mostly works .
I can understand people preferring the conky monitor .
I like it because I can resize and place the window wherever I want .
I don't use conky at all .

I had started to compile it in late 2010 , mainly focusing on the lmstemp meter with PATH to different files in /sys for the it87 temperature module for my boards from 2000/2001 back then and now for the coretemp temperature module to be able to monitor the CPU temperature if not somewhere in /proc/acpi available and not to exit if not found .

Xosview sources the /root/.Xdefaults file , that could have a part that could look like

Code:
! XOsview settings begin

! General Resources
!xosview*title:
!xosview*geometry:           +5+5
!xosview*display:
xosview*captions:           True
xosview*labels:             True
xosview*transparent:        False
xosview*meterLabelColor:    wheat
xosview*usedlabels:         True
xosview*usedLabelColor:     wheat
xosview*borderwidth:        0
xosview*font:               7x13
xosview*background:         #34A56C
xosview*foreground:         wheat
xosview*enableStipple:      False ! Change to true to try beta stipple support.
xosview*samplesPerSec:      10    ! not yet supported
xosview*graphNumCols:       128   ! number of samples shown in a graph

! Disk Meter Resources
xosview*disk:               True
xosview*diskUsedColor:      seagreen
xosview*diskIdleColor:      #8FFF00
!some kind of lightgreen
xosview*diskWriteColor:     #FF0000
!some kind of read
xosview*diskReadColor:      #F9983C
!some kind of orange
xosview*diskBandwidth:      100000000 ! 100MB/s should be reasonable today for
                                     ! both IDE and SCSI
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

! XOsview settings end


Some of the variables seem not to be used eg .: xosview*diskUsedColor

That below are the two sections of the Xdefaults file used while compiling to set default values (not changed any values but False for all other meters) :
Code:
! General Resources
!xosview*title:
!xosview*geometry:           +5+5
!xosview*display:
xosview*captions:           True
xosview*labels:             True
xosview*transparent:        False
xosview*meterLabelColor:    wheat
xosview*usedlabels:         True
xosview*usedLabelColor:     wheat
xosview*borderwidth:        0
xosview*font:               7x13
xosview*background:         navy
xosview*foreground:         wheat
xosview*enableStipple:      False ! Change to true to try beta stipple support.
xosview*samplesPerSec:      10    ! not yet supported
xosview*graphNumCols:       128   ! number of samples shown in a graph

! Disk Meter Resources
xosview*disk:               True
xosview*diskUsedColor:      seagreen
xosview*diskIdleColor:      aquamarine
xosview*diskWriteColor:     SlateBlue1
xosview*diskReadColor:      SkyBlue
xosview*diskBandwidth:      10000000 ! 10MB/s should be reasonable today for
                                     ! both IDE and SCSI
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

to have a comparison .

That's it so far for color preferences .

An intensive manpage can be found here : http://linux.die.net/man/1/xosview

Embarassed SFR was faster .. Smile

With your color scheme as I understand it , mine full-featured looks like this :
xosview-full.jpg
 Description   
 Filesize   37.38 KB
 Viewed   312 Time(s)

xosview-full.jpg


_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send private message Visit poster's website 
tallboy


Joined: 21 Sep 2010
Posts: 444
Location: Oslo, Norway

PostPosted: Sun 14 Jul 2013, 11:30    Post subject:  

Depending on which puppy you run, you may also take a look at xosview from Ubuntu and Debian repos. There are several similar packages, like wmcpu, in Debian.
There is also iotop, which present a list, like top.

tallboy

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Mon 19 Aug 2013, 17:40    Post subject: xosview-1.14  

Code:
!  xosview resources (override into your .Xdefaults file)

! General Resources

xosview*title:              Xosview DiskMeter
xosview*geometry:           220x40
!xosview*display:            220x40
xosview*captions:           True
xosview*labels:             True
xosview*meterLabelColor:    cyan
xosview*usedlabels:         True
xosview*usedLabelColor:     wheat
xosview*borderwidth:        1
xosview*font:               7x13
xosview*background:         seagreen
! navy
xosview*foreground:         yellow
xosview*enableStipple:      False ! Change to true to try beta stipple support.
xosview*samplesPerSec:      5
xosview*graphNumCols:       135   ! number of samples shown in a graph

! Disk Meter Resources

xosview*disk:               True
xosview*diskUsedColor:      yellow
xosview*diskIdleColor:      LightGreen
xosview*diskWriteColor:     DarkRed
xosview*diskReadColor:      orange2
xosview*diskBandwidth:      100000000 ! 100MB/s
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

Code:
//  MeterMaker.cc
//  Copyright (c) 1994, 1995, 2002, 2006 by Mike Romberg ( mike.romberg@noaa.gov )
//
//  This file may be distributed under terms of the GPL
//

#include "MeterMaker.h"
#include "xosview.h"

#include <fstream>
#include "diskmeter.h"

#include <stdlib.h>

#include <sstream>
#include <iomanip>

using namespace std;

MeterMaker::MeterMaker(XOSView *xos){
  _xos = xos;
}

void MeterMaker::makeMeters(void){

  if (_xos->isResourceTrue("disk"))
      push(new DiskMeter(_xos, atof(_xos->getResource("diskBandwidth"))));

}

Code:

#Makefile
-include .config

AWK ?= awk
INSTALL ?= install
PLATFORM ?= linux

# Installation paths

PREFIX ?= /usr/local

BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man

# Optional build arguments; user may wish to override

OPTFLAGS ?= -Wall -Os

# Required build arguments

CPPFLAGS += $(OPTFLAGS) -I. -MMD
LDLIBS += -lX11
LDFLAGS += -s

OBJS = Host.o \
   Xrm.o \
   bitfieldmeter.o \
   bitmeter.o \
   defaultstring.o \
   fieldmeter.o \
   fieldmeterdecay.o \
   fieldmetergraph.o \
   llist.o \
   main.o \
   meter.o \
   xosview.o \
   xwin.o

# Optional platform type

ifeq ($(PLATFORM), linux)
OBJS += linux/MeterMaker.o \
   linux/diskmeter.o
CPPFLAGS += -Ilinux/
endif

DEPS := $(OBJS:.o=.d)

xosview:   $(OBJS)
      $(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)

defaultstring.cc:   Xdefaults defresources.awk
      $(AWK) -f defresources.awk Xdefaults > defaultstring.cc

Xrm.o:      CXXFLAGS += -Wno-write-strings

.PHONY:      dist install clean

dist:
      ./mkdist $(VERSION)

install:   xosview
      $(INSTALL) -d $(DESTDIR)$(BINDIR)
      $(INSTALL) -d $(DESTDIR)$(MANDIR)/man1
      $(INSTALL) -m 755 xosview $(DESTDIR)$(BINDIR)/xosview
      $(INSTALL) -m 644 xosview.1 $(DESTDIR)$(MANDIR)/man1/xosview.1

clean:
      rm -f xosview $(OBJS) $(DEPS) defaultstring.cc

-include $(DEPS)


xosview-1.14 diskmeter only
Precise-5.5 with Precise-5.7.1 devx

# ldd ./xosview
    linux-gate.so.1 => (0xffffe000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0xb7693000)
    libstdc++.so.6 => /lib/libstdc++.so.6 (0xb75ae000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb758f000)
    libc.so.6 => /lib/libc.so.6 (0xb73e5000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb73c4000)
    libdl.so.2 => /lib/libdl.so.2 (0xb73bf000)
    libm.so.6 => /lib/libm.so.6 (0xb7393000)
    /lib/ld-linux.so.2 (0xb77c9000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0xb738e000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7387000)

# ls -s ./xosview
76 ./xosview , stripped
-static gave libX11.a errors - Ubuntu seems to cook only with water , too .

# /lib/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.15-0ubuntu10.3) stable release version 2.15, by Roland McGrath et al.
xosview-1.14_diskmeteronly.bz2
Description 
bz2

 Download 
Filename  xosview-1.14_diskmeteronly.bz2 
Filesize  30.92 KB 
Downloaded  170 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Mon 19 Aug 2013, 21:07    Post subject:  

Hi Karl.

Thank you very much for your update; but (because of my defencies) I do not understand if you regard it as essential, as opposed to desirable.

Your new download shows numeric usage, but nothing shows in my graph (using Precise 5.6) whereas it does with your previous download which seemed perfect.

My regards and thanks
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Mon 19 Aug 2013, 23:45    Post subject:  

Hi Jasper ! It's because of the Puppy Philosophy to try to strip down as much as possible !

Likely

the first had a 10MB graph
xosview*diskBandwidth: 10000000 ! 10MB/s should be reasonable today for
and this one a 100MB graph
xosview*diskBandwidth: 100000000 ! 100MB/s

so tiny transfers of 4MB/s to slow SD cards would not show as graph .

Should show for huge transfers from HDD to HDD then .

Regards .
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Tue 20 Aug 2013, 02:42    Post subject:  

HACK - Bletchley Park I'm comming !
Code:
void MeterMaker::makeMeters(void){
  if (_xos->isResourceTrue("disk100"))
      push(new DiskMeter(_xos, "100M/s", atof(_xos->getResource("diskBandwidth100"))));
  if (_xos->isResourceTrue("disk10"))
      push(new DiskMeter(_xos, " 10M/s", atof(_xos->getResource("diskBandwidth10"))));
  if (_xos->isResourceTrue("disk2"))
      push(new DiskMeter(_xos, "  2M/s", atof(_xos->getResource("diskBandwidth2"))));
}

Code:
   public:
        DiskMeter( XOSView *parent, const char *label, float max );
        ~DiskMeter( void );

Code:
DiskMeter::DiskMeter( XOSView *parent, const char *label, float max ) : FieldMeterGraph(
  parent, 3, label, "READ/WRITE/IDLE"), _vmstat(false),
  _statFileName("/proc/stat")

Code:
#endif
#if !defined(__hpux__) && !defined(__hpux)
//  Disk Meter Options
{ "-disk2", "*disk2", XrmoptionNoArg, "False" },
{ "+disk2", "*disk2", XrmoptionNoArg, "True" },
{ "-disk10", "*disk10", XrmoptionNoArg, "False" },
{ "+disk10", "*disk10", XrmoptionNoArg, "True" },
{ "-disk100", "*disk100", XrmoptionNoArg, "False" },
{ "+disk100", "*disk100", XrmoptionNoArg, "True" },
#endif
#ifdef ALLEVERYTHING

Code:
void XOSView::figureSize ( void ) {
  if ( legend_ ){
    if ( !usedlabels_ )
      xoff_ = textWidth( "XXXXXXX" );
    else
      xoff_ = textWidth( "XXXXXXXXXXX" );

Code:
    int offset;
    if ( dousedlegends_ )
      offset = parent_->textWidth( "XXXXXXXXXXX" );
    else
      offset = parent_->textWidth( "XXXXXXX" );


compiled on Puppy 4.3 glibc-2.6.1 as the first one .
To disable one of the meters : xosview -disk100 | -disk10 | -disk2
xosview3diskmeters.jpg
 Description   
 Filesize   10.79 KB
 Viewed   176 Time(s)

xosview3diskmeters.jpg

xosview-1.14_diskmeter2_10_100.bz2
Description 
bz2

 Download 
Filename  xosview-1.14_diskmeter2_10_100.bz2 
Filesize  30.18 KB 
Downloaded  172 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Tue 20 Aug 2013, 04:41    Post subject:  

Hi again Karl,

Bletchley Park is near to my home and yet so far away - I'm glad you were able to disclose your secret code - personally, I would never have been able to decode a single word of your message - so now I really appreciate both your code and your explanation.

My regards and special thanks

Also - greetings and thanks to SFR, another ace coder, for his contribution here.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Tue 20 Aug 2013, 09:30    Post subject:  

Hi Jasper !

In 2010 when I started to fiddle around with xosview , I was not able to get more than four letters to work in the label part . Now I figured out that the part
that I altered that time in xosview.cc occurs several times in different files :
bitfieldmeter.cc
bitmeter.cc
fieldmeter.cc
Code:
int offset;
    if ( dousedlegends_ )
      offset = parent_->textWidth( "XXXXXXXXXXX" );
    else
      offset = parent_->textWidth( "XXXXXXX" );

where the "XXXXX*" strings apparently indicate each X for a letter minus one X for linefeed or whatever (\0) .
I have left the four letters for the
void BitFieldMeter::drawused( int manditory ){
-function in bitfieldmeter.cc and fieldmeter.cc :
static const int onechar = parent_->textWidth( "X" );
static int xoffset = parent_->textWidth( "XXXXX" );

as is .
Here is some crytic explanation further down the file in the autoscale part :
/* For now, we can only print 3 characters, plus the optional
* suffix, without overprinting the legends. Thus, we can
* print 965, or we can print 34, but we can't print 34.7 (the
* decimal point takes up one character). bgrayson */


( That gbrew in my brain : proud : )

Added the const char *label, to linux/diskmeter.cc and linux/diskmeter.h , which I looked up in lmstemp.cc , since I knew it is possible tho change the label for it in Xdefaults .

Embarassed Forgot to present Xdefaults :
Code:
 ! Disk Meter Resources
xosview*diskUsedColor:      yellow
xosview*diskIdleColor:      LightGreen
xosview*diskWriteColor:     DarkRed
xosview*diskReadColor:      orange2
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

xosview*disk100:            True
xosview*diskBandwidth100:   100000000 ! 100MB/s
xosview*disk10:             True
xosview*diskBandwidth10:    10000000 ! 10MB/s
xosview*disk2:              True
xosview*diskBandwidth2:     2000000 ! 2MB/s

I have chosen 2M for the USB1.1 specification .
In version 1.8.3 xosview*diskBandwidth was set to 10MB/s by default, now they increased it to 100MB/s , which I did not check before . But since you wanted it for USB mainly Embarassed
But it is difficult to http://en.wikipedia.org/wiki/Trust,_but_verify which we know it as Faith is good, control is better ( http://de.wikipedia.org/wiki/Vertrauen_ist_gut,_Kontrolle_ist_besser![/url] -the ! seems to choke the BBcode [url] tag )

And in the Xrmcommandline.h there I disabled the possibility to fiddle with other meters now by wrapping them into the unset
#ifdef ALLEVERYTHING variable .

Todo would be to implement an option for +disk like
+disk DISKBANDWITH
, so that no hardcoded diskbandwithes in the configuration files needed .
-network maxbandwidth seems to have that already .

Hope that explains it a little .
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 2 of 2 [25 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Security
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1323s ][ Queries: 13 (0.0203s) ][ GZIP on ]