356 Matching Annotations
  1. Last 7 days
    1. uix includes package definitions for many GNU and non-GNU packages, all of which respect the user’s computing freedom. It is extensible: users can write their own package definitions (see Defining Packages) and make them available as independent package modules (see Package Modules). It is also customizable: users can derive specialized package definitions from existing ones, including from the command line (see Package Transformation Options).

      O sea que esta es la solución a mi inconformidad con los instaladores de arch linux: un montón de software que no uso instalado como dependencias.

  2. Jan 2022
    1. All operating systems with network support have a hosts file to translate hostnames to IP addresses. Whenever you open a website by typing its hostname, your system will read through the hosts file to check for the corresponding IP and then open it. The hosts file is a simple text file located in the etc folder on Linux and Mac OS (/etc/hosts). Windows has a hosts file as well, on Windows you can find it in Windows\System32\drivers\etc\if(typeof __ez_fad_position!='undefined'){__ez_fad_position('div-gpt-ad-vitux_com-box-3-0')};

      El archivo host traduce el hostnames a direcciones IP. Cuando abrimos un sitio tipeando su URL en un navegador nuestro hostfile la IP correspondiente para abrirla.

      1. En su primera parte el hostfile contiene nombres e IP de nuestra máquina local.
      2. En su segunda parte se encuentra información sobre los host capaces de usar el protocolo IPV6 y difícilmente es editada por el usuario.
    1. -xcf cursorfile cursorsize This lets you change the pointer cursor to one loaded from an Xcursor file as defined by libXcursor, at the specified size.

      Esta es la opción que debo usar con el comando "xcursor" para configurar la forma y tamaño del cursor en X.

    1. This runs a loop 555 times. Takes a screenshot, names it for the loop number with padded zeros, taps the bottom right of the screen, then waits for a second to ensure the page has refreshed. Slow and dull, but works reliably.

      Simple bash script to use via ADB to automatically scan pages:

      #!/bin/bash
      for i in {00001..00555}; do
         adb exec-out screencap -p > $i.png
         adb shell input tap 1000 2000
         sleep 1s
      done
      echo All done
      
  3. Dec 2021
  4. Nov 2021
    1. special permission bit at the end here t, this means everyone can add files, write files, modify files in the /tmp directory, but only root can delete the /tmp directory

      t permission bit

    1. I find some of XDG's default dirs, especially ~/.local/share/whatever, to be very annoying. (Almost as annoying as having ~/snap polluting my home dir, but for a different reason.) I shouldn't have to type such long paths or navigate three folders deep in order to access my data files. I therefore make use of the XDG_DATA_HOME environment variable for XDG-style programs, so they will put my files somewhere convenient. However, I don't think Snap can honor that variable, because AppArmor rules require fixed paths. Given 1 & 2, I think ~/.snap/data is a sensible compromise, at least until the underlying components are flexible enough to let the user choose.
  5. Oct 2021
    1. $@ is all of the parameters passed to the script. For instance, if you call ./someScript.sh foo bar then $@ will be equal to foo bar.

      Meaning of $@ in Bash

    1. The solution is absolutely straightforward and posting it *will* be embarrassing.

      Christmas 2016 & user seth, with 24k posts currently, is a total dipstick asshole for someone asking a very basic reasonable question & sticks to being an insulting tart for 6 posts.

      This is now one of the top answers online. There is still no oneliner to change your default route metrics.

    1. 管線命令僅會處理 standard output,對於 standard error output 會予以忽略 管線命令必須要能夠接受來自前一個指令的資料成為 standard input 繼續處理才行。

      也就是使用 | 的命令

  6. Sep 2021
    1. I find it much simpler to use a partition label with LABEL=.... It is shorter, easier to remember, and also has the advantage that should the partition go bad and need to be replaced you can create a new partition, give it the same label provided the old partition is either removed or at least changed to be unlabelled and fstab will never know the difference.
    1. sudo apt-get autoclean sudo apt-get autoremove sudo apt-get clean sudo apt update sudo apt-get dist-upgrade --fix-missing sudo apt-get dist-upgrade --fix-broken sudo apt full-upgrade sudo apt -f install dpkg --configure -a
    1. The best practice is this: #!/usr/bin/env bash #!/usr/bin/env sh #!/usr/bin/env python

      The best shebang convention: #!/usr/bin/env bash.

      However, at the same time it might a security risk if the $PATH to bash points to some malware. Maybe then it's better to point directly to it with #!/bin/bash

    1. Here's my bash boilerplate with some sane options explained in the comments

      Clearly explained use of the typical bash script commands: set -euxo pipefail

  7. Aug 2021
    1. set -euo pipefail

      One simple line to improve security of bash scripts:

      • -e - Exit immediately if any command fails.
      • -u - Exit if an unset variable is invoked.
      • -o pipefail - Exit if a command in a piped series of commands fails.
    1. AUR

      The AUR is a well-known user repository for Arch projects! This is a test note.

    1. CBL-Mariner is an internal Linux distribution for Microsoft’s cloud infrastructure and edge products and services.

      CBL-Mariner <--- Microsoft's Linux distribution

  8. Jul 2021
    1. All platforms. Professional features. Beautiful UI. Totally free. FontBase is the font manager of the new generation, built by designers, for designers.

  9. Jun 2021
    1. GRUB hidden menu change FAQ  

      details about grub menu hidden and how to enable, access, etc

    1. There is one very important reason for enabling job control to be useful inside scripts: the side-effect it has of placing background processes in their own process groups. This makes it much, much easier to send signels to them and their children with one simple command: kill -<signal> -$pgid. All other ways of dealing with signaling entire trees of processes either involve elaborate (sometimes even recursive) functions, which are often bugnests, or risk killing the parent in the process (no pun intended).
    1. The alternative for curl is a credential file: A .netrc file can be used to store credentials for servers you need to connect to.And for mysql, you can create option files: a .my.cnf or an obfuscated .mylogin.cnf will be read on startup and can contain your passwords.
      • .netrc <--- alternative for curl to store secrets
      • .my.cnf or .mylogin.cnf <--- option files for mysql to store secrets
    2. Linux keyring offers several scopes for storing keys safely in memory that will never be swapped to disk. A process or even a single thread can have its own keyring, or you can have a keyring that is inherited across all processes in a user’s session. To manage the keyrings and keys, use the keyctl command or keyctl system calls.

      Linux keyring is a considerable lightweight secrets manager in the Linux kernel

    3. Docker container can call out to a secrets manager for its secrets. But, a secrets manager is an extra dependency. Often you need to run a secrets manager server and hit an API. And even with a secrets manager, you may still need Bash to shuttle the secret into your target application.

      Secrets manager in Docker is not a bad option but adds more dependencies

    4. Using environment variables for secrets is very convenient. And we don’t recommend it because it’s so easy to leak things

      If possible, avoid using environment variables for passing secrets

    5. As the sanitized example shows, a pipeline is generally an excellent way to pass secrets around, if the program you’re using will accept a secret via STDIN.

      Piped secrets are generally an excellent way to pass secrets

    6. A few notes about storing and retrieving file secrets

      Credentials files are also a good way to pass secrets

    1. As it stands, sudo -i is the most practical, clean way to gain a root environment. On the other hand, those using sudo -s will find they can gain a root shell without the ability to touch the root environment, something that has added security benefits.

      Which sudo command to use:

      • sudo -i <--- most practical, clean way to gain a root environment
      • sudo -s <--- secure way that doesn't let touching the root environment
    2. Much like sudo su, the -i flag allows a user to get a root environment without having to know the root account password. sudo -i is also very similar to using sudo su in that it’ll read all of the environmental files (.profile, etc.) and set the environment inside the shell with it.

      sudo -i vs sudo su. Simply, sudo -i is a much cleaner way of gaining root and a root environment without directly interacting with the root user

    3. This means that unlike a command like sudo -i or sudo su, the system will not read any environmental files. This means that when a user tells the shell to run sudo -s, it gains root but will not change the user or the user environment. Your home will not be the root home, etc. This command is best used when the user doesn’t want to touch root at all and just wants a root shell for easy command execution.

      sudo -s vs sudo -i and sudo su. Simply, sudo -s is good for security reasons

    4. Though there isn’t very much difference from “su,” sudo su is still a very useful command for one important reason: When a user is running “su” to gain root access on a system, they must know the root password. The way root is given with sudo su is by requesting the current user’s password. This makes it possible to gain root without the root password which increases security.

      Crucial difference between sudo su and su: the way password is provided

    5. “su” is best used when a user wants direct access to the root account on the system. It doesn’t go through sudo or anything like that. Instead, the root user’s password has to be known and used to log in with.

      The su command is used to get a direct access to the root account

    1. Linux Kernel 5.11 Released Linus Torvalds (the creator of Linux) has officially released the latest kernel for the open source operating system. Kernel 5.11 includes the usual dose of expanded hardware support, as well as a feature that should excite gamers, and an improvement for Wi-Fi.

      As far as expanded hardware support, kernel 5.11 has brought improvements to RISC-V, as well as support for RISC-V CPU architecture such as OpenRISC support for the LiteX SoC controller driver.

      On the Intel side of things, kernel 5.11 adds support for: Iris Xe GPU, Software Guard Extensions (SGX), and Intel Platform Monitoring Technology (PMT). Conversely, Intel Itanium support has finally been dropped.

  10. May 2021
    1. Disclaimer If this tool works, great! However, no guarantees are made that it won't hasten the heat death of the universe through the spontaneous combustion of your CPU.
  11. Apr 2021
    1. By default, fork(2) places a newly created child process in the same process group as its parent, so that e.g. a ^C from the keyboard will affect both parent and child.
    2. But the shell, as part of its session leader duties, creates a new process group every time it launches a pipeline.
    3. Job control is what happens when you press ^Z to suspend a program, or when you start a program in the background using &
    4. A job is the same as a process group.
    1. Windows Subsystem for Linux, also known as WSL, is a compatibility layer for running Linux binary executables natively on Windows 10 using a Linux image
    1. i found that for the osx host "gonzo" , the vanished files (not the warning message itself) appear in stdout - for linux hosts they _both_ appear in stderr , but nothing in stdout (rsync.err.#num is stderr, rsync.log is stdout)
  12. Mar 2021
    1. Proton is a new tool released by Valve Software that has been integrated with Steam Play to make playing Windows games on Linux as simple as hitting the Play button within Steam. Underneath the hood, Proton comprises other popular tools like Wine and DXVK among others that a gamer would otherwise have to install and maintain themselves. This greatly eases the burden for users to switch to Linux without having to learn the underlying systems or losing access to a large part of their library of games. Proton is still in its infancy so support is inconsistent, but regularly improving.
    1. I've been made aware of a "Compatibility tool to run DOS games on Steam through native Linux DOSBox" called "steam-dos". It can be found on https://www.github.com/dreamer/steam-dos . I pulled this tool from git and using it as the the steam play compatibility tool Megarace 2 runs without issue. Saving both settings and games works again! There is no keyboard support for controlling the vehicle in game but both mouse and joystick/gamepad work. To get around a missing launcher.exe error I copied "MegaRace 2.exe" to the same folder as the original and renamed the copy to "Launcher.exe". Linux users: in your MegaRace 2 folder (steamapps/common/MegaRace 2/) create a symbolic link to start.sh named Launcher.exe. This allows the game to launch through Steam. This also allows you to put time on the game through Steam, hitting that coveted 5 minute mark that makes creating a review possible. With that out of the way, the game itself is a nice touch of nostalgia but the port is absolutely terrible. I don't remember it being quite this difficult to install off the 2 CDs. The game won't launch at all without tweaking. Can't save the config settings. Can't save the game at all in fact. While I really like MegaRace 2, you unlock tracks by completing the previous ones. Since the game can't be saved, I end up running The Foundry track over and over until I'm sick of it.So I'm torn. I love the game but I hate the completely broken port. For $3 and a local install of DOSBOX it can be made to work so I will recommend it anyway.
    1. The reason we've avoided registering "Cinnamon" as a desktop name is that it opens up issues with many upstream apps that currently OnlyShowIn=Gnome or Gnome;Unity or just Unity. The relationship Mint has with Gnome and Ubuntu isn't genial enough that we could get them to add Cinnamon to their desktop files, so we would have to distribute and maintain separate duplicate .desktop files just for Cinnamon for these upstream packages.
    1. Also manually adding [Default Applications] x-scheme-handler/zoommtg=ZoomLauncher.desktop to either $HOME/.config/mimeapps.list or $HOME/.local/share/applications/mimeapps.list does not lead to xdg-open via exo-open recognizing the zoommtg protocol.
    1. xdg-email
    2. There's a command that knows about your default browser: xdg-open http://google.com This will also work for every other type of URI (Uniform Resource Identifier), like images - which will automatically open with eog, openoffice documents, and so on, and also on filesystem paths (xdg-open /tmp/foobar.png).
    1. SystemRescue (also known as SystemRescueCd) is a Linux system rescue toolkit available as a bootable medium for administrating or repairing your system and data after a crash.

  13. www.ventoy.net www.ventoy.net
    1. Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files.

      With ventoy, you don't need to format the disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)/EFI files to the USB drive and boot them directly.

  14. Feb 2021
    1. For example, on the terminal I'm using, the right arrow outputs ^[[C. You can see what sequence your terminal outputs by pressing Ctrl-V Right Arrow. The same is true for other cursor-control keys such as Page Up and End.
    1. Typically, a process associated with a controlling terminal is foreground process and its process group is called foreground process group. When you start a process from the command line, it's a foreground process:
    2. Quit the program by sending a different signal to both processes, e.g. SIGQUIT with Ctrl + \.
    1. Why then sending the SIGINT manually to the shell doesn't kill the child, e.g. 'kill -2 <shell-pid>' doesn't do anything to a child process while Ctrl-C kills it?
    2. The shell process itself is in yet another process group all of its own and so doesn't receive the signal when one of those process groups is in the foreground. It's that simple.
    3. Switching "jobs" between foreground and background is (some details aside) a matter of the shell telling the terminal which process group is now the foreground one.
    4. I am trying to understand how CTRL+C terminates a child but not a parent process. I see this behavior in some script shells like bash where you can start some long-running process and then terminate it by entering CTRL-C and the control returns to the shell. Could you explain how does it work and in particular why isn't the parent (shell) process terminated? Does the shell have to do some special handling of CTRL+C event and if yes what exactly does it do?
    1. The CTRL-\ key sends a kill signal to the foreground job which, under normal circumstances, is guaranteed to terminate it. This signal cannot be captured by a process. However, this means the process cannot cleanup and is just summarily stopped. In some cases, a process can be stuck in a kernel wait state so this signal never reaches it. In that case, the process is unusable but cannot be killed.
    1. Also, this code will fail if $$ is not the process group leader, such as when the script is run under strace. Since a call to setsid(2) is probably tricky from a shell script, one approach might be to ps and obtain the process group ID from that.
    2. ps -o pid,pgid,stat,args
    3. When your script starts a process, that child becomes a member of a process group with PGID equal to the PID of the parent process which is $$ in the parent shell.
    4. To accomplish this, after starting the children (loop.sh) in the background, call wait, and upon receipt of the INT signal, kill the process group whose PGID equals your PID.
    5. You need a trap in loop.sh. Traps are cleared for every subshell started unless they are explicitly trap ''SIG ignored by the parent.
    1. ps --forest -o pid,tty,stat,time,cmd -g $(ps -o sid= -p 2795)
    2. To get all the processes spawned by a process the whole tree needs to be built. I used awk for that. At first it builds a hash array to contain all PID => ,child,child... . At the end it calls a recursive function to extract all the child processes of a given process. The result is passed to another ps to format the result.
    1. # Usage: run_with_timeout N cmd args... # or: run_with_timeout cmd args... # In the second case, cmd cannot be a number and the timeout will be 10 seconds. run_with_timeout () { local time=10 if [[ $1 =~ ^[0-9]+$ ]]; then time=$1; shift; fi # Run in a subshell to avoid job control messages ( "$@" & child=$! # Avoid default notification in non-interactive shell for SIGTERM trap -- "" SIGTERM ( sleep $time kill $child 2> /dev/null ) & wait $child ) }
    2. Personally, I prefer signalling an error for invalid values
    1. We can ask timeout to try to stop the program using SIGTERM, and to only send in SIGKILL if SIGTERM didn’t work. To do this, we use the -k (kill after) option. The -k option requires a time value as a parameter.
    1. timeout_child () { trap -- "" SIGTERM; child=$!; timeout=$1; ( sleep $timeout; kill $child; ) & wait $child; } And the usage: ( while true; do echo -n .; sleep 0.1; done) & timeout_child 2
    1. Instead of modifying /usr/share/applications/google-chrome.desktop, the file can be copied into ~/.local/share/applications/google-chrome.desktop and modified without root access. This file will take precedence over the global desktop file.
    1. Systemd targets are reached once and do not fire again when the connection state changes. Depending how your network is managed there are a couple of options:

      Alternatives to react to network-changes in various linux setup: systemd, NetworkManager, netcl, wicd

    1. About network-activation targets & events, but does not detect e.g. "airplane-mode" :-( (referred by man-pages)

    1. I still cannot install it on SID (Winter 2021):

      $ sudo apt install wine32
      Reading package lists... Done
      Building dependency tree... Done
      Reading state information... Done
      Some packages could not be installed. This may mean that you have
      requested an impossible situation or if you are using the unstable
      distribution that some required packages have not yet been created
      or been moved out of Incoming.
      The following information may help to resolve the situation:
      
      The following packages have unmet dependencies:
       libcurl4:i386 : Depends: librtmp1:i386 (>= 2.4+20131018.git79459a2-3~) but it is not going to be installed
       libfaudio0:i386 : Depends: libgstreamer-plugins-base1.0-0:i386 (>= 1.10.0) but it is not going to be installed
       libwine:i386 : Depends: libgstreamer-plugins-base1.0-0:i386 (>= 1.0.0) but it is not going to be installed
                      Recommends: libodbc1:i386 (>= 2.3.1) but it is not going to be installed
                      Recommends: libsane1:i386 (>= 1.0.27) but it is not installable
                      Recommends: libasound2-plugins:i386 but it is not going to be installed
                      Recommends: gstreamer1.0-plugins-good:i386 but it is not going to be installed
      E: Unable to correct problems, you have held broken packages.
      
    1. please, for the love of god do NOT use Mint as a source of inspiration for a derivative distro. If you like Cinnamon or Mate, fine, but holy CHRIST do not let your infrastructure get as criminally sloppy as Mint's. No unholy mixing of Debian and Ubuntu debs into some kind of Frankenbuntu, no namespace collisions, no ... well, no being Mint in general, please!Ideally, I really, really hope you'll continue to support Ubuntu as a primary platform, regardless of what you do with Pop!_OS. But hooboy, do not turn into another Mint, please.
    2. If it was remotely possible to get Davinci Resolve running that would be incredible (and bring a lot of video people I think)
    3. the most productive environment possible for people that use their computer to create.What is a productive environment?How do you measure productivity in an operating system environment?How do you compare YOUR distribution to other distributions when it comes to productivity?Is the way in which 'people that use their computer to create' (creators) the same across all professions and activities?Does a photographer have the same requirements for a productive environment as a software engineer?Why do you think your distribution will be the best for delivering a productive environment than any other Linux distribution?
    1. And then think about if you want a rolling release, or a fixed release. Although all the distros you mentioned are on the fixed release side.
    2. Think about how much you want to customize the desktop environment(DE), and whether you know how to do so. Pick a distro that has the DE you like.
    3. There is no best distro. All of them are more or less the same.
    4. When people talk about "beginner distros" they mean distros that are no hassle to get started, it doesnt mean they are somewhat inferior or less capable.
    5. And honestly, most people prefer the no hassle, especially after wasting too much time dabbling with distros that are "for advanced users" troubleshooting all kinds of dumbass problems that just worked out of the box in many other distros.
    1. considering PopOS is trying to tackle Ubuntu they really need their dual-boot setup to be a lot less tedious
    2. The part where you want to add 2 EFI partitions is not advisable. It seems that Windows doesn't really like this, of you are dual booting multiple Linux installs it might work. But it is always recommended to use only 1 EFI partition per disk. Hope this helps. :)
    1. Make a 512MB fat32 partition during manual/custom PopOS install.Select its role as: "/boot/efi" in the PopOS installer.When the OS is installed, type sudo apt install refind and then it should automatically start the installer else type sudo refind-install. This will install rEFInd to your /boot/efi path.
    1. Windows and Linux store their time in the BIOS differently, this will cause your clock to be desynchronized when you switch from one OS to the other. The easiest solution for it is to fix it in Linux, forcing it to work the same way as Windows. You can do this through the terminal:
  15. Jan 2021
    1. We recommend the Alpine image as it is tightly controlled and small in size (currently under 5 MB), while still being a full Linux distribution. This is fine advice for Go, but bad advice for Python, leading to slower builds, larger images, and obscure bugs.

      Alipne Linux isn't the most convenient OS for Python, but fine for Go

    1. 1) QT Apps load very slow in startup (ex, qpdfview, Audacious), had to look at Ubuntu forums to find a solution installing kvantum and KvYAru theme, so this is solved at the moment; but the theme (SVG based, cannot modify it in a text file) have orange highlights, not consistent with Mint-Y theme, but it is the best option at the moment. This temporary solution I found was here: https://itectec.com/ubuntu/ubuntu-qt-apps-are-very-slow-to-load-in-xubuntu-20-04-when-export-qt_qpa_platformthemegtk2-is-enabled/
    2. We took a stance on an issue.
    1. Pango is one of the most common font rendering libraries on Linux. It's used by GTK/GNOME and a lot of standalone apps, like Rofi, Polybar, and a lot of terminals.
    2. cp src/glyphs/Symbols-2048-em\ Nerd\ Font\ Complete.ttf ~/.local/share/fonts fc-cache -fv pango-view -t "Playing some  for you right now"
    1. Besides running contrary to the principles that lead a lot of people to Linux systems (a closed store that you can't alter...automatic updates you have no control over....run by just the one company)
    2. Linux on the desktop won't take off until it is equally easy. Snap may be dumbed down, restricted and all the rest of it, but for ordinary users it's easier - and more secure - than the alternative.
    3. >We do want Linux to be mainstream, don't we? Not at any cost.
    1. Welcome to Ubuntu!. It is good to ditch the Windows rubbish and get into the real OS where one can change anything you want, yet have a global community who can support the OS.
    1. The best thing about an open source operating system, such as Linux, is that you can customize it as much as you want, ranging from default applications such as file managers, music players, web brows