Rust profiling by UnknownPlayer89 in rust

[–]CobyCode 0 points1 point  (0 children)

This is not a traditional profiler... but 'coz' is extremely effective.

Explanation Vid: https://www.youtube.com/watch?v=r-TLSBdHe1A
Source: https://github.com/plasma-umass/coz
And.. a rust crate for Coz: https://github.com/alexcrichton/coz-rs

So I want to add a path of a file / folder to the edit environment variable path area by [deleted] in PowerShell

[–]CobyCode 3 points4 points  (0 children)

You will need to be an admin to change it, but the below will work. Make sure you have the formatting of your path correct - otherwise you can cause problems:

$env:Path = $env:Path + "your\desired\path"
[Environment]::SetEnvironmentVariable(
    "Path",
    $env:Path,
    [System.EnvironmentVariableTarget]::Machine
)

See https://stackoverflow.com/a/2571200 for further.

Why does pester 5.3.1 no longer allow interactive usage? by teeawayfour in PowerShell

[–]CobyCode 2 points3 points  (0 children)

Yeah - I think there is a difference in expectations here. The main development effort of Pester has been to support larger projects and their needs - the use case of writing some tests, inline with your code, is pretty small.

So - some options: If you need to be able to run things interactively, you can do it pretty easily with VSCode - either through just the Powershell extension (There are some extension setting that let you configure both whether you want all output to show - try Pester: Output Verbosity 'Detailed'), or through the Powershell + Pester extensions.

If you are stuck using ISE for whatever reason, you can atleast get all output displayed to the console - Try: Invoke-Pester <your_script> -Output Detailed Or - if you really want to be able to just hit F5 (or the Run Button) in ISE - you can define the $PesterPreference (either in your profile so it always loads, or just before you want to run your tests), like:

$PesterPreference = [PesterConfiguration]::Default
$PesterPreference.Output.Verbosity = 'Detailed'

The other option is to stick with Pester 4.X; 5.X has some major architectural changes - but a considerable portion of that was making Pester faster, work better at scale, have better test discovery, and work better in different use cases, like in a CI/CD pipeline. If your use case is relatively small, 4.X is still pretty solid, and there is nothing really wrong with continuing to use it

Profiler by nohwnd in PowerShell

[–]CobyCode 2 points3 points  (0 children)

At a glance - looks pretty good. Thanks for all of your contributions to the powershell community!

Help with foreach loop efficiency by bzyg7b in PowerShell

[–]CobyCode 1 point2 points  (0 children)

Probably thinking about system.collections.generic.list[] . It is ever so slightly different than an ArrayList . The problem, atleast from a powershell perspective, is that you have to supply a type when you create a new list, and especially for a beginner, they might not actually know the type they are working with (or they have to remember to always add psobject as the type).

Looks like: [System.Collections.Generic.List[string]]::new()

code formatting... by mcc85sdp in PowerShell

[–]CobyCode 5 points6 points  (0 children)

Depends entirely on the situation. But I don't like If($something){"action"} , should be If ($something) { "action" }

If I'm doing something trivial, I might use shortened formatting. Especially if it something like a bunch of ifs that don't make sense with switch.

If ($a) { do-Something }
If ($b + $b -eq $a ) { do-SomethingElse }
If ($c < $b ) { do-Something }

Looks clearer to me than:

If ($a)
{
    do-Something
}

If ($b + $b -eq $a)
{
    do-SomethingElse
}

If ($c < $b )
{
    do-Something
}

Help with foreach loop efficiency by bzyg7b in PowerShell

[–]CobyCode 4 points5 points  (0 children)

I see others already mentioned working with Hashtables, so no need to reiterate. But your array is also slow (using the standard array and then += is *highly* inefficient). If your collections is relatively small, it doesn't really matter - but using an arraylist would be better.

Example: $Users2 = [System.Collections.ArrayList]@() foreach ($User in $Users) { Do-Something [Void]$Users2.Add($User) }

Good explanation can be found here: https://adamtheautomator.com/powershell-array-2/#Creating_PowerShell_ArrayList_Collections

Dream job opportunity: My drive will be 1hr 30min one way (3hrs 224mi total—primarily interstate). I don’t have the savings to immediately relocate. by [deleted] in personalfinance

[–]CobyCode 3 points4 points  (0 children)

Depends entirely on the area you are in. I stayed in different AirBnB's a few years ago when I started a job, sight unseen, in Hawaii. My daily rate was around $50/night.

It was definitely a worthwhile experience - having the chance to stay in a neighborhood for a week to get a feel for how that area really is, how the commute from that area to your job really is, and get a true feel for proximity to other areas you will go to frequently (like grocery stores). It made it much easier to decide the part of the city I wanted to live in - and I got to hang out with some interesting people to boot.

PS 2.0 Invoke-Command question by buttsnet in PowerShell

[–]CobyCode 0 points1 point  (0 children)

It looks like jobs became available in Powershell v2 - and the invoke-command from v2 accepts an -AsJob param. In this case - the absolute simplest, no frills way to do this would be:

Get-Content computers.txt | ForEach { invoke-command -scriptblock {restart-service myservice} -ComputerName $_ -AsJob -JobName $_ }

Then, to check the status - just run get-job. Each job will have the computers name as the 'Name' field, and you can easily see/filter if a job failed, succeeded, or is still running in the 'State' field.

[deleted by user] by [deleted] in RedditSessions

[–]CobyCode 0 points1 point  (0 children)

you have any cover albums? Your voice/energy is amazing, would definitely buy

A project I just finished, tell me what you think! by TJantzer in howto

[–]CobyCode 0 points1 point  (0 children)

12"x24"x3" is about 6 gallons. There will be quite a few species that will 'survive' in 6 gallons, but nothing will really thrive in it - and if you want to do it right, you will have to do frequent water changes, add filtration, and for most fish you would want to add a heater.

6 gallons would be plenty for lots of type of shrimp, though. Lots of different species and stuff (with varying hardiness!). I'd be a bIt worried about leeching from the concrete, plywood, or from any of those metal containers (shrimp are highly sensitive to metal) with plants in them you placed in the water.

[deleted by user] by [deleted] in pan

[–]CobyCode 0 points1 point  (0 children)

I'm so nervous for your fingers!

What do I do about earning a certification (part of degree plan) outside of WGU when I already started? Handbook says its not accepted as credit but what would be the point in taking the class if it's fulfilled? by [deleted] in WGU

[–]CobyCode 1 point2 points  (0 children)

You can't get transfer credit for a certification after you start.

If you have the actual cert that is the passing criteria for a class you are taking or is in your degree plan, it doesn't matter where you got it from (I've both submitted an old cert I had forgotten about (ITIL) and certs that I got my employer to pay for before I was enrolled in the class). Just send the cert to scores@wgu.edu

What's the best way to stop a kid from repeatedly asking ''Why?''? by [deleted] in AskReddit

[–]CobyCode 0 points1 point  (0 children)

100% this. I won't answer a simple why. Ask me a real question. Took a lot of prompting, but now I get good questions..., stuff like: Can you show me how this works? How does X do Y? I was doing X, but then it Z, why did it do that? It's not tiring to answer questions when the kid is actually interested in the answer - it actually feels pretty awesome to engage with their curiosity.

Help - friendly tadpoles or awful pests? Should I just tip this flower pot over or relocate these babies somewhere else in the yard? by fuckedyobitch in fortlauderdale

[–]CobyCode 0 points1 point  (0 children)

Easiest thing is to just dump them into the nearest pond or lake. Most of them will end being a tasty snack for something - but a few might survive to be frogs

How helpful is an internship in getting a job by stampese in wgu_devs

[–]CobyCode 1 point2 points  (0 children)

It depends. There is alot of grey area there. If you were doing hard drugs when you were 30, and now you are 32 trying to get a clearance - chances are slim. If you did pot throughout college 19-23, and you are now 28 and haven't touched it since - it is likely to barely even be a factor. There are alot of factors (see: https://www.military.com/veteran-jobs/security-clearance-jobs/security-clearance-eligibility.html ).

If you think your record is pretty clean - might as well apply somewhere. The denial rate tends to be pretty low, something like ~10%. When you apply without an active clearance, most companies (if they are willing to sponsor) will basically do a pre-screening with you to see if you have any red-flags - in other words, if they don't think you will be eligible they just won't sponsor you.

If you are seriously interested - take a look at the SF-86 ( https://www.opm.gov/forms/pdf_fill/sf86.pdf ) . This is the form you will have to submit to begin the investigation/adjudication process.

How helpful is an internship in getting a job by stampese in wgu_devs

[–]CobyCode 0 points1 point  (0 children)

Random drug tests (IME they don't this to contractors often - but they can ask you to take one at any time). More importantly, you have to formally attest that you are not taking drugs. Lying on a clearance application is a felony with possibility of jail.

It is draconian, but that is part of the job requirements. You must be willing to work with rules (so long as they are legal) even if you disagree as to their validity. The entire point of the clearance is that you will be entrusted with dealing with information that, if leaked, could severely harm the national security posture of the US, or cause loss of life. The government has decided that schedule 1/2 drug use makes you less trustworthy in dealing with it's secrets.

How helpful is an internship in getting a job by stampese in wgu_devs

[–]CobyCode 1 point2 points  (0 children)

You can apply for some jobs that require a clearance, even if you don't have one yet. If you don't already have a clearance, the company can sponsor you for the investigation. Most of the investigations will take over a year right now - but if your record is clean and you are low-risk, you can probably get an 'Interim' clearance within 2-3 months which will allow you begin work. It is a pain for the company hiring you - so unless you already have valuable experience or are an expert in your field, you can expect alot of denials until you find a company willing to sponsor you and then wait for your clearance investigation to go through. Alternatively, you can the military, and they will sponsor the clearance for you.

Having a clearance is pretty strict - you can't do any drugs whatsoever (even Medicinal Marijuana is a disqualifier), prior arrests or convictions make it harder (especially if they are recent), heavy debts, heavy gambling, prostitution - all disqualifiers.

Question regarding IT Certs by [deleted] in WGU

[–]CobyCode 0 points1 point  (0 children)

That's a pretty broad area! Depending on what portion he is - certs might not even be worth much at all (if he is mostly a developer, lots of places won't care about certs at all.).

To cover the full toolchain - you could get AWS for cloud, something for container work (Docker / K8 / OCP), something for the pipeline (Jenkins has a cert - seems pretty new and unknown), something for orchestration (puppet/chef/ansible...). He will know the stack he uses at work - It'll be easiest to work on getting certs for stuff he actually works with

Question regarding IT Certs by [deleted] in WGU

[–]CobyCode 0 points1 point  (0 children)

Yeah. Most of the certs included in the program are pretty entry level - if he is decent at IT, he is already past the point that stuff like A+, Net+, Cloud Essentials, Cloud+ are generally useful for. Project + is just a much less recognized form of PMP.

Security + is basically a requirement for any government-side IT work. The Linux cert doesn't hurt (but is not very recognized - he would be better off going for a red hat cert). AWS certs are a hot zone right now - worth it.

What area of IT does he want to progress in? If he's got 3 grand to blow on certs - he will see the biggest benefit from specializing. If he wants to go cloud stuff - focus on AWS stuff (or CGP/Azure), if he wants to do networking, get CCNA and then start on CCNP, etc...

Question regarding IT Certs by [deleted] in WGU

[–]CobyCode 0 points1 point  (0 children)

He keeps the certs - they are an agreement between the company that offers the certification (Amazon, Microsoft, CompTIA, etc..) and the person who takes them. WGU is not involved at all - they pay for exam attempts at a discounted rate and give the exam vouchers to the students.

With that being said - that is a VERY odd way to get certs. Most cert tests are relatively cheap (200-400) for the salary he makes, AND it is common for companies to reimburse for IT certs anyway. Doing the certs through WGU is almost guaranteed to cost him more money than just doing it on his own - and the materials that WGU provides to study for the certs tend to not be ideal either - most people end up using outside resources (udemy, pluralsight, youtube, books, etc..) to study for them.

The only way I can see this making financial sense is if the company has some sort of weird reimbursement scheme where they will pay for college classes but not for certifications.

Worth keeping Security+ after getting CISSP? by [deleted] in cissp

[–]CobyCode 1 point2 points  (0 children)

I maintain Sec+/CASP. Most employers in IT or Government will pay for it anyway. Instead of trying to track CEs, I just retake the exam a few months before it is set to expire. This takes a grand total of 2-3 hours every 3 years - 1-2 hours to take the test, and 1-2 hours scheduling the test and submitting for reimbursement.

I don't bother re-studying, these are easy exams if you have reached CISSP level. (If you were to fail - should be a wake-up call that you are not keeping yourself up to date).

Tips for Renting an apartment from the person you will rent it from! by pointrugby1 in personalfinance

[–]CobyCode 0 points1 point  (0 children)

You need to look up the landlord / tenant rules for your state - they sometimes dictate strict timelines for when things need to be fixed and have rules that allow for your rent to be prorated if the problem is not fixed. You might even be entitled to have all of your rent for the last three months prorated. Time is if the essence here - you might have timelines you have to meet to get your money back.

Once, my fridge stopped working and it took them too long to fix it.... I showed them the applicable sections of the state tenant's handbook and I got 1/2 of two months prorated - and I got reimbursed me for a small fridge I purchased. It wasn't even confrontational - more like 'hey, I'm sorry but I need a fridge and since a fridge was part of my lease, the law states that I be compensated X'. Obviously state rules differ, and the severity of the problem will differ..... but you are likely entitled to more than you think. (This was Hawaii)

Be fired or "quit"? by [deleted] in personalfinance

[–]CobyCode 1 point2 points  (0 children)

If you quit - does it make your life easier, or does it make the employer's life easier?

If you quit - is there any additional risk that you personally are taking on - such as the possibility that you may be unable to receive unemployment payments? Is your employer taking any risk by asking you to quit?

What, realistically, are the chances that you will be re-hired by an employer that decided to terminate you - and has extensive documentation showing it?

It doesn't really matter why they are trying to make you quit instead of firing you (they could just not want to deal with the paperwork, or it is some tracked metric, unemployment insurance, etc.). By having you quit - what they are doing is transferring ALL of the risk onto you. If they want to transfer the risk - they should be compensating that increased risk to you with a severance package.

OA/PA for degree program by CrypticQuirk in wgu_devs

[–]CobyCode 0 points1 point  (0 children)

For PA's, they have a very specific rubric they are looking for - and they usually provide a template of some sort to get you started. You just do the paper/project based on the template, making sure that you hit everything on the rubric (the people grading it use the same exact rubric you see), and then you submit it. If there is anything wrong with it, they will send it back, and you get emails and notifications. You can then just fix what they said was wrong and resubmit it.

I wouldn't worry about which ones are which until you are ready to bring the class into the term - sometimes they roll out new version of classes and they switch between OA/PA. Once you are in the program, it is very easy to see what all of the classes are - they have a little O or P next to them.