Software engineer, functional programming enthusiast.

  • 7 Posts
  • 63 Comments
Joined 3 years ago
cake
Cake day: April 27th, 2021

help-circle



  • Ramin Honary@lemmy.mltoLinux@lemmy.mlWhat are your must-have programs?
    ·
    edit-2
    3 months ago

    Emacs.

    Emacs is an app platform in and of itself, and the vanilla installation comes with dozens of its own apps pre-installed. Like how web apps are all programmed in JavaScript, Emacs apps are all programmed in Lisp. All Emacs apps are scriptable and composable in Lisp. Unlike on the web, Emacs encourages you to script your apps to automate things yourself.

    Emacs apps are all text based, so they all work equally well in both the GUI and the terminal.

    Emacs comes with the following apps pre-installed:

    • a text editor for both prose and computer code
    • note taking and organizer called Org-mode (sort of like Obsidian, or Logseq)
    • a file browser and batch file renamer called Dired
    • a CLI console and terminal emulator
    • a terminal multiplexer (sort-of like "Tmux")
    • a process manager (sort-of like "Htop")
    • a simple HTML-only web browser
    • man-page and info page browser
    • a wrapper around the Grep and Find CLI tools
    • a wrapper around SSH called "Tramp"
    • e-mail client
    • IRC client
    • revion control system, including a Git porcelain called "Magit"
    • a "diff" tool
    • ASCII art drawing program
    • keystroke recorder and playback

    Some apps that I install into Emacs include:

    • "Mastodon.el" Mastodon client
    • "Elfeed" RSS feed reader
    • "consult" app launcher (sort-of like "Dmenu")


  • Ramin Honary@lemmy.mltoLinux@lemmy.mlTips/tricks for beginners
    ·
    edit-2
    3 months ago

    I wrote a few articles on my blog for people in your situation, who are mostly only familiar with Windows and/or Mac and want to learn Linux more in depth.

    "Advice for people who want to learn linux" -- This article is kind of an overview of the Linux learning process. The point of this article is to teach you what it is you need to learn about so that you set your own curriculum. Once you understand what a few of the basic things are, you can look up your own tutorials on how to learn each thing.

    "How to pick a Linux distro" -- This article is for people who are overwhelmed by the number of choices for Linux distro. The bottom line is: don't over-think it, just pick a mainstream distro like Mint, Ubuntu, or Fedora. There is like a 99.99% chance that each of these will just work as soon as you install it, no weird issues with audio, graphics, WiFi, BlueTooth, security updates, or anything else. Also, a lot of the "choices" you see among all those distros are only skin deep -- differences in the default theming (i.e. the default "desktop environment", a concept explained in the "advice" article above). But really they are all using the same basic software packages so there very little substantive difference between any of them except in their app stores, and the mechanism they each use install software.

    If you have any questions, feel free to ask me here. I can clarify here, and also update my blog posts if you think anything is confusing.


  • As many here have said, but I will emphasize: learn the Bash programming language. Linux Survival is a very good start, and you can just start experimenting right away in your own terminal on your own computer.

    To go more in depth, you can read through the manual on your computer by typing "info bash". The Info documentation browser is a command line app. You may need to install it using your package manager ("apt-get" or "pacman" or "dnf").

    In the "info" app, you can navigate with the arrow keys, pressing enter on hyperlinks, typing l (lowercase "L") works like the "back" button in a web browser, typing r (lowercase "R") works like the "forward" button. Info also lets you search the index by pressing i (lowercase "I") then entering your search in the prompt, or search the full text by pressing s and entering your search in the prompt. And q quits back to the command line prompt. "Ctrl-Z" pauses the "Info" app and drops you back into the command line, and you can resume your "info" session using the "%" (percent sign) command.

    Another thing that can help is to learn about the GNU "Coreutils", this is a suite of commands usually installed into /usr/bin or /bin which provides helpful command line utilities. These are commands like cat, wc, sort, cut, ls, du, cp, ln, chmod and many others. Read through the Coreutils Info manual by typing "info coreutils".

    And I will also reiterate recommendations from others: learn how to use Vim and/or Emacs. Vim has the more difficult learning curve but is extremely useful for writing scripts. Emacs is better though because it lets you split-screen with manual pages, and copy-paste commands between Man pages, "Infodoc" documents, the shell, and/or a text file, all using only keyboard commands. I think it makes it much easier to learn since everything is integrated together. Ask the Emacs community how to get started if you are interested.


  • It’s a i3-6006U with just 4.0GiB of RAM.

    Emacs is considerably more lightweight than a modern Web browser, or any app based on Electron.js (e.g. VSCode) so a computer with those specs is more than powerful enough to run Emacs. If you use version 29.1 or later, Emacs comes with "libgccgit" which will spend a little time pre-compiling Emacs code to very fast native code.

    Emacs used to have a reputation for being slow back in the early 1990s when 32 bit personal computers were just beginning to gain popularity. But nowadays when everyone downloads FlatPak and AppImage and Snap apps which install many hundreds of megabytes of code, Emacs is relatively small and light.

    Also, Guile Emacs and Guilemacs are two different projects, right? Because I also happen to come across this, and I’ve been interested in this project as well.

    The whole history of Guile and Emacs is here on the Emacs Wiki.

    So there are a few projects related to Guile and Emacs. The link you provided me by Ken Raeburn is a fork of older versions of both Guile and Emacs, it seems it has not been worked on in about 20 years, unfortunately.

    The project by Robin Templeton is also a little bit out of date, but still somewhat actively developed. You must build it from source from a patched version of (I think?) Emacs 26 or 27, I am not sure which it was. It works by loading libguile (the Guile interpreter/compiler) into Emacs so you can run Scheme code, and it also provides Scheme "foreign function" wrappers to the Emacs C APIs so you can do everything Emacs Lisp does in Scheme by importing the elisp-functions Scheme module. (There is an example of how to use it on the Emacs Wiki.)

    I did hear Robin say in a recent Spritely chat that it could be made to work on Emacs 29 with not too much effort, they just haven't had time to do it.

    If you are interested in Scheme, you might also want to check out the Edwin text editor which is built-in to the MIT/GNU Scheme compiler, you launch it from the Scheme REPL with the (edit) function. It is a clone of Emacs 19 (a very old Emacs) written entirely in Scheme, but unfortunately it is a little too old to be useful nowadays, in my opinion. Still, you could learn something by reading the Edwin source code.

    Finally there is TeXmacs, which is a full WYSIWYG application with a built-in LaTeX rendering engine designed for writing scientific papers, and it includes the Guile Scheme compiler for writing extensions, although I would not call TeXmacs a general purpose programming text editor the way Emacs is.







  • You seem to know more about these ethnic groups than I do.

    In my opinion, the ethnic or racial categories that define "white" or not make no sense. The definition of "white" according to white supremacists has always been very ephemeral (e.g. sometimes including Italians or Irish, sometimes excluding), and has no basis in science or reason. "White" is defined purely by political ideology.

    From a more practical point of view, I believe if you are trying to understand how white supremacists think, I would say they define "white" as the people protected by the politically powerful, who are seen as human, or as first-class citizens, or as deserving of protection under the law, whereas non-white are those who the politically powerful want to erase from humanity. They constantly shift the definition of "white" to match these criteria as the political ideology evolves over time.

    So from that point of view, you could think of antisemitism as a form of white supremacy that excludes Jews from the "white" category, while Zionism is a form of white supremacy that includes Jews as "white." But both are white supremacy, both are evil.



  • Whenever I open the symlink, does the software (player) understand «oh this file seems like a symlink, I should go and open the original file», or it’s a filesystem level stuff and software (player) basically has no idea if a file I’m opening is a symlink or the original movie.mp4?

    Others have answered well already, I just will say that symlinks work at the filesystem level, but the operating system is specially programmed to work with them. When a program asks the operating system to open a file at a given path, the OS will automatically "reference" the link, meaning it will detect a symlink and jump to the place where the symlink is pointing.

    A program may choose to inspect whether a file is a symlink or not. By default, when a program opens a file, it simply allows the operating system to reference the file path for it.

    But some apps that work on directories and files together (like "find", "tar", "zip", or "git") do need to worry about symlinks, and will check if a path is a symlink before deciding whether to reference it. For example, you can ask the "find" command to list only symlinks without referencing them: find -type l



  • @joeldebruijn@lemmy.ml the /run/user/1000 directory is an in-memory file system of a fairly small size. The operating system creates it for you to store certain things that are for your user account only. The permission settings on this directory forbid any other user on the system (except for "root") to see what is inside. This makes it safe to store secret information that only you should know.

    One typical example of something stored in this directory would be your plain text (unencrypted) password database if you use a password manager. No other user but you (and "root") can see it, and it is in-memory only so it is not accidentally copied to your persistent memory (HDD or SSD disk drive) where it might be removed and read by hackers if someone steals your computer from you. At the same time, any program running on the system that was launched by you and only you has access to your passwords so you don't need to remember passwords for everything. (Actually it is a socket to a server containing your unencrypted password database in memory, it is probably not actually a file in that directory.)

    Other things that go in this /run/user/1000 directory are socket connections to the desktop bus (allows for things like copy-and-paste or drag-and-drop to work between programs), socket connections to your audio mixer (allows you do things like to listen to music and do video chat at the same time), and a record of what external media devices you have connected to the computer which you are using via GVFS, and so on.

    Also, the number 1000 is your user ID number assigned to you by the operating system. If you create other accounts, they will have ID 1001, 1002, and so on, and each of them will have a directory with that number created in the /run/user directory for them when they login.



  • It is no longer an abstract question for me as to what I would have done if I had been an ordinary German citizens living through the reign of Hitler to resist the war crimes committed by my country.

    I now know exactly what that is like, and I am ashamed to say I am doing jack shit about it. In fact, it might be even worse than that. The Nazis tried to keep their genocide under wraps, I am guessing not a lot of ordinary German citizens actually knew about the gas chambers, they maybe only knew that jews were being rounded up and forcibly moved into labor camps (which is in itself horrible enough). But when America commits genocide, everyone knows about it and still choose to do nothing.

    And I still see morons write opinion articles with titles like "Trump is a threat to democracy!" What fucking democracy is there to speak of in the US anymore? Did everyone in America just decide, "hey, you know what, genocide of Gaza is important to me," and therefore both political parties now run pro-genocide candidates? No, there was never any choice to begin with, because there is no fucking democracy in the US.



  • I am also going to recommend the same solution as @matcha_addict@lemy.lol in this comment: https://lemmy.ml/comment/7998407

    You can create a key pair that is specifically just for this kind of backup transaction.

    To limit its affects, create a user and group on each of the devices that are highly restricted.

    This is actually the most secure solution that doesn’t require an interactive password prompt. The passwordless key only serves this one purpose and has small attack surface.

    Basically, you can tell SSH to allow root login on certain devices by setting up a root key pair. You configure SSH on the target device such that when it logs in, the login must run a script or a single command instead of running a shell, this limits what attackers can do if they somehow steal your private keys. You can also keep these private keys in your SSH agent so you only have to enter their passwords once, this will allow you to run remote commands without a password.

    I would recommend also exploring the possibility of setting up an Rsync Daemon on each remote device, it keeps an Rsync process running on a remote device and listens for connections from Rsync clients. https://linuxconfig.org/how-to-setup-the-rsync-daemon-on-linux

    On an unrelated topic: you might also want to look into using Btrfs and making and transferring snapshots to other devices.


  • no other programming language that I know of allows one to keep imports in a totally different file.

    Isn't this (in-package ...) form just a namespace feature? I know C++ and C# both have similar features, where you declare classes to be members of a namespace, but the collection of classes in the namespace need not be declared in any one file, it is assembled by the compiler as it discovers declarations across multiple files. You refer to symbols in other namespaces with the namespace::symbol syntax in C++ and namespace.symbol in C# . However I don't know the rules for hiding or re-exporting certain symbols.

    Haskell and Scheme are two other languages that I know well enough that I can say there are ways of importing all or only specific symbols from other pakcages, and re-exporting symbols from other packages to construct the API of any given package.

    It sounds to me, from your description, that Rust still needs to get its shit together with namespaces. Or maybe they already have but the code you were looking at was older and written at a time before Rust had namespaces? I don't know Rust well enough, so I can't say.