• 0 Posts
  • 28 Comments
Joined 1 year ago
cake
Cake day: July 5th, 2023

help-circle


  • As a long-time bash, awk and sed scripter who knows he’ll probably get downvoted into oblivion for this my recommendation: learn PowerShell

    It’s open-source and completely cross-platform - I use it on Macs, Linux and Windows machines - and you don’t know what you’re missing until you try a fully objected-oriented scripting language and shell. No more parsing text, built-in support for scalars, arrays, hash maps/associative arrays, and more complex types like version numbers, IP addresses, synchronized dictionaries and basically anything available in .Net. Read and write csv, json and xml natively and simply. Built-in support for regular expressions throughout, web service calls, remote script execution, and parallel and asynchronous jobs and lots and lots of libraries for all kinds of things.

    Seriously, I know its popular and often-deserved to hate on Microsoft but PowerShell is a kick-ass, cross-platform, open-source, modern shell done right, even if it does have a dumb name imo. Once you start learning it you won’t want to go back to any other.


  • I suspect i might be the winner here. My friend had an alley behind his house along with a nice strip of open land near a busy road. Eventually a strip mall was built and then another large commercial building started to go up. Being basically behind my friends house we walked over to this new building on weekend to check out the construction site.

    The building was being built with cement block and had lots of scaffolding and yet-unused block scattered around. I found a pipe-bender - a very heavy tool made out of high quality steel - and found you could just tap on of these cement blocks and it would shatter to pieces. I was fascinated, as were my friends. I have no idea how many cement blocks we destroyed over the next couple of days, but it was a huge number. Then we decided to see if we could go through a wall with the pipe bender… we could indeed, making a hole in the side of the building we could walk through. Looking around we eventually realized what we’d done was awful… we had decimated this construction site. We finally slinked away and come Monday when the crew returned, police were called and neighbors interrogated but thankfully with privacy fences all around, none of the neighbors saw anything. 11 and 12 yr olds are stupid.







  • It all depends. I don’t have a will of steel, that’s for sure. I started it to lose weight but have continued after my chronic heartburn stopped immediately, my eczema went away, my blood sugar came down and my triglycerides dropped to a normal range. I take 0 prescription meds now.

    I feel so much better, no longer have heartburn wake me up in the middle of the night, and no longer have my fingers crack and bleed from eczema. 7 years in and it’s really no trouble staying on the diet. The 45 lbs I lost turned out to be a minor benefit of the diet, not the major benefit.


  • I disagree.

    It’s rare to hear of someone killing or injuring themselves working on home electrical fixes. I’m pretty old and can’t even recall an incident. Most people won’t do it because they do have enough fear not to play around with it. But if you do know enough, you know how incredibly simple it is to replace an outlet or light switch and how to do it safely. Even a overhead light or fan is pretty trivial. Also the US 120v standard is less likely to cause harm with a stupid mistake than some other countries that have higher voltages. I’m thankful the states allow homeowners to do this themselves.

    There are definitely things people shouldn’t do with a license, but swapping switches and outlets is more trivial than changing the oil on your car.


  • Couldn’t agree more. It’s a great shell and scripting language. It’s object-oriented nature, native support for virtually every text format (csv, json, xml) and great libraries for others (yaml, excel), awesome regex and web/rest services support… it’s hard to beat and works on virtually every platform.

    Too few people in the Linux community will even look at it though since it has MS name on it.





  • Can prevent a restore, whereas doing the update with auto commit guarantees a restore on (mostly) every error you make

    Exactly. Restores often result in system downtime and may take hours and involve lots of people. The backup might not have the latest data either, and restoring to a single table you screwed up may not be feasible or come with risk of inconsistent data being loaded. Even if you just created the backup before your statement, what about the transaction coming in while you’re working and after you realize your error? Can you restore without impacting those?

    You want to avoid all of that if possible. If you’re mucking with data that you’ll have to restore if you mess up, production or not, you should be working with an open transaction. As you said… if you see an unexpected number of rows updated, easy to rollback. And you can run queries after you’ve modified the data to confirm your table contains data as you expect now. Something surprising… rollback and re-think what you’re doing. Better to never touch a backup and not shoot yourself in the foot and your data in the face all due to a stupid, easily preventable mistake.