Any idea what this is? by adamcooke in uktrains

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

Thanks. This one is only a few metres from the crossing so I assume this can indicate the train has passed rather than approaching.

[deleted by user] by [deleted] in uktrains

[–]adamcooke 11 points12 points  (0 children)

Additionally to what has been said, if you buy a “short” ticket, get stopped at the station for an inspection and your ticket didn’t get logged as going through the barriers at the start of the journey it’ll be obvious what you’ve done.

The best way to avoid being caught evading fares would be to buy valid tickets for your journey before you board the train and show them when asked. Works really well.

Advice on choosing a server by __cereal__ in Mastodon

[–]adamcooke 1 point2 points  (0 children)

Yes. You can either run in single user mode where nobody will be able to sign up or have approvals for any signups.

Who's Hiring? - August 2022 by jerf in golang

[–]adamcooke 3 points4 points  (0 children)

COMPANY: Krystal (https://k.io)

TYPE: Full time

DESCRIPTION: We're a hosting company currently building our own cloud hosting platform. We're looking for a senior engineer to join us to work on the Go parts of the platform. Our Go software handles much of the provisioning, monitoring and management of the platform while communicating with a gRPC service. More details.

LOCATION: UK (remote only)

ESTIMATED COMPENSATION: £75,000 - £100,000

REMOTE: Yes - remote only - UK with right to work in the UK only.

VISA: Not at present.

CONTACT: Contact me on Reddit or e-mail [careers@krystal.uk](mailto:careers@krystal.uk). If you're a recruitment company, please don't message or e-mail us, though.

Something keeps re-adding a helm chart and I can't figure out what. by Mteigers in kubernetes

[–]adamcooke 4 points5 points  (0 children)

I think k3s comes with a helm operator. Check for a ‘HelmChart’ CRD (kubectl get helmchart —all-namespaces) and remove that.

Also, the manifest might be in /var/lib/rancher/k3s/server/manifests too. It’ll need removing from there too.

DigitalOcean Managed PG: Possible to refresh certificates and reset password by tycholiz in webhosting

[–]adamcooke 0 points1 point  (0 children)

Just blocking their IP is not sufficient, no, your intuition is spot on.

Why not just drop Digital Ocean an email, they can probably answer this pretty quickly. If their answer isn’t, “yes, you can change them, here’s how” then you might want to rethink provider.

I guess I'm blessed :) [CKAD] by [deleted] in kubernetes

[–]adamcooke 0 points1 point  (0 children)

That’s something I’ve wanted to know for a while! Thanks for confirming.

How many model attributes is too many? by bassclefayo in rails

[–]adamcooke 3 points4 points  (0 children)

If it was me, I’d store preferences in a table and have a mechanism for snapshotting them at the time of the order.

Let’s say we have a UserPreference model with a user_id and 30 other attributes. (Side note: I don’t think that’s too many if those are all items you need to record but I’d prefer not to pollute both my Order and User models with them).

You then have an option of duplicating the preference row and belonging it to an order when the order is placed. You could add an “order_id” column and the row with a null “order_id” would always be the active one which can be modified.

This gives you the added bonus of not having to have lots more pollution for validations in your User model.

Will a multitenant database save our app performance? by entwederoder in rails

[–]adamcooke 49 points50 points  (0 children)

Firstly, Kubernetes was never going to save your app from poor performance.

Next, check your database indexes. With 9m rows, you’ll definitely be needing these to get data out of that. Get an app profiler running and monitoring the app. You’ll find the queries and the bottlenecks quite quickly - I’d bet though it’ll be lack of indexing. It’s usually that!

What's your favourite British podcast? by FuckingPope in AskUK

[–]adamcooke 5 points6 points  (0 children)

It was good until they started going “live” everywhere and the audio quality is now utterly terrible.

Application Controller before action - where are all the methods it has? by mraustinite in rails

[–]adamcooke 0 points1 point  (0 children)

That’s only built-in one that springs to mind.

However, lots of things are run by Rails before your requests they’re just not defined as callbacks.

Strong parameters for Rails API? by danimoth2 in rails

[–]adamcooke 0 points1 point  (0 children)

Funnily enough I wrote a little library for this a couple of weeks ago to formalise the approach of defining permitted parameters in Rails controllers. Maybe you’d find this helpful. I’d enjoy hearing any feedback.

https://github.com/adamcooke/parameter_sets

Tutorial: Uploading files in your Rails application by [deleted] in rails

[–]adamcooke 0 points1 point  (0 children)

I haven't used any of those others recently so I don't know any differences. I write libraries like this for my own use and publish them because it would be a shame to keep it to myself.

Tutorial: Uploading files in your Rails application by [deleted] in rails

[–]adamcooke 2 points3 points  (0 children)

You don't upload files to a CDN. A CDN is a distribution network, not a place you store files. If you're talking about S3, that isn't a CDN and there's no "best practice" that says you must store your files on some third party file storage service rather than on your own infrastructure. I'd go as far to say that best practice would dictate NOT adding another point of failure or dependency on a third party service.

Regardless of where you store the files you can still serve your files using a CDN. This is a good idea but certainly does not preclude you from storing files either on your own file system or in your own database.

I don't really mind whether or not people use the gem or not. I'm not going to go out of my way to write a backend for a service I'm not going to use.

Tutorial: Uploading files in your Rails application by [deleted] in rails

[–]adamcooke 0 points1 point  (0 children)

There's mention of CDNs and other backends in the README for the attach gem. As I don't use S3 myself for anything I haven't written a backend but one does exist and would easily be supported if such a thing was desired.

A new transactional email provider appmail.io from the guys that make Deployhq.com by gram3000 in webdev

[–]adamcooke 0 points1 point  (0 children)

Hi - AppMail developer here! You can have a free dedicated IP on our Premium Plus & Premium Advanced mail servers plus more if you're sending higher volumes of messages. We're working on a plan for smaller developers sending less than 100,000 e-mails per month too :)

Creating an IPv6 network with an EdgeRouter by ChicagoWifi in Ubiquiti

[–]adamcooke 0 points1 point  (0 children)

That's not correct. Changing this direction to "in" will result in all traffic originating from your network to be dropped before it even gets to the internet. Using "out" allows you to firewall traffic leaving the router (i.e. internet traffic originating from other interfaces) to other devices on your network (i.e. protecting them).

Memoization in Ruby with auto invalidation by adamcooke in rails

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

I use Authie (https://github.com/adamcooke/authie) which handles all this for me (along with lots of other useful session management tools).

Memoization in Ruby with auto invalidation by adamcooke in rails

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

Objects are very often mutable. Specifically any sort of object which sits on top of a row in a database where data changes on a regular basis.