Re: Bgpd multipath conf

2024-05-16 Thread Marco Agostani
Ok so in the end is there a way to install more then one route in the kernel 
table through bgpd or not ?
And if it's something that could be done in the future ?

Cheers
Marco




Caterpillar: Confidential Green
-Original Message-
From: Stuart Henderson 
Sent: Wednesday, May 15, 2024 8:26 AM
To: misc@openbsd.org
Subject: Re: Bgpd multipath conf

CAUTION: EXTERNAL EMAIL  This is a message from owner-m...@openbsd.org.  Use 
caution when opening unexpected emails and do not click on links or attachments 
from unknown senders. For more resources, visit security.cat.com/phishing.

__
On 2024-05-14, Marco Agostani  wrote:
> I try to setup an openbgpd setup involving multipath configuration
> ...with = no success.
...
>   neighbor $GW01 {
>  descr "bgp#1"
>  announce IPv4 unicast
>  announce add-path recv yes
>  set localpref 110
>   }

This just announces the add-path BGP capability.

> #bgpctl sh rib
> https://urldefense.com/v3/__http://172.18.180.0/24__;!!FtR4BK4x7WL3xYs
> !6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG2
> 7Pi4GFOtJXl9T8K7jGv49b5Fz40$
>
> flags: * =3D Valid, > =3D Selected, I =3D via IBGP, A =3D Announced,
>S =3D Stale, E =3D Error
> origin validation state: N =3D not-found, V =3D valid, ! =3D invalid
> aspa validation state: ? =3D unknown, V =3D valid, ! =3D invalid
> origin: i =3D IGP, e =3D EGP, ? =3D Incomplete
>
> flags  vs destination  gateway  lpref   med aspath origin
> *>N-? 
> https://urldefense.com/v3/__http://172.18.180.0/24__;!!FtR4BK4x7WL3xYs!6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG27Pi4GFOtJXl9T8K7jGv49b5Fz40$
>
> https://urldefense.com/v3/__http://10.0.1.241__;!!FtR4BK4x7WL3xYs!6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG27Pi4GFOtJXl9T8K7jGv41J-7V7w$
>  110 0 14381 i
> *mN-? 
> https://urldefense.com/v3/__http://172.18.180.0/24__;!!FtR4BK4x7WL3xYs!6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG27Pi4GFOtJXl9T8K7jGv49b5Fz40$
>
> https://urldefense.com/v3/__http://10.0.1.245__;!!FtR4BK4x7WL3xYs!6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG27Pi4GFOtJXl9T8K7jGv48_2TUKx$
>  110 0 14381 i
>
> Show me two routes one marked with multipath
>
> But in fib I see only one route
>
> #bgpctl sh fib
> https://urldefense.com/v3/__http://172.18.180.0/24__;!!FtR4BK4x7WL3xYs
> !6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG2
> 7Pi4GFOtJXl9T8K7jGv49b5Fz40$
>
> flags: B =3D BGP, C =3D Connected, S =3D Static
>N =3D BGP Nexthop reachable via this route
>r =3D reject route, b =3D blackhole route
> flags prio destination  gateway
> B   48 
> https://urldefense.com/v3/__http://172.18.180.0/24__;!!FtR4BK4x7WL3xYs!6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG27Pi4GFOtJXl9T8K7jGv49b5Fz40$
>
> https://urldefense.com/v3/__http://10.0.1.241__;!!FtR4BK4x7WL3xYs!6DAqIASIWdakyXeDyLwAsmIOK4cM3WJigBhTBEZwFP2QSx-N8iqQRQKGfW0L4XpCyVGG27Pi4GFOtJXl9T8K7jGv41J-7V7w$
...
> What I miss here ??

bgpd does allow add-path and having multiple paths to a prefix in the RIB (e.g. 
perhaps useful on a route-server) but it does not handle adding multiple paths 
for the same prefix to the FIB.




Re: pax and ext2fs

2024-05-16 Thread Philip Guenther
On Wed, May 15, 2024 at 1:14 AM Philip Guenther  wrote:

> On Tue, May 14, 2024 at 11:59 AM Walter Alejandro Iglesias <
> w...@roquesor.com> wrote:
>
>> Hi Philip,
>>
>> On Tue May 14 19:40:04 2024 Philip Guenther wrote:
>> > If you like, you could try the following patch to pax to more gracefully
>> > handle filesystems with time resolution more granular than nanoseconds.
>>
>> After applying your patch, as I'd done before reporting the issue, I
>> sycronized my home directory to an external ext2fs drive with the
>> command showed by the man page:
>>
>>   $ pax -rw -v -Z -Y source target
>>
>> This time only one file stays updating again an again, a soft link I
>> have in my ~/bin folder of /usr/local/bin/prename.
>
>
> I think you've managed to hit a spot where the POSIX standard doesn't
> provide a way for a program to find the information it needs to do its job
> correctly.  I've filed a ticket there
>https://austingroupbugs.net/view.php?id=1831
>
> We'll see if my understanding of pathconf() is incorrect or if someone has
> a great idea for how to get around this...
>

So yeah, what's needed is pathconfat(2)** but whether this winding loose
end ("That poor yak.") merits that much code and surface is yet to be
examined deeply.

Philip Guenther


** or lpathconf(2), but pathconfat(2) is better


Re: Errata: OpenBSD 7.5: high temperature spotted different times

2024-05-15 Thread Dan


Correction:

CPU: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz, 06-45-01,
patch 0026 (year 2014)


Dan  wrote:

> Hello,
> 
> In my OpenBSD 7.5 stable temperature incrises timtotime remaining on
> 64-65°C; an old quad cores I5 cpu.
> 
> Thanks,
> 
> -dan



OpenBSD 7.5: xfce-4.18.1: missing Special Characters utility

2024-05-15 Thread Dan


Hello,

In my OpenBSD 7.5, xfce-4.18.1 is missing the Characters Map / Special
Characters utility both graphically, in the menu, and on the disk.

Thanks!

-dan



OpenBSD 7.5: high temperature spotted different times

2024-05-15 Thread Dan
Hello,

In my OpenBSD 7.5 stable temperature incrises timtotime remaining on 64-65°C; 
an old quad cores I5 cpu.

Thanks,

-dan


subscribe

2024-05-15 Thread Anon Loli
subscribe please



Re: pax and ext2fs

2024-05-15 Thread Walter Alejandro Iglesias
On Wed May 15 13:04:53 2024 Walter Alejandro Iglesias wrote:
> After more testing I realized that I was wrong my modification doesn't
> solve the problem.
>

Yeah, I also realized that what I did was stupid. :-)



Re: pax and ext2fs

2024-05-15 Thread Walter Alejandro Iglesias
On Wed May 15 10:24:32 2024 Walter Alejandro Iglesias wrote:
> I get it working but I don't know if what I did is fine.
>
> As I'd told you the problem was ctime (when using -Y), so I added one
> conditional to your diff where it checks only mtime and it works:
>
>
> Index: ar_subs.c
> ===
> RCS file: /cvs/src/bin/pax/ar_subs.c,v
> diff -u -p -r1.51 ar_subs.c
> [...]

After more testing I realized that I was wrong my modification doesn't
solve the problem.



Re: pax and ext2fs

2024-05-15 Thread Walter Alejandro Iglesias
On Wed May 15 10:20:04 2024 Philip Guenther wrote:
> I think you've managed to hit a spot where the POSIX standard doesn't
> provide a way for a program to find the information it needs to do its job
> correctly.  I've filed a ticket there
>https://austingroupbugs.net/view.php?id=1831
>
> We'll see if my understanding of pathconf() is incorrect or if someone has
> a great idea for how to get around this...
>
>
> Philip Guenther
>

Hi Philip,

I get it working but I don't know if what I did is fine.

As I'd told you the problem was ctime (when using -Y), so I added one
conditional to your diff where it checks only mtime and it works:


Index: ar_subs.c
===
RCS file: /cvs/src/bin/pax/ar_subs.c,v
diff -u -p -r1.51 ar_subs.c
--- ar_subs.c   10 Jul 2023 16:28:33 -  1.51
+++ ar_subs.c   15 May 2024 08:19:08 -
@@ -146,23 +146,61 @@ list(void)
 }
 
 static int
-cmp_file_times(int mtime_flag, int ctime_flag, ARCHD *arcn, struct stat *sbp)
+cmp_file_times(int mtime_flag, int ctime_flag, ARCHD *arcn, const char *path)
 {
struct stat sb;
+   long res;
 
-   if (sbp == NULL) {
-   if (lstat(arcn->name, ) != 0)
-   return (0);
-   sbp = 
+   if (path == NULL)
+   path = arcn->name;
+   if (lstat(path, ) != 0)
+   return (0);
+
+   /*
+* The target (sb) mtime might be rounded down due to the limitations
+* of the FS it's on.  If it's strictly greater or we don't care about
+* mtime, then precision doesn't matter, so check those cases first.
+*/
+   if (ctime_flag && mtime_flag) {
+   if (timespeccmp(>sb.st_mtim, _mtim, <=))
+   return timespeccmp(>sb.st_ctim, _ctim, <=);
+   if (!timespeccmp(>sb.st_ctim, _ctim, <=))
+   return 0;
+   /* <= ctim, but >= mtim */
+   } else if (mtime_flag) {
+   return timespeccmp(>sb.st_mtim, _mtim, <=);
+   } else if (ctime_flag)
+   return timespeccmp(>sb.st_ctim, _ctim, <=);
+   else if (timespeccmp(>sb.st_mtim, _mtim, <=))
+   return 1;
+
+   /*
+* If we got here then the target arcn > sb for mtime *and* that's
+* the deciding factor.  Check whether they're equal after rounding
+* down the arcn mtime to the precision of the target path.
+*/
+   res = pathconf(path, _PC_TIMESTAMP_RESOLUTION);
+   if (res == -1)
+   return 0;
+
+   /* nanosecond resolution?  previous comparisons were accurate */
+   if (res == 1)
+   return 0;
+
+   /* common case: second accuracy */
+   if (res == 10)
+   return arcn->sb.st_mtime <= sb.st_mtime;
+
+   if (res < 10) {
+   struct timespec ts = arcn->sb.st_mtim;
+   ts.tv_nsec = (ts.tv_nsec / res) * res;
+   return timespeccmp(, _mtim, <=);
+   } else {
+   /* not a POSIX compliant FS */
+   res /= 10;
+   return ((arcn->sb.st_mtime / res) * res) <= sb.st_mtime;
+   return arcn->sb.st_mtime <= ((sb.st_mtime / res) * res);
}
-
-   if (ctime_flag && mtime_flag)
-   return (timespeccmp(>sb.st_mtim, >st_mtim, <=) &&
-   timespeccmp(>sb.st_ctim, >st_ctim, <=));
-   else if (ctime_flag)
-   return (timespeccmp(>sb.st_ctim, >st_ctim, <=));
-   else
-   return (timespeccmp(>sb.st_mtim, >st_mtim, <=));
 }
 
 /*
@@ -842,14 +880,12 @@ copy(void)
/*
 * if existing file is same age or newer skip
 */
-   res = lstat(dirbuf, );
-   *dest_pt = '\0';
-
-   if (res == 0) {
+   if (cmp_file_times(uflag, Dflag, arcn, dirbuf)) {
+   *dest_pt = '\0';
ftree_skipped_newer(arcn);
-   if (cmp_file_times(uflag, Dflag, arcn, ))
-   continue;
+   continue;
}
+   *dest_pt = '\0';
}
 
/*



Re: pax and ext2fs

2024-05-15 Thread Philip Guenther
On Tue, May 14, 2024 at 11:59 AM Walter Alejandro Iglesias 
wrote:

> Hi Philip,
>
> On Tue May 14 19:40:04 2024 Philip Guenther wrote:
> > If you like, you could try the following patch to pax to more gracefully
> > handle filesystems with time resolution more granular than nanoseconds.
>
> After applying your patch, as I'd done before reporting the issue, I
> sycronized my home directory to an external ext2fs drive with the
> command showed by the man page:
>
>   $ pax -rw -v -Z -Y source target
>
> This time only one file stays updating again an again, a soft link I
> have in my ~/bin folder of /usr/local/bin/prename.


I think you've managed to hit a spot where the POSIX standard doesn't
provide a way for a program to find the information it needs to do its job
correctly.  I've filed a ticket there
   https://austingroupbugs.net/view.php?id=1831

We'll see if my understanding of pathconf() is incorrect or if someone has
a great idea for how to get around this...


Philip Guenther


Re: viomb0 unable to allocate256 physmem pages, error 12

2024-05-15 Thread Philip Guenther
viomb is a driver that tries to support OpenBSD, as a VM guest, responding
to a request from the VM host to stop using so much physical memory.  That
log message indicates that the kernel couldn't easily free up that much
physical memory, sorry!  The VM host is, of course, free to decide to just
page out whatever memory it wants instead, possibly resulting in thrashing:
running a VM setup oversubscribed for memory is a great way to be
frustrated and hate computers.

How can you make that message go away?  Provision your VM setup with enough
memory that it's not over subscribed, or at least so that the OpenBSD
guest(s) isn't the one being asked to slim itself (possibly by giving it
*less* but _reserved_ memory, so that the VM host never tries to shrink
its usage).


Philip Guenther


On Tue, May 14, 2024 at 4:16 PM F Bax  wrote:

> I'm not a coder; but I found source for viomb; which
> calls uvm_pglistalloc; which calls uvm_pmr_getpages which mentions ENOMEM:
>
> https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/uvm/uvm_pmemrange.c?rev=1.66=text/plain
> There I found this comment:
> * fail if any of these conditions is true:
> * [1]  there really are no free pages, or
> * [2]  only kernel "reserved" pages remain and
> *the UVM_PLA_USERESERVE flag wasn't used.
> * [3]  only pagedaemon "reserved" pages remain and
> *the requestor isn't the pagedaemon nor the syncer.
>
> Unsure how I might use this information to get rid of the previously
> mentioned error message..
>
> On Tue, May 14, 2024 at 2:28 PM Peter J. Philipp 
> wrote:
>
>> On Tue, May 14, 2024 at 01:58:18PM -0400, F Bax wrote:
>> > Recently installed 7.5 amd64 in qemu VM (8G RAM) under proxmox. See this
>> > message many times on console and dmesg.
>> >
>> > viomb0 unable to allocate 256 physmem pages, error 12
>> >
>> > What does this mean? How to resolve this issue?
>>
>> Hi,
>>
>> When you see "error " it's good to look up the manpage on errno.
>> Under number 12 it says:  ENOMEM "Cannot Allocate Memory".  But look for
>> yourself for a deeper explanation.  Also if you want to hunt for this
>> errno
>> in the code you would most likely grep for ENOMEM.
>>
>> Best Regards,
>> -pjp
>>
>> --
>> ** all info about me:  lynx https://callpeter.tel, dig loc
>> delphinusdns.org **
>>
>>


Re: Bgpd multipath conf

2024-05-15 Thread Stuart Henderson
On 2024-05-14, Marco Agostani  wrote:
> I try to setup an openbgpd setup involving multipath configuration ...with =
> no success.
...
>   neighbor $GW01 {
>  descr "bgp#1"
>  announce IPv4 unicast
>  announce add-path recv yes
>  set localpref 110
>   }

This just announces the add-path BGP capability.

> #bgpctl sh rib 172.18.180.0/24
>
> flags: * =3D Valid, > =3D Selected, I =3D via IBGP, A =3D Announced,
>S =3D Stale, E =3D Error
> origin validation state: N =3D not-found, V =3D valid, ! =3D invalid
> aspa validation state: ? =3D unknown, V =3D valid, ! =3D invalid
> origin: i =3D IGP, e =3D EGP, ? =3D Incomplete
>
> flags  vs destination  gateway  lpref   med aspath origin
> *>N-? 172.18.180.0/24  10.0.1.241110 0 14381 i
> *mN-? 172.18.180.0/24  10.0.1.245110 0 14381 i
>
> Show me two routes one marked with multipath
>
> But in fib I see only one route
>
> #bgpctl sh fib 172.18.180.0/24
>
> flags: B =3D BGP, C =3D Connected, S =3D Static
>N =3D BGP Nexthop reachable via this route
>r =3D reject route, b =3D blackhole route
> flags prio destination  gateway
> B   48 172.18.180.0/24  10.0.1.241
...
> What I miss here ??

bgpd does allow add-path and having multiple paths to a prefix in the
RIB (e.g. perhaps useful on a route-server) but it does not handle
adding multiple paths for the same prefix to the FIB.




Bgpd multipath conf

2024-05-14 Thread Marco Agostani
Hello guys,
I try to setup an openbgpd setup involving multipath configuration ...with no 
success.


My bgpd.conf  is like that



prefix-set privnetworks {
10.55.0.0/16
10.60.0.0/16
172.16.0.0/12
}

log updates
network 10.240.0.0/16

group "eBGP" {
  remote-as $AS1
  neighbor $GW01 {
 descr "bgp#1"
 announce IPv4 unicast
 announce add-path recv yes
 set localpref 110
  }

  neighbor $GW02 {
 descr "bgp#2"
 announce IPv4 unicast
 announce add-path recv yes
 set localpref 110
  }
}

match from any community GRACEFUL_SHUTDOWN set { localpref 0 }
deny quick from group eBGP prefix 0.0.0.0/0
Deny out internal route
deny quick from group eBGP prefix 10.240.0.0/16 or-longer
##allow private
allow quick from group eBGP prefix-set privnetworks or-longer set rtlabel 
PRIVNET

allow quick to group eBGP prefix 10.240.0.0/16
deny quick from any

#bgpctl sh rib 172.18.180.0/24

flags: * = Valid, > = Selected, I = via IBGP, A = Announced,
   S = Stale, E = Error
origin validation state: N = not-found, V = valid, ! = invalid
aspa validation state: ? = unknown, V = valid, ! = invalid
origin: i = IGP, e = EGP, ? = Incomplete

flags  vs destination  gateway  lpref   med aspath origin
*>N-? 172.18.180.0/24  10.0.1.241110 0 14381 i
*mN-? 172.18.180.0/24  10.0.1.245110 0 14381 i

Show me two routes one marked with multipath

But in fib I see only one route

#bgpctl sh fib 172.18.180.0/24

flags: B = BGP, C = Connected, S = Static
   N = BGP Nexthop reachable via this route
   r = reject route, b = blackhole route
flags prio destination  gateway
B   48 172.18.180.0/24  10.0.1.241

Confirmed by route

#route -n get 172.18.180.0/24
   route to: 172.18.180.0
destination: 172.18.180.0
   mask: 255.255.255.0
gateway: 10.0.1.241
  interface: sec7130
if address: 10.0.1.242
   priority: 48 (bgp)
  flags: 
  label: PRIVNET
 use   mtuexpire
   0 0 0
sockaddrs: 

Multipath is enabled

# sysctl net.inet.ip.multipath
net.inet.ip.multipath=1

and static routes with -mpath option are setup correctly

What I miss here ??

Cheers
Marco




Caterpillar: Confidential Green


Re: What software to debugging and analyzing C?

2024-05-14 Thread Tomasz Rola
On Tue, May 14, 2024 at 05:19:43AM -0300, Crystal Kolipe wrote:
> On Sun, May 12, 2024 at 10:26:55PM +0200, Tomasz Rola wrote:
> > I am sure gdb has some merits but for whatever C programs I wrote so
> > far, a much more useful debugging technique was putting printf in
> > right places and isolate the problem, and after that doing some mental
> > work to actually understand why this seemingly correct line does
> > something so wrong.
> 
> Exactly.  What you describe is likely the best method to fully understand the
> code, what it's supposed to do and what it actually does, and by extension
[...]

Yes, I guess.

> > Besides, all debuggers introduce their own perturbation and thus
> > certain classes of error will be very hard to catch with them, if
> > ever.
> 
> But you do realise that adding printf() calls to the code can also change,
> for example, the memory layout that the compiler uses, so certain memory
> allocation bugs might become more or less easily triggerable?

No, this did not occurred to me, at least not in such explicit
way. Albeit somewhere deep I realise that program execution can
change, if for example two "not related" lines of code switch places
etc. (because of optimisation, for example).

Before you pointed it out above I considered printf to be almost
non-intrusive way of debugging. Thanks!

-- 
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.  **
** As the answer, master did "rm -rif" on the programmer's home**
** directory. And then the C programmer became enlightened...  **
** **
** Tomasz Rola  mailto:tomasz_r...@bigfoot.com **



Re: Could OpenBSD use some compute?

2024-05-14 Thread Jan Stary
On May 14 12:24:28, romand...@gmail.com wrote:
> If someone had spare capacity, (say, in their homelab, ~80% available,
> about same amount 10k/mon would buy in AWS spot instances), and wanted to
> share it with the open source community in general and OpenBSD devs in
> particular, and were willing to do some ops and eat the electricity bill,
> how could they go about putting all those to good use?
> Hosting mirrors comes to mind, maybe some build/test server? Fuzzy testing
> dev branches?

"I'm asking for a friend"



Re: viomb0 unable to allocate256 physmem pages, error 12

2024-05-14 Thread F Bax
I'm not a coder; but I found source for viomb; which calls uvm_pglistalloc;
which calls uvm_pmr_getpages which mentions ENOMEM:
https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/uvm/uvm_pmemrange.c?rev=1.66=text/plain
There I found this comment:
* fail if any of these conditions is true:
* [1]  there really are no free pages, or
* [2]  only kernel "reserved" pages remain and
*the UVM_PLA_USERESERVE flag wasn't used.
* [3]  only pagedaemon "reserved" pages remain and
*the requestor isn't the pagedaemon nor the syncer.

Unsure how I might use this information to get rid of the previously
mentioned error message..

On Tue, May 14, 2024 at 2:28 PM Peter J. Philipp 
wrote:

> On Tue, May 14, 2024 at 01:58:18PM -0400, F Bax wrote:
> > Recently installed 7.5 amd64 in qemu VM (8G RAM) under proxmox. See this
> > message many times on console and dmesg.
> >
> > viomb0 unable to allocate 256 physmem pages, error 12
> >
> > What does this mean? How to resolve this issue?
>
> Hi,
>
> When you see "error " it's good to look up the manpage on errno.
> Under number 12 it says:  ENOMEM "Cannot Allocate Memory".  But look for
> yourself for a deeper explanation.  Also if you want to hunt for this errno
> in the code you would most likely grep for ENOMEM.
>
> Best Regards,
> -pjp
>
> --
> ** all info about me:  lynx https://callpeter.tel, dig loc
> delphinusdns.org **
>
>


Re: Localnet Hacking

2024-05-14 Thread Peter J. Philipp
On Tue, May 14, 2024 at 01:54:52AM +0200, Peter J. Philipp wrote:
> Hi,
> 
> A few more people responded, I'm falling behind on priorities though because

Hi again,

https://mainrechner.de/Buecher2024/batch1.png

Here is the first batch that will be mailed out on Friday at the latest.  I
still have to find cartons for these.  We have Sweden, Israel, Turkeye, 
Germany, USA, Canada, Spain, Australia, with some of them double or triple.
Thanks to all.

If you waould like to be on the second batch which goes out Friday the
24th please start writing me in private starting Saturday the 18th. I have
my hands full with this and life in general.

Thanks to all that participated.

-pjp

-- 
** all info about me:  lynx https://callpeter.tel, dig loc delphinusdns.org **



Re: pax and ext2fs

2024-05-14 Thread Walter Alejandro Iglesias
Hi Philip,

On Tue May 14 19:40:04 2024 Philip Guenther wrote:
> If you like, you could try the following patch to pax to more gracefully
> handle filesystems with time resolution more granular than nanoseconds.

After applying your patch, as I'd done before reporting the issue, I
sycronized my home directory to an external ext2fs drive with the
command showed by the man page:

  $ pax -rw -v -Z -Y source target

This time only one file stays updating again an again, a soft link I
have in my ~/bin folder of /usr/local/bin/prename.  I tried the command
Stuart Henderson taught me in that file:

$ stat -f %Fm /usr/local/bin/prename
1713451867.0

... no sub-second timestamp, like happens when I run the same stat
comand with the files in the ext2fs drive.  I ran stat with other files
under /usr/local, same result, I end noticing that /usr/local is the
only partition mounted with the wxallowed option.

I wish my guessing info will be useful. :-)  Let me know what more I can
do to help.


> The whitespace will presumably be mauled by gmail so use patch's -l option.

Some lines in the diff arrived wrapped but I corrected them and could
apply the patch.  Gmail has an well hidden option :-), if you open your
account from your browser you can configure it to send in plain text.
You have to click in Compose, then in the compose window go to the last
icon in the bottom right (with a vertical ellipis) hovering with your
mouse says "More options", click and you'll see there the "Plain Text"
option, select it and the option stays saved.  I don't use gmail since a
long time, I had to investigate this tired of friends sending me the
HTML copy of all their messages.

>
> Philip Guenther
>
>

-- 
Walter



Re: viomb0 unable to allocate256 physmem pages, error 12

2024-05-14 Thread Peter J. Philipp
On Tue, May 14, 2024 at 01:58:18PM -0400, F Bax wrote:
> Recently installed 7.5 amd64 in qemu VM (8G RAM) under proxmox. See this
> message many times on console and dmesg.
> 
> viomb0 unable to allocate 256 physmem pages, error 12
> 
> What does this mean? How to resolve this issue?

Hi,

When you see "error " it's good to look up the manpage on errno.
Under number 12 it says:  ENOMEM "Cannot Allocate Memory".  But look for
yourself for a deeper explanation.  Also if you want to hunt for this errno
in the code you would most likely grep for ENOMEM.

Best Regards,
-pjp

-- 
** all info about me:  lynx https://callpeter.tel, dig loc delphinusdns.org **



viomb0 unable to allocate256 physmem pages, error 12

2024-05-14 Thread F Bax
Recently installed 7.5 amd64 in qemu VM (8G RAM) under proxmox. See this
message many times on console and dmesg.

viomb0 unable to allocate 256 physmem pages, error 12

What does this mean? How to resolve this issue?


Re: pax and ext2fs

2024-05-14 Thread Philip Guenther
If you like, you could try the following patch to pax to more gracefully
handle filesystems with time resolution more granular than nanoseconds.
The whitespace will presumably be mauled by gmail so use patch's -l option.

Philip Guenther


Index: ar_subs.c
===
RCS file: /data/src/openbsd/src/bin/pax/ar_subs.c,v
diff -u -p -r1.51 ar_subs.c
--- ar_subs.c   10 Jul 2023 16:28:33 -  1.51
+++ ar_subs.c   14 May 2024 17:19:15 -
@@ -146,23 +146,59 @@ list(void)
 }

 static int
-cmp_file_times(int mtime_flag, int ctime_flag, ARCHD *arcn, struct stat
*sbp)
+cmp_file_times(int mtime_flag, int ctime_flag, ARCHD *arcn, const char
*path)
 {
struct stat sb;
+   long res;

-   if (sbp == NULL) {
-   if (lstat(arcn->name, ) != 0)
-   return (0);
-   sbp = 
+   if (path == NULL)
+   path = arcn->name;
+   if (lstat(path, ) != 0)
+   return (0);
+
+   /*
+* The target (sb) mtime might be rounded down due to the
limitations
+* of the FS it's on.  If it's strictly greater or we don't care
about
+* mtime, then precision doesn't matter, so check those cases first.
+*/
+   if (ctime_flag && mtime_flag) {
+   if (timespeccmp(>sb.st_mtim, _mtim, <=))
+   return timespeccmp(>sb.st_ctim, _ctim,
<=);
+   if (!timespeccmp(>sb.st_ctim, _ctim, <=))
+   return 0;
+   /* <= ctim, but >= mtim */
+   } else if (ctime_flag)
+   return timespeccmp(>sb.st_ctim, _ctim, <=);
+   else if (timespeccmp(>sb.st_mtim, _mtim, <=))
+   return 1;
+
+   /*
+* If we got here then the target arcn > sb for mtime *and* that's
+* the deciding factor.  Check whether they're equal after rounding
+* down the arcn mtime to the precision of the target path.
+*/
+   res = pathconf(path, _PC_TIMESTAMP_RESOLUTION);
+   if (res == -1)
+   return 0;
+
+   /* nanosecond resolution?  previous comparisons were accurate */
+   if (res == 1)
+   return 0;
+
+   /* common case: second accuracy */
+   if (res == 10)
+   return arcn->sb.st_mtime <= sb.st_mtime;
+
+   if (res < 10) {
+   struct timespec ts = arcn->sb.st_mtim;
+   ts.tv_nsec = (ts.tv_nsec / res) * res;
+   return timespeccmp(, _mtim, <=);
+   } else {
+   /* not a POSIX compliant FS */
+   res /= 10;
+   return ((arcn->sb.st_mtime / res) * res) <= sb.st_mtime;
+   return arcn->sb.st_mtime <= ((sb.st_mtime / res) * res);
}
-
-   if (ctime_flag && mtime_flag)
-   return (timespeccmp(>sb.st_mtim, >st_mtim, <=) &&
-   timespeccmp(>sb.st_ctim, >st_ctim, <=));
-   else if (ctime_flag)
-   return (timespeccmp(>sb.st_ctim, >st_ctim, <=));
-   else
-   return (timespeccmp(>sb.st_mtim, >st_mtim, <=));
 }

 /*
@@ -842,14 +878,12 @@ copy(void)
/*
 * if existing file is same age or newer skip
 */
-   res = lstat(dirbuf, );
-   *dest_pt = '\0';
-
-   if (res == 0) {
+   if (cmp_file_times(uflag, Dflag, arcn, dirbuf)) {
+   *dest_pt = '\0';
ftree_skipped_newer(arcn);
-   if (cmp_file_times(uflag, Dflag, arcn, ))
-   continue;
+   continue;
}
+   *dest_pt = '\0';
}

/*

On Thu, May 2, 2024 at 6:54 AM Walter Alejandro Iglesias 
wrote:

> On Thu, 2 May 2024 12:03:10, Stuart Henderson wrote
> > I don't have a suitable filesystem handy to test, but does OpenBSD's
> > implementation of ext2fs support sub-second timestamps?
> >
> > stat -f %Fm $filename
> >
> > If not, that's a probable explanation for the difference in behaviour.
> > You could probably confirm by forcing timestamps with no nanosecond
> > components, e.g. touch -t mmddhhmm.ss $filename, or copy to ext2fs
> > and back again.
>
> $ doas mount -t ext2fs /dev/sd0i /mnt
> $ touch ~/test.txt
> $ cp ~/test.txt /mnt
> $ stat -f %Fm /mnt/test.txt
> 1714657214.0
> $ cp ~/test.txt /mnt
> $ stat -f %Fm /mnt/test.txt
> 1714657409.0
> 癘m
>


Could OpenBSD use some compute?

2024-05-14 Thread Roman Dzvinkovsky
If someone had spare capacity, (say, in their homelab, ~80% available,
about same amount 10k/mon would buy in AWS spot instances), and wanted to
share it with the open source community in general and OpenBSD devs in
particular, and were willing to do some ops and eat the electricity bill,
how could they go about putting all those to good use?
Hosting mirrors comes to mind, maybe some build/test server? Fuzzy testing
dev branches?
If not compute, mb smth else, like storage/GPU/much-ram?

Thanks in advance,
Roman.


Re: Favorite configuration and system replication tools?

2024-05-14 Thread Walter Alejandro Iglesias
On Tue May 14 18:11:16 2024 Страхиња Радић wrote:
> Antipatterns are bad. I don't mean the ellipsis in `ls -l ...`. I mean 
> things like
>
>   cat file | grep hello | cat | sed 's/hello/world/g' | cat - > output
>
>   for file in `echo `ls *` `; do echo $file; done
>
>   ls -l | awk '{ print $5 }'  # different things with different ls'es
>   # under different locales, and on 
>   # different systems, with differently
>   # named files
>
> which are something a novice will see and adopt, especially when it is 
> not even communicated as a "sketch", and a seasoned user of shell will 
> just be annoyed with.

This recalls me again the quote of the article you linked:

  "..., unless extreme portability is more important..."

Let's make it short.  Would you guarantee that your shell scripts work
on any unix-like system?


And here I abandon the discussion, needless to say that I appreciate all
your advices.

Greetings!



Re: Favorite configuration and system replication tools?

2024-05-14 Thread Страхиња Радић
Дана 24/05/14 11:52AM, Walter Alejandro Iglesias написа:
> I learned about the convenience of adding the '-r' option in the "while
> read" loop many years ago when I was writing a script to convert roff to
> html, the problem aroused with the backslash in roff comments (.\").

That's more or less the point that answer is trying to make: you should 
use the right tool for the job. Shell command language is not fit to 
create parsers or interpreters in. Attempts can be made, but some 
corner will be hit sooner or later. When that happens, it is time to 
rethink if the problem would be better attacked by a full-fledged 
program in a general programming language. Parsers, interpreters and 
compilers are examples of this.


> Immediately, some "experts" started to point me "holes" in my
> script, when what I posted was just a sketch.  In that case disregarding
> shell scripting wasn't useful as an argument since they were proposing
> fail2ban.sh (a clear example of using shell scripting for something
> complicated. ;-))

Antipatterns are bad. I don't mean the ellipsis in `ls -l ...`. I mean 
things like

  cat file | grep hello | cat | sed 's/hello/world/g' | cat - > output

  for file in `echo `ls *` `; do echo $file; done

  ls -l | awk '{ print $5 }'# different things with different ls'es
# under different locales, and on 
# different systems, with differently
# named files

which are something a novice will see and adopt, especially when it is 
not even communicated as a "sketch", and a seasoned user of shell will 
just be annoyed with.

I've also seen system shell scripts from major distributions of 
GNU/Linux and some mainstream software projects which feature examples 
of this kind, so not even their developers are immune to it. More than 
necessary amounts of bugs and security holes are then not a surprise at 
all.



Re: What software to debugging and analyzing C?

2024-05-14 Thread Chris Bennett
On Tue, May 14, 2024 at 05:19:43AM -0300, Crystal Kolipe wrote:
> On Sun, May 12, 2024 at 10:26:55PM +0200, Tomasz Rola wrote:
> > I am sure gdb has some merits but for whatever C programs I wrote so
> > far, a much more useful debugging technique was putting printf in
> > right places and isolate the problem, and after that doing some mental
> > work to actually understand why this seemingly correct line does
> > something so wrong.
> 
> Exactly.  What you describe is likely the best method to fully understand the
> code, what it's supposed to do and what it actually does, and by extension
> avoid making the same coding mistakes in the future.  Finding and fixing a
> single error with gdb doesn't have the same educational benefit, nor in
> many cases such a guarantee that other nearby bugs have also been noticed.
> 
> > Besides, all debuggers introduce their own perturbation and thus
> > certain classes of error will be very hard to catch with them, if
> > ever.
> 
> But you do realise that adding printf() calls to the code can also change,
> for example, the memory layout that the compiler uses, so certain memory
> allocation bugs might become more or less easily triggerable?

Yes, I do realize that printf has that flaw.
I also program some in Perl. print, warn, die, etc. can sometimes help,
but often they don't. Carefully studying or just trying to rewrite a
section of code from scratch is the only solution. Many years ago I
wrote a trivial Perl script wrong. It very slowly grabbed more and more
memory until it crashed the server about every two days. After very
carefully watching, I figured out it was my script and I fixed a rather
silly bug. I'll never forget that experience.

-- 
Regards,
Chris Bennett

"Who controls the past controls the future. Who controls the present controls 
the past."
 George Orwell - 1984



Re: What software to debugging and analyzing C?

2024-05-14 Thread Walter Alejandro Iglesias
On Tue May 14 11:40:42 2024 Tomasz Rola wrote:
> I am sure gdb has some merits but for whatever C programs I wrote so
> far, a much more useful debugging technique was putting printf in
> right places and isolate the problem,

I got used to doing this too.  I started doing it intuitively, I'm
self-taught (and I'm certainly not an expert).



Re: Favorite configuration and system replication tools?

2024-05-14 Thread Walter Alejandro Iglesias
On Tue May 14 11:11:33 2024  wrote:
> When `while ... read ...` idiom is used, it is advisable to clear IFS 
> to turn off field splitting, and use -r to avoid interpretation of 
> backslash sequences in the input:
>
>   while IFS= read -r dir; do # ...
>
> Back to parsing the output of ls(1) (also applicable to parsing the 
> output of find(1), or globs), there is an indepth analysis of the 
> problem at [1]. The accepted answer concludes that perhaps shell 
> command language is not the right tool for the job, and a more 
> sophisticated language should be used instead. While I don't agree with 
> the author's choice of Python, any language supporting opendir(3), 
> readdir(3) or equivalent functions will suffice.
>
> [1]: 
> https://unix.stackexchange.com/questions/128985/why-not-parse-ls-and-what-to-do-instead
>

Let's start for what the first answer in that forum put in bold:

   Bourne shell is a bad language.  It should not be used for anything
   complicated, unless extreme portability is more important than any
   other factor (e.g. autoconf).

If you analyze that statement, depending on the case, it may have sense
or not at all.

I learned about the convenience of adding the '-r' option in the "while
read" loop many years ago when I was writing a script to convert roff to
html, the problem aroused with the backslash in roff comments (.\").

When I post an example of a shell script in some forum or mailing list I
post an sketch, assuming others will use it as a example and write
themselves their own solution.  Who won't be able to overcome issues
like the above are those who aren't familiar or trained in that language
in particular.  For me (as I think it should be for any unix user) shell
scripting is mainly the way a "use" the computer, it's not a
"programmers" language, something you use to write whole applications of
the kind "Push this button and relax, I'll do the job".  I have a
hundred of dirty shell scripts in my ~/bin directory that if you examine
them you'll find many dumb errors, but mainly they do the job.  I don't
know anything about python (I don't like it), but I bet that if you
analyze python, or C or Perl, you'll also find inconsistencies you'll
have to workaround as with shell scripting.  Nothing is perfect when you
see it in detail.

Many years ago I posted in some linux forum an example of a shell script
to blacklist IPs in a web-mail server.  My intention was encouraging
users to not follow the MSWin approach, I mean downloading some 3rd
party tool instead of learning what the system already has to offer.
And I remember myself proposing and giving solutions with rsync in that
same forum to someone asking for a mirror capable synchronizing tool.
This, and *learning to do things by yourself* (even if your program isn't
as good the one you download or isn't good at at all), are the
fundamental tendencies I always defend since ARE THE REASON OF EXISTENCE
OF FOSS.  Immediately, some "experts" started to point me "holes" in my
script, when what I posted was just a sketch.  In that case disregarding
shell scripting wasn't useful as an argument since they were proposing
fail2ban.sh (a clear example of using shell scripting for something
complicated. ;-))

Summarizing, my motivation was triggered by the topic of the thread and
the way it was raised by the OP.


-- 
Walter



Re: What software to debugging and analyzing C?

2024-05-14 Thread Crystal Kolipe
On Sun, May 12, 2024 at 10:26:55PM +0200, Tomasz Rola wrote:
> I am sure gdb has some merits but for whatever C programs I wrote so
> far, a much more useful debugging technique was putting printf in
> right places and isolate the problem, and after that doing some mental
> work to actually understand why this seemingly correct line does
> something so wrong.

Exactly.  What you describe is likely the best method to fully understand the
code, what it's supposed to do and what it actually does, and by extension
avoid making the same coding mistakes in the future.  Finding and fixing a
single error with gdb doesn't have the same educational benefit, nor in
many cases such a guarantee that other nearby bugs have also been noticed.

> Besides, all debuggers introduce their own perturbation and thus
> certain classes of error will be very hard to catch with them, if
> ever.

But you do realise that adding printf() calls to the code can also change,
for example, the memory layout that the compiler uses, so certain memory
allocation bugs might become more or less easily triggerable?



Re: Localnet Hacking

2024-05-13 Thread Peter J. Philipp
On Tue, May 14, 2024 at 01:54:52AM +0200, Peter J. Philipp wrote:
> Hi,
> 
> A few more people responded, I'm falling behind on priorities though because
> I am very close to cracking AES-128 I have reduced it to a complexity of
> 2 ^ 64.  However I have some old code to get the first 32 bits identified but
> I want to find a cleaner way.  I'll upload my code to the https://centroid.eu
> misc repo tomorrow.  Once I have the crib for the first 32 bits in a sureshot
> everything falls into place and the complexity falls to 2 * (2 ^ 32).  I guess
> that's the same a 2 ^ 33.

Well my sugar high is over.  It was good for a week or two.  I spotted the
error in my logic.  I'll still be working on this tough.

I passed rk into gosh() and used it.. I totally oversaw that.

Best Regards,
-pjp



Re: Localnet Hacking

2024-05-13 Thread Peter J. Philipp
On Sat, May 11, 2024 at 10:35:38AM +0200, Peter J. Philipp wrote:
> On Sat, May 11, 2024 at 08:45:45AM +0200, Peter J. Philipp wrote:
> > Contact me privately if you would like a batch with what you like.  I'll
> > make note on that webpage of what's given away.  Offer ends July 1st of this
> > year.
> 
> Three books have already been given away.  They went to Finland.  Look for
> a marking of a flag beside the name of the title of the book.
> 
> Also if I may interest some people:  The Java book is autographed by Ian F.
> Darwin who is also on this list.  Also the 4.4BSD book which is quite beaten
> up was autographed by 3 of the 4 authors at BSDCon 2000.  They were everyone
> other than John Quarterman.  Maybe I'll run into him one day but then I'll
> be missing 3 signatures hehe.
> 
> -pjp

Hi,

A few more people responded, I'm falling behind on priorities though because
I am very close to cracking AES-128 I have reduced it to a complexity of
2 ^ 64.  However I have some old code to get the first 32 bits identified but
I want to find a cleaner way.  I'll upload my code to the https://centroid.eu
misc repo tomorrow.  Once I have the crib for the first 32 bits in a sureshot
everything falls into place and the complexity falls to 2 * (2 ^ 32).  I guess
that's the same a 2 ^ 33.

It's kept me up most of the day and night today as it's exciting work.  I
promise to send your books by friday as wednesday and thursday are booked
for me too.  Also there has been close to 10 people now, for any new request
I plea you to wait until next week.  This is an exciting May.

(Are you ready for the non-quantum cryptography apocalypse?, I'm starting to
believe we're in a game like tron or something.. let's work together)

-pjp

-- 
** all info about me:  lynx https://callpeter.tel, dig loc delphinusdns.org **



Wacom pen tip pressure

2024-05-13 Thread ruivlea
Hello,

I tried to use wacom CTL-672, it works. Except pen tip pressure,
As stated in man uwacom.

On linux, pen tip pressure also not working if xf86-input-wacom
not installed.

In /src/sys/dev/hid/hidms.c:
...
case HID_USAGE2(HUP_WACOM | HUP_DIGITIZERS, HUD_TIP_PRESSURE):
DPRINTF(("Stylus usage pressure set\n"));
ms->sc_loc_z = h.loc;
ms->sc_tsscale.minz = h.logical_minimum;
ms->sc_tsscale.maxz = h.logical_maximum;
ms->sc_flags |= HIDMS_Z;
break;
...
Seems like it can read tip pressure, but need more processing,
isn't it? (correct me if i wrong).

So, to make pen tip pressure works, do we need uwacom + X driver 
(xf86-input-wacom) to handle advanced process?.
Is xf86-input-wacom need to be ported?.
Or just improve uwacom?.
Or both?

It would be good if pen tip pressure can be used on openbsd.



Re: What software to debugging and analyzing C?

2024-05-13 Thread Chris Bennett
On Mon, May 13, 2024 at 08:24:38AM +0200, Janne Johansson wrote:
> pkg_add llvm and run "scan-build" on your code, then you get a quite
> thorough analysis on what potential error code paths it detects, with
> fancy webpages to go along with the explanations for each found issue:
> 
> http://c66.it.su.se:8080/obsd/scan-build-2019-10-10-202112-79522-1/report-3f2f00.html#EndPath
> 
> It's not 100% perfect of course, but it still is a neat way to point
> out where in the code you may need to make an extra effort to cover
> corner cases.
> 
> > I also wouldn't mind any other useful tips that might not be software.
> > Any help very appreciated.
> 
> Perhaps this fuzzing guide helps a bit getting programs to run better?
> https://undeadly.org/cgi?action=article=20150121093259

Thank you and to the others replying.
-- 
Regards,
Chris Bennett

"Who controls the past controls the future. Who controls the present controls 
the past."
 George Orwell - 1984



Re: gmake compile of python3.12 crashes on openBSD 7.5 but not on openBSD 7.4

2024-05-13 Thread Stuart Henderson
On 2024-05-12, Sandeep Gupta  wrote:
> ./Tools/scripts/pydoc3 > build/scripts-3.12/pydoc3.12
> Illegal instruction (core dumped)
>
>   I am unable to find a proper debugger into which to load the python.core
> generated after core dump, so can't provide any useful debug info.

pkg_add gdb and use the 'egdb' command.




Re: https://twitter.com/openbsd

2024-05-13 Thread tux2bsd
On Sunday, May 12th, 2024 at 11:04 AM, T.J. Townsend  
> Wasting everyone's time by complaining on a mailing list that
> we didn't post a tweet seems a little petty too. Anyway I just
> blocked you from the OpenBSD account, so that should make life
> easier for everyone going forward.

Funny how the others have started rambling on about learning to
type and you haven't had another one of your petty power trips
about everyone's time being wasted.  Are you feeling OK?  Do
you need a pettiness power-up?  I bet you do!

I did note I forgot to format the width for my last few emails,
I forgot about protonmail simply sending it holus-bolus.  This
one should be OK.

Oh, get on-topic!!!

I learnt to type long enough ago that I don't remember actually
learning, then one day I just stopped looking at the keyboard
and never noticed the transition.  Those kids will get bored
of those typewriters in days, weeks at most.

tux2bsd



Re: What software to debugging and analyzing C?

2024-05-13 Thread Janne Johansson
> I found a YouTube channel LowLevelLearning that covers various
> programming languages in a manner that I find particularly helpful and
> clear. For example comparing C and assembly on the same code is superb.
>
> In a short, he recommended valgrind to help finding memory leaks.
> Other than splint and gdb, what other software is useful for working
> with C?

pkg_add llvm and run "scan-build" on your code, then you get a quite
thorough analysis on what potential error code paths it detects, with
fancy webpages to go along with the explanations for each found issue:

http://c66.it.su.se:8080/obsd/scan-build-2019-10-10-202112-79522-1/report-3f2f00.html#EndPath

It's not 100% perfect of course, but it still is a neat way to point
out where in the code you may need to make an extra effort to cover
corner cases.

> I also wouldn't mind any other useful tips that might not be software.
> Any help very appreciated.

Perhaps this fuzzing guide helps a bit getting programs to run better?
https://undeadly.org/cgi?action=article=20150121093259


-- 
May the most significant bit of your life be positive.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis

Andreas Kähäri  writes:

i'm not sure why you're addressing this to me, as i'm not the 
OP.


It's addressed to the thread in general.


Your response quoted me, then made use of the word 'you'. Which 
you - and yes, i mean you, Andreas, specifically - have again done 
below:


That said, yes, minimising the extent to which certain 
non-'word'

characters
(i.e. roughly the POSIX 'alnum' class as described in 
re_format(7))

_can_
make it easier to programatically do certain tasks which are
restricted by
the long and messy history of C and Unix development. Given 
that

i've been
using computers for a few decades, i still instinctively don't 
use

spaces in
filenames, even though they're very much allowed. But of 
course,

that's not
what most of the world does, and this is an example of trying 
to

work out
what the best tradeoffs might be when dealing with the 
messiness of

the real
world.


Alexis.


With rsync(1):

rsync -n -aim --delete-excluded \
--include-from=list \
--include='*/' \
--exclude='*' \
source/ target

This would read your inclusion patterns from the file "list" (it 
is
assumed that directories are entered as "dirname/***", which 
matches the
name "directory" and all its content), include any directory, 
and then
finaly exclude anything not already included.  The matched names 
would
be synchonised from beneath "source" to "target", and excluded 
names
would be deleted from the target.  With "-m", we don't keep 
directories

at the target that ends up being empty.


You - by which i mean, you, Andreas, specifically - have quoted me 
_at length_, in an email with _my email address_ in the To header, 
before immediately making remarks not related to the text of mine 
you quoted (which was instead related to the `-r` option to `read` 
in the context of processing filenames, and which Страхиња has 
addressed to my satisfaction).


If you - by which i mean, you, Andreas, specifically - want to use 
'you' in the general sense of 'one' ("This would read one's 
inclusions patterns ..."), which is certainly fair enough, then 
please don't quote unrelated text _from me_ when doing so. If, for 
some bizarre reason, your mail client prevents the removal of 
unrelated quotes from others, use a better mail client.


In any case, from this point forward, please do not include my 
email address in the delivery-related headers of any further 
replies to this thread.



Alexis.



Re: What software to debugging and analyzing C?

2024-05-12 Thread Tomasz Rola
On Sun, May 12, 2024 at 11:51:32AM -0700, Chris Bennett wrote:
> I found a YouTube channel LowLevelLearning that covers various
> programming languages in a manner that I find particularly helpful and
> clear. For example comparing C and assembly on the same code is superb.
> 
> In a short, he recommended valgrind to help finding memory leaks.
> Other than splint and gdb, what other software is useful for working
> with C?
> I also wouldn't mind any other useful tips that might not be software.
> Any help very appreciated.

I am sure gdb has some merits but for whatever C programs I wrote so
far, a much more useful debugging technique was putting printf in
right places and isolate the problem, and after that doing some mental
work to actually understand why this seemingly correct line does
something so wrong.

This approach does not look sexy enough to show it on y-t, so I guess
there will not be a movie showing it.

Besides, all debuggers introduce their own perturbation and thus
certain classes of error will be very hard to catch with them, if
ever. It also sometimes happened to me, that debugger pointed to wrong
place, where the error supposedly happened. Very wrong place - like
GUI code when in fact the bug was in database communication.

I think it all becomes even more funky if you start playing with
multithreaded apps and languages which come with threads built-in,
under the hood.

All of those things happened many years ago - perhaps debuggers
improved, I have no idea.

So, I suggest that you do: man tee
and after that:  ./yourcode 2>&1 | tee log.txt
and: less log.txt

-- 
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.  **
** As the answer, master did "rm -rif" on the programmer's home**
** directory. And then the C programmer became enlightened...  **
** **
** Tomasz Rola  mailto:tomasz_r...@bigfoot.com **



Re: https://twitter.com/openbsd

2024-05-12 Thread Stuart Longland VK4MSL

On 13/5/24 04:40, Chris Bennett wrote:

I saw a news bit yesterday that in one town, all of the school children
are buying old fashioned typewriters to break their link to computers
and do things the old fashioned way. +1 to them.
I prefer real text on paper myself. I learn things much better that way.


Makes a lot more sense for teaching typing skills actually.  In my day, 
my school was using i586-class machines running Windows 95 and Office 97.


Seemed like a reasonable choice, but Word 97 was overkill for the job, 
and actually had a few anti-features which were problematic in exams: it 
only took an arsehole student a brief moment to stab F7 on your keyboard 
just as a teacher came around the corner to get someone disqualified 
from the typing exam… since use of the spell checker was forbidden in 
that context.


Typewriters had no such luxuries.  Mind you, neither did "simpler" word 
processors and text editors, so chalk one up for educator tunnel vision.


I applaud the kids there for thinking outside the box.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 21:50:12 2024 Martin Schröder wrote:
>
>   If a line begins with "- " (dash, space) or "+ " (plus, space),
>   then the type of rule is being explicitly specified as an exclude
>   or an include (respectively).  Any rules without such a prefix are
>   taken to be an include.

I'd read the man page.  What I understand from this paragraph is that
you have to include in the list *all* the files.  How convenient! :-)

>
>
> Coming back to the topic of this thread:

Yeah, because I'm talking about football.


>
> Best
>  Martin
>
>
>



Re: Why /var/www/run instead of /var/run for web services

2024-05-12 Thread Dan


> I suspect that it is because a web service might change its root
> directory to /var/www using chroot(2),

> Can anyone confirm or deny my assumption?


right, www is chrooted.

-Dan



Re: What software to debugging and analyzing C?

2024-05-12 Thread Jan Stary
On May 12 11:51:32, cpb_m...@bennettconstruction.us wrote:
> In a short, he recommended valgrind to help finding memory leaks.

man malloc



Re: What software to debugging and analyzing C?

2024-05-12 Thread Walter Alejandro Iglesias
Otto Moerbeek thought me this:

First compile your program with debug symbols (and, conveniently, without
optimization settings.)

  $ DEBUG="-g -O0" make

Then:

  $ MALLOC_OPTIONS=D ktrace -tu 
  $ kdump -u malloc

kdump will though you lines like this:

  0x34f10a4b153   20480  1  20480 addr2line -e /usr/lib/libc.so.97.1 0x4d153
  0x34f10a96470  410576 25  16423 addr2line -e /usr/src/usr.bin/ 0x98470

If you compiled your program with debugging symbols and your program has
some leak, the name of your program will appear in some of those lines.
Then you run that addr2line command and it'll show you in which file and
line the leak is produced.  It will show your errors that valgrind won't.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Martin Schröder
Am So., 12. Mai 2024 um 21:18 Uhr schrieb Walter Alejandro Iglesias
:
> On Sun May 12 20:58:43 2024 Andreas Kähäri wrote
> > With rsync(1):
> >
> >   rsync -n -aim --delete-excluded \
> >   --include-from=list \
> >   --include='*/' \
> >   --exclude='*' \
> >   source/ target
> >
>
> I don't understand what your command does exactly.  And this is surely

man rsync

 --include=PATTERN
This option is a simplified form of the --filter option that
specifies an include rule and does not allow the full rule-parsing
syntax of normal filter rules.  This is equivalent to specifying
-f'+ PATTERN'.

See the FILTER RULES section for detailed information on this
option.

 --include-from=FILE
This option is related to the --include option, but it specifies a
FILE that contains include patterns (one per line).  Blank lines
in the file are ignored, as are whole-line comments that start
with ';' or '#' (filename rules that contain those characters are
unaffected).

If a line begins with "- " (dash, space) or "+ " (plus, space),
then the type of rule is being explicitly specified as an exclude
or an include (respectively).  Any rules without such a prefix are
taken to be an include.

If a line consists of just "!", then the current filter rules are
cleared before adding any further rules.

If FILE is '-', the list will be read from standard input.

Coming back to the topic of this thread: I'm curious that nobody has mentioned
ansible/puppet/salt/... yet.

Best
 Martin



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 20:58:43 2024 Andreas Kähäri wrote
> With rsync(1):
>
>   rsync -n -aim --delete-excluded \
>   --include-from=list \
>   --include='*/' \
>   --exclude='*' \
>   source/ target
>

I don't understand what your command does exactly.  And this is surely
of everyone interest since, like me, everyone has many files and
directories in $HOME which are not worth to save, as ~/.cache for
example.  If you take a second look to my examples, the one using pax
and the other using rsync inside a loop, both are thought to synchronize
*only* what I put in the list and, as you see, in the list there are
files and directories.  I appreciate that you or any other rsync expert
here show me how to accomplish that (in case it's possible) with rsync
without resorting to a loop as I did.

(Not challenging, I'm asking this as favor.) 


I use a simliar solution to syncronize my $HOME directory to other
machines.  Related to the idea of synchronizing a selection of files and
directories saved in a list, I attempted to lern how rdist(1) works, as
Robert B. Carleton advised me, but I couldn't see much, rdistd(1) core
dumped.



What software to debugging and analyzing C?

2024-05-12 Thread Chris Bennett
I found a YouTube channel LowLevelLearning that covers various
programming languages in a manner that I find particularly helpful and
clear. For example comparing C and assembly on the same code is superb.

In a short, he recommended valgrind to help finding memory leaks.
Other than splint and gdb, what other software is useful for working
with C?
I also wouldn't mind any other useful tips that might not be software.
Any help very appreciated.
-- 
Regards,
Chris Bennett

"Who controls the past controls the future. Who controls the present controls 
the past."
 George Orwell - 1984



Re: https://twitter.com/openbsd

2024-05-12 Thread Chris Bennett
On Sun, May 12, 2024 at 09:53:00AM +, Rubén Llorente wrote:
> 
> I think it is worth mentioning I know of a number of small operations that
> have announced their complete withdrawal from social media - Twitter,
> Facebook, Instagram, the Fediverse - because the benefit they get from
> social media presence is not worth the labor time required to sustain social
> media presence.
> 
> That said, when those operations ceased social media activity, they took
> care of making it widely known among their audience rather than just let
> their social media accounts rot...
> 

I saw a news bit yesterday that in one town, all of the school children
are buying old fashioned typewriters to break their link to computers
and do things the old fashioned way. +1 to them.
I prefer real text on paper myself. I learn things much better that way.
-- 
Regards,
Chris Bennett

"Who controls the past controls the future. Who controls the present controls 
the past."
 George Orwell - 1984



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Chris Bennett
On Sun, May 12, 2024 at 01:40:25PM +0200, Walter Alejandro Iglesias wrote:
> > Unix development. Given that i've been using computers for a few 
> > decades, i still instinctively don't use spaces in filenames, even 
> > though they're very much allowed. But of course, that's not what 
> > most of the world does, and this is an example of trying to work 
> > out what the best tradeoffs might be when dealing with the 
> > messiness of the real world.
> 
> I overlooked this in my example because I *never* use spaces, UTF-8 or
> any special characters to name my file names.  Lately, I finally
> persuaded my wife to use Linux, after decades of having to use Windows.
> Even when I educated her in this matter she has clients who send her
> files named with any kind of crap, so taking care of this issue is still
> convenient.
> 

I download a lot of files with a hideous mess of characters. I wrote a
small script to substitute in acceptable characters. I can enter a
regex, select to just use a directory or go down recursively. Also I can
select to only change filenames or directories or both.
After reading this thread I see I need to update the script.
-- 
Regards,
Chris Bennett

"Who controls the past controls the future. Who controls the present controls 
the past."
 George Orwell - 1984



Why /var/www/run instead of /var/run for web services

2024-05-12 Thread Souji Thenria

Hi everyone,

I hope all of you had a great weekend so far!

I was wondering why OpenBSD web services like httpd write their PID file
to /var/www/run instead of /var/run.

I suspect that it is because a web service might change its root
directory to /var/www using chroot(2), making everything outside of this
directory inaccessible during runtime (this would probably not affect
httpd but maybe other web-related services), and that /var/www is the
home directory of the www user. However, I couldn't find anything to
confirm this.

Can anyone confirm or deny my assumption?

Regards,
Souji



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis

Andreas Kähäri  writes:

The external env(1) utility will only ever list environment 
variables.

The IFS variable does not need to be exported as an environment
variable
as it's only ever used by the current shell (and any new shell 
would

reset it).

To list all variables in a shell, use the built-in set utility 
without

any arguments.

$ (unset -v IFS; ksh -c 'set' | grep -A 1 IFS)
IFS='
'

$ (unset -v IFS; ksh -c 'printf "%s" "$IFS" | hexdump -C')
  20 09 0a  | 
..|

0003


i stand corrected.


Alexis.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis

Страхиња Радић  writes:


Дана 24/05/12 07:31PM, Alexis написа:


Omitting -r as a parameter to read would make it interpret 
backscape 
sequences, which would make the directory name in the filesystem 
different than the one command/script operates on, which is most 
likely undesired (unless the intention is to exploit some bug).


Yes, i understood that omitting `-r` would make it interpret 
escape sequences, hence me asking:


about the possibility of someone having consciously put e.g. a 
\t in a directory name because they were assuming that it

_would_  get interpreted when required?


So i take your answer as, in reference a comment in the other 
subthread: yes, there are in fact 'inappropriate' characters, in 
the sense that certain representations of certain characters 
aren't allowed. Which seems very reasonable to me. Thanks for 
explaining.



Alexis.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Страхиња Радић
Дана 24/05/12 07:31PM, Alexis написа:
> i wondered about that in this context. If people putting odd / inappropriate
> things in directory names are a concern ("weird characters", as you wrote
> upthread), what do we do about the possibility of someone having consciously
> put e.g. a \t in a directory name because they were assuming that it _would_
> get interpreted when required?

Omitting -r as a parameter to read would make it interpret backscape 
sequences, which would make the directory name in the filesystem 
different than the one command/script operates on, which is most 
likely undesired (unless the intention is to exploit some bug).

Consider

$ dir=$'helloe[1mworlde[0m'; echo $dir | while read dir; do 
echo $dir; mkdir $dir; done
helloe[1mworlde[0m
$ ls -ldq hello*
drwxr-xr-x  2 user  user  512 May 12 14:13 helloe[1mworlde[0m/
$ ls -ld $(echo $dir)
ls: hello\e[1mworld\e[0m: No such file or directory
$ rmdir $(echo $dir)
rmdir: hello\e[1mworld\e[0m: No such file or directory
$ rmdir helloe\[1mworlde\[0m/
 -- expansion by Tab key
vs

$ dir=$'helloe[1mworlde[0m'; echo $dir | while read -r dir; do 
echo $dir; mkdir $dir; done
helloworld
 ^-- bold attribute on
$ ls -ldq hello*
drwxr-xr-x  2 user  user  512 May 12 14:13 hello\e[1mworld\e[0m/
$ ls -ld $(echo $dir)
drwxr-xr-x  2 user  user  512 May 12 14:13 hello\e[1mworld\e[0m/
$ rmdir $(echo $dir)



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Andreas Kähäri
On Sun, May 12, 2024 at 08:08:17PM +1000, Alexis wrote:
> Andreas Kähäri  writes:
> 
> > Well, that's one way to control this trainwreck of a script; just say
> > that any name containing "inappropriate" characters aren't allowed!
> > 
> > May I ask why you don't simply use rsync(1) (or even openrsync(1) from
> > the OpenBSD base system)?
> 
> i'm not sure why you're addressing this to me, as i'm not the OP.

It's addressed to the thread in general.

> 
> That said, yes, minimising the extent to which certain non-'word' characters
> (i.e. roughly the POSIX 'alnum' class as described in re_format(7)) _can_
> make it easier to programatically do certain tasks which are restricted by
> the long and messy history of C and Unix development. Given that i've been
> using computers for a few decades, i still instinctively don't use spaces in
> filenames, even though they're very much allowed. But of course, that's not
> what most of the world does, and this is an example of trying to work out
> what the best tradeoffs might be when dealing with the messiness of the real
> world.
> 
> 
> Alexis.

With rsync(1):

rsync -n -aim --delete-excluded \
--include-from=list \
--include='*/' \
--exclude='*' \
source/ target

This would read your inclusion patterns from the file "list" (it is
assumed that directories are entered as "dirname/***", which matches the
name "directory" and all its content), include any directory, and then
finaly exclude anything not already included.  The matched names would
be synchonised from beneath "source" to "target", and excluded names
would be deleted from the target.  With "-m", we don't keep directories
at the target that ends up being empty.

-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Andreas Kähäri
On Sun, May 12, 2024 at 07:56:55PM +1000, Alexis wrote:
> Andreas Kähäri  writes:
> 
> > The ksh(1) shell sets IFS by default to a space, tab and a newline
> > character.
> 
> Those are the defaults used when IFS is not set _as a variable_. If you log
> in, and run env(1), in the absence of any manual setting of IFS in .kshrc or
> whatever, you'll see that IFS is not listed, because it's not 'set' in the
> shell variable sense. When it's not set, the shell assumes that IFS has the
> value you listed.
> 
> (Additionally, a shell variable not being set is _not_ the same as that
> variable being set to the empty string.)
> 
> 
> Alexis.

The external env(1) utility will only ever list environment variables.
The IFS variable does not need to be exported as an environment variable
as it's only ever used by the current shell (and any new shell would
reset it).

To list all variables in a shell, use the built-in set utility without
any arguments.

$ (unset -v IFS; ksh -c 'set' | grep -A 1 IFS)
IFS='
'

$ (unset -v IFS; ksh -c 'printf "%s" "$IFS" | hexdump -C')
  20 09 0a  | ..|
0003



-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 13:22:13 2024 Alexis wrote:
> Andreas Kähäri  writes:
> > Well, that's one way to control this trainwreck of a script; 
> > just say
> > that any name containing "inappropriate" characters aren't 
> > allowed!
> >
> > May I ask why you don't simply use rsync(1) (or even 
> > openrsync(1) from
> > the OpenBSD base system)?
>
> i'm not sure why you're addressing this to me, as i'm not the OP.

I guess it's me who Andreas should address this question to, right?

I gave a dirty example to someone who mentioned pax to the OP.  Just
playing and lerning. :-)

I've been using rsync since ever, but, first, I don't think rsync is
bulletproof either and, second, making a backup with pax is faster and
in some cases simpler.  If you don't want to delete files on the target
you don't need to do scripting at all.

Let's take the example I put in my first message.  With rsync, you'll
have to do something like this:

~/backup_list

# backup_list
.Xdefaults
.kshrc
.nexrc
.profile
.calendar/
.config/feh/
.config/fontconfig/
.config/gtk-3.0/gtk.css
Documents/
Pictures/
[...]
---

files=$(egrep -v "^$|^#" ~/backup_list)

for i in $files ; do
rsync -av --delete --mkpath $HOME/$i $device/$user/$i
done


But openrsync doesn't have a '--mkpath' option, I let Andreas to think
the solution. :-)


>
> That said, yes, minimising the extent to which certain non-'word' 
> characters (i.e. roughly the POSIX 'alnum' class as described in 
> re_format(7)) _can_ make it easier to programatically do certain 
> tasks which are restricted by the long and messy history of C and 
> Unix development. Given that i've been using computers for a few 
> decades, i still instinctively don't use spaces in filenames, even 
> though they're very much allowed. But of course, that's not what 
> most of the world does, and this is an example of trying to work 
> out what the best tradeoffs might be when dealing with the 
> messiness of the real world.

I overlooked this in my example because I *never* use spaces, UTF-8 or
any special characters to name my file names.  Lately, I finally
persuaded my wife to use Linux, after decades of having to use Windows.
Even when I educated her in this matter she has clients who send her
files named with any kind of crap, so taking care of this issue is still
convenient.


>
>
> Alexis.
>
>
>

-- 
Walter



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Andreas Kähäri
On Sun, May 12, 2024 at 07:31:41PM +1000, Alexis wrote:
> Страхиња Радић  writes:
> 
> > When `while ... read ...` idiom is used, it is advisable to clear IFS to
> > turn off field splitting
> 
> *nod* Fair point; it's not set by default, so i didn't think to note that
> any manual setting of it should be overridden for this.

The ksh(1) shell sets IFS by default to a space, tab and a newline
character.

> 
> > and use -r to avoid interpretation of backslash sequences in the input:
> 
> i wondered about that in this context. If people putting odd / inappropriate
> things in directory names are a concern ("weird characters", as you wrote
> upthread), what do we do about the possibility of someone having consciously
> put e.g. a \t in a directory name because they were assuming that it _would_
> get interpreted when required?
> 
> 
> Alexis.


Well, that's one way to control this trainwreck of a script; just say
that any name containing "inappropriate" characters aren't allowed!

May I ask why you don't simply use rsync(1) (or even openrsync(1) from
the OpenBSD base system)?



-- 
Andreas (Kusalananda) Kähäri
Uppsala, Sweden

.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 11:40:05 2024 tux2bsd wrote
> Hi Walter
>
> mktemp makes temporary unique filenames like this:
>
> delete_list=$(mktemp)
> source_list=$(mktemp) 
> target_list=$(mktemp) 
> # Do your code. If you want to keep something you do
> # that appropriately then:
> rm $delete_list $source_list $target_list
>
>

This version can deal with files with special characters and spaces:

# Remove files from target directory
delete_list=$(mktemp -t delete.XX) || exit 1
source_list=$(mktemp -t source.XX) || exit 1
target_list=$(mktemp -t target.XX) || exit 1

dirs=$(echo "$files" | grep '/$')

cd && find $dirs | sort | uniq > $source_list
cd "$target" && find $dirs | sort | uniq > $target_list
diff $source_list $target_list |
grep '^> ' | sed 's#^> #'$target'/#' > $delete_list

cd &&
while read line; do
echo "delete $line"
rm "$line"
done < $delete_list

# Clean
rm $source_list $target_list $delete_list



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis

Andreas Kähäri  writes:

Well, that's one way to control this trainwreck of a script; 
just say
that any name containing "inappropriate" characters aren't 
allowed!


May I ask why you don't simply use rsync(1) (or even 
openrsync(1) from

the OpenBSD base system)?


i'm not sure why you're addressing this to me, as i'm not the OP.

That said, yes, minimising the extent to which certain non-'word' 
characters (i.e. roughly the POSIX 'alnum' class as described in 
re_format(7)) _can_ make it easier to programatically do certain 
tasks which are restricted by the long and messy history of C and 
Unix development. Given that i've been using computers for a few 
decades, i still instinctively don't use spaces in filenames, even 
though they're very much allowed. But of course, that's not what 
most of the world does, and this is an example of trying to work 
out what the best tradeoffs might be when dealing with the 
messiness of the real world.



Alexis.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis

Andreas Kähäri  writes:

The ksh(1) shell sets IFS by default to a space, tab and a 
newline

character.


Those are the defaults used when IFS is not set _as a 
variable_. If you log in, and run env(1), in the absence of any 
manual setting of IFS in .kshrc or whatever, you'll see that IFS 
is not listed, because it's not 'set' in the shell variable 
sense. When it's not set, the shell assumes that IFS has the value 
you listed.


(Additionally, a shell variable not being set is _not_ the same as 
that variable being set to the empty string.)



Alexis.



Re: https://twitter.com/openbsd

2024-05-12 Thread Rubén Llorente

Stuart Longland wrote:
It's also dead because how how things are being run there.  It's a site 
for misinformation.  "OpenBSD 7.5 is released" isn't misinformation, 
it's fact, so has no place on twitter.com or x.com.  It's also news 
about an open-source free-software project, something that also is 
off-topic for twitter.com and x.com.


Traditional social media has been on the decline since 2015, and it has 
nothing to do with the reliability of the content it hosts. I would 
argue TV stations and newspapers generate a comparable amount of garbage 
and nobody complains.


The main issue is that it is getting harder to reach people from social 
media, which is the main goal of corporate and commercial users of 
social media. So called "organic growth" (ie. passively building an 
audience just because they find you on social media) has been descending 
since 2015. The main issue seems to be that mainstream social media 
generates so much stuff for people to read that the probability of 
people finding you instead of finding yet another silly video has 
decreased significantly.


I think it is worth mentioning I know of a number of small operations 
that have announced their complete withdrawal from social media - 
Twitter, Facebook, Instagram, the Fediverse - because the benefit they 
get from social media presence is not worth the labor time required to 
sustain social media presence.


That said, when those operations ceased social media activity, they took 
care of making it widely known among their audience rather than just let 
their social media accounts rot...




Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis

Страхиња Радић  writes:

When `while ... read ...` idiom is used, it is advisable to 
clear IFS 
to turn off field splitting


*nod* Fair point; it's not set by default, so i didn't think to 
note that any manual setting of it should be overridden for this.


and use -r to avoid interpretation of backslash sequences in the 
input:


i wondered about that in this context. If people putting odd / 
inappropriate things in directory names are a concern ("weird 
characters", as you wrote upthread), what do we do about the 
possibility of someone having consciously put e.g. a \t in a 
directory name because they were assuming that it _would_ get 
interpreted when required?



Alexis.



Re: Favorite configuration and system replication tools?

2024-05-12 Thread tux2bsd
> What about the following, better?
> 
> -
> # Remove files from target directory
> date=$(date +%H%M%S)
> delete_list=/tmp/delete_$date
> source_list=/tmp/source_$date
> target_list=/tmp/target_$date

Hi Walter

mktemp makes temporary unique filenames like this:

delete_list=$(mktemp)
source_list=$(mktemp) 
target_list=$(mktemp) 
# Do your code. If you want to keep something you do
# that appropriately then:
rm $delete_list $source_list $target_list

tux2bsd



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Страхиња Радић
Дана 24/05/12 06:17PM, Alexis написа:
> To deal with spaces etc., one could possibly use something along the lines
> of the following kludge; it assumes that \n is relatively unlikely to be
> found in a directory name, and that the directories in $dirs can be
> separated by \n.
> 
>  cd "$target" &&
>echo "$(echo $dirs | while read dir
>do
>  find $dir
>done)\n" | sort | uniq > "$target_list"

When `while ... read ...` idiom is used, it is advisable to clear IFS 
to turn off field splitting, and use -r to avoid interpretation of 
backslash sequences in the input:

while IFS= read -r dir; do # ...

Back to parsing the output of ls(1) (also applicable to parsing the 
output of find(1), or globs), there is an indepth analysis of the 
problem at [1]. The accepted answer concludes that perhaps shell 
command language is not the right tool for the job, and a more 
sophisticated language should be used instead. While I don't agree with 
the author's choice of Python, any language supporting opendir(3), 
readdir(3) or equivalent functions will suffice.

[1]: 
https://unix.stackexchange.com/questions/128985/why-not-parse-ls-and-what-to-do-instead



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 10:07:30 2024 Страхиња Радић wrote:
> A few notes:
> 
> - You don't need a backslash after a pipe (|) or a list operator (||
>   and &&) - a line ending with a pipe is an incomplete pipeline. So 
>   (with added quoting):
> 
>   diff "$source_list" "$target_list" |
>   awk '/^> / { print "'"$target"'/" $NF }' > "$delete_list"

I know, just fingers habit. :-)

>
>   As an example for a list operator, the second line beginning with cd
>   could also be written as:
> 
>   cd "$target" &&
>   find "$dirs" | sort | uniq > "$target_list"
> 
>   This works even when entering commands interactively from the command 
>   line.
> 
> - Before the `rm -rf` line, a useless use of cat[1]:
> 
>   sed 's/^/delete /' "$delete_list"
> 
> - The xargs is unnecessary in `rm -rf $(cat $delete_list | xargs)`; 
>   BTW, that line is vulnerable to weird pathnames (for example, 
>   those including spaces, line feeds and special characters).
> 

What about the following, better?

-
# Remove files from target directory
date=$(date +%H%M%S)
delete_list=/tmp/delete_$date
source_list=/tmp/source_$date
target_list=/tmp/target_$date

dirs=$(echo "$files" | grep '/$')

cd && find $dirs | sort | uniq > $source_list
cd "$target" && find $dirs | sort | uniq > $target_list
diff $source_list $target_list |
 awk '/^> / { print "'$target'/" $NF }' > $delete_list

cd &&
if [ -s $delete_list ]; then
echo "Deleting on ${target}:"
rm -vrf $(cat $delete_list)
fi

# Clean
rm $source_list $target_list $delete_list
-


Thanks for your recomendations!


-- 
Walter



Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis

Страхиња Радић  writes:

Lapsus: the variable dirs should not be quoted here if it 
contains more 
than one directory to be passed to find. It is vulnerable to 
directory 
names containing spaces and weird characters, however.


So:

   cd "$target" &&
find $dirs | sort | uniq > "$target_list"


To deal with spaces etc., one could possibly use something along 
the lines of the following kludge; it assumes that \n is 
relatively unlikely to be found in a directory name, and that the 
directories in $dirs can be separated by \n.


 cd "$target" &&
   echo "$(echo $dirs | while read dir
   do
 find $dir
   done)\n" | sort | uniq > "$target_list"


Alexis.



gmake compile of python3.12 crashes on openBSD 7.5 but not on openBSD 7.4

2024-05-11 Thread Sandeep Gupta
I was able to compile Python 3.12 from source code on openBSD 7.4. However,
after upgrade to 7.5 the compile process crashes with core dump:

cc -pthread   -g  -Wl,--export-dynamic -o Programs/_testembed
Programs/_testembed.o -L. -lpython3.12 -lpthread  -lutil
 -lm
_testembed.c:1848
(./Programs/_testembed.c:1848)(Programs/_testembed.o:(test_init_use_frozen_modules)):
warning: wcscpy() is almost always misused, please use wcslcpy()
sed -e "s,/usr/bin/env
python3,/home/kabiraatmonallabs/Execution/Runtime/bin/python3.12," <
./Tools/scripts/2to3 > build/scripts-3.12/2to3-3.12
sed -e "s,/usr/bin/env
python3,/home/kabiraatmonallabs/Execution/Runtime/bin/python3.12," <
./Tools/scripts/idle3 > build/scripts-3.12/idle3.12
sed -e "s,/usr/bin/env
python3,/home/kabiraatmonallabs/Execution/Runtime/bin/python3.12," <
./Tools/scripts/pydoc3 > build/scripts-3.12/pydoc3.12
Illegal instruction (core dumped)
gmake[2]: *** [Makefile:1142: checksharedmods] Error 132
gmake[2]: Leaving directory
'/home/kabiraatmonallabs/Execution/Runtime/Python-3.12.2'
gmake[1]: *** [Makefile:793: profile-gen-stamp] Error 2
gmake[1]: Leaving directory
'/home/kabiraatmonallabs/Execution/Runtime/Python-3.12.2'
gmake: *** [Makefile:805: profile-run-stamp] Error 2

  I am unable to find a proper debugger into which to load the python.core
generated after core dump, so can't provide any useful debug info.
I don't think this is due to some changes in Python code that is creating
the core dump. Any ideas would be helpful.

Thanks
Sandeep


Re: https://twitter.com/openbsd

2024-05-11 Thread tux2bsd
Stuart L, your rant is unhinged.

> The OpenBSD team owe us (you included), nothing.

No shit.

I only asked, in my own way, why there was an inconsistency in release posts on 
Twitter.  They've been somewhat regular.

By blocking me the little tyrant T.J. Townsend demonstrated just how trivially 
a release post could have been made.  It takes just a tiny little bit less 
effort to make a post on that platform.  He said "we" at one point to deflect 
from the fact he didn't want to, I just don't understand why.

"Ah, one of us forgot & it's a bit late now" would have been a normal person's 
response, not immediately *I blocked you*.

tux2bsd



Re: https://twitter.com/openbsd

2024-05-11 Thread Stuart Longland

On 12/5/24 10:02, tux2bsd wrote:

The rest of what you blathered about is in your head, I only ever
mentioned the lack of an (singular) announcement via Twitter.


You want announcements on Twitter, you make it happen.

As it happens, Twitter is DEAD.  Ask that idiot @elonmusk -- he'll 
confirm it for you.  He calls it 핏.  The domain remains "twitter.com" 
because they've likely hard-coded it into too many places to make a 
feasible switch-over to "x.com" possible.


It's also dead because how how things are being run there.  It's a site 
for misinformation.  "OpenBSD 7.5 is released" isn't misinformation, 
it's fact, so has no place on twitter.com or x.com.  It's also news 
about an open-source free-software project, something that also is 
off-topic for twitter.com and x.com.


But, that's beside the point.  There's an API there… it's not rocket 
science to write a script that takes an email from `stdin`, scrapes the 
subject line and a hyperlink, then slaps that into a HTTP POST request… 
then configure your mail server to call it on receipt of an email.


I for one, am thankful they provide this project at all.  OpenBSD and 
its spin-off projects like OpenSSH… have made the Internet a better 
place.  The OpenBSD team owe us (you included), nothing.


They already give plenty.  And I've given this thread enough attention.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.



Re: Kernel debugging

2024-05-11 Thread Alexis

Daniel Hejduk  writes:

Is there any way to build the kernel on Linux preferably Arch 
Linux?


In a VM, sure. Otherwise, no. Here's a comment from a thread about 
this topic, from a couple of years ago:


 https://www.reddit.com/r/openbsd/comments/r6wj3c/comment/hmwhk4a/


Alexis.



Re: https://twitter.com/openbsd

2024-05-11 Thread tux2bsd
On Sunday, May 12th, 2024 at 12:34 PM, Chris Petrik  wrote:

> Still amusing regardless

Thanks for the inspiration.  I made the following they-speak so that it's in 
the left's lobotomy language.

One wonders why T.J. Townsend doesn't simply sell OpenBSD's Twitter credentials 
to some porn site, make they's $458.12 then they not need to bother their they 
with Twitter ever again.

T.J. Townsend won't close OpenBSD's Twitter account because their they needs it 
for their they's ego.  "I manage OpenBSD's Twitter!!" they boasts as they plays 
the children's game Minecraft.  Triumphantly they regales "I blocked tux2bsd 
based on a single email which made this they felt personally attacked.  This 
they sure showed tux2bsd!!!".

Meanwhile, Stuart Longland is lost somewhere in at the commune looking for 
they's bourgeoisie reading glasses.

tux2bsd



Re: https://twitter.com/openbsd

2024-05-11 Thread Chris Petrik
Yeap a reason why ML suck 

Sent from Proton Mail Android


 Original Message 
On 5/11/24 7:02 PM, tux2bsd  wrote:

>  On Sunday, May 12th, 2024 at 11:25 AM, Stuart Longland
>  > since you seem to want evidence that it was announced…
>  
>  Learn to read:
>  
>  > No post about the 7.5 release on https://twitter.com/openbsd
>  
>  The rest of what you blathered about is in your head, I only ever mentioned 
> the lack of an (singular) announcement via Twitter.  At no point in time did 
> I suggest it was not announced via standard channels.
>  
>  You and T.J. Townsend have a personal issue with Twitter, so much so that 
> the pair of you are being irrational.
>  
>  tux2bsd
>  
>



Re: https://twitter.com/openbsd

2024-05-11 Thread tux2bsd
On Sunday, May 12th, 2024 at 11:25 AM, Stuart Longland 
> since you seem to want evidence that it was announced…

Learn to read:

> No post about the 7.5 release on https://twitter.com/openbsd

The rest of what you blathered about is in your head, I only ever mentioned the 
lack of an (singular) announcement via Twitter.  At no point in time did I 
suggest it was not announced via standard channels.

You and T.J. Townsend have a personal issue with Twitter, so much so that the 
pair of you are being irrational.

tux2bsd



Re: https://twitter.com/openbsd

2024-05-11 Thread tux2bsd
On Sunday, May 12th, 2024 at 11:04 AM, T.J. Townsend  wrote:

> On Sat, May 11, 2024 at 10:26:49PM +, tux2bsd wrote:
> 
> > Seemed strange, if deliberate then exceptionally petty.

> Wasting everyone's time by complaining on a mailing list that
> we didn't post a tweet seems a little petty too. Anyway I just
> blocked you from the OpenBSD account, so that should make life
> easier for everyone going forward.

I checked, you did too.  Taking that action only feeds your own ego T.J. 
Townsend.

I said it "Seemed strange,".  The rest of the sentence was if it was 
deliberate, which it must have been since you felt the need to overreact.

You also showed how trivial it would have been for a post like "OpenBSD 7.5 
released" to have been made but one can only conclude you didn't want to.  
Bizarre.

tux2bsd



Re: https://twitter.com/openbsd

2024-05-11 Thread Stuart Longland

On 12/5/24 09:12, tux2bsd wrote:

On 12/5/24 08:26, tux2bsd wrote:

No post about the 7.5 release on https://twitter.com/openbsd

Seemed strange, if deliberate then exceptionally petty.




Twitter is dead.


You forgot CC.  Here, I'll add Reply-To so you don't get confused next time.


That's your leftism talking, not reality.


No, it's reality.  It was irrelevant before, it's irrelevant and dead 
now.  Much of the infosec community have jumped ship, and these days, 
sites like https://infosec.exchange/ pretty much have surpassed the need 
for Twitter.


As for the announcement, since you seem to want evidence that it was 
announced…


https://marc.info/?l=openbsd-announce=171228270018970=2

If you want announcements on your ${SOCIAL_MEDIA_SITE}, subscribe an 
email client, write a script to publish it to said site.  There's no 
need for people here to help you flog a dead horse.

--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.



Re: https://twitter.com/openbsd

2024-05-11 Thread tux2bsd
> On 12/5/24 08:26, tux2bsd wrote:
> > No post about the 7.5 release on https://twitter.com/openbsd
> > 
> > Seemed strange, if deliberate then exceptionally petty.
> > 

> Twitter is dead.

That's your leftism talking, not reality.




Re: https://twitter.com/openbsd

2024-05-11 Thread T.J. Townsend
On Sat, May 11, 2024 at 10:26:49PM +, tux2bsd wrote:
> I'm a bit late remembering to follow this up.
> 
> No post about the 7.5 release on https://twitter.com/openbsd
> 
> Seemed strange, if deliberate then exceptionally petty.
> 
> IIRC I saw it on OSNews on the day.

Wasting everyone's time by complaining on a mailing list that
we didn't post a tweet seems a little petty too. Anyway I just
blocked you from the OpenBSD account, so that should make life
easier for everyone going forward.



Re: https://twitter.com/openbsd

2024-05-11 Thread Stuart Longland

On 12/5/24 08:26, tux2bsd wrote:


I'm a bit late remembering to follow this up.

No post about the 7.5 release on https://twitter.com/openbsd

Seemed strange, if deliberate then exceptionally petty.

IIRC I saw it on OSNews on the day.



Twitter is dead.

OpenBSD has a website you can check, and an announcements list you can 
subscribe to if you're too busy to check the website.


While there's possibly some benefit in having a presence on the 
fediverse, I think the era of commercialised social media would be a 
good one to leave behind.

--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.



https://twitter.com/openbsd

2024-05-11 Thread tux2bsd


I'm a bit late remembering to follow this up.

No post about the 7.5 release on https://twitter.com/openbsd

Seemed strange, if deliberate then exceptionally petty.

IIRC I saw it on OSNews on the day.



Re: Kernel debugging

2024-05-11 Thread Kirill A . Korinsky
On Sat, 11 May 2024 21:49:42 +0100,
Daniel Hejduk  wrote:
> 
> Is there any way to build the kernel on Linux preferably Arch Linux?
>

It is theoretically possible, but you need to change Makefiles a lot, and
probably to hack your toolchain.

-- 
wbr, Kirill



Re: Favorite configuration and system replication tools?

2024-05-11 Thread Страхиња Радић
Дана 24/05/11 10:36PM, Страхиња Радић написа:
>   cd "$target" &&
>   find "$dirs" | sort | uniq > "$target_list"

Lapsus: the variable dirs should not be quoted here if it contains more 
than one directory to be passed to find. It is vulnerable to directory 
names containing spaces and weird characters, however.

So:

   cd "$target" &&
find $dirs | sort | uniq > "$target_list"



Re: Kernel debugging

2024-05-11 Thread Daniel Hejduk
Hello again,
Is there any way to build the kernel on Linux preferably Arch Linux?

Best regards,
Daniel Hejduk

11. května 2024 22:05:50 SELČ, "Kirill A. Korinsky"  napsal:
>On Sat, 11 May 2024 20:28:08 +0100,
>Daniel Hejduk  wrote:
>> 
>> I want to enable kernel debugging how can I do it?
>> 
>
>See: https://man.openbsd.org/options
>
>-- 
>wbr, Kirill
>


Re: Favorite configuration and system replication tools?

2024-05-11 Thread Страхиња Радић
Дана 24/05/11 07:41PM, Walter Alejandro Iglesias написа:
> Today I realized that the loop above is not necesary:
> 
> ---
> dirs=$(echo "$files" | grep '/$')
> 
> cd && find $dirs | sort | uniq > $source_list
> cd $target && find $dirs | sort | uniq > $target_list
> diff $source_list $target_list |\
>awk '/^> / { print "'$target'/" $NF }' > $delete_list
> 
> cat $delete_list | sed 's/^/delete /'
> rm -rf $(cat $delete_list | xargs)
> 
> # Clean
> rm $source_list $target_list $delete_list
> 

A few notes:

- You don't need a backslash after a pipe (|) or a list operator (||
  and &&) - a line ending with a pipe is an incomplete pipeline. So 
  (with added quoting):

  diff "$source_list" "$target_list" |
awk '/^> / { print "'"$target"'/" $NF }' > "$delete_list"

  As an example for a list operator, the second line beginning with cd
  could also be written as:

  cd "$target" &&
find "$dirs" | sort | uniq > "$target_list"

  This works even when entering commands interactively from the command 
  line.

- Before the `rm -rf` line, a useless use of cat[1]:

  sed 's/^/delete /' "$delete_list"

- The xargs is unnecessary in `rm -rf $(cat $delete_list | xargs)`; 
  BTW, that line is vulnerable to weird pathnames (for example, 
  those including spaces, line feeds and special characters).


[1]: https://porkmail.org/era/unix/award



Re: Kernel debugging

2024-05-11 Thread Vitaliy Makkoveev
> On 11 May 2024, at 22:28, Daniel Hejduk  wrote:
> 
> Hello,
> I want to enable kernel debugging how can I do it?
> 

See ddb(4) man page.

> Best regards,
> Daniel Hejduk



Re: Kernel debugging

2024-05-11 Thread Kirill A . Korinsky
On Sat, 11 May 2024 20:28:08 +0100,
Daniel Hejduk  wrote:
> 
> I want to enable kernel debugging how can I do it?
> 

See: https://man.openbsd.org/options

-- 
wbr, Kirill



Kernel debugging

2024-05-11 Thread Daniel Hejduk
Hello,
I want to enable kernel debugging how can I do it?

Best regards,
Daniel Hejduk

Re: Favorite configuration and system replication tools?

2024-05-11 Thread Walter Alejandro Iglesias
On Sat May 11 20:20:04 2024 "Robert B. Carleton" wrote:
> Another tool you might want to take a look at is rdist(1). It's limited
> in some ways, but is a native capability to OpenBSD. It has a long
> history.
>

I've never used rdist(1) either, I will learn about it.  Thanks Robert
for mention it to me!

With unix I always feel like I'm just starting out, blissfully ignorant,
(I was about to also say "young" but that would be an exaggeration :-)).



Re: Favorite configuration and system replication tools?

2024-05-11 Thread Robert B. Carleton
Walter Alejandro Iglesias  writes:

> On Fri May 10 08:36:50 2024 Walter Alejandro Iglesias wrote
>> Then I do something like this (simplified for clartiy):
>>
>> [...]
>>
>> dirs=$(echo "$files" | grep '/$')
>>
>> for i in $dirs ; do
>>  find $source/$i | sed 's#'$source'##' | sort | uniq > $source_list
>>  find $target/$i | sed 's#'$target'##' | sort | uniq > $target_list
>>  diff $source_list $target_list |\
>>   awk '/^> / { print "'$target'" $NF }' >> $delete_list
>> done
>>
>> cat $delete_list | sed 's/^/delete /'
>> rm -rf $(cat $delete_list | xargs)
>>
>> rm $source_list $target_list $delete_list
>> 
>>
>
>
> Today I realized that the loop above is not necesary:
>
> ---
> dirs=$(echo "$files" | grep '/$')
>
> cd && find $dirs | sort | uniq > $source_list
> cd $target && find $dirs | sort | uniq > $target_list
> diff $source_list $target_list |\
>awk '/^> / { print "'$target'/" $NF }' > $delete_list
>
> cat $delete_list | sed 's/^/delete /'
> rm -rf $(cat $delete_list | xargs)
>
> # Clean
> rm $source_list $target_list $delete_list
> 

Another tool you might want to take a look at is rdist(1). It's limited
in some ways, but is a native capability to OpenBSD. It has a long
history.



Re: Localnet Hacking

2024-05-11 Thread Peter J. Philipp
On Sat, May 11, 2024 at 05:55:11PM +, Lucretia wrote:
> I would love some used books but don't have 1000???. I will have $750 around 
> beginning of June if you want to send me a Paypal invoice to my Apple email: 
> openbsd.g...@icloud.com I was going to buy my second laptop but books are 
> probably better for me at this point in time.
> 
> Your other message was crammed full of info, I don't know most of what you 
> said but I'll try to spend time in the mentioned manpages this week.

Hi Lucretia,

Sorry there is a communication failure.  I meant you should pick three books
for 20 EUR shipping or whatever it was for your country.  I'll have to look it
up.  I'm distributing it to anyone interested, first come first serve.  With
a limit of up to 3 (sometimes an exception for a 4th book is made) per person.

Best Regards,
-pjp



Re: Localnet Hacking

2024-05-11 Thread Lucretia
I would love some used books but don't have 1000€. I will have $750 around 
beginning of June if you want to send me a Paypal invoice to my Apple email: 
openbsd.g...@icloud.com I was going to buy my second laptop but books are 
probably better for me at this point in time.

Your other message was crammed full of info, I don't know most of what you said 
but I'll try to spend time in the mentioned manpages this week.

Lux of the Agony
720077 Bishkek
Altyn Kazyk 31A
KYRGYZSTAN
l...@openbsdgirl.com


 Original Message 
On 5/11/24 12:45, Peter J. Philipp  wrote:

>  On Sat, May 11, 2024 at 02:52:32AM +, Lucretia wrote:
>  > Book recommendations are most welcome!
>  >
>  > Lux of the Agony
>  > 720077 Bishkek
>  > Altyn Kazyk 31A
>  > KYRGYZSTAN
>  > l...@openbsdgirl.com
>  
>  If you want some used books, I'm moving across the Atlantic soon and I can't
>  take my books along.  In total the new value of them was 8000 odd EUR.  If
>  I send three books to kyrgystan and it's under 2 kg, I checked with DHL
>  it will cost under 20 EUR.  If I send all these books out in batches of three
>  it will cost 1000 odd EUR, which I don't have.  So I ask you pay shipping if
>  you want any of these.  They are all dear to me, however I tried donating 
> them
>  to local clubs, libraries and noone wants them, and I can't take them along.
>  
>  Even if you don't like what you're getting (or you don't like used books.. I
>  know I don't) you can pass them on to someone who doesn't mind.  However you
>  can also just request three books, in order to look into them and if you like
>  them you can repurchase them.  I know in some locations it's very hard to get
>  a peek into a book.
>  
>  So willing to end out 53-54 batches of 3 books to people who want some of
>  these.  Very little of these I got used but they are all mostly 5 years+
>  old.  Some were purchased in Canada and most were purchased in Germany while
>  I had work.
>  
>  Here is the booklist:  https://mainrechner.de/Buecher2024/
>  
>  Contact me privately if you would like a batch with what you like.  I'll
>  make note on that webpage of what's given away.  Offer ends July 1st of this
>  year.
>  
>  Best Regards,
>  -pjp
>  
>  --
>  ** all info about me:  lynx https://callpeter.tel, dig loc delphinusdns.org 
> **
>  
>



Re: Favorite configuration and system replication tools?

2024-05-11 Thread Walter Alejandro Iglesias
On Fri May 10 08:36:50 2024 Walter Alejandro Iglesias wrote
> Then I do something like this (simplified for clartiy):
>
> [...]
>
> dirs=$(echo "$files" | grep '/$')
>
> for i in $dirs ; do
>   find $source/$i | sed 's#'$source'##' | sort | uniq > $source_list
>   find $target/$i | sed 's#'$target'##' | sort | uniq > $target_list
>   diff $source_list $target_list |\
>awk '/^> / { print "'$target'" $NF }' >> $delete_list
> done
>
> cat $delete_list | sed 's/^/delete /'
> rm -rf $(cat $delete_list | xargs)
>
> rm $source_list $target_list $delete_list
> 
>


Today I realized that the loop above is not necesary:

---
dirs=$(echo "$files" | grep '/$')

cd && find $dirs | sort | uniq > $source_list
cd $target && find $dirs | sort | uniq > $target_list
diff $source_list $target_list |\
 awk '/^> / { print "'$target'/" $NF }' > $delete_list

cat $delete_list | sed 's/^/delete /'
rm -rf $(cat $delete_list | xargs)

# Clean
rm $source_list $target_list $delete_list




7.5 stable wsmoused question

2024-05-11 Thread mindfsck
Hello,

I am trying to narrow down an issue (and learn along the way) with
wsmoused. The issue is:
- X (wsfb) is running with xfce4 and xenodm, the mouse works fine in X.
- I go to a console and execute wsmoused (as root) with no parameters, so
as per sources, /dev/wsmouse is opened.
- I have a working mouse cursor now on the console.
- Going back to X (ctrl-alt-F5)
- Here the mouse seems to still be in console mode, the framebuffer is
getting riddled when moving the mouse and the black background of the
console comes to light.

Ok, this is the issue, but more importantly is my question :-)

I tried the following:
1) wrote a C program that opens /dev/wsmouse and checks perror output.
2) running this as root on the console works (no error).
3) running this as root inside X gives me a "device busy".

I am puzzled re. (3)! How does it know that I'm in X?


Re: Localnet Hacking

2024-05-11 Thread Peter J. Philipp
On Sat, May 11, 2024 at 08:45:45AM +0200, Peter J. Philipp wrote:
> If you want some used books, I'm moving across the Atlantic soon and I can't
> take my books along.  In total the new value of them was 8000 odd EUR.  If
> I send three books to kyrgystan and it's under 2 kg, I checked with DHL
> it will cost under 20 EUR.  If I send all these books out in batches of three
> it will cost 1000 odd EUR, which I don't have.  So I ask you pay shipping if
> you want any of these.  They are all dear to me, however I tried donating them
> to local clubs, libraries and noone wants them, and I can't take them along.
> 
> Even if you don't like what you're getting (or you don't like used books.. I
> know I don't) you can pass them on to someone who doesn't mind.  However you
> can also just request three books, in order to look into them and if you like
> them you can repurchase them.  I know in some locations it's very hard to get
> a peek into a book.
> 
> So willing to end out 53-54 batches of 3 books to people who want some of
> these.  Very little of these I got used but they are all mostly 5 years+
> old.  Some were purchased in Canada and most were purchased in Germany while
> I had work.
> 
> Here is the booklist:  https://mainrechner.de/Buecher2024/
> 
> Contact me privately if you would like a batch with what you like.  I'll
> make note on that webpage of what's given away.  Offer ends July 1st of this
> year.

Wow, thanks for the 4 people who got some books already!  They come from all
over the world, Australia, Germany, Finland, and United States.

Just to clarify, anyone can get around 3 books.  Look at the book chart of
mine if you see a country flag beside the title it's taken.  I thank you
all for taking this off my hands (like said I can't take them along on the
plane, they don't fit in a suitcase).

I'm happy to be mailing out a batch of 10 parcels per week give or take a few.
More I can probably not handle before July 1st.

Lux, get a book or three, sorry to be hijacking your thread here, I mean well.

-pjp

-- 
** all info about me:  lynx https://callpeter.tel, dig loc delphinusdns.org **



Re: Localnet Hacking

2024-05-11 Thread Kirill A . Korinsky
On Sat, 11 May 2024 03:52:32 +0100,
Lucretia  wrote:
> 
> I have a laptop and am looking to purchase a second computer. Neither of them 
> will be connected to The Internet, but will be networked together.
> 
> My goal is to study networking, starting with some of the most basic commands 
> and routines. This will be purely for educational purposes. I may build upon 
> the network later, perhaps with unconventional devices, but for now I want to 
> focus just on having two Amd64 machines communicating with one another.
>

I wonder why to buy any physical devices if you may run virtual machines?

-- 
wbr, Kirill



Re: Localnet Hacking

2024-05-11 Thread Peter J. Philipp
On Sat, May 11, 2024 at 08:45:45AM +0200, Peter J. Philipp wrote:
> Contact me privately if you would like a batch with what you like.  I'll
> make note on that webpage of what's given away.  Offer ends July 1st of this
> year.

Three books have already been given away.  They went to Finland.  Look for
a marking of a flag beside the name of the title of the book.

Also if I may interest some people:  The Java book is autographed by Ian F.
Darwin who is also on this list.  Also the 4.4BSD book which is quite beaten
up was autographed by 3 of the 4 authors at BSDCon 2000.  They were everyone
other than John Quarterman.  Maybe I'll run into him one day but then I'll
be missing 3 signatures hehe.

-pjp

-- 
** all info about me:  lynx https://callpeter.tel, dig loc delphinusdns.org **



Re: Localnet Hacking

2024-05-11 Thread zeloff
Familiarise yourself with IPv4: addreses, network segments, netmasks, and 
private IP ranges. Even a careful reading of wikipedia might be enough to get 
you started. By the end you shouls have a basic understanding of how packets 
are routed. You won't be building a router, so no need for complex stuff, that 
will come later. Then the OS itself: ifconfig and (some of) route will help. 
Read their man pages (at least the parts about inet (aka IPv4) for ifconfig and 
how 'get' and 'show' work on route. By then you'll be able to assign an address 
to each host, and have them communicating with each other.ping will help you to 
check if things are flowing, tcpdump might help to see if and why things are 
/not/ flowing.By now you got to where you wanted, but my next step would be 
going deeper into routing, handling hosts with multiple interfaces,  and 
subnets. Then perhaps NAT, and redirecting and for that you need pf.  Peter 
Hansteen's "The Book of PF" might help you there, but there's also the PF parts 
of OpenBSD's FAQ, and several other places online.Take it one step at a time, 
and let your curiosity lead you.Cheers-- Sent from my phone, apologies for bad 
formatting
 Original message From: Lucretia  Date: 
11/05/2024  03:53  (GMT+00:00) To: misc@openbsd.org Subject: Localnet Hacking I 
have a laptop and am looking to purchase a second computer. Neither of them 
will be connected to The Internet, but will be networked together.My goal is to 
study networking, starting with some of the most basic commands and routines. 
This will be purely for educational purposes. I may build upon the network 
later, perhaps with unconventional devices, but for now I want to focus just on 
having two Amd64 machines communicating with one another.What are some basic 
networking commands from the base installation or from ports that would be good 
for a novice to learn more in-depth?I have no plans to connect this system to 
The Internet now or in the future, so keep that in mind when suggesting.Book 
recommendations are most welcome!Lux of the Agony720077 BishkekAltyn Kazyk 
31akyrgyzstan...@openbsdgirl.com

Re: Localnet Hacking

2024-05-11 Thread Peter J. Philipp
On Sat, May 11, 2024 at 02:52:32AM +, Lucretia wrote:
> Book recommendations are most welcome!
> 
> Lux of the Agony
> 720077 Bishkek
> Altyn Kazyk 31A
> KYRGYZSTAN
> l...@openbsdgirl.com

If you want some used books, I'm moving across the Atlantic soon and I can't
take my books along.  In total the new value of them was 8000 odd EUR.  If
I send three books to kyrgystan and it's under 2 kg, I checked with DHL
it will cost under 20 EUR.  If I send all these books out in batches of three
it will cost 1000 odd EUR, which I don't have.  So I ask you pay shipping if
you want any of these.  They are all dear to me, however I tried donating them
to local clubs, libraries and noone wants them, and I can't take them along.

Even if you don't like what you're getting (or you don't like used books.. I
know I don't) you can pass them on to someone who doesn't mind.  However you
can also just request three books, in order to look into them and if you like
them you can repurchase them.  I know in some locations it's very hard to get
a peek into a book.

So willing to end out 53-54 batches of 3 books to people who want some of
these.  Very little of these I got used but they are all mostly 5 years+
old.  Some were purchased in Canada and most were purchased in Germany while
I had work.

Here is the booklist:  https://mainrechner.de/Buecher2024/

Contact me privately if you would like a batch with what you like.  I'll
make note on that webpage of what's given away.  Offer ends July 1st of this
year.

Best Regards,
-pjp

-- 
** all info about me:  lynx https://callpeter.tel, dig loc delphinusdns.org **



Re: My PC is crashing

2024-05-10 Thread Jadi
I suspect a bad IMG/ISO file. Have you checked its hash? or I suggest a
redownload, rewrite / check and new install.
Jadi

On Sat, May 11, 2024 at 1:04 AM Daniel Hejduk 
wrote:

> Hello again,
> I tried memtest and it passed :D
> But after some trying to debug it I found something the sudden shutdown
> corrupts disk.
> One particular file "/share/relink/kernel/GENERIC.MP/gap.o" was always
> corrupted.
> So it happens when kernel is relinking.
>
> How you told me I tried using i386 but it didn't boot by flashing it on
> USB nor using Ventoy.
> Ventoy will always prompt me "Maybe the image does not support X64 UEFI",
> so I tried enabling legacy but again nothing.
> Is there way to boot i386, or fix the relinking error?
>
> Thank you for helping me on my journey.
>
> Best regards,
> Daniel Hejduk
>
>
> 10. května 2024 9:33:59 SELČ, Stuart Henderson 
> napsal:
>
>> On 2024-05-10, Peter N. M. Hansteen  wrote:
>>
>>> On Fri, May 10, 2024 at 08:48:56AM +0200, Anders Andersson wrote:
>>>
 Missing from the FAQ is IMO step 0: Run memtest over night to rule out
 hard to debug hardware problems. It won't catch everything of course,
 but it usually finds RAM issues which is its main job.

>>>
>>>  That is a very valid point.
>>>
>>>  Bad RAM could very well be the cause of the problems described. And on
>>>  a side note, given that the memory allocation in OpenBSD is different than
>>>  what some other systems do, it is not unlikely that other systems never
>>>  or only rarely would hit the failing memory location while OpenBSD would,
>>>  more often.
>>>
>>
>> Yet it was able to do an install and relink the kernel while in the
>> installer. Also IME memory-related problems are more likely to result in
>> crashes rather than the machine shutting down. This doesn't completely
>> rule out memory problems, but it's more likely to result from a
>> difference between RAMDISK and GENERIC.MP kernels.
>>
>> First things first, Daniel:
>>
>> - if you used i386, try amd64 instead.
>>
>> - if you configured to run X in the installer, try without that.
>>
>> - try going back a release or two, is there any difference?
>>
>>


Re: Localnet Hacking

2024-05-10 Thread Peter J. Philipp
Hi Lux,

In my opinion if you want to study networking load up on every distfile in
/usr/ports/net as these tools will help you.  ipcalc is valuable even pros
use it because doing CIDR and netmasks in your head is possible but not 
practical in all scenarios.

That said you should look into bridging (start with bridge(8)) with OpenBSD 
along with the vether(4) manpage.  Along with vmd and vmm's you can set 
up a deep network based on vether's and tap(4)'s.  

Don't be afraid to use tcpdump(4) especially with the icmp filter along with 
ping/ping6 which are run continuous you can/could find problems.

I don't know how much RAM you have on your machines but pretend you have 16GB
that's enough for roughly 12-14 vmm's if each takes 1 GB RAM.  Each with one 
or two tap(4)'s to become a router.  You may want to look into autoinstall(8) 
scripts to configure these "routers" quickly.  For that you'll need some 
knowledge perhaps of the vnconfig(8), rdsetroot(8), and how to compile 
RAMDISK kernels.

What else do we need... you may want to look at a networking scenario using
PPPoE.  So perhaps look into npppd(8) for the server side and pppoe(4) for
the client side.  Then another scenario uses DHCP so look into dhcpd(8).
Another one will use IPv6 perhaps, here, rad(8) and co will help.  For DNS
on the authoritative side look into nsd(8), and unbound(8) for the recursive.

Look into DNSSEC, nsd is fully capable of this.  And unwind(8) will validate
the answers or it should SERVFAIL (a specific DNS error).

For a start that is good enough, bridging, routing, dhcp, pppoe, dns.  You
can also make your network 4x4 matrix like or even 16 hosts deep.  This will
help you learning how to traceroute and icmp timex messaging.  With so many
virtual hosts in different configurations you may find that configuration is
a pain in the *** (PITA).  Perhaps use some cluster management like puppet
or ansible, or write your own scripts.  You'll also need ssh key management,
perhaps even coupled with the autoinstall file.  All configurations should
be in a got(1) tree which is like git.  gotwebd will help you see differences
in setups.

Usually it's said that "communication is key" but in this scenario you are
establishing communication so perhaps "organization is key".  I personally
found my own hardships last week on revisions, until I got confused and didn't
have a real history so I'm trying to pick up where the going was good.

BTW, manpage(8) would mean you type "man 8 manpage", or "man -s 8 -k manpage".

Hope that helps,
-pjp

On Sat, May 11, 2024 at 02:52:32AM +, Lucretia wrote:
> I have a laptop and am looking to purchase a second computer. Neither of them 
> will be connected to The Internet, but will be networked together.
> 
> My goal is to study networking, starting with some of the most basic commands 
> and routines. This will be purely for educational purposes. I may build upon 
> the network later, perhaps with unconventional devices, but for now I want to 
> focus just on having two Amd64 machines communicating with one another.
> 
> What are some basic networking commands from the base installation or from 
> ports that would be good for a novice to learn more in-depth?
> 
> I have no plans to connect this system to The Internet now or in the future, 
> so keep that in mind when suggesting.
> 
> Book recommendations are most welcome!
> 
> Lux of the Agony
> 720077 Bishkek
> Altyn Kazyk 31A
> KYRGYZSTAN
> l...@openbsdgirl.com
> 

-- 
my associated domains:  callpeter.tel|centroid.eu|dtschland.eu|mainrechner.de



Localnet Hacking

2024-05-10 Thread Lucretia
I have a laptop and am looking to purchase a second computer. Neither of them 
will be connected to The Internet, but will be networked together.

My goal is to study networking, starting with some of the most basic commands 
and routines. This will be purely for educational purposes. I may build upon 
the network later, perhaps with unconventional devices, but for now I want to 
focus just on having two Amd64 machines communicating with one another.

What are some basic networking commands from the base installation or from 
ports that would be good for a novice to learn more in-depth?

I have no plans to connect this system to The Internet now or in the future, so 
keep that in mind when suggesting.

Book recommendations are most welcome!

Lux of the Agony
720077 Bishkek
Altyn Kazyk 31A
KYRGYZSTAN
l...@openbsdgirl.com



Re: My PC is crashing

2024-05-10 Thread Daniel Hejduk
Hello again,
I tried memtest and it passed :D
But after some trying to debug it I found something the sudden shutdown 
corrupts disk.
One particular file "/share/relink/kernel/GENERIC.MP/gap.o" was always 
corrupted.
So it happens when kernel is relinking.

How you told me I tried using i386 but it didn't boot by flashing it on USB nor 
using Ventoy.
Ventoy will always prompt me "Maybe the image does not support X64 UEFI", so I 
tried enabling legacy but again nothing.
Is there way to boot i386, or fix the relinking error?

Thank you for helping me on my journey.

Best regards,
Daniel Hejduk

10. května 2024 9:33:59 SELČ, Stuart Henderson  
napsal:
>On 2024-05-10, Peter N. M. Hansteen  wrote:
>> On Fri, May 10, 2024 at 08:48:56AM +0200, Anders Andersson wrote:
>>> Missing from the FAQ is IMO step 0: Run memtest over night to rule out
>>> hard to debug hardware problems. It won't catch everything of course,
>>> but it usually finds RAM issues which is its main job.
>>
>> That is a very valid point. 
>>
>> Bad RAM could very well be the cause of the problems described. And on
>> a side note, given that the memory allocation in OpenBSD is different than
>> what some other systems do, it is not unlikely that other systems never
>> or only rarely would hit the failing memory location while OpenBSD would,
>> more often.
>
>Yet it was able to do an install and relink the kernel while in the
>installer. Also IME memory-related problems are more likely to result in
>crashes rather than the machine shutting down. This doesn't completely
>rule out memory problems, but it's more likely to result from a
>difference between RAMDISK and GENERIC.MP kernels.
>
>First things first, Daniel:
>
>- if you used i386, try amd64 instead.
>
>- if you configured to run X in the installer, try without that.
>
>- try going back a release or two, is there any difference?
>
>-- 
>Please keep replies on the mailing list.
>


Re: Fwd: RTL8192EU wifi issue

2024-05-10 Thread Chris Petrik
Hello,

Posting and re posting isn't going to get you help any quicker if no one has 
that card there won't be any interest and wifi is badly supported on any BSD. 
This looks more of a PR issue rather a ML issue

Chris

Sent from Proton Mail Android

 Original Message 
On 5/10/24 12:34 PM, Mizsei Zoltán  wrote:

> Crossposting on misc aswell
>
> 2024. máj. 7. 14:50:33 Mizsei Zoltán :
>
> Hi,
>
> I have a so called "Tenda 300Mbps Mini Wireless N Adapter" (this is not the 
> terribly small one). It reports itself as:
>
> urtwn0 at uhub0 port 2 configuration 1 interface 0 "Realtek 802.11n NIC" rev 
> 2.10/2.00 addr 2
> urtwn0: MAC/BB RTL8192EU, RF 6052 2T2R, address 50:2b:73:c9:11:00
>
> It associates sucessfully with the AP, but it can't reliaby communicate 
> because OBSD reports 98% packet loss. However the same adapter works just 
> fine with the same router on the same machine using NetBSD.
>
> NetBSD reports:
> [ 1.809012] urtwn0 at uhub3 port 1
> [ 1.809012] urtwn0: Realtek (0x0bda) 802.11n NIC (0x818b), rev 2.10/2.00, 
> addr 1
> [ 1.859025] urtwn0: MAC/BB RTL8192EU, RF 6052 2T2R, address 50:2b:73:c9:11:00
> [ 1.869029] urtwn0: 1 rx pipe, 3 tx pipes
>
> Interestingly OpenBSD thinks it is 2T2R while NBSD says it is 3T1R. <- maybe 
> a bug?
>
> This is the firmware from OpenBSD:
> -rw-r--r-- 1 root bin 31818 Mar 20 22:17 urtwn-rtl8192eu
> And this is the firmware from NetBSD:
> -r--r--r-- 1 root bin 13904 May 7 14:31 urtwn-rtl8192eu
>
> As you can see, the file size is clearly different, so I have tried to 
> replace the OpenBSD firmware in /etc/firmware with the one from NetBSD, but 
> it fails to load correctly:
>
> urtwn0: timeout waiting for firmware readiness
>
> strings and file doesn't gives any hint about the content of the firmwares, 
> so I'd like to know what's the difference, and if it is possible to 
> update6replace the firmware in OBSD with the one from NetBSD?
>
> Thank You!
>
> --ext

  1   2   3   4   5   6   7   8   9   10   >