Re: [gentoo-user] Software emulation of angled arrow keys on Lenovo Thinkpad?

2022-08-25 Thread Walter Dnes
On Wed, Aug 24, 2022 at 05:58:28PM -0400, Jack wrote

> Ah - I expect the game is interpreting keycodes fairly directly.  You  
> can use xev (or similar) to find what the various keys are currently  
> producing, and there must be some (Xorg related) program to translate  
> them to whatever the program is expecting - perhaps determined by using  
> xev with a "proper" keyboard.

  1..9 on a real keyboard numeric keypad.  The "XLookupString" line
tells you which key is pressed.  I think the "keycode" entry is what is
being acted on by the game.  Google seems to indicate that setxkbmap is
what I need,  Once I emerge it, then what?

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031605618, (-448,387), root:(368,623),
state 0x10, keycode 87 (keysym 0xffb1, KP_1), same_screen YES,
XLookupString gives 1 bytes: (31) "1"
XmbLookupString gives 1 bytes: (31) "1"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031605778, (-448,387), root:(368,623),
state 0x10, keycode 87 (keysym 0xffb1, KP_1), same_screen YES,
XLookupString gives 1 bytes: (31) "1"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031650802, (105,320), root:(921,556),
state 0x10, keycode 88 (keysym 0xffb2, KP_2), same_screen YES,
XLookupString gives 1 bytes: (32) "2"
XmbLookupString gives 1 bytes: (32) "2"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031650962, (105,320), root:(921,556),
state 0x10, keycode 88 (keysym 0xffb2, KP_2), same_screen YES,
XLookupString gives 1 bytes: (32) "2"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031840786, (76,301), root:(892,537),
state 0x10, keycode 89 (keysym 0xffb3, KP_3), same_screen YES,
XLookupString gives 1 bytes: (33) "3"
XmbLookupString gives 1 bytes: (33) "3"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031840946, (76,301), root:(892,537),
state 0x10, keycode 89 (keysym 0xffb3, KP_3), same_screen YES,
XLookupString gives 1 bytes: (33) "3"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031846434, (76,301), root:(892,537),
state 0x10, keycode 83 (keysym 0xffb4, KP_4), same_screen YES,
XLookupString gives 1 bytes: (34) "4"
XmbLookupString gives 1 bytes: (34) "4"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031846594, (76,301), root:(892,537),
state 0x10, keycode 83 (keysym 0xffb4, KP_4), same_screen YES,
XLookupString gives 1 bytes: (34) "4"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031849730, (76,301), root:(892,537),
state 0x10, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
XLookupString gives 1 bytes: (35) "5"
XmbLookupString gives 1 bytes: (35) "5"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031849874, (76,301), root:(892,537),
state 0x10, keycode 84 (keysym 0xffb5, KP_5), same_screen YES,
XLookupString gives 1 bytes: (35) "5"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031852754, (76,301), root:(892,537),
state 0x10, keycode 85 (keysym 0xffb6, KP_6), same_screen YES,
XLookupString gives 1 bytes: (36) "6"
XmbLookupString gives 1 bytes: (36) "6"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031852914, (76,301), root:(892,537),
state 0x10, keycode 85 (keysym 0xffb6, KP_6), same_screen YES,
XLookupString gives 1 bytes: (36) "6"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031960290, (74,286), root:(890,522),
state 0x10, keycode 79 (keysym 0xffb7, KP_7), same_screen YES,
XLookupString gives 1 bytes: (37) "7"
XmbLookupString gives 1 bytes: (37) "7"
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031960418, (74,286), root:(890,522),
state 0x10, keycode 79 (keysym 0xffb7, KP_7), same_screen YES,
XLookupString gives 1 bytes: (37) "7"
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x101,
root 0x76b, subw 0x0, time 2031963218, (74,286), root:(890,522),
state 0x10, keycode 80 (keysym 0xffb8, KP_8), same_screen YES,
XLookupString gives 1 bytes: (38) "8"

Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Mark Knecht
On Thu, Aug 25, 2022 at 4:59 PM Dale  wrote:

> I may do some mobo hunting shortly.  See what little thing I can buy
> that is powerful enough.  I don't think a Raspberry Pi is enough.  It
> gets close tho.  Biggest thing, I'd need a lot of SATA ports.  LOTS of
> them.

Granted, I had a couple of old cases which lowered the cost but
I went to a local computer store and bought used motherboards
that came with processors and memory. They were both Core i7
but I paid only about $75 each. I needed power supplies and hard drives
so each machine ended up around $350 or so by the time I was done.
Each has 2 4TB drives for storage and a 1TB drive for the OS. A lot
of used motherboards have on-board VGA and Gb/S networking.

These are TrueNAS machines, FreeBSD not Linux, but they have
a Linux version now if that makes you more comfortable.

I'd stick with AMD64 as it's better tested and I don't think you'll
get the network throughput you need to be fast with a Raspberry Pi


Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Dale
Rich Freeman wrote:
> On Thu, Aug 25, 2022 at 2:59 PM Dale  wrote:
>> While at it, can I move the drives on LVM to another system without
>> having to copy anything?  Just physically move the drives and LVM see
>> them correctly on the new system?
> As long as we aren't talking about boot partitions/sectors, the answer
> is yes.  As long as all the drives are attached and accessible by the
> kernel (necessary drivers/etc present), then LVM will put them
> together.  It doesn't care where it finds them, as all the necessary
> metadata is stored on the drives and gets scanned.
>
> If you're talking about boot partitions/sectors then it isn't a huge
> problem, but you do need to ensure the bootloader can find the right
> drives/etc, as it isn't nearly as flexible and may need updates if the
> drives switch order/etc, at least for legacy bootloaders.
>

That's what I was thinking but I was wondering if I had to copy
something from /etc for it to work or not.  It's best to be sure.  ;-) 

I may do some mobo hunting shortly.  See what little thing I can buy
that is powerful enough.  I don't think a Raspberry Pi is enough.  It
gets close tho.  Biggest thing, I'd need a lot of SATA ports.  LOTS of
them. 

Thanks to all.

Dale

:-)  :-) 



Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Dale
Wols Lists wrote:
> On 25/08/2022 19:59, Dale wrote:
>> While at it, can I move the drives on LVM to another system without
>> having to copy anything?  Just physically move the drives and LVM see
>> them correctly on the new system?  I may try to build a small computer
>> for a NAS soon.  I'm not sure what is the least I can buy that will
>> perform well.  I need to look into small mobos to see what options I
>> have.  I mostly need a CPU to handle moving files, memory to pass it
>> through and lots of SATA ports.  I figure a fast card for most SATA
>> ports.
>
> https://raid.wiki.kernel.org/index.php/Linux_Raid
>
> That might be a good read ... I know I push it a bit, but it does go
> into disk management a decent bit.
>
> If you can think of any improvements, they'll be welcome! :-)
>
> Cheers,
> Wol
>
>

It seems I've been to that link before, may even have it bookmarked,
somewhere.  I'll give it another read tho.  After all, it has to be good
or you wouldn't share it.  ;-) 

Dale

:-)  :-) 



Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Wols Lists

On 25/08/2022 19:59, Dale wrote:

While at it, can I move the drives on LVM to another system without
having to copy anything?  Just physically move the drives and LVM see
them correctly on the new system?  I may try to build a small computer
for a NAS soon.  I'm not sure what is the least I can buy that will
perform well.  I need to look into small mobos to see what options I
have.  I mostly need a CPU to handle moving files, memory to pass it
through and lots of SATA ports.  I figure a fast card for most SATA ports.


https://raid.wiki.kernel.org/index.php/Linux_Raid

That might be a good read ... I know I push it a bit, but it does go 
into disk management a decent bit.


If you can think of any improvements, they'll be welcome! :-)

Cheers,
Wol



Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Rich Freeman
On Thu, Aug 25, 2022 at 2:59 PM Dale  wrote:
>
> While at it, can I move the drives on LVM to another system without
> having to copy anything?  Just physically move the drives and LVM see
> them correctly on the new system?

As long as we aren't talking about boot partitions/sectors, the answer
is yes.  As long as all the drives are attached and accessible by the
kernel (necessary drivers/etc present), then LVM will put them
together.  It doesn't care where it finds them, as all the necessary
metadata is stored on the drives and gets scanned.

If you're talking about boot partitions/sectors then it isn't a huge
problem, but you do need to ensure the bootloader can find the right
drives/etc, as it isn't nearly as flexible and may need updates if the
drives switch order/etc, at least for legacy bootloaders.

-- 
Rich



Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Dale
Jack wrote:
> On 8/25/22 08:52, Rich Freeman wrote:
>> On Thu, Aug 25, 2022 at 8:43 AM Dale  wrote:
>>> I've already got data on the drive now with the default settings so it
>>> is to late for the moment however, I expect to need to add drives
>>> later.  Keep in mind, I use LVM which means I grow file systems quite
>>> often by adding drives.  I don't know if that grows inodes or not.  I
>>> suspect it does somehow.
>> It does not.  It just means that if you want to reformat it you have
>> to reformat all the drives in the LVM logical volume.  :)
>
> As I remember, if you enlarge a logical volume by adding a new
> physical volume, you then have to expand the filesystem to use that
> additional space.  Looking at resize2fs, it does increase the number
> of inodes, but only linearly in proportion to the amount of increased
> size.  I don't see any way to tell it to decrease, or even just not
> increase, the number of inodes.
>
> Related question - how much space would you actually save by
> decreasing the number of inodes by 90%?  Enough for one or two more
> videos?
>
>
>


Now I have to admit, that is a question I have too.  That's why I was
wondering about tools that give info on inodes and such.  It could be it
just is not worth the effort to change the defaults.  Most videos are
either pushing 1GB or around 2GBs, depending on length of video.  If it
only saves a few 100MBs or even a few GBs, it won't really help much. 
The difference just isn't large enough.  If I was storing small files,
then it would but then I'd need those inodes as well.  Sort of a catch
22 there. 

At the moment, I just don't know enough about whether I should change
the defaults or not.  It's one of those, it's not really broke so it may
not need fixing. 

TLDR:  I will say this tho, I'm loving this fast internet even tho my
VPN seems to slow things down some.  Still, it is a LOT faster than DSL
by a huge margin.  Some things download so fast, if I blink, I miss it. 
When I do eix-sync, it is mostly processing things here with the CPU or
organizing files.  Downloading the files tends to be limited by the
server on the other end.  Downloading things like libreoffice, Firefox
etc takes seconds.  I use tail -f to watch it and it goes by really
fast.  My last update was quite large and I think it took less than 2
minutes. 

I'll be getting a new hard drive to add pretty soon.  :-D

While at it, can I move the drives on LVM to another system without
having to copy anything?  Just physically move the drives and LVM see
them correctly on the new system?  I may try to build a small computer
for a NAS soon.  I'm not sure what is the least I can buy that will
perform well.  I need to look into small mobos to see what options I
have.  I mostly need a CPU to handle moving files, memory to pass it
through and lots of SATA ports.  I figure a fast card for most SATA ports. 

Dale

:-)  :-) 



Re: [gentoo-user] KDE plasma desktop view shows files that don't exist

2022-08-25 Thread Mateusz Okulus
On 22/08/24 11:05AM, Jack wrote:
> Checking here for any ideas or suggestions before I report as a KDE bug.
>
> I have my KDE Plasma desktop set to show my ~/Desktop folder. Two days ago,
> I created a script.pl Perl script in that folder. (No, I don't generally do
> work in that folder, but I just needed a quick script to deal with a file I
> had just downloaded there.) After editing that file in emacs, a script.pl~
> also showed up on the Desktop.  However, so did a file #script.pl#, and
> actually I now have three files showing that name.  The original and the
> emacs backup also show up in Dolphin and an "ls" command in a terminal. 
> None of the "#" files do, however, which is expected, as there are transient
> working files only during an active emacs session.
>
> Trying to edit one (double click) from the desktop opens an empty file, and
> right clicking and selecting Properties shows the correct info as of when
> the file actually existed - but if I ask for any checksums, they show up as
> blank fields.
>
> I've looked, and have not found any relevant bug on the KDE bugzilla.  (As
> it's not likely a Gentoo bug, I don't see any point in filing at b.g.o.)
>
> Has anyone else noticed this?  Can anyone else reproduce it?
>
> Thanks for any feedback.
>
> Jack

I'm fairly sure this isn't a bug, the files exits, and are just empty,
as they show both in Dolphin and using ls.

script.pl~ is an Emacs backup file, it's created automatically and won't
be removed. It was created by Emacs when the original file was still
empty.

#script.pl# is an Emacs auto-saved file, which was also saved when the
buffer was empty. "auto-saves happen every 300 keystrokes, or after
around 30 seconds of idle time", from manual, so you probably left the
empty buffer for more than 30 seconds, but the script was shorter than
300 characters, so it only auto saved the empty file.

Those file exist on your system, they are just empty. That's why the
dates are correct. You can simply delete them if you want.

Those resources might be useful:
https://stackoverflow.com/a/12031838
https://stackoverflow.com/a/18330742

In particular you can disable backup files, if you don't care or use git
for example.

Regards,
mmokulus



Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Jack

On 8/25/22 08:52, Rich Freeman wrote:

On Thu, Aug 25, 2022 at 8:43 AM Dale  wrote:

I've already got data on the drive now with the default settings so it
is to late for the moment however, I expect to need to add drives
later.  Keep in mind, I use LVM which means I grow file systems quite
often by adding drives.  I don't know if that grows inodes or not.  I
suspect it does somehow.

It does not.  It just means that if you want to reformat it you have
to reformat all the drives in the LVM logical volume.  :)


As I remember, if you enlarge a logical volume by adding a new physical 
volume, you then have to expand the filesystem to use that additional 
space.  Looking at resize2fs, it does increase the number of inodes, but 
only linearly in proportion to the amount of increased size.  I don't 
see any way to tell it to decrease, or even just not increase, the 
number of inodes.


Related question - how much space would you actually save by decreasing 
the number of inodes by 90%?  Enough for one or two more videos?





Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Rich Freeman
On Thu, Aug 25, 2022 at 8:43 AM Dale  wrote:
>
> I've already got data on the drive now with the default settings so it
> is to late for the moment however, I expect to need to add drives
> later.  Keep in mind, I use LVM which means I grow file systems quite
> often by adding drives.  I don't know if that grows inodes or not.  I
> suspect it does somehow.

It does not.  It just means that if you want to reformat it you have
to reformat all the drives in the LVM logical volume.  :)

There are filesystems that don't have fixed limits on inodes on
filesystem creation, but ALL filesystems have tradeoffs.  This is one
of the big limitations of ext4, but ext4 also has a number of
advantages over alternatives.  I tend to use zfs but it has its own
issues.  I don't believe inodes are fixed in zfs, but the last time I
looked into it there were potential issues with reducing the size of a
vdev.  (I think that was being worked on but I'm not sure how stable
that is, or if it is compatible with grub.  Actually, one of my pet
peeves has been that finding out exactly what zfs features are
compatible with grub is tricky.  Oh, you can google it, but I don't
think there is any official page that is kept up to date.)

-- 
Rich



Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread Dale
William Kenworthy wrote:
>
> On 25/8/22 06:45, Frank Steinmetzger wrote:
>>> [..]
>>> Also, if you're using ext2/3/4, there's the preset, i.e. if you're
>>> rather sure about what kind of data is going to be on there, you
>>> can tune it so that it reserves more or less place for metadata like
>>> inodes, which can be another bit.
>> When I format a partition (and I usually use ext4, with some f2fs
>> mingled in
>> on flash bashed devices), I always set the inode count myself,
>> because the
>> default was always much too high. Like 15 m on a 40 GiB partition or
>> so. My
>> arch root partition has 2 m inodes in total, 34 % of which are in use
>> for a
>> full-fledged KDE setup. That’s sufficient.
>>
>> On Gentoo, I might give it some more for the ever-growing portage
>> directory.
>> But even a few percent on a 10 TB drive amount to many gigabytes.
>>
> Keep in mind ext4 is created with a fixed number of inodes - you cant
> change it once its created so you have to deal with reformatting the
> filesystem and replacing the data.  Just another reason to use
> something more modern - running out of inodes, especially on a large
> disk is not a minor matter as you have to find somewhere to copy/store
> the data so you can reformat the disk with more inodes and then put it
> back.  I seem to remember the last time it happened to me (its not an
> uncommon event) I had to deal with mass corruption too.
>
> On the other hand, at one inode per file and Dale primarily storing
> large media files it may be safe to reduce them.
>
> BillK

I've already got data on the drive now with the default settings so it
is to late for the moment however, I expect to need to add drives
later.  Keep in mind, I use LVM which means I grow file systems quite
often by adding drives.  I don't know if that grows inodes or not.  I
suspect it does somehow.  This is my current inodes on drives inside my
puter.  I removed the cruft from the list.


root@fireball / # df -i
Filesystem       Inodes   IUsed IFree IUse% Mounted on
/dev/sda6       1525920   18519   1507401    2% /
/dev/mapper/OS-usr        2564096  752882   1811214   30% /usr
/dev/sda1                        98392    1219 97173    2% /boot
/dev/mapper/OS-var    3407872  322463   3085409   10% /var
/dev/mapper/home-home--lv 18318  727910 182416538    1% /home
/dev/mapper/backup-backup  45793280 1359825  44433455    3% /backup
/dev/mapper/crypt 488378368   43027 488335341    1%
/home/dale/Desktop/Crypt
root@fireball / #


The portage tree is on /var on my system.  The ones I am most curious
about is the /home and the crypt one.  As you can see, /home and crypt
is using only a tiny fraction of inodes.  Here is the interesting bit:


root@fireball / # df -h
Filesystem Size  Used Avail Use% Mounted on
/dev/sda6   23G  2.2G   20G  10% /
/dev/mapper/OS-usr  39G   22G   15G  61% /usr
/dev/sda1  373M  187M  167M  53% /boot
/dev/mapper/OS-var  52G   23G   26G  47% /var
/dev/mapper/home-home--lv  5.5T  2.6T  2.9T  48% /home
/dev/mapper/backup-backup  688G  369G  319G  54% /backup
/dev/mapper/crypt   15T   12T  3.1T  79% /home/dale/Desktop/Crypt
root@fireball / #


As you can see, /home is about half full, crypt however is pushing 80%
pretty hard.  On /home, I have my documents directory and it has lots of
smaller files compared to crypt.  While /home does have some videos, it
also contains my camera picture directory and the directories for my
trail cameras.  Also, it has small documents such as recipes and such
which can be anywhere from a few kilobytes to maybe 1MB or so, not many
much larger than that.  While I may not want to reduce /home much, I
could likely reduce crypt by 90% and still have a lot left over,
provided that changes when I grow the file system as I add drives etc. 
Yes, I'm already on the hunt for another hard drive to add onto crypt. 

Is there a tool to tell the average size of files in a directory?  Tools
that would help us to know how many inodes one actually needs?  As it
is, I'm doing a lot of updating of old files with larger files, due to
higher resolution of videos.  Example, some videos are going from a
little below 720p to 720p or 1080p.  The difference in file size is
pretty large.  Sometimes double or more. 

This is interesting to consider here.  One doesn't want to run out of
inodes but at the same time, even if I only had 10% of the number I have
now for crypt I'd still have 10 times more than I need with the thing
almost full. This is also true for my backup drives as well.  Two of
them at least.  One that has documents I'd likely leave as is. 

I'm going to have to work on better storage somehow.  All of this is
going to crop up again eventually, likely sooner rather than later. 

Dale

:-)  :-) 

P. S.  I have to close my VPN to check emails still.  Pardon the time
lag in replies compared to the past. 



Re: [gentoo-user] Getting maximum space out of a hard drive

2022-08-25 Thread William Kenworthy



On 25/8/22 06:45, Frank Steinmetzger wrote:

[..]
Also, if you're using ext2/3/4, there's the preset, i.e. if you're
rather sure about what kind of data is going to be on there, you
can tune it so that it reserves more or less place for metadata like
inodes, which can be another bit.

When I format a partition (and I usually use ext4, with some f2fs mingled in
on flash bashed devices), I always set the inode count myself, because the
default was always much too high. Like 15 m on a 40 GiB partition or so. My
arch root partition has 2 m inodes in total, 34 % of which are in use for a
full-fledged KDE setup. That’s sufficient.

On Gentoo, I might give it some more for the ever-growing portage directory.
But even a few percent on a 10 TB drive amount to many gigabytes.

Keep in mind ext4 is created with a fixed number of inodes - you cant 
change it once its created so you have to deal with reformatting the 
filesystem and replacing the data.  Just another reason to use something 
more modern - running out of inodes, especially on a large disk is not a 
minor matter as you have to find somewhere to copy/store the data so you 
can reformat the disk with more inodes and then put it back.  I seem to 
remember the last time it happened to me (its not an uncommon event) I 
had to deal with mass corruption too.


On the other hand, at one inode per file and Dale primarily storing 
large media files it may be safe to reduce them.


BillK