Re: Snapshot generation stalled?

2021-09-01 Thread Theo de Raadt
Because I'm not building them right now.



Karel Gardas  wrote:

> 
> 
> Hello,
> 
> installed snapshot on amd64 week or so ago to see how it is
> working. It's #195 from Aug 23. During the past few days I've checked
> from time to time
> with sysupgrade (with or without -s) but it always claimed I'm on the
> latest snapshot.
> I've also switched from hostserver.de to spline.de and then to
> cdn.openbsd.org to see if there are some difference due to outdated 
> mirror(s) but still the same result.
> 
> So let me ask is snapshot generation stopped for whatever reason for
> now, or am I doing anything wrong with sysupgrade?
> 
> Thanks!
> Karel
> 



Re: Snapshot generation stalled?

2021-09-01 Thread Christian Weisgerber
Karel Gardas:

> installed snapshot on amd64 week or so ago to see how it is working. It's
> #195 from Aug 23. During the past few days I've checked from time to time
> with sysupgrade (with or without -s) but it always claimed I'm on the latest
> snapshot.

BTW, I use this to check the date of the lastest available snapshot:

ftp -MVo- https://ftp.openbsd.org/pub/OpenBSD/snapshots/$(uname -m)/BUILDINFO

> So let me ask is snapshot generation stopped for whatever reason for now,

Yes.  Base snapshots are not being built at the moment.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: Snapshot generation stalled?

2021-09-01 Thread Ingo Schwarze
Hi Karel,

Karel Gardas wrote on Wed, Sep 01, 2021 at 07:32:50PM +0200:

> installed snapshot on amd64 week or so ago to see how it is working. 
> It's #195 from Aug 23. During the past few days I've checked from time 
> to time
> with sysupgrade (with or without -s) but it always claimed I'm on the 
> latest snapshot.
> I've also switched from hostserver.de to spline.de and then to 
> cdn.openbsd.org to see if there are some difference due to outdated 
> mirror(s) but still the same result.
> 
> So let me ask is snapshot generation stopped for whatever reason for 
> now, or am I doing anything wrong with sysupgrade?

https://www.openbsd.org/hackathons.html

Running -current is one thing.  Running bleeding-edge code right
from the middle of a hackathon is quite another.  If that is *really*
what you intend to do, please look at the release(8) manual page.

Yours,
  Ingo



Snapshot generation stalled?

2021-09-01 Thread Karel Gardas



Hello,

installed snapshot on amd64 week or so ago to see how it is working. 
It's #195 from Aug 23. During the past few days I've checked from time 
to time
with sysupgrade (with or without -s) but it always claimed I'm on the 
latest snapshot.
I've also switched from hostserver.de to spline.de and then to 
cdn.openbsd.org to see if there are some difference due to outdated 
mirror(s) but still the same result.


So let me ask is snapshot generation stopped for whatever reason for 
now, or am I doing anything wrong with sysupgrade?


Thanks!
Karel



Re: Run a command on "last day of month"

2021-09-01 Thread Raul Miller
Or, since last day of the month never occurs before the 28th, you
could run the script only on days which might be the last of the
month,

Also, since crontab does support a month column, you could have three
crontab entries: one for months with 31 days (month: 1,3,5,7,8,10,12),
another for months with 30 days (month:4,6,9,11), and another for
February. Then, you could either neglect the 29th of February, or you
could have your script do a year test (and the next year evenly
divisible by 4 which is not a leap year is 2100).

FYI,

-- 
Raul

On Wed, Sep 1, 2021 at 8:04 AM Nick Holland  wrote:
>
> On 9/1/21 5:50 AM, Joel Carnat wrote:
> > Hello,
> >
> > I would like to run a command on "the last day of each month".
> >
> >   From what I understood reading the crontab(5) manpage, the simplest way
> > would be setting day-of-month to "28-31". But this would mean running
> > the command 4 times for months that have 31 days.
> >
> > Is there a simpler/better way to configure crontab(1) to run a command
> > on "the last day of month" only ?
> >
> > Thank you,
> > Joel C.
> >
>
> Just run your script every day, and first thing in the script, check to see
> if it is the last day of the month -- and quickly exit if it isn't.  Very
> cheap to do and relatively easy if you know a good trick to do it.
>
> http://holland-consulting.net/scripts/endofmonth.html
>
> Find the last day of the month:
> $ set $(cal)
> $ shift $(($# - 1))
> $ echo $1
> 30
>
> Compare to today:
> $ date "+%d"
> 1
>
> rather easy, and fairly portable.
> You could probably stuff it into a one-liner in a crontab, but I would not
> recommend it.
>
>
> Nick.
>



Re: Run a command on "last day of month"

2021-09-01 Thread Ingo Schwarze
Hi,

Adam Paulukanis wrote on Wed, Sep 01, 2021 at 04:39:54PM +0200:

> if today is the last day of the month, tomorrow will be 1st.

That is a non-portable assumption and a trap that many people seem
to fall into.

For example, in the shire calendar, 1 Afterlithe (~= July) is the
fourth day after 30 Forelithe (which always is the last day of
Forelithe ~= June) in some years, and the fifth day after in other
years, but never the first, second, or third.  Similarly, 1 Afteryule
(~= January) is the third day after 30 Forejule (the last day in
Foreyule ~= December).  That also implies that January 1 is *never*
the first day of the year, and that the last day of the last month
of a year is *never* the last day of that year.

Localization is an extremely hard and complex task.  For that reason,
OpenBSD believes the C library is the wrong place to attempt to
provide such functionality.  The same applies to general-purpose
command line tools like date(1), ls(1), and cron(8).  The price to
pay in terms of complexity, and hence ultimately in bugs, would be
excessive.

Yours,
  Ingo



Re: Run a command on "last day of month"

2021-09-01 Thread Paul de Weerd
On Wed, Sep 01, 2021 at 04:39:54PM +0200, Adam Paulukanis wrote:
| On Wed, 1 Sept 2021 at 16:32, Christian Weisgerber  wrote:
| >
| > Goetz Schultz:
| >
| > > I would go the other way and check tomorrows date. If it is "01", then I
| > > know today is the last of this month:
| > >
| > > date --date="tomorrow" +%d
| > > 02
| >
| > That's not OpenBSD.
| >
| > $ date --date="tomorrow" +%d
| > date: unknown option -- -
| > usage: date [-aju] [-f pformat] [-r seconds]
| > [-z output_zone] [+format] [[cc]yy]mm]dd]HH]MM[.SS]]
| >
| 
| 
| Not sure if it is OpenBSD. I am on Darwin right now
| 
| $ date -v+1d +%d # if today is the last day of the month, tomorrow will be 
1st.

This will work on OpenBSD:

[ $(date -r $(($(date +%s) + 86400)) +%e) -eq 1 ] || exit 0


Although you'll have to be cautious with tricks like these to run this
only between 01:00 and 23:00 if your system runs with a timezone that
has daylight savings time.

Cheers,

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: Run a command on "last day of month"

2021-09-01 Thread Adam Paulukanis
On Wed, 1 Sept 2021 at 16:39, Adam Paulukanis  wrote:
>
> On Wed, 1 Sept 2021 at 16:32, Christian Weisgerber  wrote:
> >
> > Goetz Schultz:
> >
> > > I would go the other way and check tomorrows date. If it is "01", then I
> > > know today is the last of this month:
> > >
> > > date --date="tomorrow" +%d
> > > 02
> >
> > That's not OpenBSD.
> >
> > $ date --date="tomorrow" +%d
> > date: unknown option -- -
> > usage: date [-aju] [-f pformat] [-r seconds]
> > [-z output_zone] [+format] [[cc]yy]mm]dd]HH]MM[.SS]]
> >
>
>
> Not sure if it is OpenBSD. I am on Darwin right now

Nevermind. It seems OpenBSD does not have it.

>
> $ date -v+1d +%d # if today is the last day of the month, tomorrow will be 
> 1st.



Re: Run a command on "last day of month"

2021-09-01 Thread Adam Paulukanis
On Wed, 1 Sept 2021 at 16:32, Christian Weisgerber  wrote:
>
> Goetz Schultz:
>
> > I would go the other way and check tomorrows date. If it is "01", then I
> > know today is the last of this month:
> >
> > date --date="tomorrow" +%d
> > 02
>
> That's not OpenBSD.
>
> $ date --date="tomorrow" +%d
> date: unknown option -- -
> usage: date [-aju] [-f pformat] [-r seconds]
> [-z output_zone] [+format] [[cc]yy]mm]dd]HH]MM[.SS]]
>


Not sure if it is OpenBSD. I am on Darwin right now

$ date -v+1d +%d # if today is the last day of the month, tomorrow will be 1st.



Re: Run a command on "last day of month"

2021-09-01 Thread Christian Weisgerber
Goetz Schultz:

> I would go the other way and check tomorrows date. If it is "01", then I
> know today is the last of this month:
> 
> date --date="tomorrow" +%d
> 02

That's not OpenBSD.

$ date --date="tomorrow" +%d
date: unknown option -- -
usage: date [-aju] [-f pformat] [-r seconds]
[-z output_zone] [+format] [[cc]yy]mm]dd]HH]MM[.SS]]

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: Run a command on "last day of month"

2021-09-01 Thread Bruno Ferreira
Hello

I do this one liner in my cron with success, maybe it suits you:

0›  5›  *›  *›  *›  TOM=$(TZ=MST-24 date +%d); [ $TOM
-eq 1 ] && logger "Ultimo dia do mês!!!"

Em qua., 1 de set. de 2021 às 09:06, Nick Holland <
n...@holland-consulting.net> escreveu:

> On 9/1/21 5:50 AM, Joel Carnat wrote:
> > Hello,
> >
> > I would like to run a command on "the last day of each month".
> >
> >   From what I understood reading the crontab(5) manpage, the simplest way
> > would be setting day-of-month to "28-31". But this would mean running
> > the command 4 times for months that have 31 days.
> >
> > Is there a simpler/better way to configure crontab(1) to run a command
> > on "the last day of month" only ?
> >
> > Thank you,
> > Joel C.
> >
>
> Just run your script every day, and first thing in the script, check to see
> if it is the last day of the month -- and quickly exit if it isn't.  Very
> cheap to do and relatively easy if you know a good trick to do it.
>
> http://holland-consulting.net/scripts/endofmonth.html
>
> Find the last day of the month:
> $ set $(cal)
> $ shift $(($# - 1))
> $ echo $1
> 30
>
> Compare to today:
> $ date "+%d"
> 1
>
> rather easy, and fairly portable.
> You could probably stuff it into a one-liner in a crontab, but I would not
> recommend it.
>
>
> Nick.
>
>

-- 
Atenciosamente,
Bruno Ferreira.


Re: Run a command on "last day of month"

2021-09-01 Thread Goetz Schultz



On 01/09/2021 13:02, Nick Holland wrote:

On 9/1/21 5:50 AM, Joel Carnat wrote:

Hello,

I would like to run a command on "the last day of each month".

  From what I understood reading the crontab(5) manpage, the simplest way
would be setting day-of-month to "28-31". But this would mean running
the command 4 times for months that have 31 days.

Is there a simpler/better way to configure crontab(1) to run a command
on "the last day of month" only ?

Thank you,
Joel C.



Just run your script every day, and first thing in the script, check to see
if it is the last day of the month -- and quickly exit if it isn't.  Very
cheap to do and relatively easy if you know a good trick to do it.

http://holland-consulting.net/scripts/endofmonth.html

Find the last day of the month:
    $ set $(cal)
    $ shift $(($# - 1))
    $ echo $1
    30

Compare to today:
    $ date "+%d"
    1

rather easy, and fairly portable.
You could probably stuff it into a one-liner in a crontab, but I would not
recommend it.


Nick.



I would go the other way and check tomorrows date. If it is "01", then I 
know today is the last of this month:


date --date="tomorrow" +%d
02

--
Thanks and regards

  Goetz R Schultz

Quis custodiet ipsos custodes?
>8--
  /"\
  \ /  ASCII Ribbon Campaign
   X   against HTML e-mail
  / \
>8--

>8--

 /"\
 \ /  ASCII Ribbon Campaign
  X   against HTML e-mail
 / \ 


  This message is transmitted on 100% recycled electrons.

>8--

Please support these causes:

https://you.38degrees.org.uk/petitions/rescue-lanes-on-multi-lane-roads

https://www.justgiving.com/crowdfunding/fylde-cfr-team

8<--
Unsigned message - no responsibillity that content is not altered



Re: Run a command on "last day of month"

2021-09-01 Thread Nick Holland

On 9/1/21 5:50 AM, Joel Carnat wrote:

Hello,

I would like to run a command on "the last day of each month".

  From what I understood reading the crontab(5) manpage, the simplest way
would be setting day-of-month to "28-31". But this would mean running
the command 4 times for months that have 31 days.

Is there a simpler/better way to configure crontab(1) to run a command
on "the last day of month" only ?

Thank you,
Joel C.



Just run your script every day, and first thing in the script, check to see
if it is the last day of the month -- and quickly exit if it isn't.  Very
cheap to do and relatively easy if you know a good trick to do it.

http://holland-consulting.net/scripts/endofmonth.html

Find the last day of the month:
   $ set $(cal)
   $ shift $(($# - 1))
   $ echo $1
   30

Compare to today:
   $ date "+%d"
   1

rather easy, and fairly portable.
You could probably stuff it into a one-liner in a crontab, but I would not
recommend it.


Nick.



Re: Run a command on "last day of month"

2021-09-01 Thread Theo de Raadt
Joel Carnat  wrote:

> Hello,
> 
> I would like to run a command on "the last day of each month".
> 
> From what I understood reading the crontab(5) manpage, the simplest
> way would be setting day-of-month to "28-31". But this would mean
> running the command 4 times for months that have 31 days.
> 
> Is there a simpler/better way to configure crontab(1) to run a command
> on "the last day of month" only ?

cron has no way to do this

adding a non-portable extension doesn't really make sense

the easiest way is to have your script run then (or every day), and
make a more detailed check inside the script.  this pattern is very
common...



Run a command on "last day of month"

2021-09-01 Thread Joel Carnat

Hello,

I would like to run a command on "the last day of each month".

From what I understood reading the crontab(5) manpage, the simplest way 
would be setting day-of-month to "28-31". But this would mean running 
the command 4 times for months that have 31 days.


Is there a simpler/better way to configure crontab(1) to run a command 
on "the last day of month" only ?


Thank you,
Joel C.



Re: Accessing LAN behind gateway from Road Warrior on wg(4) based tunnel

2021-09-01 Thread Alexander Hall
On Fri, Aug 27, 2021 at 03:03:36PM +0200, Erling Westenvik wrote:
> Hello all,
> I have successfully set up a wg(4) based VPN tunnel from my laptop
> (current) to my home/office gateway (6.9) but have problems
> understanding how to access the LAN behind the gateway.
> 
> [Laptop]
> - wg0 (10.0.0.42)
> - egress (trunk0 {em0 iwn0} dhcp)
> [Internet]
> [Gateway]
> - egress (em0 dhcp)
> - wg0 (10.0.0.1)
> - bridge0 {em1, (vether0 192.168.3.1 dhcpd)}
> [LAN]
> - various 192.168.3.0/24
> 
> I can ping/ssh between wg(4) endpoints (10.0.0.1 to 10.0.0.42 and vica
> versa) and also from LAN clients (192.168.3.0/24) to gateway wg(4)
> endpoint (10.0.0.1), but the laptop (10.0.0.42) can only reach the
> gateway (10.0.0.1).
> 
> Is it as easy as defining some routes? If so, where? There's a ton of
> more or less relevant and/or updated howto's out there but I have not
> found anyone dealing with a similar scenario. Any hints are appreciated.

Routes:

laptop: route add 192.168.3/24 10.0.0.1
"various 192.168.3.0/24": route add 10.0.0.42 192.168.3.1

(The latter is probably already the case if 192.168.3.1 is the default gw)

Alternatively, NAT the traffic from 10.0.0.42 onto the 192.168.3/24 network
Something like this late in the pf rules on Gateway:
match out on em1 from any received-on wg0 nat-to (em1)

/Alexander

> 
> (My wg(4) setup is based on:
> https://www.tumfatig.net/20201202/a-mesh-vpn-using-openbsd-and-wireguard/)
> 
> Best regards,
> 
> Erling
>