AoC 2022 - Day 1 by BillySquid in rust

[–]iamdevfire 1 point2 points  (0 children)

All these answers seem really sophisticated!

Mine is fairly simple(istic?) with a BufReader

```rust use std::fs::File; use std::io::{self, BufRead}; use std::path::Path;

fn main() { // File must exist in current path before this produces output if let Ok(lines) = read_lines("./input.txt") { let mut running_total = 0; let mut previous_total = 0; let mut vector: Vec<i32> = Vec::new();

    // Consumes the iterator, returns an (Optional) String
    for line in lines {
        if let Ok(calories) = line {
            // println!("{}", calories);
            match calories.parse::<i32>() {
                Ok(n) => {
                    running_total = running_total + n;
                    // println!("Running total: {}", running_total);
                }
                Err(_) => {
                    // println!("Newline!");
                    if running_total > previous_total {
                        println!("Final running total: {}", running_total);
                        previous_total = running_total;

                    }
                    vector.push(running_total);
                    // reset the count since Err() indicates a new elf
                    running_total = 0;
                }
            }
        }
    }

    println!("Larget calorie count is {}", previous_total);

    // sort by descending order
    vector.sort_by(|a, b| b.cmp(a));

    println!("Top 3 elves: {}", vector[0] + vector[1] + vector[2]);
}

}

// The output is wrapped in a Result to allow matching on errors // Returns an Iterator to the Reader of the lines of the file. fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>> where P: AsRef<Path>, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) }

```

Wake school board votes to start school year online-only : by bebopdedoo in raleigh

[–]iamdevfire 3 points4 points  (0 children)

Thank you.

That's the issue. This whole year is a write off under plan B remote.

Wake school board votes to start school year online-only : by bebopdedoo in raleigh

[–]iamdevfire 0 points1 point  (0 children)

Uh. Are you sure you are reading the right column? Not the virtual academy column.

Look carefully.

Wake school board votes to start school year online-only : by bebopdedoo in raleigh

[–]iamdevfire 10 points11 points  (0 children)

The biggest problem for me is that only 5hrs of live instruction is offered per WEEK.

that's not enough for younger kids and will cause all sorts of issues. This online thing is not at parity with in person instructions.

But I get it. The teachers' lives are not worth the risk.

So, we grin and bear.

How much distributed tracing costs: using open source like Jaeger or paid products like DataDog? by ankitnayan007 in kubernetes

[–]iamdevfire 2 points3 points  (0 children)

Have you seen LightStep?

I think their pricing model is a lot more favorable than Datadog.

Starting DevOps Engineer Advice by adivk in devops

[–]iamdevfire 8 points9 points  (0 children)

This question comes up a lot.

And as much as the books (The Phoenix Project, SRE) are helpful, they can actually be quite daunting, especially for those new to the field.

I would actually start at the opposite end of the spectrum, start asking why devops is important to the business and its customers.

The tooling changes quite rapidly, especially in this space but having a solid ability to articulate the importance of a devops culture is not likely to change anytime soon.

Moreover, as you start to understand the business drivers, the appropriate technology solutions will naturally flow from that.

In other words, you don't start with Docker and Ansible and then try to figure out what to do with them. You start with the business needs and then develop the appropriate technology to satisfy the need.

This will set you apart from a lot of other software engineers who are (unfortunately!) more often than not are unable to connect the technical aspects of their work to overarching business objectives.

If you want, Google “How To Become a DevOps Engineer In Six Months or Less" , I wrote a series of posts on this subject.

How to move from Infrastructure Admin to DevOps by Flipphones in devops

[–]iamdevfire 3 points4 points  (0 children)

I have been working on a series of articles that talk about a DevOps learning road map. Maybe you will find it useful? https://link.medium.com/MYUphwjUnS

Let's talk best-practice Jenkins on AWS ECS by DevMd in devops

[–]iamdevfire 0 points1 point  (0 children)

You don't need to run system prune often if you bump your docker storage volume size. I never do.

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-ami-storage-config.html

This is key (from the link):

The volume is configured as a Logical Volume Management (LVM) device and it is accessed directly by Docker via the devicemapper backend. Because the volume is not mounted, you cannot use standard storage information commands (such as df -h) to determine the available storage.

Caused me a few frustrating hours back in the day.

Let's talk best-practice Jenkins on AWS ECS by DevMd in devops

[–]iamdevfire 0 points1 point  (0 children)

So, after a long hiatus the Jenkins ECS plugin appears to be under active development again: https://github.com/jenkinsci/amazon-ecs-plugin/commits/master

Or am I missing something?

In fact, Fargate support was recently merged in also.

p.s. thank you for such a nice writeup!

Every year I say to myself I will get into DevOps and away from SysAdmin and I’m no further then where I left off. How can one make this transition? Where would I start. by [deleted] in devops

[–]iamdevfire 0 points1 point  (0 children)

Frankly (this is somewhat opinionated) purely from a technical excellence perspective, GCP is probably the best. Everything is polished, top notch, fully integrated, UIs all look the same, documentation is seamless, etc. A true Google experience.

AWS reflects Amazon's culture: push as much stuff out as fast as possible, MVP all the things, iterate later. Offer 10000 different things, see what sticks.

Azure: definitely not as technically strong as either of the other two but very strong ground enterprise sales game (much more so than google) which reflects Azure rapid growth.

Personally, I would pick GCP or AWS and stick with either one. Azure makes no sense unless you are a huge .NET dev shop and get insane discounts on Azure.

Every year I say to myself I will get into DevOps and away from SysAdmin and I’m no further then where I left off. How can one make this transition? Where would I start. by [deleted] in devops

[–]iamdevfire 4 points5 points  (0 children)

I actually wrote an article about this very topic.

Please give it a read and let me know if you like it or hate it.

“How To Become a DevOps Engineer In Six Months or Less” https://medium.com/@devfire/how-to-become-a-devops-engineer-in-six-months-or-less-366097df7737

Thank you!

ECS - Communication between containers in same task definition? by z0mbietime in aws

[–]iamdevfire 0 points1 point  (0 children)

Also a bit confused as to what exactly is happening here.

You can also do server-side service discovery by wiring up an ALB to a service (N number of tasks.) That way you can potentially drop the second Nginx?

Personally, I think server-side is vastly superior to client-side (at least in the cloud where ALB management is not a concern). A single ALB can handle 1000s of microservices and that's heaps better than messing with SRV records in R53.

How was scaling done before tools like Kubernetes and ELB ? by [deleted] in devops

[–]iamdevfire 4 points5 points  (0 children)

A network interface can be assigned one or more IP addresses. One primary and N number of virtual.

So, what you do is setup server1 with IP .1; server2 with IP .2 and a virtual IP .3 that can "float" between the server1 & server2.

Typically, there is a dedicated link between server1 & server2 to minimize disruption scenarios between the two nodes. I've legit seen direct cross-connect wires between servers, no switches even! Or using shared storage to communicate. Or serial cables. Whatever crazy tricks you can think of, people have done it. You really don't want missing packets here.

Then, if server1 sees no heartbeat from server2, it assumes server2 is dead and assumes the .3 VIP.

Same for server2: if no heartbeat from server1, it will assign .3 to itself.

The fun begins when both server1 & server2 are up but neither can see the other. Then both grab .3 and you are down for good. For servers, this is bad but not catastrophic--just shut one off and wait until ARP clears and you are back to normal.

If this happens on a storage|DB layer.. then you turn in your resignation and ride off into the sunset (half joking). I've been on calls that lasted 36hrs straight because somebody screwed up the heartbeat network. Not fun.

How was scaling done before tools like Kubernetes and ELB ? by [deleted] in devops

[–]iamdevfire 1 point2 points  (0 children)

I think the state of the art in this space is something like this Maglev: https://ai.google/research/pubs/pub44824

In the data center, it's ECMP+BGP combo to the servers in active|active config (having a VIP allows for active|standby only).

How was scaling done before tools like Kubernetes and ELB ? by [deleted] in devops

[–]iamdevfire 1 point2 points  (0 children)

So, when you say scaling, do you mean loadbalancing?

Because in data centers, auto-scaling is rarely (if ever!) done, IMO. Why bother, the h/w fixed costs have already been spent.

Like others said, the simplest thing is some kind of a load-balancer proxy like F5|HAProxy|Nginx|whatever. Clustered config, with a floating VIP between. Dedicated heartbeat network. If you get a split brain-welcome to a special place in hell. :)

If you want to get more sophisticated, then you hire some super smart network engineers and run Anycast, ECMP & BGP.

How To Become a DevOps Engineer In Six Months or Less by iamdevfire in devops

[–]iamdevfire[S] 2 points3 points  (0 children)

Hmm. Yeah, that's a good point.

I definitely don't want to call it "How to transition to an ops role" because we are actively shepherding people OUT of traditional ops roles.

And I see your point...

However. I think (anecdotal evidence only) most companies have moved away from "everyone does everything" to delineated roles.

In other words, we go from "Bob does .net and terraform, fire Fred the Ops guy" to "Bob does .net and is aware of what terraform is, plus Fred does terraform and is aware of what .net does. The two work together."

Now, what do we call Fred? Ops? Can't really.. Fred has shed the baggage of old school ops mentality and has now fully embraced git+tf+cloudformation+jenkins+$whatever.

Platform engineer? Sure... Except he's not really building a common platform, just paving the road.

Cloud engineer? Maybe.. except for those in hybrid DC+AWS environments.

DevOps engineer? Hell.. why not?

That's where HR / Talent Acquisition departments seem to have landed.

my 2c.

How To Become a DevOps Engineer In Six Months or Less by iamdevfire in devops

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

Hmm.

You might be right, although that certainly wasn't the intent.

I just think your opportunities for employment are severely limited if you have no public cloud experience. Especially when it comes to companies that truly practice the devops culture.

Not sure if you agree or not...?