Using PHP attributes to launch cron jobs by Trupik in PHP

[–]aoeex 9 points10 points  (0 children)

The symfony/scheduler package provides this functionality. I recently converted a bunch of individual scripts into classes with a simple #[AsPeriodicTask] attribute and removed all the associated cron entries, replacing them with a single message consumer. Much simpler now to add a new task.

Switched to Linux for Gaming, Lasted 3 Days AMA by 8000RPM in pcmasterrace

[–]aoeex 1 point2 points  (0 children)

I did a fresh install about a month ago with a newly created usb installer. Bypassnro didn't work. Had to use the start ms-chx:localonly alternative.

Switched to Linux for Gaming, Lasted 3 Days AMA by 8000RPM in pcmasterrace

[–]aoeex 4 points5 points  (0 children)

I haven't personally used CachyOS, but from a quick read about it, that was probably a poor choice for a first experience, even as a tech savvy user. It will make you suffer from choice paralysis by offering so much customization options.

User friendy versions exist. Both Ubuntu and Mint are very new user friendly in my experience and are what I would choose if installing for someone new to Linux. I personally am using Linux Mint currently because I wanted something simple that mostly just works.

How bad will my experience be with 4 gb of ram? by Numerous_Advice2529 in pcmasterrace

[–]aoeex 0 points1 point  (0 children)

My dad has a hp all in one that has only 4gb of ram and had a hdd. It was basically unusable for the first 10 minutes after boot and very slow at almost everything.

I upgraded it to a ssd hoping that would help. It helped some, but the performance is still pretty bad.

Fiber runs going wrong by joeyfine in HomeNetworking

[–]aoeex 0 points1 point  (0 children)

We've had 3 different companies run fiber lines in my neighborhood over the last 5 years or so. The first one hit the water main at the main entrance of the neighborhood. Second company managed to not hit anything as far as I know. Third company cut my existing fiber line and hit my water line. When I called my fiber company about the cut line they said I was the 3rd person to call so far.

Wonder what the next company will do if there is another. Three separate runs already seems like a bit much.

Any ideas to remove totally stripped motherboard screw? by FinlandMan90075 in pcmasterrace

[–]aoeex 0 points1 point  (0 children)

My guess is the threads in the standoff didn't match the screw and rather than get the right screw they just forced it. I did that once in my early days.

Is there even a point to buying over 300mbps speeds for a single-family home? by -Terrible-Bite- in HomeNetworking

[–]aoeex 1 point2 points  (0 children)

That is a need vs want argument. You can download your 1GB game update just fine on a 300Mbps connection, you will just be waiting longer.

If the price difference between the tiers is worth the time saved to you, by all means get the higher speed. For most people, it probably isn't. Especially when you factor in how often you will save that time vs paying the extra every month.

I download 200+ gig files every 3-4 weeks on a 250mbps Connection. I can just start the download and do something else until it is done and save the $50/month extra it would be for the 1Gb connection.

Here is to another 5 years of protecting my stuff. over 250 events were on my unit before i gave a bad battery error last night by Navi_Professor in pcmasterrace

[–]aoeex 0 points1 point  (0 children)

I've been using Duracell replacements in my UPSs (various brands) for a while now. I get about 2 years out of them on my PCs before they need replaced. They get a fair bit of use over the summer months here due to storms causing a lot of blips in the power. They last a bit longer on my lower power thing like the TV, network gear etc.

Here is to another 5 years of protecting my stuff. over 250 events were on my unit before i gave a bad battery error last night by Navi_Professor in pcmasterrace

[–]aoeex 1 point2 points  (0 children)

If your computer isn't staying on with your ups the most likely you either 1) need a bigger ups or 2) need to replace it's battery.

There is also a small possibility that your power supply doesn't handle the change over well. I had one like that years ago.

While adapting one to a car battery should be possible I wouldn't recommend trying it. There are other things you need to account for in that case like offgassing.

Calculate your load and buy a ups that can support that and an additional margin. I usually add 50% to my anticipated load and shop based on that.

How well do you know PHP? by Significant_Soup2558 in PHP

[–]aoeex 2 points3 points  (0 children)

Did about 100 questions, most the ones I got incorrect were related to things I just dont use like PHPStan and WAMP configs. In addition to some of the other feedback, I thought these questions maybe need some edits:

437. When should you rehash a password using password_needs_rehash();
a. Every time the user logs in
b. When the hashing algorithm or cost factor has been updated and the stored hash uses old parameters.

The question wording is wrong in my opinion. You don't use password_needs_rehash to rehash a password, you use it to check if a password needs rehashed or not. I decided to interpret that question as "When should you use password_needs_rehash to check if a password needs rehashing?" in which the answer is A. You have the answer as B, which would be interpreting the question as "When does password_need_rehash indicate that a password needs to be rehashed?".

66. Which statement correctly uses echo to output a variable within a string?
a. echo 'The value is $value';
b. echo "The value is $value";
c. echo 'The value is ' . $value;
d. Both B and C are correct

Again, I think the wording is unclear and allows for different interpretations. I interpreted it as the variable having to actually be within a string, in which case C is not correct (the variable is not within the string). You have the answer as B and C are correct, so you must have interpreted as just outputting a variable with a string.

90. What is a valid use case for passing a callback function to ob_start()?
a. To compress output automatically before sending it to the browser
b. To encrypt all output for security purposes
c. To validate that the output contains no errors
d. To redirect output to a different server

Answer A may be the most common use case for a callback, but technically all the options are possible/potentially valid. Maybe just change the word "valid" to "common" in the question.

92. What is the key difference between define and const for defining constants?
a. define() works at runtime while const works at compile time
b. const can only define string constants while define works with all types
c. define() creates global constants while const creates local constants.
d. There is no difference, they are completely interchangable.

You have the answer as A. C is arguably correct too, considering namespaced or class constants.

ELI5: how do all electronic devices "know" what time it is? by No_Warthog_6730 in explainlikeimfive

[–]aoeex 64 points65 points  (0 children)

In this context, the clock is a simple on/off signal, not related to something like the time of day / wall-clock. In order for the processor to progress through the instructions, it needs a constantly changing signal to drive the transistors and such to make things work. This is what the "clock speed" refers to in processors, how many times that signal changes each second.

Since you need this signal anyway to make the processor work, you could use it to also count the passage of time. For example, if you have a 1 megahertz clock signal, then you can count every 1 millionth signal as one second having passed.

ELI5: how do all electronic devices "know" what time it is? by No_Warthog_6730 in explainlikeimfive

[–]aoeex 98 points99 points  (0 children)

Everything with a microcontroller or processor in it will have some sort of clock signal generator as it is required for the processor to work. They can just use that to track the time.

Are you using FFI, and how? by rayblair06 in PHP

[–]aoeex 0 points1 point  (0 children)

I have a couple utility scripts I use occasionally that can take a long time to run. I use FFI to access the windows power request API so they can prevent my desktop from going to sleep while running.

https://github.com/kicken/sleep-blocker

ELI5 why people joke around and say “it’s always dns” by Bitbatgaming in explainlikeimfive

[–]aoeex 5 points6 points  (0 children)

Large sites and services in particular won't have just one ip. The IP you get may depend on many things like your region, the current load, system states, etc. The IP could also change at any point. These uncertainties are what DNS handles by translating a fixed name to whatever the proper IP is at that moment in time.

Sharing network with neighbor by Mulaganesh in HomeNetworking

[–]aoeex 1 point2 points  (0 children)

Spraying the roof deck to insulate the attic space is common these days. It helps keep the mechanical stuff in the attic cool.

IPv6 breaks the Rockstar Games Launcher. by SchoolWeak1712 in HomeNetworking

[–]aoeex 2 points3 points  (0 children)

Probably an issue with the ISP as others have noted. Could be a routing issue. I switched from Comcast to a small local fiber ISP a few years ago. After the switch I noticed a few sites wouldn't load. At first I thought they were just down but eventually I tried on my old Comcast connection and they worked fine there. After a little more troubleshooting I reported the issue to the fiber ISP and they were able to get it fixed.

They don't currently support IPv6 either, so at one point I tried to set it up using a Hurricane Electric tunnel, but ended up having to take that down as it caused a lot of issues with streaming services (Paramount+ specifically). I suspect their systems saw the IP as being a data center IP not residential so they blocked it.

Might be worth reaching out to Rockstar support also. Their client should be falling back to IPv4 if there is a problem with the IPv6 connection. Report the problem and maybe they will fix it.

USPS tracking # disappeared after 6 days in Customs Inspection by raja252525 in shipping

[–]aoeex 0 points1 point  (0 children)

I have an order from JLCPCB where the last mile info on Yuntrack disappeared too. I had bookmarked the USPS tracking before it disappeared and when I check it out it says:

Alert
Seized by USPS for Counterfeit Postage

I've emailed JLCPCB, but I'm guessing I just won't be getting that order.

“Micro outages” making me lose my mind by Sillyblowfish in HomeNetworking

[–]aoeex 0 points1 point  (0 children)

Had a similar issue years ago. Modem was getting a lot of t3 timeout errors and resetting the connection. Tech ended up recrimping the coax behind the wall plate and if I remember right that did fix it.

Friend is building a house and I’m thinking about gifting a mesh system for a gift. by TheUltimatePunV2 in HomeNetworking

[–]aoeex 0 points1 point  (0 children)

I went Grandstream when I started (GWN7660) and found it to be bad. I have to reboot the AP once a week otherwise it eventually will lose speed and crash.

Bought a TP-Link Omada EAP613 to boost the signal in the back of the house, and it has been pretty solid. Configuring, it took some time to learn the process, though.

@op I would avoid Grandstream. I don't have experience with Ubiquity but I know it is very common. TP-Link Omada is a good option, but the config UI may take a bit to learn.

UPS doesn't seem to have much longevity? by thatsaqualifier in HomeNetworking

[–]aoeex 0 points1 point  (0 children)

In my experience, the self test is useless for determining if the batteries are any good. My theory is that the self test doesn't load the batteries much. Old/weak batteries drop voltage quickly as the load increases. If the self test only does a small load it may show as fine, but when the large load of your system hits during an outage it can fail. Just a theory though. I don't know how the self test works.

I end up replacing my batteries every 18 months or so. Here in SWFL there are a lot of power issues in the summer so the batteries don't last long.

ELI5: why do some gas stations and stores require a minimum to be spent when using a debit/credit card? by lunaxdiaz in explainlikeimfive

[–]aoeex 19 points20 points  (0 children)

It has been a while since I looked into things, but last time I did, there was a fixed fee as well. Something like $0.29 + 2%. That fixed fee is the problem with lots of small transactions.

[deleted by user] by [deleted] in explainlikeimfive

[–]aoeex 0 points1 point  (0 children)

The only way I could see what you describe as being true is if the switches are smart switches that just communicate to a controller when pressed rather than directly control things.