BasiliusCarver
BasiliusCarver on Hacker News
Thanks. I haven't used nix myself so I'm not sure... If you have the powershell nix package installed you should be able to use Install-Module like in any other environment.
Posted by
BasiliusCarver on Sunday September 08, 2024 @04:20PM
from the show-hn dept.
https://pwshspectreconsole.com/reference/demo/get-spectredemofeatures/
I like spectre.console and wanted to be able to use it in powershell scripts so I built this module.
I’ve used this:
dig @1.1.1.1 ch txt whoami.cloudflare +short
Astro is awesome. It’s easy enough to get started with a template for a static site and flexible enough to build dynamic web apps.
My static personal site is Astro hosted on cloudflare pages https://github.com/ShaunLawrie/shaunlawrie.com
And I used their documentation template https://starlight.astro.build/ for my autogenerated docs on https://pwshspectreconsole.com/
I love having the ability to focus on the content and never having any blockers if I want to do something weird like embed a prebuilt react component for some edge cases.
Posted by
BasiliusCarver on Sunday May 21, 2023 @01:59AM
from the show-hn dept.
https://github.com/ShaunLawrie/PwshSyntaxHighlight
I had some fun learning to parse PowerShell code with the built-in abstract syntax tree for this one. I originally wrote it to add some color to the output in PowerShellAI.
Posted by
BasiliusCarver on Thursday May 18, 2023 @06:58AM
from the icannwiki.org dept.
I built it into the existing PowerShellAI module because I was learning as I went and I was already using it. The module already has quite a bit of adoption too so I figure it’s a good way to find bugs and get some feedback. Just launch it to a few hundred people and see what works.
Posted by
BasiliusCarver on Wednesday April 19, 2023 @03:17AM
from the show-hn dept.
https://shaunlawrie.com/blog/powershellai/
I’ve been having fun generating code via LLMs but getting frustrated with the common pitfalls (hallucinated functions, parameters, mixed up language constructs etc.). I use PowerShell a lot in my daily work so I built something to help generate a lot of boilerplate code I need. I’ve used the PS abstract syntax tree to parse the LLM output and validate that common issues aren’t present, if they...
I’ve lurked for years and have decided to start writing stuff down in public
https://shaunlawrie.com/Hand written HTML/css/js deployed via cloudflare pages
I've always used shell scripting of various types and tend to work to whatever is available in the operating environments I'm working in.
If I'm doing stuff in Windows-land I'm going to use PowerShell because it's readily available and it's an "object"-ively good shell scripting language as it's tightly integrated with the OS (Windows treats everything as objects).
Bash is tightly integrated with the unix-like OS's where the OS treats everything as text and the shell scripting environment plays well with that. Trying to use PowerShell to integrate with tooling that assumes you want to always receive text can be a pain especially when it sends debug messages over stderr which PowerShell treats as an exception (looking at you git).
I still use pwsh on Linux for things like Github actions because being able to do something like this is nice considering how often you need to interact with JSON based apis, rather than getting the raw text of some json property using jq you get the actual type and can use .NET to deal with them:
$responseVariable = Invoke-RestMethod "https://jsonplaceholder.typicode.com/posts/1"
Write-Host "Title is '$($responseVariable.title)'"
Write-Host "Title is a '$($responseVariable.title.GetType())'"
Write-Host "UserId is '$($responseVariable.userId)'"
Write-Host "UserId is a '$($responseVariable.userId.GetType())'"
> Title is 'some text blah blah blah'
> Title is a 'string'
> UserId is '1'
> UserId is a 'long'
I think I've been using bash-like stuff for ~15 years and PowerShell for the last 3 and now that it's cross platform I reckon it's definitely worth having a look at, I wasn't so keen on learning when it only applied to Windows Server management.
“Solidly between terrifying and awesome” is a great description thanks
Haha I didn’t expect to see my name while I scrolled through HN this morning. This is my PowerShell script I added to PowerShell Gallery this weekend. I submitted it as “Show HN” a while ago and the only feedback I got was “arrow keys are impractical” so I added basic Vim keybindings
My whole career has been built around what you say you’re good at and I love it. I see debugging and optimising as puzzles. I started in test automation and performance engineering and went through sre and now platform engineering
Love it when you do the “who wrote this” git blame and it was <myself@now-2y>
Posted by
BasiliusCarver on Saturday October 01, 2022 @10:31PM
from the ask-hn dept.
I went through it and I’ve seen others think the same. It’s where you think you know the best way to do something so the old software is just plain wrong and “needs to be completely rewritten” but you don’t really have enough context to understand the business cost vs reward of a rewrite. X axis == time
Y axis == confidence
| : : /
| : re- : _/
| /:write:\_/
| _/...
Added customizable keymappings and a vim default :p
Posted by
BasiliusCarver on Wednesday September 28, 2022 @11:04AM
from the show-hn dept.
https://shaunlawrie.com/blog/pwshsprites/
I got a bit carried away writing an editor so I could draw some pixel art for starting my blog and ended up with some pwsh spaghetti that's quite fun to use.
Nicely presented. It’s fun but the new-user learning curve is definitely frustrating (especially because most of the documentation is super dry). I ended up with this after a while of playing with the language
https://github.com/ShaunLawrie/TicTacTOBOL
I’ve found it pretty handy to run a defragmentation in a guest OS before trying to shrink virtual hard drives. Not sure it affects all virtual drives but hyper-v vhdx can compact poorly if the data is quite fragmented and it’s often easier to defrag in the guest if the filesystem isn’t something you have drivers for on the host.
Posted by
BasiliusCarver on Thursday September 01, 2022 @11:13AM
from the show-hn dept.
One of the things I’ve done before among the other suggestions is to put a hidden link like /followmeifyouscraping.html in the landing page to get a bit of info about scraping volume and then you can use fail2ban filters to block if it’s visited if you want
Posted by
BasiliusCarver on Monday July 04, 2022 @08:30PM
from the bitstamp.net dept.
I had fun a few years ago learning a little bit of COBOL and wish this had been around then because you never know if any of the documentation is relevant to modern-ish COBOL.
Feel free to repurpose this version of tic tac toe for learning
https://github.com/ShaunLawrie/TicTacTOBOL
Posted by
BasiliusCarver on Friday April 22, 2022 @02:38AM
from the show-hn dept.
https://github.com/ShaunLawrie/HnsExplorer
I've been playing with cross platform windows/linux Kubernetes clusters recently and have had endless problems with installer scripts misconfiguring networking by using the wrong NIC etc.I got frustrated with the tooling on windows to debug container networking so I built a tool that attempts to stitch together the HNS (Host Network Service) & HCS (Host Compute Service) resources into a...
Thanks, I might give "Connect FORTRAN" a go next
I started by copying a COBOL helloworld program and working through the concepts on
https://www.tutorialspoint.com/cobol
It's very lightweight but that's what I was after.
What I wish I had done from the start was compile with all warnings (-Wall) because it would have caught a few things like me assigning constants to variables (pictures in COBOL) that were not the right size so they were silently truncated at runtime
Posted by
BasiliusCarver on Sunday May 24, 2020 @11:02PM
from the show-hn dept.
I wanted to learn a little bit of COBOL so I could have a better understanding of the code underpinning a large amount of the money that flows through our banks. I found it quite enjoyable and it's less scary than I anticipated given the reaction I've seen from a lot of developers. If anyone has pointers for how I could improve this feel free to hit me with a PR.