Blåhaj Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Ignacio@lemmy.ml to Linux@lemmy.ml · 3 年前

The only cheat sheet you need

cheat.sh

external-link
message-square
19
link
fedilink
  • cross-posted to:
  • leftistunix@lemmygrad.ml
119
external-link

The only cheat sheet you need

cheat.sh

Ignacio@lemmy.ml to Linux@lemmy.ml · 3 年前
message-square
19
link
fedilink
  • cross-posted to:
  • leftistunix@lemmygrad.ml
alert-triangle
You must log in or # to comment.
  • QuazarOmega@lemy.lol
    link
    fedilink
    arrow-up
    43
    ·
    3 年前

    TL;DR

    sudo rm -rf /* # can't have problems without a system
    
    • fxt_ryknow@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      3 年前

      Copy. Paste. Enter.

    • Goun@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      3 年前

      System administrators hate this trick!

  • penquin@lemmy.kde.socialBanned
    link
    fedilink
    arrow-up
    23
    ·
    3 年前

    Ok, this is a very good cheat sheet

    • stepanzak@iusearchlinux.fyi
      link
      fedilink
      arrow-up
      8
      ·
      3 年前

      Thefuck is a cool program, but I stopped using it because it was slow.

    • nelson@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      3 年前

      I haven’t had as much luck with that program as I’d like to. :(

    • Cwilliams@beehaw.org
      link
      fedilink
      arrow-up
      3
      ·
      3 年前

      My .bash_history using this program…

  • Arthur Besse@lemmy.mlM
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    3 年前

    sites like this are neat until you remember that curl’s willingness to write ansi escape codes to stdout when it is a tty (as this site relies on to format the output when the user agent is curl) is actually a security vulnerability.

    • JetpackJackson@feddit.de
      link
      fedilink
      arrow-up
      5
      ·
      3 年前

      Could you give me an ELI5 please

      • Arthur Besse@lemmy.mlM
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        3 年前

        This post The Terminal Escapes: Engineering unexpected execution from command line interfaces has a summary of the longer paper in the first link.

        tldr: There are a variety of ways that attackers can cause you to execute execute arbitrary code when you echo their maliciously-crafted data to your terminal. Therefore, when you run curl without redirecting its output, or when you cat a file you’ve downloaded, you’re trusting the server (and also the network, when you don’t have https:// in the url) not to exploit you.

        • JetpackJackson@feddit.de
          link
          fedilink
          arrow-up
          2
          ·
          3 年前

          Ah ok that makes sense, thank you!

    • tal@lemmy.today
      link
      fedilink
      arrow-up
      3
      ·
      3 年前

      I’m more-inclined to blame a virtual terminal than the program writing the sequences if there’s an exploit there.

      • Arthur Besse@lemmy.mlM
        link
        fedilink
        arrow-up
        2
        ·
        3 年前

        Of course the terminal emulators are ultimately to blame but when there are so many problems in so many of them, imo curl’s default behavior should be to filter its output when writing to a tty.

        • kraniax@lemmy.wtf
          link
          fedilink
          arrow-up
          1
          ·
          3 年前

          is there a curl argument that can be used to block this behavior?

          • Arthur Besse@lemmy.mlM
            link
            fedilink
            arrow-up
            1
            ·
            3 年前

            You can redirect curl’s output to a file with the -o filename option (or with > filename for shell redirection). But in the case of sites like this which output ansi-escape-formatted data that isn’t very useful.

            Also, after saving unknown data to a file it’s common to look at it with less or perhaps xxd or strings or file … all of which have had their own CVEs in recent years 🤦

            Computer security is a fractal of bad news.

  • Administrator@monyet.cc
    link
    fedilink
    arrow-up
    8
    ·
    3 年前
    cheat() {
      curl cht.sh/$1
    }
    
    • Pantherina@feddit.de
      link
      fedilink
      arrow-up
      2
      ·
      3 年前

      Awesome!

  • stifle867@programming.dev
    link
    fedilink
    arrow-up
    6
    ·
    3 年前

    Appears to be the same developer as wttr.in

  • bionicjoey@lemmy.ca
    link
    fedilink
    arrow-up
    4
    ·
    3 年前

    IIRC this site uses TLDR pages

  • vettnerk@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    3 年前

    deleted by creator

Linux@lemmy.ml

linux@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !linux@lemmy.ml

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

  • !opensource@lemmy.ml
  • !libre_culture@lemmy.ml
  • !technology@lemmy.ml
  • !libre_hardware@lemmy.ml

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 392 users / day
  • 1.12K users / week
  • 3.97K users / month
  • 12.4K users / 6 months
  • 989 local subscribers
  • 65.6K subscribers
  • 9.33K Posts
  • 216K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.mldeleted by creator
  • nooter692@lemmy.ml
  • MarcellusDrum@lemmy.ml
  • Arthur Besse@lemmy.ml
  • Cyclohexane@lemmy.ml
  • d3Xt3r@lemmy.nzdeleted by creator
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org