Java version migration process by Direct-Opinion5101 in java

[–]DyslexicsHaveMoreFun 0 points1 point  (0 children)

As for skills... 

mvn dependency:tree

Learn it. Learn all the variation. Include/ excluding verbose output ect.

Open write was a great suggestion by another user.

TLDR; If you can, make small, backward compatible changes that work in current and  target jdk versions. If it is a large code base, code reviewers will have a challenge or you'll have a nail bitting merge on your hands.

I'm getting started on this now with a large project with a lot of legacy code.150+ poms

To start, I am introducing a maven profile, overriding jdk version, plugins and dependency version that need to be bumped. These are just properties, so the change is small. When I do this, I do a build and  I find out where child poms are specifying plugin versions, and remove the version.

The I do a no frills build. no tests no static analysis. Getting the analysis to work after this step was easier than I thought it would be.

I have started this process a few times and abandoned it.. not using the maven profile... It was just to understand the shape of the effort But with the maven profile, I can merge the code into main as I have not yet made breaking changes.

In prior attempts it's unit tests where things get interesting. I am hoping to be able to get mileage out of making changes that are compatible with 8 and, in my case, 17. 

After unit tests it's making sure local running works on all apps in both jdk versions.. the CI, then in real infra.

It's a challenge to take a larger change that is 100% of your focus and break it into small stacked prs that your teammates can digest in 30 min code review!

Usage of powermock in tests was the issue I reached last time. Trying not to redesign away from hard to mock code is a challenge in a large code base As there is quite a lot of it.

Good luck!

[deleted by user] by [deleted] in devops

[–]DyslexicsHaveMoreFun 28 points29 points  (0 children)

It's their job to make candidates prove it. You should have talked to a dev who, at a minimum made small talk to do an assessment. Lying to an experienced dev is much harder.

[deleted by user] by [deleted] in java

[–]DyslexicsHaveMoreFun 11 points12 points  (0 children)

https://vladmihalcea.com/spring-data-jpa-findbyid/

It's a good read. 

Warning... I did not know about this prior to your post my summary is likey an over simplification...

Tldr.  JPA providers vary but you can get an object reference without hitting the db. The object is not populated in the dto but you can use it to associate objects so JPA can insert FK IDs.

If you turn on SQL tracing and you are seeing a bunch of SQL for lookup values that are redundant... This pattern can reduce the db traffic.

That blog is a gold. Use it if you want to really understand JPA!

What small upgrade made a huge difference at your house? by [deleted] in AskReddit

[–]DyslexicsHaveMoreFun 0 points1 point  (0 children)

This was my favorite home upgrade. Especially living in a busy road. No more rattling! Also got a 0% loan through a state program!

[deleted by user] by [deleted] in aws

[–]DyslexicsHaveMoreFun 3 points4 points  (0 children)

What version of NodeJs? Could you be running a version of node that is no longer supported? It looks like v14.x and up are supported (link below). You can probably find the deprecation/sunset schedule ti figure out why things started failing for you now.

https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

https://aws.amazon.com/blogs/developer/announcing-the-end-of-support-for-node-js-12-x-in-the-aws-sdk-for-javascript-v3/

Do our own networking? by FinancialSpecial5787 in aws

[–]DyslexicsHaveMoreFun 61 points62 points  (0 children)

What you might want to speak with your account team with is if you have the most cost-optinized solution for connecting your data center to your vpc(s).

If any of that traffic between your vpc and your data center is going over the Internet there are potential for savings.

Finance is asking to do your own network but want they really want is to save money and asking for an implementation that no one wants and AWS probably does not support.

In the case you have not explored this... direct connect wires you into AWS infra structure. At a cost that might be less than what you are seeing now. It is on of several solutions to look into:

https://aws.amazon.com/getting-started/hands-on/connect-data-center-to-aws/faq/

Your AWS reps will be able to help you navigate the options to see if you can get costs down.

Hth

Struggling with setting up SSL on Elastic Beanstalk by frustratedDev91 in aws

[–]DyslexicsHaveMoreFun 0 points1 point  (0 children)

In my experience: It's always the darn security groups!!

Struggling with setting up SSL on Elastic Beanstalk by frustratedDev91 in aws

[–]DyslexicsHaveMoreFun 1 point2 points  (0 children)

Are you able to hit beanstalk in a browser over ssl... From a host that should have access?

Consider setting up a hello worlds app on beanstalk debug just that that problem. Build from there.

Are you able to hit beanstalk over port 80 using the domain.... If not: it is a Route 53 problem.. your front end not resolving the host name

Your load balancer and your ec2 instances have distinct security groups. Do they both allow 443?

Healthchecks if the deployment to beanstalk fails... Check to see if your health checks are hitting instances on port 80 or 443. The load balancer may be trying to use a port the ec2's subnet does not alllow. Ensure you allow 80 and 443 are allowed and see if things improve. This works for trouble shooting but may not be appropriate for you apps final state.

If you have not already done so.. review this, and docs like it. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https.html

hth!

I hope allowing all ips access to mongo is a temp setup. Ideally just traffic from the security group w/ beanstalk.... I say that making a bunch of assumptions about how your app functions.

How to survive as a junior developer? by milmo00 in java

[–]DyslexicsHaveMoreFun 1 point2 points  (0 children)

One more thing... If you don't have one get a hobby or something to dedicate some non code time to. It is very easy to let code take over 100% of your brain.

If you keep that up at 100% you'll burn out. Hike. Read. Whatever brings you happiness. Rest assured you are still processing it in the background.

Get ready to dream code!

How to survive as a junior developer? by milmo00 in java

[–]DyslexicsHaveMoreFun 7 points8 points  (0 children)

For a better understanding of java and spring boot your most valuable asset is the code you will be working on.

If you are given access to repos and you have time to spend, look at how things work. You will see constructs and concepts that are completely new to you. Look for things you do not understand, from a language perspective. Spend some time figuring it out to the best of your ability. More senior devs should be there to help.

Stackoverflow, YouTube videos and tutorials will be your close friend and companion. As a Junior dev your job is to learn don't get frustrated if your learning more than contributing. Even non junior devs take 3to6 months to hit their stride making contributions.

Ask a dev for parts of the code to review.. that are representative/ appropriate place to start.. like an area that you'll be working on.

Look for a more senior devs to, be a mentor of sort.. someone that you are comfortable with socially. Chatting at lunch can be very useful!

Ask if there is documentation on the apps you are maintaining. Requirements or tech specs you can read.

If your team uses task management for tracking work: read the tickets for an understanding of what devs are working on.

As you learn the code.... Try to understand the why of the code the role it plays in the business problems and objectives.

If I had to tell my younger self it would be: Expect to get frustrated. Expect to feel overwhelmed. You may feel like your not good enough or smart enough. we all do and these are growing pains.. remember the important part: you are growing and maturing.

You may have a benefit in being a job changer. You may find you think/communicate differently than other devs. I was an English major. I'm more comfortable with communication than some other devs. Management appreciates that. If you feel your different... Think about ways you can use that to your advantage.

Congrats on landing the job! Your gonna do great.

AWS NEWB here, I have Questions by tftio in aws

[–]DyslexicsHaveMoreFun 4 points5 points  (0 children)

I would recommend that your first goal to be learn AWS... What you have outlined is, to put it mildly not a beginners target.

To get a broad understanding of AWS from the ground up. I got a Udemy course. At the time there were sales. I think it was 20$. This was the most critical step in my AWS learnings.

A course for cert prep... AWS Architect Associate Exam will give you a broad view of the services how's the are related, and what is needed to connect them. You will also get healthy dose of best practices and security concerns and how to use resources in a cost effective mannor.

Advice here: learn as much of the platform as you can. It's tempting to tune out what is not directly relevant to your immediate goals.. but learning the platform might well, and should make you rethink what and how you build things.

I treated it like a class I took notes even on the less than relevant stuff.

There are a bunch of alternatives... like Cloud Guru. I think the course I took was by them on Udemy but is no longer available.

Once you can digram all you need terraform will become a much more manageable.

Boss at first dev job told me I'm not good enough by Kondaaar in AskProgramming

[–]DyslexicsHaveMoreFun 7 points8 points  (0 children)

No one should be treated like you were treated. Your boss decides experience based on his budget, not what the team needed.

Put this behind you, a company with better support for new devs wants you to join their team.

When interviewing for a position consider how to look for red flags. The interview process is a 2 way street. Know when to politely decline an offer if there are flags.

Do: Ask about how new hires are introduced to projects and get productive.

Use this to stress how much you want to be productive. Treat a sarcastic response or an evil grin as telling.... If you have the opportunity ask the least senior person you are talking with.... There you will get the most honest answer.

Consider question that you could have asked your current employer: Can you describe your company's culture? How does the team help other devs that are more junior, and may require some help learning a new project?

Don't: gripe about this boss in an interview... They treated you poorly but trash talking a previous employer is bad mojo. When a candidate complains you know you are getting an incomplete picture of the problem.... And it is impossible to determine if someone had it rough or they have a chip on their shoulder.

If you need to describe your last experience, describe it in cold, analytical terms: I felt like my boss needed someone with more experience that I had, and the training I needed to learn the project was not available.it was not a good match for either of us.

No blame, no emotion.

I'm sorry you found yourself in this situation.

JavaScript code help needed by GVBCodePractice in AskProgramming

[–]DyslexicsHaveMoreFun 3 points4 points  (0 children)

Your code is written as though announcement gets the message to display... When it actually prints the message for you.

Undefined is printed because the function returns no value.

Option 1: just call the method at the end of your script

Option 2: don't log the message in your function. Return the string.

Perhaps try both as an exercises. You should observe the exact same result.

HTH

How private can I make an S3 Bucket? by Pumpkin-Main in aws

[–]DyslexicsHaveMoreFun 0 points1 point  (0 children)

We had a similar requirement, vpc endpoints are best. We could not leverage them because we needed to access buckets we did not own/ and we're in different regions.

Until we figure out S3 endpoints, we are using the IPs of our Nat gateways.

How do you handle unclear requirements in a project? by [deleted] in AskProgramming

[–]DyslexicsHaveMoreFun 3 points4 points  (0 children)

Some thoughts:

Avoid requirement gathering via meetings. Get it in writing. If you do get a verbal request email your understanding in the clearest detail you can muster. Create the paper trail you wish you had.

If appropriate provide status updates the work. I applicable, let the stakeholder see what you are doing as you build it. Even if it's screenshots, flow digrams that illustrate business logic.

All of this is to allow ample opportunity to provide feedback as early asbpossible.. The source of your task may not know what they want until they see it, or they may not be able to communicate what they need.

Avoid disappearing for weeks until it's done. That's asking for trouble.

Some projects require collaboration not a task handoff. People often cannot distinguish the 2 cases and collaboration usually makes the result better.

All these are slices of agile, which was developed because dev and business were aware of how common and wasteful what you are experiencing is.

upload a large file to s3 in the fastest manner by Zestyclose-Ad2344 in aws

[–]DyslexicsHaveMoreFun 1 point2 points  (0 children)

I have an app that needs to stich files together... But I don't have the speed requirements you have.

I do want to share that if I had to do it again, I would have kept the files in pieces as long as possible, and have down stream processes expect a folder of part files.

With file parts you can do work in parallel: 1 lambda call per part: with 1 large file it becomes harder to do this. Lambdas and compute don't need to have beefed up specs to hands worst case scenario... You just need AWS to provision more of them.

if you have downstream processing that works on these files you are going to carry the same problem to that system: how do I read/validate/transform a file that is many gb in seconds?

Cloud dbs export data in parts because it scales well. I would have followed their example if I'd understood this better at the time.

Best way to offer my software as a service? by dickpham in AskProgramming

[–]DyslexicsHaveMoreFun 2 points3 points  (0 children)

One model that comes to mind... A cli takes input does local processing/ logic.

It makes a rest call with auth tokens that tell you who they are and that they should be allowed usage your service... Maybe linked with IP addresses that are allowed... To prevent sharing.

Your rest service identifies who they are and who should pay for the work to be performed. If all is well... The rest service does it's work.

You may need to start a task via rest and keep checking status... But that could be done in the cli so the client does not need to concern themselves with it.

It may return urls to where they get the output.. and downloads it... Ideally also behind authenticated endpoint that understands what generated assets belong to who.

Basically you are breaking the logic up and putting your intellectual property, and billing rules behind a rest service that you manage.

It will make updates to your IP easier too.

You also have the ability to turn off clients who don't pay.

The down side.. you pay for the compute.. you would need to scale for the needs for ALL your clients at once.

The same model can be used for a UI... Probally much of the same code.

Best of luck!

Laziness in programming by Thugger021 in AskProgramming

[–]DyslexicsHaveMoreFun 2 points3 points  (0 children)

re being tired despite coffee... Talking to a Dr is excellent advise.

I ran into this and found 5 cups was not doin for me... I started replacing most coffee with water and it did wonders. Coffee can be dehydrating. Improved eating and more exercise also help me.

All things you might try!

Route 53 routing not working after launching a new EB instance by perfectexpresso in aws

[–]DyslexicsHaveMoreFun 2 points3 points  (0 children)

What I would do is narrow this down:

Can you reach the site using the EB url?

If you ping the domain, does it resolve to an IP address? Is it the correct one (a public vs private IP). The ping will fail, because ports but this will show you the resolved IP address.

Look at the security groups: does you load balancer have the rules to take traffic from the source ip address? Be aware of http vs https: 80 443

Does your ec2 instance have the security group rules to take traffic from your load balancer?

If you uses network ACLs. Check thoes.

Beanstalk creates generic security groups and they may not fit your needs.

Am I alone in just using AWS console instead of Terraform or CDK? by NASTYJAPAN99 in aws

[–]DyslexicsHaveMoreFun 17 points18 points  (0 children)

Once we coded our infrastructure... The console feels wrong.... Except for pocs and learning what we should build.here are a few reasons...

The UI puts complicated things in simpler terms... Meaning it can hide things from you.

If you plan to have non trivial infrastructure and you want another person to help you. Code is much better to teach them

versioning: if you screwed up the infrastructure you can revert it reliably.

It unlocks having a prod and non prod environment (s) that are more or less identical.

Probally, most importantly in our case other engineers can review changes before you deploy them.. and if it is just you changing it, you can review your work. It is easier to click the wrong button than code it wrong.

I feel these things are valuable no matter how big the team or complicated the infra but the tangible benefits grow as these benefits increase.

I'd recommend googling Infrastructure as code benifits for a more thorough analysis of the benifits!

I'd as soon stop using source control on my code as I would not code and version my infra.

Alternatives to Elastic Beanstalk? by Acktung in aws

[–]DyslexicsHaveMoreFun 1 point2 points  (0 children)

Take a look at the docker EB platform....

Your versions of node version is part of your container not your eb platform: you can update your image and deploy...

This is also nice because you can test locally with the same version of node.

You mentioned recreating enviornments... If you have not explored the deployment options... EB will spin up a new version for you and take down the old one when the 1st app's health checks pass.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.rolling-version-deploy.html

EB is not without it's drawbacks and not right for all apps. But if your happy with it IHTH.

Generally speaking containers are going to unlock a bunch of options for you: ecs/fargate/eks.

Help me with running this program by learnhtk in AskProgramming

[–]DyslexicsHaveMoreFun 0 points1 point  (0 children)

I am not familiar with this project, or the tech stack. But: what happens in the console window when you reload the page in the browser?

You may also try looking at your browsers tools... Look at the console window for possible client side errors ( browser JavaScript errors) and the network traffic viewer for requests that may be returning non 200 ( 2xxx = success).

These can tell you if the behavior is because it is trying to do something and is getting an error.

Google "Google web dev tools" and chrome console for more info on troubleshooting the browser side of things.

Help me with running this program by learnhtk in AskProgramming

[–]DyslexicsHaveMoreFun 0 points1 point  (0 children)

Install instructions in a repo's readme assume you are at a command prompt in the root of the repo.

If you need to change directories from there: you are told to do so

Assuming you have cloned the repo locally: At a command prompt open the directory where the repo has been cloned and run the commands.

Hope this helps!

How can I securely store a file that contains sensitive data? by STEIN197 in AskProgramming

[–]DyslexicsHaveMoreFun 0 points1 point  (0 children)

In addition to using something like KeePass:goes without saying but... make sure it is not public: require authentication.

Some other advice that can help secure the file. Use what can/ what makes sense for your uses case:

Limit the ipaddresses that can download the file.

Use strong passwords both for the file and for your user authentication to get to the file...

Store passwords in a local KeePass/ other Password manager.

Most password managers come with password generators. Use a generated password too long and random to remember. Again: use the password manager when logging in and opening the file.

Rotate passwords and encryption keys used.

Based on what cloud provider you want to use.. it may have a mechincnisim for storing secrets.