What is the epoch of LUKS that is shown when running luksDump? Posted: 08 May 2021 10:13 AM PDT When you run luksDump on a LUKS device, I get this: $ sudo cryptsetup luksDump /dev/sda1 LUKS header information Version: 2 Epoch: 3 Metadata area: 16384 [bytes] Keyslots area: 16744448 [bytes] UUID: 4640c6e4-[…] Label: (no label) Subsystem: (no subsystem) Flags: (no flags) […] I's quite obvious what "version" refers to (the current best is v2, so this is what you should aim for) and I've seen values for Epoch from 3 to 5. However, what does Epoch refer to, actually? And what value should I aim at? Does it matter (security-wise) what number is stated there? Is it bad if it is still Epoch 3 e.g.? Can one upgrade that Epoch? I've searched the web and the FAQ for information, but the word epoch is not mentioned there. |
Window resizes lag/CPU spikes when compositor running Posted: 08 May 2021 10:10 AM PDT I run Gentoo with i3 and the picom compositor. I installed the alacritty terminal to give a try, and noticed that when picom is running, the terminal lags when rapidly resizing the window - rather than a smooth motion, it stutters. It also spikes a CPU core, under the alacritty process. When I kill the picom process though it works smoothly. I get this with other windows, but it's far far worse with alacritty, likely because it's a completely GPU rendered terminal, although I'm not certain on the specifics of what's going on. I have a Ryzen 5 and GTX960 (with nvidia drivers), so hardware isn't the issue here. Is this a bug in picom, or a possible misconfiguration in my graphics libraries or the compositor? |
Finding a string in a txt of house addresses with number ranges by passing in exact number and street names Posted: 08 May 2021 09:55 AM PDT Context I'm a postal worker (mail sorter) and am trying to write a bash script which allows me to input an exact street address and first couple letters of a street name, and have it return the matched string which contains the route number information. I have to sort thousands of letters which can't be machined per day by looking down at the letter, then looking up at massive posters with every address in my city on them. This script could save me literal hours, so I'm trying my hardest to learn the process to get it done. I have a hobby-like background in unix/linux scripting. Not sure if regex is the solution here, or variations of grep, find, awk, sed, or all of them! I have a text file with a list of addresses (house number ranges and street names), each on newlines, like such: 6974-7075 hwy 99: ss1 7757-8079 hwy 99: ss14 98-258 even foo st N: 15 97-257 odd foo st N: 16 21-301 foo st S: 17 15-20 foo st S: 7 bar st: 1 fake st: 31 fake pl: 77 sample dr: 89 Notice the existance of number ranges, streets with one route (no house #'s given), even and odd specifiers, road type (st, hwy, pl, dr, etc.), north(N) and south(S) indicators, and finally route info after a colon. Current State I have the following script that can return the strings I want as long as I input a street number which appears exactly as is in the text file: #! /bin/bash civic="$1" street="$2" grep $civic.*$street /path/to/addresses.txt executing ./script.sh 7757 or ./script.sh 7757 h will return 7757-8079 hwy 99: ss14 for me. I like the full string returned here, not just the route after the colon. But, obviously, executing ./script.sh 8020 h won't return 7757-8079 hwy 99: ss14 , as my code doesn't check for numbers within a range yet. Help Needed However, I'm looking for a way to be able to enter 8020 h and still have it return 7757-8079 hwy 9: ss14 , as 8020 is within the range 7757-8079. Furthermore, notice foo st in the text has an even and odd range with different routes, as well as N and S indicators. I'm looking for a way to be able to enter 107 f or 107 foo and have it return 97-257 odd foo st N: 16 , without also returning 98-258 even foo st N: 15 , as the house # is odd. The words even/odd will always be specified in the strings for those even/odd cases, so maybe a grep or search for those words in a string with a number range if the house # entered is odd? That example would also return 21-301 odd foo st S: 17 (notice foo st S) as the the house # is within the range, and the string has odd in it. I'm ok with this returning both N and S, as I won't have time to specify N or S. I'd be extremely grateful for any help offered in my endeavor, whether a fully fleshed out answer, or a hint at getting closer. Not here to mooch, but simply ask for some help! Let me know if I can be more specific. |
kde top bar horizontal padding Posted: 08 May 2021 09:42 AM PDT After a fresh install of fedora kde i have set some widget into my top bar. Everyting is ok but after a reboot i have some horizontal padding, how can I configure them? The picture show the padding when the edit mode is active normally the padding is not transparent |
Unable to execute file, despite having execute permissions on the file Posted: 08 May 2021 10:11 AM PDT I evidently misunderstand some aspect of file permissions. I'm attempting to execute a binary file compiled with g++ within a /var/www/html/modules file of a Linux machine from within a Drupal installation: uname -a Linux <redacted> 3.10.0-1160.6.1.el7.x86_64 #1 SMP Tue Nov 17 13:59:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux If I run ls -al from within the modules directory, I can see that I have full permissions on the file (as the apache user): whoami apache pwd /var/www/html/modules ls -al total 108 drwxrwxrwx. 42 apache apache 4096 May 8 17:03 . drwxrwxrwx. 9 apache apache 4096 May 8 16:49 .. . . . -rwxrwxrwx. 1 apache apache 46016 May 8 16:38 my_binary cd ../.. ls -al total 8 drwxr-xr-x. 4 root root 33 Dec 3 10:31 . drwxr-xr-x. 21 root root 4096 Dec 11 18:49 .. drwxr-xr-x. 2 root root 6 Nov 16 16:19 cgi-bin drwxrwxrwx. 9 apache apache 4096 May 8 16:49 html And here's distro information: cat /proc/version Linux version 3.10.0-1160.6.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Nov 17 13:59:11 UTC 2020 For completeness, here's file run on the file: file my_binary my_binary: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=e7fb75e11b7234dc1129e9502304fcc7440fd788, for GNU/Linux 3.2.0, not stripped And, if I check mount | grep noexec , the current directory doesn't appear to show up in the results: mount | grep noexec devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,perf_event) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,memory) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuacct,cpu) cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,net_prio,net_cls) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,blkio) cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb) cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,pids) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,freezer) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuset) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,devices) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) And, as suggested in the comments, here's the results of cat /proc/mounts | grep noexec : cat /proc/mounts | grep noexec devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0 securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,seclabel,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 cgroup /sys/fs/cgroup/perf_event cgroup rw,seclabel,nosuid,nodev,noexec,relatime,perf_event 0 0 cgroup /sys/fs/cgroup/memory cgroup rw,seclabel,nosuid,nodev,noexec,relatime,memory 0 0 cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,seclabel,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0 cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,seclabel,nosuid,nodev,noexec,relatime,net_prio,net_cls 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,seclabel,nosuid,nodev,noexec,relatime,blkio 0 0 cgroup /sys/fs/cgroup/hugetlb cgroup rw,seclabel,nosuid,nodev,noexec,relatime,hugetlb 0 0 cgroup /sys/fs/cgroup/pids cgroup rw,seclabel,nosuid,nodev,noexec,relatime,pids 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,seclabel,nosuid,nodev,noexec,relatime,freezer 0 0 cgroup /sys/fs/cgroup/cpuset cgroup rw,seclabel,nosuid,nodev,noexec,relatime,cpuset 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,seclabel,nosuid,nodev,noexec,relatime,devices 0 0 pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 Despite that, attempting to run the file yields a permissions error: ./my_binary bash: line 84: ./my_binary: Permission denied What is likely to be the issue here, or how can I further diagnose what's causing the permission issues? I feel obligated to say that I ran into this while doing an (easy) Hack the Box challenge. I'm doing the challenges to learn though, and this is a hurdle that I'd really like to learn from. |
Bash script for sqlite commands Posted: 08 May 2021 09:09 AM PDT I wish to run a bash script that asks for a variable to be then used in a sqlite query. I have no real experience in scripting, anyway I've tried something like the following but it doesn't work. Doesn't even give an error, just it doesn't show anything. #!/bin/bash echo name read name sqlite3 /arch.db << 'EOF' .headers on select type, number, address from documents where name = '$name'; EOF I'd appreciate any help. |
How to utilize default EXT4 behavior in FUSE Posted: 08 May 2021 09:32 AM PDT I'm starting to work with FUSE, but I'm finding it to be too low-down for me to get a quick start. I really only want to override some of the features of a typical EXT filesystem, not rewrite every single aspect of the filesystem. Is there some way I can just rewrite a few functions and reroute the rest to do what EXT would? |
Kernel keeps trying to access/read my laptop's empty CD drive Posted: 08 May 2021 10:16 AM PDT I'm using a 16-to-18-years-old laptop, a Clevo Zeus M3CW, on which I recently installed antiX Linux 19.3. The kernel version is 4.9.235 (compiled for 486). Now, whenever I boot, the kernel complains about I/O errors from device /dev/sr0 - my laptop's built-in CD-ROM. This is what lsblk says about the device: # lsblk -o +VENDOR,MODEL | head -1 ; lsblk -o +VENDOR,MODEL | grep sr0 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT VENDOR MODEL sr0 11:0 1 1024M 0 rom TEAC DW-224E-A The drive is empty - no CD in there. Later while the system runs, I get innumerable dmesg entries such as the following: [ 53.250051] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.250056] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.250066] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.250071] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.250076] sr 1:0:0:0: [sr0] tag#0 unaligned transfer and also this: [ 53.312725] REISERFS warning (device sr0): sh-2006 read_super_block: bread failed (dev sr0, block 16, size 512) [ 53.312746] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.312754] REISERFS warning (device sr0): sh-2006 read_super_block: bread failed (dev sr0, block 128, size 512) [ 53.359602] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.359617] EXT4-fs (sr0): unable to read superblock [ 53.405593] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.405606] EXT4-fs (sr0): unable to read superblock [ 53.464594] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 53.464608] EXT2-fs (sr0): error: unable to read superblock [ 53.533449] sr 1:0:0:0: [sr0] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 53.533461] sr 1:0:0:0: [sr0] tag#0 Sense Key : Medium Error [current] [ 53.533478] sr 1:0:0:0: [sr0] tag#0 Add. Sense: Unable to recover table-of-contents [ 53.533490] sr 1:0:0:0: [sr0] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 02 00 [ 53.533516] SQUASHFS error: squashfs_read_data failed to read block 0x0 [ 53.533528] squashfs: SQUASHFS error: unable to read squashfs_super_block and these: [ 2852.951421] sr 1:0:0:0: [sr0] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 2852.951431] sr 1:0:0:0: [sr0] tag#0 Sense Key : Medium Error [current] [ 2852.951444] sr 1:0:0:0: [sr0] tag#0 Add. Sense: Unable to recover table-of-contents [ 2852.951453] sr 1:0:0:0: [sr0] tag#0 CDB: Read(10) 28 00 00 07 ff fc 00 00 02 00 [ 2852.951458] blk_update_request: 1680 callbacks suppressed [ 2852.951462] blk_update_request: I/O error, dev sr0, sector 2097136 [ 2852.951509] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 2852.951514] blk_update_request: I/O error, dev sr0, sector 2097136 [ 2852.951521] buffer_io_error: 1670 callbacks suppressed [ 2852.951525] Buffer I/O error on dev sr0, logical block 2097136, async page read [ 2852.951540] sr 1:0:0:0: [sr0] tag#0 unaligned transfer [ 2852.951544] blk_update_request: I/O error, dev sr0, sector 2097137 [ 2852.951550] Buffer I/O error on dev sr0, logical block 2097137, async page read [ 2852.951563] sr 1:0:0:0: [sr0] tag#0 unaligned transfer I should also note that if I insert a CD, it automounts and reads fine. My questions: - What makes the kernel try to read from
/dev/sr0 all the time? Especially on boot, when it's not in /etc/fstab nor mentioned in the grub configuration. - How can I make the kernel give up on this device? From the get-go or after failing a few times?
|
FreeBSD XServer Graphical Install Posted: 08 May 2021 08:04 AM PDT I have pb to install graphic interface on my freebsd thx a lot code bold italic quote |
Error while trying to use numpy, maybe because two version of python are installed? Posted: 08 May 2021 07:57 AM PDT I'm new to Linux, I installed Mint 20.1. The thing is that while trying to use some code using numpy I get this error: I tried updating python and now it seems I have two versions of it. If in terminal I type python3 I get this message If I type python3.9 i see this Maybe is because of this? I really appreciate your help, thanks! |
Visudo permission in file execute script Posted: 08 May 2021 07:42 AM PDT I'm trying to run a shell script via php but I'm getting a permission error, however I'm trying to add permission to my www-data user to use the sudo command without a password, but it's not working, I don't know if I'm reporting anything wrong. Below is how my "visudo" file is edited. www-data ALL=(ALL) NOPASSWD:/var/www/mysite/classes/builder-sites-nginx.sh www-data ALL=(ALL) NOPASSWD:/var/www/mysite/classes/MyClassToCallScript.php My code PHP is: $command = "sudo sh ".dirname(__FILE__)."/builder-sites-nginx.sh {$domain}"; // dump($command); $response = shell_exec($command); But my response is "empty". I did a test by adding the following excerpt to my "visudo" www-data ALL=(ALL) NOPASSWD:ALL Using the way I mentioned above works, but I believe that the security of my site will be at risk, correct? Why my apache user will have sudo permissions and if someone puts in some malicious file I will be in trouble, so I come back with my initial question, the way I am putting the path to "visudo" in just executing the given script is right? |
How is the theoretical maximum file size on filesystems like XFS calculcated? Posted: 08 May 2021 09:23 AM PDT Documentation for XFS claims its current theoretical maximum file size is 8 exbibytes - 1 byte. However, I am wondering how this calculation was computed? I cannot seem to find discussion of this elsewhere, and I am also curious if there is a way for me to verify this if I have the filesystem mounted? |
shell scripts to pattern(s) search and list file(s) in a directory Posted: 08 May 2021 08:28 AM PDT I used ls | agrep "<search pattern #1>;<search pattern #2>;...;<search pattern #n>" to quickly and/or effectively perform a search/list of some file(s) in a directory with some search pattern(s). As an illustration, I created an empty directory and filled it with some empty files using the touch command as shown below: ~ ls -l total 0 -rw-r--r-- 1 me users 0 May 7 14:00 animals-bird_dog_cat.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-bird_dog.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-bird.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-cat_dog_bird.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-cat_dog.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-cat.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-dog_bird.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-dog_cat_bird.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-dog_cat.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-dog.txt Then, using ls -l | agrep "cat;bird" , I have no problem to search/find file(s) whose name(s) contain only cat and bird as shown below. ~ ls -l | agrep 'cat;bird' -rw-r--r-- 1 me users 0 May 7 14:00 animals-bird_dog_cat.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-cat_dog_bird.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-dog_cat_bird.txt AFAICT, this method is pretty fast and effective (I am all ears for a better solution). Since I do this a lot on a daily base, I thought it may be better to write a simple shell script to perform such a task by simply giving the search pattern(s) in CLI. For instance, I wrote a simple shell scripts as shown below and named it mls and make it executable: #!/bin/bash bold=$(tput bold) italic=$(tput sitm) normal=$(tput sgr0) if [ "$#" -lt 1 ]; then echo "${bold}Usage${normal}: $0 <search string 0> [... <search string n>]" exit 0 fi patterns="" for ((i=1;i<$#;i++)) do patterns+="${!i};" done patterns+="${!#}" /usr/bin/ls -lart | agrep '${patterns}${!#}' Then, when I executed the above shell script with a search pattern of mls cat bird , it returns nothing as shown below. ~ ls -l | agrep 'cat;bird' -rw-r--r-- 1 me users 0 May 7 14:00 animals-bird_dog_cat.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-cat_dog_bird.txt -rw-r--r-- 1 me users 0 May 7 14:00 animals-dog_cat_bird.txt ~ mls cat bird ~ Did I miss something? |
noarch conflicts with file from package pgdg-redhat-repo-42.0-15.noarch when update Posted: 08 May 2021 08:17 AM PDT Today I am using this command to update my Fedora 32: sudo yum update shows this error: Running transaction check Transaction check succeeded. Running transaction test The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Error: Transaction test error: file /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG from install of pgdg-fedora-repo-42.0-15.noarch conflicts with file from package pgdg-redhat-repo-42.0-15.noarch I am searching from internet but found no one encount this problem. What should I do to fix it? |
How to avoid duplicate completion in Bash Posted: 08 May 2021 07:35 AM PDT I defined the basic completion script. For program d, it can take subcommand exempt, limit, show, and update. complete -W "exempt limit show update" d However, when I press tab after d exempt , bash displays the completion menu again. $ d <tab> exempt limit show update $ d exempt <tab> exempt limit show update $ d exempt exempt <tab> exempt limit show update How do I prevent Bash from inserting the same word again and again? |
How to get contents between two strings using same number of repeated characters? Posted: 08 May 2021 09:40 AM PDT Essentially, I'm trying to get the content between two string, but that use the same character repeated N time, like so: === This is a test === ==== Another test ==== == Last test == The above is just an example of course. Here what I tried and their result: sed -u '/==/!d;s//&\n/;s/.*\n//;:a;/==/bb;$!{n;ba};:b;s//\n&/;P;D' testfile Give = This is a test = Another test Last test If I were to use only one of the above in the testfile : Last test This would give the wanted result (albeit with too many added newlines but that's fine for this example). The above works only if there a single instance of those repeated characters or if it is a pair of unique strings enclosing the content... How can I get the content between two strings using the same number of repeated characters? I prefer to use either grep , sed or awk for this. |
Force programs bind to an interface, not IP address Posted: 08 May 2021 09:34 AM PDT I have a machine with two network interfaces and two different internet connections. I know there are multiple routing tables and stuff like that. However I have a very easy scenario. Outgoing ssh application should always go via wlan0. So why doing so complicated stuff? First testing with curl which does its job perfect: curl --interface wlan0 ifconfig.me 185.107.XX.XX curl --interface eth0 ifconfig.me 62.226.XX.XX So without setting up any special routing rules for two interfaces, it works exactly as I want. eth0 is the default route ip route default via 192.168.178.1 dev eth0 proto dhcp src 192.168.178.21 metric 202 default via 172.16.1.1 dev wlan0 proto dhcp src 172.16.1.88 metric 303 172.16.1.0/24 dev wlan0 proto dhcp scope link src 172.16.1.88 metric 303 192.168.178.0/24 dev eth0 proto dhcp scope link src 192.168.178.21 metric 202 Now try to do the same with wget. Wget is ideal for debugging as it has with --bind-address the same option as ssh with -b . wget -O- --bind-address=192.168.178.21 ifconfig.me 2> /dev/null 62.226.XX.XX You get the same output when omitting --bind-address wget -O- --bind-address=172.16.1.88 ifconfig.me 2> /dev/null This command just hangs for about 9 (!) minutes and outputs nothing at the end, like ssh will do. I know this Bind unix program to specific network interface thread. However even if the title is "Bind unix program to specific network interface" all solutions working with LD_PRELOAD bind to an IP adress. This feature is already supported by ssh, but does not help here. Firejail could solve this, but as explained in other topic has still the bug not working that way via Wifi. So how can one really force an appliation to use a specific interface without all that complicated routing, netns or iptables rules? LD_PRELOAD looks very promising, however so far this code only focuses on changing bind IP not bindinterface. |
Debian - Intel® I219-V - NIC not detected Posted: 08 May 2021 07:27 AM PDT I have build a new PC today, however debian installation (10.9.0) cannot detect my onboard NIC. My mobo: https://www.asus.com/Motherboards-Components/Motherboards/All-series/PRIME-H510M-E/ One LED is static red and the other LED is blinking orange once I connect the ethernet cable. During installation debian says, that my network card was not automatically detected and lets me choose from a list of drivers, I found that e1000e should be compatible with this NIC, but when I manually select it, nothing happens, it puts me back to the manual driver selection menu. On windows 10 the NIC works just fine. I finished the installation without NIC card, then I downloaded the official driver from intel (e1000e) and loaded it successfully into kernel using modprobe. However my /etc/network/interfaces is still empty, only local loopback is there. How do I know what is the name of the interfaces for the NIC or how do I know that the NIC is working after I loaded the driver ? Any commands to actually check that ? |
How to reorder the grub menu--set the cursor located at the first menu automactically? Posted: 08 May 2021 09:58 AM PDT There are two disks in my pc and dual os (debian--buster + win10 )installed on sda,a single os(debian buster ) installed on sdb. Everytime to reboot pc,the grub menu show as the following: Debian GNU/Linux Advanced option for Debian GNU/Linux Windows Boot Manager(on /dev/sda2) Debian GNU/Linux 10(buster) on /dev/sda6 Advanced options for Debian GNU/Linux 10(buster) (on /dev/sda6) System setup If i select the first item Debian GNU/Linux to enter df /boot/grub/grub.cfg /dev/sdb1 I upload the /boot/grub/grub.cfg as https://www.dropbox.com/s/9qjmk178jlj2gha/grub.cfg-sdb1?dl=0 , If i select the first item Debian GNU/Linux 10(buster) on /dev/sda6 to enter df /boot/grub/grub.cfg /dev/sda1 I upload the /boot/grub/grub.cfg as https://www.dropbox.com/s/kf94rbc9g1xpx8e/grub.cfg-sda1?dl=0 . My expectation:reorder the grub menu as below when to reboot pc everytime: Debian GNU/Linux 10(buster) on /dev/sda6 Advanced options for Debian GNU/Linux 10(buster) (on /dev/sda6) Debian GNU/Linux Advanced option for Debian GNU/Linux Windows Boot Manager(on /dev/sda2) System setup I make a adjust this way: sudo mount /dev/sda2 /mnt sudo grub-install --efi-directory=/mnt sudo grub-mkconfig -o /boot/grub/grub.cfg Reboot it ,please have a look at the grub menu. Why the cursor located at the menu Advanced options for Debian GNU/Linux 10(buster) (on /dev/sdb1) instead of the first menu? How to create the below grub menu to make the cursor located in the first menu when to boot my pc everytime? |
Latitude & Dell TB19 USB-C thunderbolt Nightmare with ubuntu 21 Posted: 08 May 2021 09:11 AM PDT Internet is already full of Dell WD19TB dock problem... but i didn't found answer for my random crashes on a fresh install, and a fresh dock. Nothing works well (multi screen, ethernet, etc.) with latest Ubuntu 21, dock Thunderbolt WD19TB using Usb-C and Latitude 7410. Dock is authorized and energy / charge is the only thing that works well. Even cold/hot plugged i have this information : ➜ boltctl ○ Dell WD19TB Thunderbolt Dock ├─ type: peripheral ├─ name: WD19TB Thunderbolt Dock ├─ vendor: Dell ├─ uuid: 0074c1e4-aad2-d400-ffff-ffffffffffff ├─ generation: Thunderbolt 3 ├─ status: disconnected ├─ authorized: mar. 04 mai 2021 06:55:21 ├─ connected: mar. 04 mai 2021 06:55:21 └─ stored: lun. 26 avril 2021 06:47:49 ├─ policy: iommu └─ key: no ➜ fwupdmgr get-devices Latitude 7410 │ ├─PC SN730 NVMe WDC 1024GB: │ Device ID: 6cc1c2d37a98d92020a9c80f9cc15d88a0656184 │ Summary: NVM Express Solid State Drive │ Current version: 11150012 │ Vendor: Sandisk Corp (NVME:0x15B7) │ GUIDs: 10215a6e-5eb4-5fe4-a3d0-1ff4b3295840 │ e3a1928f-2cb0-4b92-8526-9368d8c0c2d1 │ Device Flags: • Internal device │ • Updatable │ • System requires external power source │ • Supported on remote server │ • Needs a reboot after installation │ • Device is usable for the duration of the update │ ├─System Firmware: │ │ Device ID: baccc6ce3addfafe7012c24cd5f60f2f9d41c832 │ │ Current version: 1.5.2 │ │ Minimum Version: 1.5.2 │ │ Vendor: Dell Inc. (DMI:Dell Inc.) │ │ GUIDs: ae3bd037-2f4a-414c-9f1c-493a454171da │ │ 230c8b18-8d9b-53ec-838b-6cfc0383493a │ │ 6edb33d7-4632-503c-a9f1-f057af06d598 │ │ Device Flags: • Internal device │ │ • Updatable │ │ • System requires external power source │ │ • Supported on remote server │ │ • Needs a reboot after installation │ │ • Cryptographic hash verification is available │ │ • Device is usable for the duration of the update │ │ │ └─UEFI dbx: │ Device ID: 362301da643102b9e38477387e2193e57abaa590 │ Summary: UEFI Revocation Database │ Current version: 238 │ Minimum Version: 238 │ Vendor: UEFI:Linux Foundation │ Install Duration: 1 second │ GUIDs: 00fe3755-a4d8-5ef7-ba5f-47979fbb3423 │ 4a6cd2cb-8741-5257-9d1f-89a275dacca7 │ c6682ade-b5ec-57c4-b687-676351208742 │ f8ba2887-9411-5c36-9cee-88995bb39731 │ Device Flags: • Internal device │ • Updatable │ • Needs a reboot after installation │ ├─UEFI Device Firmware: │ Device ID: df945476b677e7a2dab827b25b9807ed655fc132 │ Current version: 222 │ Minimum Version: 222 │ Vendor: DMI:Dell Inc. │ GUIDs: ffd6eef5-4372-4adc-8eeb-3dc0b7338375 │ fbfd77fb-abcd-56bc-bb4b-27bcd6c22fb4 │ Device Flags: • Internal device │ • Updatable │ • System requires external power source │ • Needs a reboot after installation │ • Device is usable for the duration of the update │ ├─UEFI Device Firmware: │ Device ID: 5b1ec19a3f6b7f8du4e7dec250ecbf3ea1be366e │ Current version: 286588946 │ Minimum Version: 286588946 │ Vendor: DMI:Dell Inc. │ GUIDs: e3a1928f-2cb0-4b92-8526-9368d8c0c2d1 │ 1dc76a3d-4347-5a73-91f2-9fe9fd30e334 │ Device Flags: • Internal device │ • Updatable │ • System requires external power source │ • Needs a reboot after installation │ • Device is usable for the duration of the update │ └─USB2.0 Hub: Device ID: b0a78eb71f4eeea7dfxfb114522556ba8ce22074 Summary: USB 2.x Hub Current version: 30.3 Vendor: VIA Labs, Inc. (USB:0x2109) Install Duration: 15 seconds GUIDs: 1cea77d9-5efe-5499-9d65-228a3cf7160b 20054c2d-afa4-5f73-ade0-18dbd6f09fa5 ae960a48-da94-5862-94b0-f38f69e4f74d e5211a7f-db4d-5122-8bc3-5ccba6b7f45a 2546d7af-3b17-5174-8ff5-e92f441a926f b0a54e37-45da-53f3-98c6-4b33a105d30e Device Flags: • Updatable • Cryptographic hash verification is available • Device stages updates • Device can recover flash failures Basic info : ➜ uname -ra Linux IRED-15-19C0 5.11.0-16-generic #17-Ubuntu SMP Wed Apr 14 20:12:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux During boot i have this error : xhci_hcd 0000:3a:00.0: xHCI host controller not responding, assume dead xhci_hcd 0000:37:00.0: HC died; cleaning up pcieport 0000:39:04.0: can't change power state from D3cold to D0 (config space inaccessible) Even when dual screen works at startup (alignment of planet), it's common to observe a crash after some minutes with random TB disconnection. My cmd line : cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-5.11.0-16-generic root=/dev/mapper/ubuntu--budgie--vg-root ro quiet splash vt.handoff=7 Update : I try that, don't work : |
Collapsing a series of comma separated numbers in a sequence to Beginning-End [duplicate] Posted: 08 May 2021 08:23 AM PDT Problem I am trying to solve/enhance a BASH script that provides a number sequence: I am using a topologically aware tool (lstopo-no-graphics) to extract physical processor numbers to use for input to numactl for processor binding. Example output for L3 L#4 shared cache physical core lstopo-no-graphics --no-io|sed -n "/L3 L#3/,/L3/p"|grep -v "L3\|L2"|tr -s '[:space:]'|cut -d " " -f4|grep -o "[0-9]*"|sort -g|tr '\n' ','|sed '$s/,$//' results in the number series string: 32,33,34,35,36,37,38,39,96,97,98,99,100,101,102,103 All well and good, I use this series for the numactl --physcpubin=32,33,34,35,36,37,38,39,96,97,98,99,100,101,102,103 ، I would would like to be able to collapse the sequence down to numactl --physcpubin=32-39,96-103 , looking to collapse multiple comma separated number sequences to an "a-n" series when sequential, with each sequence comma separated. I don't have a problem with the existing bash script, just looking for a cleaner implementation if anyone has any ideas? |
Force headset mic as default microphone Posted: 08 May 2021 09:29 AM PDT Is there any way that I can force pulseaudio on Debian to use the headset mic option as the microphone instead of internal? You can manually set the mic to "headset mic" even when its unplugged in pavucontrol . For some reason the headset mic isnt getting automatically switched, and since the internal mic is never going to be used I don't need pulseaudio to switch to anything, just stay on the headset mic. I did find a fix that allowed the mic to automatically switch over, but it had a nasty sounding pop any time you plugged in any audio device which was not what I wanted. Since you can manually set the mic input to a headset mic (even when not plugged in), surely there is way to change the default so that the internal mic is never used? |
Bluetooth headphones work for audio, but built-in headphone mic doesn't Posted: 08 May 2021 08:42 AM PDT I'm using Pop_OS! 20.04. I have a pair of Sony Bluetooth headphones (wh-1000xm3). I'm using a USB dongle for a Bluetooth receiver. The audio works in the headphones, the on-headphone controls work, but the built-in mic doesn't. The mic and audio work with my Android phone, Windows, and Mac. I went into settings and everything looks right, but the OS isn't detecting it. In Slack and Google Hangouts, there's a message saying that it can't be found as well as this online test https://www.onlinemictest.com/. Are there any tools I can use to debug this? How can I figure out if it's the Bluetooth receiver, or something in my OS or the headphones? I've tried blueman, but I didn't see anything out-of-the-ordinary. I've tried this https://askubuntu.com/a/1233446/566235 but I don't know which one to add to my alsa-base.conf. My codec is Realtek ALC888 Screenshot of my audio settings, I can't unmute the input for my headphones. The input for pavucontrol. The last one are my headphones. All the requested output: $ bluetoothctl devices Device 70:26:05:8C:CE:40 LE_WH-1000XM3 Device DC:2C:26:D0:90:6A RK-Bluetooth keyboard Device CA:1C:83:E2:08:59 BT4.0+2.4G Mouse Device E0:9F:2A:08:10:43 Intuos BT S Device E0:EA:E1:C3:44:22 Inspire 2 $ bluetooth show Controller 00:1A:7D:DA:71:11 (public) Name: pop-os Alias: pop-os Class: 0x001c0104 Powered: yes Discoverable: yes DiscoverableTimeout: 0x00000000 Pairable: no UUID: Message Notification Se.. (00001133-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: OBEX Object Push (00001105-0000-1000-8000-00805f9b34fb) UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb) UUID: IrMC Sync (00001104-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Vendor specific (00005005-0000-1000-8000-0002ee000001) UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb) UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: OBEX File Transfer (00001106-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d0535 Discovering: no Advertising Features: ActiveInstances: 0x00 SupportedInstances: 0x05 SupportedIncludes: tx-power SupportedIncludes: appearance SupportedIncludes: local-name $ bluetoothctl info 70:26:05:8C:CE:40 Device 70:26:05:8C:CE:40 (public) Name: LE_WH-1000XM3 Alias: LE_WH-1000XM3 Class: 0x00240404 Icon: audio-card Paired: yes Trusted: yes Blocked: no Connected: yes LegacyPairing: no UUID: Vendor specific (00000000-deca-fade-deca-deafdecacaff) UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Vendor specific (7b265b0e-2232-4d45-bef4-bb8ae62f813d) UUID: Vendor specific (81c2e72a-0591-443e-a1ff-05f988593351) UUID: Vendor specific (931c7e8a-540f-4686-b798-e8df0a2ad9f7) UUID: Vendor specific (96cc203e-5068-46ad-b32d-e316f5e069ba) UUID: Vendor specific (b9b213ce-eeab-49e4-8fd9-aa478ed1b26b) UUID: Vendor specific (f8d1fbe4-7966-4334-8024-ff96c9330e15) Modalias: usb:v054Cp0CD3d0452 ManufacturerData Key: 0x012d ManufacturerData Value: 04 00 01 31 00 01 ba 5c 10 b9 00 60 d0 00 00 00 ...1...\...`.... 00 00 00 ... ServiceData Key: 0000fe26-0000-1000-8000-00805f9b34fb ServiceData Value: 0a c9 5c ..\ ServiceData Key: 0000fe2c-0000-1000-8000-00805f9b34fb ServiceData Value: 0a c9 5c ..\ $ lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null Couldn't open device, some information will be missing Couldn't open device, some information will be missing Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 Bus 002 Device 013: ID 1224:2a25 bDeviceClass 239 Miscellaneous Device bDeviceProtocol 1 Interface Association iProduct 2 (Bus Powered) Couldn't open device, some information will be missing Bus 002 Device 012: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) bDeviceClass 224 Wireless bDeviceProtocol 1 Bluetooth iProduct 2 Couldn't open device, some information will be missing Couldn't open device, some information will be missing Bus 002 Device 011: ID 05e3:0608 Genesys Logic, Inc. Hub bDeviceClass 9 Hub Couldn't open device, some information will be missing bDeviceProtocol 1 Single TT iProduct 1 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 Bus 006 Device 003: ID 045e:0291 Microsoft Corp. Xbox 360 Wireless Receiver for Windows bDeviceClass 255 Vendor Specific Class bDeviceProtocol 255 Vendor Specific Protocol iProduct 0 (Bus Powered) Couldn't open device, some information will be missing Bus 006 Device 002: ID 25a7:fa11 Nordic 2.4G Wireless Receiver bDeviceClass 0 bDeviceProtocol 0 iProduct 2 (Bus Powered) Couldn't open device, some information will be missing Couldn't open device, some information will be missing Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Couldn't open device, some information will be missing bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 Bus 005 Device 002: ID 04b3:3025 IBM Corp. NetVista Full Width Keyboard bDeviceClass 0 bDeviceProtocol 0 iProduct 2 (Bus Powered) Couldn't open device, some information will be missing Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Couldn't open device, some information will be missing bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 Couldn't open device, some information will be missing Couldn't open device, some information will be missing Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub bDeviceClass 9 Hub Couldn't open device, some information will be missing bDeviceProtocol 0 Full speed (or root) hub iProduct 2 Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub bDeviceClass 9 Hub bDeviceProtocol 0 Full speed (or root) hub iProduct 2 Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub bDeviceClass 9 Hub bDeviceProtocol 3 iProduct 2 Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub bDeviceClass 9 Hub bDeviceProtocol 1 Single TT iProduct 2 |
Convert a comma delimited list of numbers to a hyphenated list or range Posted: 08 May 2021 08:25 AM PDT I have a comma delimited string of numbers as follows: 1,2,3,5,6,7,8,9,12,14 I'm looking for a command to use in a bash script that can combine adjacent numbers into range/hyphenated entries as follows: 1-3,5-9,12,14 The initial string is guaranteed to be sorted in ascending order. |
Accessing function documentation Posted: 08 May 2021 08:57 AM PDT Is there a way to access docstrings in Bash? How does one include a docstring in a function's definition in Bash? More specifically how do I add and access docstrings to the following function? funky() { echo "Violent and funky!" } |
Whether wild card symbol can be added to path variable? Posted: 08 May 2021 09:00 AM PDT Scenario: Parent folder contains, many sub-folders (say in a few hundreds) containing executables or source programs. Say, parent folder, bin contains many sub-folders, mod1, mod2, ... modn (for example, /opt/app1/bin/ with sub-folders mod1, mod2, mod3, ...., modn). Adding all them to path variable may exceed the path character/line limit or could be very clumsy! It is understood from dogbane's answer at what is wild card to select all directories in a directory that: a) wild card */ can be used to match directories and b) wild card **/*/ can be used to match directories and sub-directories. Whether adding entry /opt/app1/bin/**/*/ to PATH variable, will search the executables in the sub-folders? Will there be any complications, by doing so? |
How to collapse consecutive numbers into ranges? Posted: 08 May 2021 08:28 AM PDT Given a sorted input file (or command output) that contains unique numbers, one per line, I would like to collapse all runs of consecutive numbers into ranges such that n n+1 ... n+m becomes n,n+m input sample: 2 3 9 10 11 12 24 28 29 33 expected output: 2,3 9,12 24 28,29 33 |
How to find the name of a Nix package to install it in configuration.nix? Posted: 08 May 2021 07:34 AM PDT Suppose I search for a package to install using nix-env 's --query operation: $ nix-env -qa 'aspell.*en' aspell-dict-en-7.1-0 I write this package name in /etc/nixos/configuration.nix , NixOS's main configuration file: environment.systemPackages = with pkgs; [ aspell-dict-en ]; Yet if I run sudo nixos-rebuild switch , NixOS command to update the configuration and install all system-wide packages specified by declaratively, it aborts with an error: error: undefined variable 'aspell-dict-en' at /etc/nixos/configuration.nix:44:5 I know that for many packages, although not all, the name that nix-env returns and the name one should specify in environment.systemPackages configuration option are different, but I don't understand the logic. How do I install a package that I found through nix-env ? |
How to debug causes of excessive ksoftirqd resource usage? Posted: 08 May 2021 09:32 AM PDT man ksoftirqd indicates that: If ksoftirqd is taking more than a tiny percentage of CPU time, this indicates the machine is under heavy soft interrupt load. I'm working with a Debian Wheezy system under generally high system utilization in which ksoftirqd processes utilizes excessive cpu and disk resources for a short period of time. During that time, the system operates at a snails pace. How can one begin to understand what the root cause is for this ksoftirqd resource utilization spikes? |
Split DNS (bind9), match-clients any doesn't work? Posted: 08 May 2021 10:03 AM PDT I've been fighting with this for the last few days. A few of my entries have external and internal IP's. My internal network is 10.0.0.0/8. When I nslookup pc1.clase.net internally it responds with a 10.0.0.0 address but if I nslookup pc1.clase.net externally it still gives me a 10.0.0.0 address. I'm on Debian Wheezy. named.conf include "/etc/bind/named.conf.options"; view "internal" { match-clients { 10.0.0.0/8;}; zone "clase.net"{ type master; file "/etc/bind/internals/db.forward.net"; allow-transfer { 10.0.0.11/8; } }; }; include "/etc/bind/named.conf.default-zones"; zone "10.in-addr.arpa" { type master; file "/etc/bind/internals/db.reverse.net"; allow-transfer { 10.0.0.11/8; }; }; }; view "external" { match-clients { any; }; zone "clase.net" { type master; file "/etc/bind/externals/db.forward.net"; allow-transfer { 10.0.0.11/18; }; }; }; internal/db.foward.net $TTL 604800 @ IN SOA ns.clase.net. root.clase.net. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800); Negative Cache TTL ; @ IN NS ns.clase.net. ns IN A 10.0.0.10 pc1 IN A 10.0.0.12 external/db.forward.net $TTL 604800 @ IN SOA ns.clase.net. root.clase.net. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800); Negative Cache TTL ; @ IN NS ns IN A 150.210.0.1 ns IN A 150.210.0.1 pc1 IN A 150.210.0.22 |
No comments:
Post a Comment