HNHacker News
TopNewBestAskShowJobs

GSGBen

261 karma · joined January 26, 2020

https://twitter.com/GSGBen
submissionscomments
GSGBen··on SolarWinds: What Hit Us Could Hit Others
No mention of using an "air gap" in any of the comments here.

Air-gapped networks are a pain to work with but are incredibly effective. I still haven't read anything on how the attackers actually reached the build server though, so it's hard to say if it would have worked in this specific case. I wonder if the lack of a clear statement of how they made the initial breach is due to

- bad searching on my part

- they still don't know

- they're still trying to mitigate it

- they're still trying to word it in a PR-approved way

GSGBen··on Parsing JSON at the CLI: A Practical Introduction to jq and more
Yep. Love powershell, disliked this decision, but now understand it: objects returned from native powershell commands have a loooooooooooooooooooot of nesting. Try:

  gci | select -first 1 | ConvertTo-Json -Depth 2
  gci | select -first 1 | ConvertTo-Json -Depth 3
  gci | select -first 1 | ConvertTo-Json -Depth 4
one at a time.
GSGBen··on Parsing JSON at the CLI: A Practical Introduction to jq and more
Everything in powershell is an object, but sometimes the output format doesn't make it clear. Select-String basically returns a match object with some nested results, but the output formatting makes it awkward to see. Pipe it to

  | format-list *
to investigate it, and you'll see a bunch of members. In this case if what you want is just the matched string, you want to expand the `Matches` property of the object, then expand the value property of each of those. In this case the term 'expand' is key: if you just use `select` it'll return you the property, name and all. Use `-expand` to return the plain array. So something like:

  Get-ChildItem -Recurse -Path * | Select-String $pattern | select -expand matches | select -expand value
which you can then use how you like. An alternate form is

  (Get-ChildItem -Recurse -Path * | Select-String $pattern).Matches.Value
because the . notation for member access works on all items in an array (Matches in this case).
GSGBen··on Use long flags when scripting (2013)
Yep, the readability of PowerShell puts other shell scripting to shame. The "verbose default + short aliases" design is fantastic for maintaining both script readability and one-liner speed.
GSGBen··on Ask HN: I'd like to learn vocals, any suggestion on how I can do this?
I feel this is very very wrong and damaging, I'd like to make sure anyone reading this comment has a balancing comment to read against it, mainly about the pitch thing. The kind of thing I wish I'd been able to read 10 years ago.

First, you're probably not tone deaf. If you can differentiate between one note and a note a semitone away, you've got enough pitch to sing. If you can watch two youtube videos, think one sounds good and one sounds bad, you've got enough pitch to sing.

I spent a long time worrying about this because I struggled with pitch a lot, and then even though I could eventually (with a lot of adjustment) get my voice to make a sound at the same pitch as a piano key, it didn't sound "right" or "good". Even though the tuner told me i was right on it. Also the pitch always seemed different inside my head to listening back to it.

In the end it turns out it's all about frequencies. Your voice is making a whole bunch of them when you vocalise, it's not just a simple sine wave, and these resonate at different places, and sound different inside your head (to you) and outside (to everyone else). When I had the pitch issues, I actually mainly had placement issues. Good placement feels like cutting off the lower half of my voice, but is pretty much just you making the right frequencies and more importantly avoiding making the wrong ones. To a natural singer this probably sounds like crazy talk, but to someone who always sounded bad, this is life-changing.

So yeah, ignore the parent comment, find a good teacher who started from nothing and can teach you placement (I still recommend https://bohemianvocalstudio.com/), and practise like crazy. You'll never look back.

GSGBen··on Ask HN: I'd like to learn vocals, any suggestion on how I can do this?
Get regular Skype lessons with Kegan from https://www.bohemianvocalstudio.com. He also has YouTube videos up so you can get a taste for what he focuses on first. Don't worry if he doesn't sing in the exact style you want, because it's all about foundational principles. It's life-changing stuff.

If that won't work for you and you're set on in-person lessons, try to find someone who was never a natural singer, and had to learn everything from scratch. They'll be able to pass on more than someone who started with a basic natural ability.

GSGBen··on Ambitions for a Unix Shell
(Replied to op instead of comment):

Is your complaint about PowerShell the verbosity? Because I love its approach to this: full verbosity is the default (great for scripts), then terminal usage is improved by aliases (ForEach-Object is just %), great autocomplete via psreadline, and automatic parameter shortening: -re and -fo are automatically understood as -Recurse and -Force. Honestly makes every other shell a pain to use now for me.

Also having everything be object based is just...I have no idea how I lived before.

← PreviousPage 3 of 3