466 Matching Annotations
  1. Feb 2021
    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:
  2. 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 browsers, and text editors etc. to more vital system components such as the kernel, display managers, and terminal consoles. You can do this simply by downloading new application software and replacing the old ones with that, or editing system components by making changes in the source code of your operating system. The display manager is one such system component that you can replace simply by running a few commands mentioned in this article.
  3. Dec 2020
    1. BlackArch is a Linux distribution designed for penetration testing and security research. You can think of it like Kali Linux, with the exception of being based on Arch Linux. Its official repositories contain more than +2500 various penetration testing tools, and hence it can be considered a very good option for anyone wishing to explore this field and try to hack their own phones/routers/devices during the quarantine time.

      BlackArch <--- kind of Kali Linux based on Arch Linux

    2. Redstar OS is a Fedora-based Linux distribution that was developed to empower all computers running in North Korea. Researchers from various independent teams verified that the distribution contains huge spying mechanisms and logging capability, beside some modified kernel modules to record everything done on the OS.

      Redstar OS <--- Linux distribution for North Korea

  4. Nov 2020
    1. Normally Ubuntu swaps files to disk frequently. Since the disk is a microSD card that's a bit slow and has limited write cycles, it's best to reduce swapping to only when needed.
  5. Oct 2020
    1. I have downloaded this browser, to use with Office 365 (for my Uni stuff). I haven't really given it a full workout yet, mostly as I generally use Brave.

      I personally think we'll see more Microsoft apps coming to Linux with the big one being the ultimate... basing Windows on a Linux Kernel, rather than the NT Kernel, within the next 5 year or so!

    1. Future kernel updates would require the updated kernels to be signed again, so it makes sense to put the signing commands in a script that can be run at a later date as necessary. A sample script /root/module-signing/sign-vbox-modules is given below.
    1. Windows: Shift + Delete

      On Linux, it's this:

      Linux: Shift + Delete

      Thanks for listing us, too. It's like we don't even exist.

    1. Linux Memory Management at Scale

      "we had to build a complete and compliant operating system in order to perform resource control reliably"

      epic real-talk. the only people on the planet who seemed to have tamed linux for workloads. controlling memory. taming io. being on the bleeding edge, it turns out, is almost entirely about forward-progress. what can we reclaim?

      • oomd for memory protection
      • fbtax2
      • psi monitoring for io regulation
      • cgroups v2

      https://facebookmicrosites.github.io/cgroup2/docs/fbtax-results.html

  6. Sep 2020
  7. Aug 2020
  8. Jul 2020
    1. A shell script to automate the retrieval and installation of the Oracle (Sun) Java Runtime Environment
  9. Jun 2020
    1. To get a feel for how much pseudo-random data is available in your entropy pool, you can run this command:$ cat /proc/sys/kernel/random/entropy_avail 2684 The number shown appears to represent the number of bits of entropy that have been collected. Even 2,684 might not seem like much in a world in which we routinely speak in terms of terrabytes, but numbers above 100 are said to be a good sign. I
  10. May 2020
    1. I'd like to offer my thoughts on ctime verses mtime. Sorry, but this will be a little verbose. First, if you change the contents of a file you change the mtime of a file. Since this is a change to the inode, ctime is updated as well. The mtime is bit like the date on a letter and ctime is a bit like the postmark on the envelope. You can set mtime to anything you want via the utime() system call or the touch command. Doing so sets the ctime and you cannot reset ctime. If you restored last year's payroll records from tape, you might want to set the mtime back to the end of last year. But the ctime will reliably still indicate when the last change to the file occurred. This is how your backup program will know that it must back up the file. The ctime is really used by backup program. But an application program that prints out a payroll listing would use mtime.
    2. ctime indicates inode data change: ie. when you do chmod. chown on the file or when the file size changes. Not the contents of the file.

      ctime -inode -? ->file changes sizes

    1. ctime refers to changes made to the file's inode (such as changing permissions, etc). mtime refers to changes to the data within the file. So cnewer will use a reference files inode change time for the comparision, whereas newer will use a reference files data modification time.

      ctime - inode changes mtime - file changes atime - access time

    1. The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice.
    2. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
    1. So be careful running editing a bash script that may be currently executing. It could execute an invalid command, or do something very surprising.

      Never modify a running bash command as it can execute something surprising

    1. That app you desperately need in order to function? We probably have it. The vast software libraries of Ubuntu and Flatpak combine to make all of your tools available in a single location, called the Pop!_Shop.
  11. Apr 2020
    1. I could probably bootstrap my way up from this with the C compiler to write a terrible editor, then write a terrible TCP client, find my way out to ftp.gnu.org, get wget, and keep going from there. Assume that documentation is plentiful. You want a copy of the Stevens book so you can figure out how to do a DNS query by banging UDP over the network? Done.

      What would the author do in a situation of being alone in a room with:

      HD #1 is blank. HD #2 has a few scraps of a (Linux) OS on it: bootloader, kernel, C library and compiler, that sort of thing. There's a network connection of some sort, and that's about it. There are no editors and nothing more advanced than 'cat' to read files. You don't have jed, joe, emacs, pico, vi, or ed (eat flaming death). Don't even think about X. telnet, nc, ftp, ncftp, lftp, wget, curl, lynx, links? Luxury! Gone. Perl, Python and Ruby? Nope.

  12. Feb 2020
    1. I use this to keep information about processes that were running at any time during last five days. These are 1-min snapshots so something might get lost but I think it is good enough for me. I want to have some data available when I discover there was a peak in resource usage (I use munin for that). I haven't found a better way to keep track of past processes (tried psacct).
  13. Jan 2020
  14. Dec 2019
    1. Now using sudo to work around the root account is not only pointless, it's also dangerous: at first glance rsyncuser looks like an ordinary unprivileged account. But as I've already explained, it would be very easy for an attacker to gain full root access if he had already gained rsyncuser access. So essentially, you now have an additional root account that doesn't look like a root account at all, which is not a good thing.
    1. It is possible to do a successful file system migration by using rsync as described in this article and updating the fstab and bootloader as described in Migrate installation to new hardware. This essentially provides a way to convert any root file system to another one.
    2. rsync provides a way to do a copy of all data in a file system while preserving as much information as possible, including the file system metadata. It is a procedure of data cloning on a file system level where source and destination file systems do not need to be of the same type. It can be used for backing up, file system migration or data recovery.
    1. I am familiar with using rsync to back up various files from my system but what is the best way to completely restore a machine.
    1. I run the script daily, early every morning, as a cron job to ensure that I never forget to perform my backups.
    2. There are many options for performing backups. Most Linux distributions are provided with one or more open source programs specially designed to perform backups. There are many commercial options available as well. But none of those directly met my needs so I decided to use basic Linux tools to do the job.
    1. CloneZilla works perfectly. It produces small image files, has integrity check and works fast. If you want to use third device as image repository you should choose device-image when creating image of the first disk and then image-device when you restore it to second disk. If you want to use only two disks - you should use device-device mode. Optionally you may want generate new UUIDs, SSH-key (if SSH server installed), and change hostname.
    1. While there are so many tools to backup your systems, I find this method super easy and convenient, at least to me. Also, this method is way better than disk cloning with dd command. Because It doesn’t matter if your hard drive is different size, or use different filesystem.
    1. Beginner's Guide to Installing from Source http://moi.vonos.net/linux/beginners-installing-from-source/

      Linux From Scratch ... a quote from the vonos.net document: "This document was inspired by the TLDP document Software Building HOWTO which sadly is not actively maintained."

  15. Nov 2019
    1. CompizConfig Settings Manager's Place windows plug-in which will allow an application that isn't running to open on its particular workspace at its pre-defined X-Y coordinate,
    1. The thing is that each UI decision depends on countless other UI decisions. A simple example is keybindings. On UNIX/Linux, it’s nearly impossible to pick reasonable default bindings for global desktop navigation because they all conflict with bindings that some app is using. On Windows, the desktop navigation bindings are hardcoded, and no app uses them, because apps know for sure which bindings to avoid.
  16. Sep 2019
  17. May 2019
    1. we will include an in-house custom-built Linux kernel to underpin the newest version of the Windows Subsystem for Linux (WSL)
  18. Apr 2019
  19. Mar 2019
  20. Feb 2019
    1. A kernel driver is necessary to initalize the tablet and translate hardware-specific protocols into standard input events. We contribute patches directly to the Linux kernel, as well as maintain an out-of-tree kernel module that enables old kernels to work with many newer tablets.

      必须安装内核驱动来初始化数位板和转换硬件特殊协议为标准输入事件.我们贡献了补丁直接加入到Linux内核,也维护了一个树型的内核模式让旧内核能够用于新的数位板.

      如果系统对你的数位板无响应或鼠标无响应,尝试安装或更新input-wacom.

  21. Dec 2018
  22. Nov 2018
    1. For compatibility head also supports an obsolete option syntax -[num][bkm][cqv], which is recognized only if it is specified first.
    2. ‘-n [-]num’ ‘--lines=[-]num’ Output the first num lines.
    3. ‘-c [-]num’ ‘--bytes=[-]num’ Print the first num bytes, instead of initial lines.
  23. Oct 2018
    1. the concept of magic numbers goes back to unix and pre-dates the use of file extensions. The original idea of the shell was that all 'executable' would look the same - it didn't matter how the file had been created or what program should be used to evaluate it. The shell would look at the contents of the file and determine the appropriate file. Microsoft came along and chose a different approach and the era of file extensions was born. Then to make things 'nicer' for users microsoft chose to 'hide' these extensions and the era of trojan files which look like they are of one type but really have a different extension and are processed by a different file was born.
    1. Does any one else think that Microsoft is harming the end users windows 10 system stability with a malicious reason behind it? This has been brought up several times in the security forums.

  24. Sep 2018
  25. Aug 2018
    1. RHEL mount hangs: nfs: server [...] not responding, still trying
  26. Jul 2018
  27. Apr 2018
    1. “The number of moving parts is so vast, and several of them are under the control of different groups. There’s no way you could ever pull it together into an integrated system in the same way as you can in a single commercial product with, you know, a single maniac in the middle.”

      While there are indeed many moving parts modern Version Control Systems take care of that properly and automatically. The idea of a Benevolent dictatorship dictating the course of the software is not wrong, but it's been shown that it limits the software itself, no matter how smart or good the dictator is, he/she will never be able to think about every aspect and possible applications of the software. And considering this is a tool for research and experimentation, limiting the tool on purpose is not a very good idea, if you ask me. EVEN THEN, an open-source model leaves space for a Benevolent dictatorship (just as Linux and Google does for many of its FOSS projects), so that isn't really an argument against an open-source non-commercial developing model, in the worst case scenario.

  28. Mar 2018
    1. 1) <hex_major><hex_minor> device number in hexadecimal represents itself * no leading 0x, for example b302. * 2) /dev/nfs represents Root_NFS (0xff) * 3) /dev/<disk_name> represents the device number of disk * 4) /dev/<disk_name><decimal> represents the device number * of partition - device number of disk plus the partition number * 5) /dev/<disk_name>p<decimal> - same as the above, that form is * used when disk name of partitioned disk ends on a digit. * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the * unique id of a partition if the partition table provides it. * The UUID may be either an EFI/GPT UUID, or refer to an MSDOS * partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero- * filled hex representation of the 32-bit "NT disk signature", and PP * is a zero-filled hex representation of the 1-based partition number. * 7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to * a partition with a known unique id. * 8) <major>:<minor> major and minor number of the device separated by * a colon.

      this is all possible valid formats passed to root= option in linux boot command line

  29. Feb 2018
  30. Jan 2018
  31. Dec 2017
    1. You terminate a session by killing its parent process, called the session leader. Find out which process it is with: ps -dN|grep pts/3
    1. 0 6 * * * /root/zwk/test.sh >> /root/zwk/operate_`date +"\%Y\%m\%d"`.log 2>&1

      crontab 执行命令,将对应运行日志按照日期进行存放

  32. Nov 2017
    1. In Bash you quite often need to check to see if a variable has been set or has a value other than an empty string. This can be done using the -n or -z string comparison operators.

      Two most useful commands in bash