10 ms·
Couldn't agree more. As a die hard Unix guy and ex Slashdot-esque zealot (colloquially a bit of a twat). Yet I'm knocking out PowerShell all the time now and d
by wumbernang 11y ago
Couldn't agree more.
As a die hard Unix guy and ex Slashdot-esque zealot (colloquially a bit of a twat). Yet I'm knocking out PowerShell all the time now and dread having to log into the pile of CentOS kit I have lying around. It is arcane. Even after 15 years I spend most of my time in the manpages or working out another damn config format.
Literally did a two liner to scrape a web page, parse it and call a REST endpoint with the parsed data as JSON in PowerShell. I cant even use python now. I've been broken.
It makes me cringe saying all this as well kind of like a racist making amends with his past.
The only thing I still hate is windows update.
- halo 11y agoI'm not even a Powershell fan, I'm just not especially fond of Unix-likes, which feel like a local maximum that has turned into an unchangable standard. I think Unix-like environments feel dated, clunky and there's a tendancy for it to result in permanent bloat, stagnation and a web of interdependencies. I understand that lots of people are familiar with Unix-like tools and their many idiosyncrasies and like to be able to transfer that knowledge across platforms. But that doesn't mean there isn't merit to a platform not conforming to that and trying to improve on it.
- pjc50 11y agoLots of people keep using the word "bloat" to refer to Linux as opposed to Windows, which I find bizarre given that it's long been a criticism in the other direction.
- tcfunk 11y agoYeah, I would genuinely like to know what all is considered to be bloat within the Unix space. If anyone could point to some information about this I'd be curious.
- cactusface 11y agoX11, KDE, GNOME, GCC, Emacs, Mozilla? Any huge project I guess. The GNU command line tools are not as lean as the BSD ones but so what?
- Thetawaves 11y agoThey also generally have more (useful) features than the BSD ones.
- fallat 11y agoNot only that but they include more documentation inside the binary. Someone also pointed out to me one time that some features in some GNU utils are only possible to have if they are implemented in the binary, rather as a separate program.
- cactusface 11y agoWell, generally speaking nothing is impossible, but it's often more efficient to put the extra features in the same binary. However this "bloat" is nothing compared to your typical desktop or programming environment.
- oldmanjay 11y agoSince the word is used mainly as an insult due to people having emotional attachments to technology, the real question in my mind is how did you not find it bizarre on every use. Or I guess another way to say it is that "bloated" is only a measurement of the speaker's disdain for the software under question. It has little relationship with any actual quality measurement, generally. Bizarre on its face, to me.
- nivla 11y agoMan after years of hearing how bloated Windows is compared to other OSes, I was expecting my first Windows Phone to be the same. But nope to my surprise it was fast and fluid, even on low end devices! I guess, the same can also be said about Win8/Win10 compared to Vista/Win7. Bloat seems like dirt that accumulates overtime. A little bit of cleanup and optimization can sometimes do magic.
- ethbro 11y agoBloat and legacy support are two sides of the same coin. Microsoft chose one answer to that, Apple another. I think Windows Phone is a clear example that Microsoft has technical chops when starting clean, it just lacks business willpower to make decisions that favor performance over support.
- Fiahil 11y agoI would really like to see what would be the glorious future of the "dated", and "clunky" Unix-like environment.
- deleted 11y ago[deleted]
- friendzis 11y agoI disagree. 1. Unix-like environments are (or rather were before systemd) kinda similar and once you drop a shell - good to go. Even with powershell Microsoft have gone down the route of version/feature pinning. If you plan to maintain at least Windows 7/Server 2003 in your scripts - well, powershell 2 is the highest you can aim, bye bye new features, welcome bloat. Red Hat while shipping old versions still backports features. 2. The only thing in Unix-likes being standard are core utils and OpenSSH. Everything else can be anything (SysV/upstart/Systemd, Gnome/KDE/tiny_tiling_wm, bash/zsh) and we are actually deprecating older technologies for new ones (quite often changing the name). Due to ELTS (extremely long term support, often called legacy cruft) core subsystems are mostly the same (on the outside) in Windows. And if it is a server you can bet it is running IIS and MSSQL. 3. Try using `wmic` shell or `net` util. Unbearable clunkiness of such tools and bearable GUI tools mean that we have very little general scripts/tools to transfer
- wumbernang 11y agoThis isn't the case. WMF is available separately. I just rolled our WMF4 over all our kit and we have PS4 everywhere now including win7 and 2008.
- digler999 11y ago> The only thing I still hate is windows update. all those "2 liners" don't mean much if you have to reboot your box every 2 days to apply more emergency 0-day security patches.
- wumbernang 11y agoYeah every 2 days I have to reboot all of our kit to apply updates... http://i.imgur.com/5ZxiLGf.png http://i.imgur.com/5ZxiLGf.png
- wosos 11y agoSo, no security patches?
- wumbernang 11y agoA reasonable question. Only ones that affect the network surface footprint, so none here as it's on a private VLAN.
- beachstartup 11y agothat's a pretty terrible practice no matter what OS you're using.
- hackmiester 11y agoWhy? I assume that "private VLAN" means it isn't exposed to potential external attack.
- mburns 11y agoBeing 'private' only means you don't get hit by drive-by scans from the Internet. There are (depending on configuration) plenty of opportunities for internal attacks, for example the workstation being used to access the boxes. Not to mention removable media (usb, cd-rom) or files copied onto those otherwise isolated hosts could be infected. Patching servers is just good practice. As is designing a system that can handle rebooting individual servers without user-facing downtime.
- currysausage 11y ago> Literally did a two liner to scrape a web page, parse it and call a REST endpoint with the parsed data as JSON in PowerShell. This sounds cool. Can you recommend terse resources for getting to know PowerShell? Is MSDN the best place to look for docs or are there better places to go?
- tim333 11y agoNot an expert but there's a "PowerShell in 10 Minutes" here: http://social.technet.microsoft.com/wiki/contents/articles/15525.powershell-in-10-minutes.aspx http://social.technet.microsoft.com/wiki/contents/articles/1...
- wumbernang 11y agoTBH I couldn't find a decent book or resource and sort of hacked my way around for a year or so. It had a good build in manual (get-help). This is a good poke at the fundamentals of my example: Scrape a page: $flight = " LH3396" $url = "http://bing.com?q=flight status for $flight" $result = Invoke-WebRequest $url $elements = $result.AllElements | Where Class -eq "ans" | Select -First 1 -ExpandProperty innerText Hit a REST endpoint: $body = @{ Name = "So long and thanks for all the fish" } Invoke-RestMethod -Method Post -Uri "$resource\new" -Body (ConvertTo-Json $body) -Header @{"X-ApiKey"=$apiKey} Sources: [1] http://stackoverflow.com/questions/9053573/powershell-html-parsing-get-information-from-a-website http://stackoverflow.com/questions/9053573/powershell-html-p... [2] http://www.lavinski.me/calling-a-rest-json-api-with-powershell/ http://www.lavinski.me/calling-a-rest-json-api-with-powershe...
- hassiktir 11y agoThis is really cool (and unfortunately I know nothing about powershell, I'm young and dumb) but I'm pretty sure this is replicable line for line with bash (and curl, maybe awk too idk). Am I wrong?
- will_hughes 11y agoThe main difference between bash/gnuutils stuff and Powershell is that every command returns an object (or an enumeration of objects), and commands can take an object (or an enumeration of objects) as input. This lets everything implicitly understand how to access named properties without everyone having to do string parsing. Sure, you can solve the same problems with bash/grep/awk/sed/etc - but sometimes it's a bunch simpler to solve in Powershell.
- david-given 11y agoI did find an open source implementation here: http://pash.sourceforge.net/ http://pash.sourceforge.net/ Don't know if it's any good --- never tried it; it says it's about half complete, but I don't know if it's a useful half. After looking at the docs, you could do a lot of what Powershell does with Unix shells; you'd need a different set of conventions, where instead of using unformatted text as an intermediate format you used a streamable table format with support for metadata. Then you could have commands like 'where', which would be awesome. $ xps | xwhere user -eq dg | xsort -desc rss | xtop 10 | xecho "rss=@.rss cmdline=@.command" ...or something. sh syntax is a bit lacking; PowerShell's got lots of useful builtins, including having native support for the format so it knows how to present it to the user. An sh version would conversion routines back and forth from text. The tricky part would be bootstrapping; getting enough functionality quickly enough that enough people would start using it to make it sustainable. I'd still rather use this than faff around with awk, though. I've done way too much of that. And if I never have to parse the output of ls -l using cut again, I will be a happy person.
- XorNot 11y agoIsn't this just complaining you want a different tool? The entire Powershell format depends on, amongst other things, the object interface being sane, existing, and usable. The whole point of the GNU system was working around the usual "I can see it here, need this bit, and want to put it there". If you need to do something really specific a lot, you write a tool which does that.
- david-given 11y agoYes, precisely. The main thing would be to do is to define the stream format, and then persuade people to actually use it. The point of the exercise is that the traditional Unix pipelinable commands have standardised on unstructured textual data. Powershell has standardised on structured tabular data, which is what lets you do the cool things.
- vidarh 11y agoExactly. The Unix/Linux world has not gone the way of a Powershell type shell for the simple reason that for the uses where we want an object-oriented API, we have a plethora of scripting languages designed for that purpose, and we all have our own favourites. When we want a text oriented API we use shell scripts. When we want an object oriented API we pick our favourite scripting language - which may very well for many of us be different for different problem domains.
- jfuhrman 11y ago>two liner to scrape a web page, parse it and call a REST endpoint with the parsed data as JSON in PowerShell Can you post this 2 liner? Sounds interesting.
- wumbernang 11y agoI can't post the one-liner as it's earning me a shit ton of cash every month but in concept it's the same as what I've posted here: https://news.ycombinator.com/item?id=9649090 https://news.ycombinator.com/item?id=9649090
- artursapek 11y agoHow can two lines of code be earning you shit tons of cash? Can you show it if you swapped out specific details with generic placeholders (which page you're parsing, which endpoint you're hitting)?
- wumbernang 11y agoIt merely exploits some fundamental differences on how humans operate between two markets and turns that into real-time information for me on which I can make trade decisions. This isn't stocks, shares, futures etc for ref either. I don't want to say any more nor post any code as it's unique and a good earner at the moment.
- artursapek 11y agoUnderstandable. Sounds really interesting.
- pbowyer 11y ago> It merely exploits some fundamental differences on how humans operate between two markets and turns that into real-time information for me on which I can make trade decisions. Now that's teasing ;)
- the_af 11y ago
- antjanus 11y agoSounds awesome, how would you recommend someone get started with PS? I'm CLI-only dev, use Node, code tons of front-end but all I use to do is CMDer, VIM, and SSH all running together.
- wumbernang 11y agoFire up PowerShell ISE (comes with windows) as administrator and type: Update-Help This will download all the help. Then you can type "Get-Help About_" and hit tab to see the master topic lists.
- fibo 11y agoPower shell is ok but MS DOS terminal needs an update: it has several limitations about fonts, encoding and missing libs that make it the worst terminal experience imho. Ah also POSIX compliance could simplify the life of those who develop on Windows. I tryed to develop on Windows for many years, I tryed hard but you are always missing some feature that on Unix is basic.
- grogenaut 11y agoFor the love of... just let me drag it wider than an old vt110 terminal!
- Already__Taken 11y agoThat's all done in Windows 10.
- wumbernang 11y agoName a feature. I've ported tonnes of POSIX stuff to windows. 99% of it's there and the rest is easily plugged into a bit of win32. I tend to use PowerShell ISE that is built into windows rather than cmd, which you're right, sucks.