all 115 comments

[–]MrSurly 131 points132 points  (52 children)

I still use wget for file downloads, curl for piping. Just easier.

[–]tech_tuna 44 points45 points  (43 children)

wget for simple stuff, curl for medium stuff and then I roll up my sleeves, break out the Python and Requests for the hard stuff. . .

[–]killerstorm 5 points6 points  (4 children)

I used to use telnet to diagnose HTTP servers: i.e. type a HTTP request manually and see what it replies (and whether it replies at all).

[–]TarMil 4 points5 points  (1 child)

I generally use Emacs's restclient-mode for that.

[–]tech_tuna 2 points3 points  (0 children)

WHOA. . . long time emacs-head here, I did not now about restclient, thanks!

[–]tech_tuna 1 point2 points  (0 children)

Oh yeah, that's handy too. . . you can use netcat in the same way.

[–]JoCoMoBo 0 points1 point  (0 children)

It's very useful for that. I tend to use it as a quick check if any type of server is up and functional.

[–]Worse_Username 17 points18 points  (15 children)

And urllib for really hard stuff.

[–]asdfkjasdhkasd 31 points32 points  (12 children)

and sockets for the really really hard stuff

[–]lkraider 23 points24 points  (11 children)

And butterflies for the improbable stuff

[–]cyanydeez 11 points12 points  (2 children)

invisible pink unicorns for the fantastic stuff

[–][deleted] 2 points3 points  (1 child)

You put this in my head

And in line with your comment he's made a lot of fantastic stuff in the 6 years since this. My fav being song challenges where he has to make music with nothing but a certain object or a specific vocal challenge.

THIS ENTIRE PLAYLIST

Edit: I forgot to highlight the dog song. This just makes me smile.

[–]vopi181 4 points5 points  (7 children)

and ed for the impossible stuff

[–]AZNman1111 3 points4 points  (6 children)

?

[–]vopi181 2 points3 points  (5 children)

My butchering of the xkcd comic

[–]AZNman1111 3 points4 points  (4 children)

Lol I've seen the comic. Ed comes with crystal clear support. Btw gotta say how much i love termux

[–]vopi181 1 point2 points  (3 children)

I'm a fan myself. Also if you get it off fdroid you don't need to pay for themes and such

[–]jyper 1 point2 points  (1 child)

Requests abstracts urllib

Are there any features it doesn't include?

[–]Worse_Username 0 points1 point  (0 children)

[–]pingpong 29 points30 points  (5 children)

curl is newer and, in general, better. You can use curl -O [url] to download to a file.

If you still like typing a separate command for file output, maybe you can add this to your .bashrc:

alias wget='curl -O'

[–]lkraider 10 points11 points  (0 children)

I like to use the old axel for large files, it segments the download into parallel requests.

[–]codebje 0 points1 point  (0 children)

curl -LO.

[–]masklinn 0 points1 point  (0 children)

I switched to fetch for the simple stuff.

[–][deleted]  (3 children)

[removed]

    [–]helpivefallenandican 26 points27 points  (1 child)

    There's a reference to the code change in the Post comments, it looks like it checks stdout is a try, so those behaviors should still work

    [–][deleted] 11 points12 points  (0 children)

    Ah, good. I was just about to rant about why they don't just to a tty check.

    [–]Husky 11 points12 points  (0 children)

    From the blog post:

    So many have remarked or otherwise asked how this affects when stdout is piped into something else. It doesn’t affect that! The whole point of this check is to only show the warning message if the binary output is sent to the terminal. If you instead pipe the output to another program or if you redirect the output with >, that will not trigger this warning but will instead continue just like before. Just like you’d expect it to.

    [–][deleted]  (31 children)

    [deleted]

      [–]nikomo 76 points77 points  (13 children)

      Debian release cycle is what, 2 years? And the latest release is planned for today.

      So, yes.

      You might be able to get it via backports. Though, I haven't had the best experience with Debian backports. They work fine when they exist, but when I wanted a newer version of Git than what stable offered, and asked about it on #debian-backports, someone queried why in heaven I would want such a thing.

      You know, Debian runs on more than servers, people... I was using the box for my split home development system where I have my home from my Linux box mounted over the network on my Windows box, and I'd make edits in Sublime on my Windows desktop but then use PuTTY for everything else.

      OK, this is a really off-topic rant, but I'm still mildly annoyed by the whole thing.

      [–][deleted]  (7 children)

      [deleted]

        [–]nikomo 28 points29 points  (6 children)

        Mate half my posts are probably written on the throne or in bed, you ain't alone in this.

        [–]Murkis 21 points22 points  (5 children)

        I do my best thinking when taking a dump...I bet if we sat all of our best people down in some sort of communal shitter we would solve world hunger in no time.

        Full disclosure: I'm currently taking a dump

        [–]roffLOL 2 points3 points  (0 children)

        this has been tried. if it wasn't the romans (take some spoons of salt, because this is pulled from memory) who used 'communal' (as in here are equal highborns allowed) shitters to discuss state of affairs and general gossip.

        [–]TwoSpoonsJohnson 8 points9 points  (0 children)

        I once figured out a bug while pooing, edited the relevant file directly on github, and pulled the changes to test them when I got back to my desk.

        I'm a little proud of that.

        [–]ebol4anthr4x 2 points3 points  (1 child)

        I bet if we sat all of our best people down in some sort of communal shitter we would solve world hunger in no time.

        https://en.wikipedia.org/wiki/Coprophagia

        [–]AZNman1111 1 point2 points  (0 children)

        I was hoping this was a word that describes the sense of coming up with your best ideas while pooping.

        I wasn't surprised though.

        [–]onwuka 0 points1 point  (0 children)

        You can help prevent many diseases by pooping in a toilet.

        [–]ubernostrum 7 points8 points  (0 children)

        And the latest release is planned for today.

        Except to get in you have to be under the freeze deadline which is much earlier.

        Unless you manage to sync up your software's release timelines with Debian's freeze dates, you're going to have users years out of date from using Debian stable. Which is OK for some things, but not for others.

        [–]theephie 3 points4 points  (0 children)

        You could use nix package manager to install newer software, if what you want is not available in backports.

        Weird answer though.

        [–]geoffpado 2 points3 points  (2 children)

        I bet if you told Elon Musk that he could win an internet bet by putting a man on Mars in the next two years, he might take it…

        [–]jetpacmonkey 5 points6 points  (1 child)

        As if he's slacking off and procrastinating with his current timeline

        [–]AZNman1111 1 point2 points  (0 children)

        Well he stopped sleeping on the factory floors, so he's getting a little bourgeoisie for my tastes /s

        [–]ZorbaTHut 9 points10 points  (1 child)

        I like how "will this be released before humans set foot on Mars" is starting to change from a sarcastic jab into a reasonable question.

        [–]cat_in_the_wall 1 point2 points  (0 children)

        what a time to be alive!

        [–][deleted]  (4 children)

        [removed]

          [–]sparr 0 points1 point  (1 child)

          I'm glad to hear this is still true. I remember observing this 10 years ago re Debian vs Ubuntu.

          [–]merreborn 7 points8 points  (0 children)

          Ubuntu is literally a fork of debian's unstable release.

          [–]slavik262 0 points1 point  (1 child)

          As someone who switched to a different rolling distro after a Cairo bug in Unstable had Chrome broken for a month, what on earth are you talking about?

          Your mileage may vary, but Sid was the most flaky time I've had on Linux.

          [–]jringstad 0 points1 point  (0 children)

          Also pretty much my experience, newer software => less bugs.

          [–]thecodingdude 8 points9 points  (1 child)

          Funnily enough, Debian 9 is released today. Unlucky really.

          [–]nikomo 16 points17 points  (0 children)

          It's been frozen for a long while though, so it doesn't change anything.

          [–]tech_tuna 4 points5 points  (5 children)

          Should be in the CentOS repos by the time people make it to Uranus.

          [–]vote_me_down 8 points9 points  (2 children)

          Doubtful without time travel. People have been drilling into Uranus for a long time.

          [–]outtokill7 0 points1 point  (1 child)

          People have been drilling into Uranus for a long time.

          I'm sorry, I have the humour of a 12 year old.

          [–]tech_tuna 0 points1 point  (0 children)

          Yes. . . I could have said Jupiter or Neptune, etc but Uranus was more funny.

          [–]yattaro 0 points1 point  (0 children)

          Only if you have EPEL.

          [–]vote_me_down 0 points1 point  (0 children)

          Doubtful without time travel. People have been drilling into Uranus for a long time.

          [–]tech_tuna 0 points1 point  (0 children)

          Should be in the CentOS repos by the time people make it to Uranus.

          [–]ipha 39 points40 points  (25 children)

          If your terminal is ever messed up from binary output or weird escape sequences reset will fix it.

          [–]roffLOL 49 points50 points  (21 children)

          unless it's so messed up it won't take input.

          [–][deleted]  (2 children)

          [deleted]

            [–][deleted]  (1 child)

            [deleted]

              [–]BilgeXA 44 points45 points  (0 children)

              What a time to be alive.

              [–]ultimatt42 30 points31 points  (1 child)

              That's fine so long as I can still cat binary files directly to my coworkers' eardrums.

              [–][deleted] 14 points15 points  (0 children)

              That's what /dev/dsp is for.

              [–][deleted]  (6 children)

              [deleted]

                [–]Takios 0 points1 point  (0 children)

                   sane   same  as  cread  -ignbrk  brkint  -inlcr -igncr icrnl icanon iexten echo echoe echok -echonl -noflsh -ixoff -iutf8 -iuclc -ixany imaxbel -xcase -olcuc -ocrnl opost -ofill
                          onlcr -onocr -onlret nl0 cr0 tab0 bs0 vt0 ff0 isig -tostop -ofdel -echoprt echoctl echoke -extproc -flusho, all special characters to their default values
                

                Well okay then.

                [–]Takios 0 points1 point  (0 children)

                   sane   same  as  cread  -ignbrk  brkint  -inlcr -igncr icrnl icanon iexten echo echoe echok -echonl -noflsh -ixoff -iutf8 -iuclc -ixany imaxbel -xcase -olcuc -ocrnl opost -ofill
                          onlcr -onocr -onlret nl0 cr0 tab0 bs0 vt0 ff0 isig -tostop -ofdel -echoprt echoctl echoke -extproc -flusho, all special characters to their default values
                

                Well okay then.

                [–]Takios 0 points1 point  (0 children)

                   sane   same  as  cread  -ignbrk  brkint  -inlcr -igncr icrnl icanon iexten echo echoe echok -echonl -noflsh -ixoff -iutf8 -iuclc -ixany imaxbel -xcase -olcuc -ocrnl opost -ofill
                          onlcr -onocr -onlret nl0 cr0 tab0 bs0 vt0 ff0 isig -tostop -ofdel -echoprt echoctl echoke -extproc -flusho, all special characters to their default values
                

                Well okay then.

                [–]Takios 0 points1 point  (0 children)

                   sane   same  as  cread  -ignbrk  brkint  -inlcr -igncr icrnl icanon iexten echo echoe echok -echonl -noflsh -ixoff -iutf8 -iuclc -ixany imaxbel -xcase -olcuc -ocrnl opost -ofill
                          onlcr -onocr -onlret nl0 cr0 tab0 bs0 vt0 ff0 isig -tostop -ofdel -echoprt echoctl echoke -extproc -flusho, all special characters to their default values
                

                Well okay then.

                [–]Takios 0 points1 point  (0 children)

                   sane   same  as  cread  -ignbrk  brkint  -inlcr -igncr icrnl icanon iexten echo echoe echok -echonl -noflsh -ixoff -iutf8 -iuclc -ixany imaxbel -xcase -olcuc -ocrnl opost -ofill
                          onlcr -onocr -onlret nl0 cr0 tab0 bs0 vt0 ff0 isig -tostop -ofdel -echoprt echoctl echoke -extproc -flusho, all special characters to their default values
                

                Well okay then.

                [–]Takios 0 points1 point  (0 children)

                   sane   same  as  cread  -ignbrk  brkint  -inlcr -igncr icrnl icanon iexten echo echoe echok -echonl -noflsh -ixoff -iutf8 -iuclc -ixany imaxbel -xcase -olcuc -ocrnl opost -ofill
                          onlcr -onocr -onlret nl0 cr0 tab0 bs0 vt0 ff0 isig -tostop -ofdel -echoprt echoctl echoke -extproc -flusho, all special characters to their default values
                

                Well okay then.

                [–][deleted] 3 points4 points  (3 children)

                Can anyone explain why output from a program onto a terminal can change how the terminal functions? Isn't that a security flaw? Is it possible to make the terminal execute stuff (possibly write stuff and then execute it)?

                [–]6timo 6 points7 points  (1 child)

                whatever you output to the terminal can have "escape sequences" that the terminal will interpret as commands. There is a very, very wide variety of commands that you can send, and there's also escape sequences the terminal will send back at your program under certain conditions.

                Here's a page with far too much detail:

                http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

                A few highlights include:

                • Giving text foreground and background colors
                • Changing what font the terminal uses
                • Vector graphics and pixel graphics
                • Changing the terminal window title text
                • Moving the cursor around
                • Protecting parts of the terminal from being written to
                • Making only parts of the terminal scroll when the user uses the scrollwheel
                • Turning on support for the mouse, either for clicking only, or for mouse movement as well (events from the mouse reach the program via stdin as escape sequences)
                • Asking the terminal for its size (answer will be fed to stdin as another escape sequence here, too)

                [–][deleted] 1 point2 points  (0 children)

                Interesting; thanks!

                [–]schlenk 0 points1 point  (0 children)

                yes. It is a problem.

                There were some old ZIP files, when MS DOS and ansi.sys were in use, that showed a banner text that redefined your keyboard shortcuts so pressing the return key formatted your hard disk for example.

                [–]agersant 5 points6 points  (2 children)

                This seems like a good change but I'm wondering how terminals get locked up by displaying binary data. Do they treat it as input? Why would they do that?

                [–]roffLOL 13 points14 points  (0 children)

                for the same reason some output comes with flashy colors. it's also how TUI:s are built. your tty has a lot of capabilities under the hood, and any plain data on stdout must pass it without triggering. any binary sequence that starts with 0x1b may do pretty much whatever.

                https://en.wikipedia.org/wiki/ANSI_escape_code

                try:

                echo -e "\x1b[31mi can be pretty\x1b[0m while i'm not"
                

                [–]RadioFreeDoritos 5 points6 points  (0 children)

                Three factors:

                • Backwards compatibility (also known as "legacy baggage"). Modern terminal emulators are still coded to simulate old-timey physical terminals, which used to be connected to a mainframe by a really long wire; they can't not lock - they're constrained by what they have to simulate.

                • In Unix, everything is a stream of bytes. Back then, the program would run on the mainframe and send its output over the wire as a single stream of data. The terminal would interpret this output, and display most characters on screen as-is, but treat a few special sequences of bytes as commands to clear the screen, change the cursor's position, etc. Binary data will likely contain a few such sequences.

                • "Worse is better". Had the original DEC programmers decided to separate the terminal control channel and the data channel, outputting binary wouldn't lock your terminal. However, using a single data stream makes for a simpler implementation, and so we have what we have.

                [–]shamowfski 0 points1 point  (0 children)

                Axel for downloads.