Off-and-on trying out an account over at @[email protected] due to scraping bots bogging down lemmy.today to the point of near-unusability.

  • 1 Post
  • 147 Comments
Joined 2 years ago
cake
Cake day: October 4th, 2023

help-circle

  • tal@lemmy.todaytolinuxmemes@lemmy.worldNew EU directive drop.
    link
    fedilink
    English
    arrow-up
    13
    ·
    edit-2
    8 days ago

    Ed is kinda-sorta great-granddaddy vim.

    https://en.wikipedia.org/wiki/Ed_(software)

    ed (pronounced as distinct letters, /ˌiːˈdiː/)[1] is a line editor for Unix and Unix-like operating systems. It was one of the first parts of the Unix operating system that was developed, in August 1969.

    Dennis M. Ritchie produced what Doug McIlroy later described as the “definitive” ed,[5] and aspects of ed went on to influence ex, which in turn spawned vi.

    https://en.wikipedia.org/wiki/Vi_(text_editor)

    Vim (“Vi IMproved”) has many additional features compared to vi, including (scriptable) syntax highlighting, mouse support, graphical versions, visual mode, many new editing commands and a large amount of extension in the area of ex commands.

    I’ve never used qed, but it sounds like that might be considered even one step back:

    https://en.wikipedia.org/wiki/Ed_(software)

    Many features of ed came from the qed text editor developed at Thompson’s alma mater University of California, Berkeley.

    https://en.wikipedia.org/wiki/QED_(text_editor)

    Initial release: 1967

    I guess TECO — which I also have not used — would kinda-sorta be the emacs analog:

    https://en.wikipedia.org/wiki/TECO_(text_editor)

    TECO (/ˈtiːkoʊ/[1]), short for Text Editor & Corrector, [2] [3][4] is both a character-oriented text editor and a programming language,[5][6] that was developed in 1962 for use on Digital Equipment Corporation computers, and has since become available on PCs and Unix. Dan Murphy developed TECO while a student at the Massachusetts Institute of Technology (MIT).

    It was subsequently modified by many other people[7] and is a direct ancestor of Emacs, which was originally implemented in TECO macros.

    EDIT: Actually…hmm. Now that I think of it, I might have briefly used TECO on a DEC VAX/VMS cluster. IIRC, I mostly used EVE, though.

    EDIT2: Hmm. Apparently someone has ported TECO to Linux:

    https://www.almy.us/teco.html

    TECO, that grand old text editor your father used when he was young, is still available! It is powerful and compact precursor to EMACS and has a completely nongraphical user interface. This is based on Pete Siemsen’s TECOC implementation, and comes with a copy of the original DECUS TECO documentation.

    Do I need a paper tape punch and reader to use TECO?

    No. Modern TECOs will also edit text files.

    Is TECO fast?

    Yes, it’s probably the fastest editor available

    While I’m maintaining the files as I had worked on them and downloads here, Blake McBride has taken the source code, added the video/scope mode, fixed bugs and improved the speed (not that it is slow!), documented the changes and has it available in GitHub. Go here for his work https://github.com/blakemcbride/TECOC

    tries building it

    Hah. It takes under a third of a second to compile on my system:

    $ git clone https://github.com/blakemcbride/TECOC.git
    $ cd TECOC/src
    $ time make -j32 -f makefile.linux >/dev/null 2>&1
    
    real    0m0.296s
    user    0m2.341s
    sys     0m0.874s
    $
    

    Hmm. Yeah, I don’t remember how to use this at all, if I did use it. Looks like the command syntax is a little like ed’s, but you whack Escape twice to execute commands. Each press of Escape displays a dollar sign.

    Intro guide © 1972: https://ia902906.us.archive.org/25/items/bitsavers_decpdp10TOandbook04tecoIntro_1457616/04_tecoIntro_text.pdf

    $ ./tecoc
    *Ihello, world!$$
    *EWtest.txt$$
    *EX$$
    $ cat test.txt; echo
    hello, world!
    $
    

    Clearly does work, though.





  • Oooh, neat. I didn’t know about that. Thanks. That better not have been around since the 1990s or something, with me always searching the bash(1) man page to find builtin information.

    $ help help|head -n2
    help: help [-dms] [pattern ...]
        Display information about builtin commands.
    $ git clone https://git.savannah.gnu.org/git/bash.git
    $ cd bash
    $ git log -S "Display information about builtin commands."|grep ^commit|tail -n1
    commit 3185942a5234e26ab13fa02f9c51d340cec514f8
    $ git show 3185942a5234e26ab13fa02f9c51d340cec514f8|grep ^Date
    Date:   Mon Jan 12 13:36:28 2009 +0000
    $
    

    Well, it’s not the 1990s, but still. Dammit.



  • That sign won’t stop me, because I can’t read!

    $ man ls | spd-say -e
    

    EDIT: If you run the above, it looks like speech-dispatcher splits the thing up into a bunch of different consecutive blocking requests, which means that it’s a pain in the neck to stop with a single command. You might want to leave $ while true; do spd-say -S; done running for a bit to make it actually stop talking.



  • tal@lemmy.todaytolinuxmemes@lemmy.world*The penguin inches closer...*
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    2 months ago

    It does sort of suggest that from a UI standpoint, a chunk of users doesn’t really deal well with the traditional paradigm of “opening a document in an application consumes resources, and part of the job of the user is to manage those resources”. Like, maybe Chrome should just do the equivalent of, at least by default, converting a tab that hasn’t been viewed for some time into something akin to a bookmark, just reload it when it’s viewed. Or at least push the data into on-disk storage.

    I don’t use Chrome, but Firefox does something vaguely-analogous to that for session storage — like, if Firefox dies unexpectedly, restored tabs won’t reload content until actually viewed, I assume to avoid the thundering herd problem.

    I remember when I first encountered mobile OSes auto-killing programs and stuff to try to manage memory for users. I thought that it was pretty insane. But…clearly some users have trouble with it, and maybe it’s a reasonable UI change for them. I know people who had difficulty, on various desktop OSes, understanding the significance of starting a program and the idea that a running program would consume memory and perhaps CPU time.




  • tal@lemmy.todaytolinuxmemes@lemmy.worldFish rules
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    I mean, that’s not a question I can answer for you. I have never had a problem, myself, but I have no idea what your professional situation is. There are a shit-ton of ways to move git repositories around. If you can ssh out, if you can move physical storage in and out, if you have https out (though that’ll be unidirectional in). I doubt that a typical IT department is going to care about you moving your dotfiles in, so if they do block something, probably worth a try just saying “I just want to pull my dotfiles from home; what’s a good way to do that?” My guess is that most IT departments aren’t going to have an issue with that. If you work for an intelligence service or something that has really super-stringent security requirements, then having any data movement in or out may be more of a headache.

    I would be careful to avoid sticking credentials (keys, passwords, anything like that) in any git-managed dotfiles. Not an issue for most software, but there are a few packages that will do that (neonmodem, a BBS-themed console Linux Lemmy client, does that…was just trying it yesterday.) You don’t want to be dumping your home credentials all over in your git history, and work isn’t going to want you pushing work credentials out.


  • tal@lemmy.todaytolinuxmemes@lemmy.worldFish rules
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 months ago

    I have no shell configs of any kind because it seemed like everytime I used another computer, I would not have them and I would end up having the re-learn everything.

    What I do is store my dotfiles in a git repository, and leave symlinks to the files in that repository. Then, when I move to another computer, pulling over all my configuration consists of doing a git pull to pull the git repo over and then running a command to set up the symlinks on that new computer. I can also make changes and selectively push things in. Some things need to be specific to a computer, and those don’t go in.

    I use a homebrew script to set up the symlinks. A number of people use GNU stow for this.

    kagis for an example of someone using stow

    https://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html?round=two

    If you edit the symlinks in emacs (and I imagine vim), it picks up on the fact that they’re symlinks into a git repository and that they’re version-controlled.

    So, like:

    • Have a bare git repository on home machine, the “master” copy.

    • Every machine with an account has a non-bare dotfiles git repository checked out and symlinks pointing into that repo.

    • Make any changes on a given machine like you normally would, then git commit them to the local non-bare dotfiles git repo and push them to the master repository.

    • If setting up on a new machine, pull the git repository, and then run the command to set up the symlinks.___





  • tal@lemmy.todaytolinuxmemes@lemmy.worldAn awkward realization
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    2 months ago

    I mean, there’s a point in data structure complexity where it’s useful to use Python.

    But as to dicts, sure. You’re looking for zsh’s “associative array”. Bash has it too.

    zsh

    $ typeset -A mydict
    $ mydict[foo]=bar 
    $ echo $mydict[foo]
    bar
    $
    

    bash

    $ typeset -A mydict
    $ mydict[foo]=bar
    $ echo ${mydict[foo]}
    bar
    $
    


  • tal@lemmy.todaytolinuxmemes@lemmy.worldAn awkward realization
    link
    fedilink
    English
    arrow-up
    15
    ·
    edit-2
    2 months ago

    To be fair, a lot of the programs don’t use a single character, have multiple spaces between fields, and cut doesn’t collapse whitespace characters, so you probably want something more like tr -s " "|cut -d" " -f3 if you want behavior like awk’s field-splitting.

    $ iostat |grep ^nvme0n1
    nvme0n1          29.03       131.52       535.59       730.72    2760247   11240665   15336056
    $ iostat |grep ^nvme0n1|awk '{print $3}'
    131.38
    $ iostat |grep ^nvme0n1|tr -s " "|cut -d" " -f3
    131.14
    $