HNHacker News
TopNewBestAskShowJobs

Samon

124 karma · joined April 9, 2017

submissionscomments
Samon··on Ask HN: What music do you listen to when programming?(or do you not?)
I find I'm best "in the zone" for development while listening to electro-house or deep house. The genre lends itself to minimal lyrics (some of what I listen to might be in a foreign language, but even that which is in English is usually very 'shallow' and repetitive). Basically lots of deep bass thumping along at a reasonably consistent pace with a 'light' melody on top :)
Samon··on The Man Behind Windows PowerShell
I write hundreds of lines of PowerShell every day, and quite like it as a language. Coming from a C# developer background, I initially struggled when I first started with PowerShell, but I believe this was mainly 1: the many quirks and issues with the early versions of PowerShell (this was back in PowerShell v1 days), and 2: that I was trying to use PowerShell as if it were C# (or a similarly 'structured' language).

Yes, the output from calling native commands within functions can be a little tricky, and something that annoyed me initially, but once you understand the concept of passing objects around, not strings, you quickly get used to either capturing the output into a variable ($BlahResult = .\blah.exe /foo bar /baz 2>&1), where you can then access the string output (stdout) and any ErrorRecord (stderr) lines, or as you suggested, piping to Out-Null if you don't actually need the output. If you're writing your own 'echo' type statements for debugging or information purposes, you learn to use Write-Verbose or Write-Debug instead of Write-Output (which is what happens by default).

The unwrapping example was something that got me initially, because I was used to defining a collection (array, List, whatever), populating it, and then returning that collection... and then having the calling code iterate over that collection. "The PowerShell way" is to not focus on the collection/array at all, but instead just let it take care of that and deal with the items themselves. If you pipe the output of a function to Foreach-Object, it will work correctly - if it's a single object returned, that's what will be $_ in the loop, if it's multiple, they will all be passed in one-by-one as $_... if you actually want to access the array itself (for example to count the number of items), then you can enforce the array type by wrapping it in an additional array (i.e. @($Users).Count).

Samon··on Ask HN: For a dependable desktop Linux, is there anything other than Ubuntu?
Another vote for Fedora here. I've been running it for years on multiple different desktops and laptops, it has been really rock solid. The only thing I would say in favour of Ubuntu (and by extension, Mint) is that because they are targeted more at a 'beginner' Linux user, there tends to be more documentation/tutorials online (e.g. "how to do X in Ubuntu"). Of course with some experience and googling, most of those are easily adapted to other distros too.
Samon··on Ask HN: How can I find 20-25 hour week programming jobs?
Do you not consider the "meetings + other things" work? If that's what is required as part of your job, how would working less hours help?
Samon··on Ask HN: What is your profession?
Title is 'Senior Automation Engineer', but basically I write workflows (PowerShell/SMA and ServiceNow's dialect of Javascript) to automate/orchestrate IT operations processes. Stuff like user onboarding and offboarding, systems integrations between various internal and external/cloud systems, lots of 'customer requests X, perform the steps to deliver X'.
Samon··on Ask HN: Share Your Raspberry Pi Project
I've built my home automation setup around Raspberry Pis.

I have an old Nexus7 tablet mounted on the wall (3D printed wall mount which incorporates a wireless charging coil) which hits the web UI of NodeRED running on a Pi to provide a 'home control panel'.

There's a pi with a heap of relays which controls things like my garden lights, sprinklers, motorised curtains (3D printed adapters to convert standard curtain tracks into motorised ones), etc, and then I have a number of Orvibo S20 WiFi power sockets to switch things like lamps on and off.

I have a pi mounted behind the front entrance panel acting as a doorbell, also connected to a camera module which triggers push notifications etc when motion is detected. This also ties back into the main 'automation hub' via NodeRED.

I also built an aquarium monitoring/control system on another Pi, with ambient and water temperature probes, a bunch of relays turning filters, lights, heaters, pumps, etc on and off, and an IR-emitter to send the relevant commands to my lighting fixtures to control the colour temperature and intensity (providing a 'sunrise'/'sunset' effect). Again, this all ties back to the main system using NodeRED.

Unrelated to the home automation, I also use a Pi to manage and run my 3D printer using OctoPrint, and run my media centre using LibreElec/Kodi/Emby (with my media stored on my main workworkstation and served via Emby).

Samon··on Switching to the Mutt Email Client
"Data Leakage Protection". The idea being that the everything that ever goes in or out of a mailbox is recorded, audited, etc. Yes, deleting an email/thread doesn't remove it from Vault, but this way, other than copying/pasting from the browser window into another client, there is always a trail of where an email went, and users can't "take home" a dump of their entire mailbox. When legal get involved and need a dump of "every email between employee X and external party Y", there is no question of whether a different SMTP server was used so we may not have a record of the sent messages, etc.
Samon··on Switching to the Mutt Email Client
I agree. I work in a large-ish company (~9k) who a few years back moved from Exchange/Outlook to GSuite (with POP and IMAP disabled) - so using anything but the Gmail web interface and/or the mobile apps is out of the question. Add in the obligatory (and yes, slightly annoying) corporate managed email signature (HTML), the fact that everyone is used to just copying images/screenshots inline with the text, and of course the very tight google mail/calendar/drive integration, and I don't think that even if I could use a text-only client outside the Google ecosystem, it would be a viable option.
Samon··on Ask HN: The best free alternative to MS Word?
If you're after 'The Most Compatible Free Office Suite', in terms of file compatibility, user interface/experience, etc, you can't go past WPS Office (wps.com) for Windows or Linux.
← PreviousPage 3 of 3