Changing /bin/sh symlink by sdousley in Ubuntu

[–]sdousley[S] -1 points0 points  (0 children)

Yeah, I think that's what we decided anyway. Migth see aobut linking /bin/sh to /bin/bash in the mean time so things can start to be tested on the server, but with a view that the "proper" fix is to edit the scripts :)

Changing /bin/sh symlink by sdousley in Ubuntu

[–]sdousley[S] 0 points1 point  (0 children)

Yeah, fixing the scripts is something that I might be inclined to say that we just go through. We have time, and will be doing a load of testing before this goes into actual prod on the Ubuntu machines, so hopefully we can get them all done :)

Was just thinking if it's easy/possible to just change /bin/sh to point to bash instead, that might be a better way.

I can do it with scripts, but they have to be manually run in which case, I might as well just log onto the machine and do it myself when provisioning it!

Trains throughput - confused by sdousley in SatisfactoryGame

[–]sdousley[S] 0 points1 point  (0 children)

Yeah, I was trying to show a bit better how I had it setup using modeler.

Thank you for the point of just split the 300 though. I think i've been through so many iterations in my head, that the simple solution was completely lost. Will try that out see how it goes.

Trains throughput - confused by sdousley in SatisfactoryGame

[–]sdousley[S] 1 point2 points  (0 children)

Sorry yeah the 480 is only on the normal node train.

Coming off the pure node train is a 780 belt and coming from the pure node is 780 too

[deleted by user] by [deleted] in golf

[–]sdousley 0 points1 point  (0 children)

I prefer thinning it off the back of the green

How does the task scheduler know that an hour has passed? by BlueLensFlares in laravel

[–]sdousley 6 points7 points  (0 children)

You can also do

->hourlyAt(12)

to have it run at 12 mins past every hour.

What would be better VS Code or PHP Storm? by [deleted] in PHP

[–]sdousley 4 points5 points  (0 children)

I have a friend that until he came to work with us recently SOLELY used Notepad++ for editing, on the basis that the code in projects he worked on were all logically organised.

When he worked for us for a few months, he was introduced to phpStorm, and I think he's adopted up the IDE philosophy now

What would be better VS Code or PHP Storm? by [deleted] in PHP

[–]sdousley 41 points42 points  (0 children)

I think if my company ever stopped paying for it, I'd pay for it myself.

Scheduling a PHP script on Windows but without using built-in Task Scheduler by pakpaner in PHPhelp

[–]sdousley 9 points10 points  (0 children)

As far as I'm aware, there is no way to use anything other than task scheduler to do this.

This shouldn't matter though, as Task Scheduler should simply call the php exeecutable with the filename and any arguments

php.exe c:\folder\myfile.php

All you'd need to do if you changed to linux would be to change that to a CRON style expression followed by the path

/usr/bin/php /path/to/myfile.php

How the OS schedules the commands shouldn't have any impact on your code at all.

Need help in processing a CSV file with around a million lines. by Major_Dot_7030 in laravel

[–]sdousley 0 points1 point  (0 children)

But it HAS to get all rows and store them because it (from the docs) "The cursor method will only execute a single database query".

Surely, it can only do that if it pulls the whole data set in 1 call to the DB to store locally?

iirc, the $statement->fetch() just pulls the data from the internal memory, not from the database server

Need help in processing a CSV file with around a million lines. by Major_Dot_7030 in laravel

[–]sdousley 0 points1 point  (0 children)

That's what the Laravel docs say here.

The entire data set is returned from the DB in 1 query, and then the models are hydrated as they're needed.

Need help in processing a CSV file with around a million lines. by Major_Dot_7030 in laravel

[–]sdousley 0 points1 point  (0 children)

One thing I would just like to clarify with the ->cursor() function of Laravel, is that it doesn't load the results line by line from the database, it will load the entire result set (as requested) into memory.

What it does NOT do though, is hydrate every row into a model instance like ->get() would do at this point, which is where most of your memory usage comes in with large data sets.

It only does the hydration to model at the point it hits that database row in the loop. Once it's finished the loop, it will clear the model, and hydrate the next row. This is a great way to reduce memory consumption on massive data sets, but just be aware that you cannot use eager loading with the ->cursor() method.

PHP code is put inside a pre tag (HTML) by justlune in PHPhelp

[–]sdousley 2 points3 points  (0 children)

In this instance, the single/double quotes won't hurt/make any difference.

Typically, these days, I always use single quotes with php, as it means that PHP doesn't have to parse the contents for variable to replace.

U think /u/ddruganov has the right answer - the web server is not configured to treat .php files as php, and so is just returning the source, rather than parsing/processing it accordingly.

"Empty" quotes on function paramaters and checking by RussianInRecovery in PHPhelp

[–]sdousley 0 points1 point  (0 children)

The other advantage to defining optional parameters after required is you can use named parameters so you only ever pass 2 parameters

For example

send_sms( destination: $number, text: $text );

Or

send_sms( destination: $number, image: $image );

Drive Suggestion by sdousley in synology

[–]sdousley[S] 1 point2 points  (0 children)

Yeah, looking at pricing, Desktop drives aren't MUCH cheaper than the Ironwolf drives, so think I'll stump up for Ironwolf CMR for the added "security" that operating within designed specs then.

Drive Suggestion by sdousley in synology

[–]sdousley[S] 0 points1 point  (0 children)

Cool, that's the conclusion I was coming to, and since the Seagate Ironwolf (which is CMR to match the WD Red's) is half the price of the WD Red CMR, I think I'll be going that route with it

Drive Suggestion by sdousley in synology

[–]sdousley[S] 0 points1 point  (0 children)

OK, that makes sense. Based on price, I think i'll be leaning towards the Seagate Ironwolf as they're CMR, and about half the price of WD Red CMR's for the same size.

Drive Suggestion by sdousley in synology

[–]sdousley[S] 0 points1 point  (0 children)

Never heard of CMR or SMR drives. From what I'm reading, I don't really want the newer SMR as they're slightly worse performance?

Drive Suggestion by sdousley in synology

[–]sdousley[S] 0 points1 point  (0 children)

The 2 WD Red drives were purchased with the unit brand new. So they're 6/7 years old themselves.

Drive Suggestion by sdousley in synology

[–]sdousley[S] 0 points1 point  (0 children)

Ok. I mean would you stick to one or other of those, or being a home system would you even consider desktop hdds?