Saturday, October 30, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


The way to set the /boot/grub/grub.cnf partition

Posted: 30 Oct 2021 06:46 AM PDT

how do we set which of the /boot/grub/grub.cnf partition which will run grub menu ?

..  .  

I messed up trying to set python3 as default on Linux mint

Posted: 30 Oct 2021 06:44 AM PDT

Okay, so I did a quick Google search on how to set python3 as default. I came across this code:

echo "alias python='python3'" >> .bashrc source .bashrc

Typed it into the terminal and it didn't work as I wanted so I double-checked I didn't make any mistakes and I wasn't (and am still not) sure what the ">>" means. I think once or twice I just did,

.bashrc source .bashrc

When I start a terminal now it says:

-bash: alias: source: not found

-bash alias: .bashrc: not found

-bash: alias: source: not found

-bash alias: .bashrc: not found

my@my-hp:~$

I've got it all messed up. I have no idea how to fix this and erase what I've done.

The good news is when I type "python" into the terminal it runs python3, but I still can't run a py file by typing it in the terminal after changing the directory to the appropriate folders as I wanted.

Any help would be greatly appreciated

adding a private key of another user

Posted: 30 Oct 2021 06:30 AM PDT

I am running on macos as usera. I want to ssh from usera@cli, but with a key that I have of user b. e.g

usera@mbp ssh userb@server

What should I do for this? I have the id_rsa private key of userb in plaintext

Thanks

How do I consistently name audio devices?

Posted: 30 Oct 2021 05:51 AM PDT

I have a couple of amateur radios that I connect to my Linux computer over USB. The radios present themselves as sound cards, and are visible like so:

$ aplay -l  [...]  card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]    Subdevices: 1/1    Subdevice #0: subdevice #0  card 2: CODEC_1 [USB Audio CODEC], device 0: USB Audio [USB Audio]    Subdevices: 1/1    Subdevice #0: subdevice #0    $ arecord  $ cat rec   **** List of CAPTURE Hardware Devices ****  card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]    Subdevices: 1/1    Subdevice #0: subdevice #0  card 2: CODEC_1 [USB Audio CODEC], device 0: USB Audio [USB Audio]    Subdevices: 0/1    Subdevice #0: subdevice #0  

They show up on USB as:

$ lsusb | grep Audio  $ lsusb | grep Aud  Bus 001 Device 102: ID 08bb:2901 Texas Instruments PCM2901 Audio Codec  Bus 001 Device 099: ID 08bb:2901 Texas Instruments PCM2901 Audio Codec  

The problem here is that I have software that wants to talk to one of them, but it doesn't know which one. The software (js8call and wsjtx) simply allows me to select the name from a dropdown, and remembers the name chosen.

The names in this dropdown are:

alsa_input.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo  alsa_input.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo.2  

Other software (e.g. direwolf) wants the device in "plughw:2,0" format, where the other radio is "plughw:1,0".

But it's not consistent which is which. It depends on when Linux detected them, which in the best case is the order that I plugged them in, and in the normal case it's a race condition, since both are plugged in and are using the same power supply, so they boot up at the same time when I turn on the power.

So, how do I make Linux name these two sound devices in a consistent way, so that I don't have to edit config files, and change settings in a UI, every time they happen to have been detected in a different order?

Debian 11 Bullseye - Why don't I have cgconfig service although I installed cgroup-tools?

Posted: 30 Oct 2021 05:55 AM PDT

I am using Debian 11 Bullseye. I have installed cgroups-tools and I created a cgconfig.conf file. When I start the cgconfig servive by using:

sudo systemctl start cgconfig.service   

it gives this error:

*Unit cgconfig.service could not be found.*  

I checked that which services are available in /etc/init.d, and found that there is only the cgroupfs-mount service. How can I start the cgroups service?

Block edit only lets me insert not delete

Posted: 30 Oct 2021 07:06 AM PDT

I would like to delete some spaces across a block of text. I am able to insert spaces or characters, but seem unable to delete.

Steps that I try:

  1. Control + V to enter block mode
  2. Press up or down key to select the lines I want to edit
  3. Press Shift + i (I) to enter capital insert mode
  4. Make the changes I want to the top line of the block
  5. Press escape

I made a screen cast of me first succeeding in inserting a space across the block then failing to delete a space across the block. MP4 file (If there's a more appropriate place to upload this to please let me know).

How can I delete some spaces across a block in a oner? Everything under steps, I want to delete two spaces. How can I do that?

  send-pg:      runs-on: ubuntu-latest      name: send data to postgres      steps:           - name: checkout current repo             uses: actions/checkout@v2 # Defaults to current repo - check out current repo           - name: Retreive data from ssql job              uses: actions/download-artifact@v2             with:               name: marketing-data               path: ga-files           - name: Check csv file is there and export matrix game for Rscript             run: |                ls -l                  ls -l ga-files  

regular update broke initramfs on elementary os 6

Posted: 30 Oct 2021 05:42 AM PDT

NOTE: ->I have above average linux experience. not an elite.

->i have nvidia gtx 1650 laptop card.

->i use linux xanmod cacule kernel.

->i use latest mesa and nvidia drivers from http://ppa.launchpad.net/kisak/kisak-mesa/ubuntu and http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu

i installed elementary os 2 months ago and have not run into any issues since then. systemctl --failed and journalctl -p 3 -b were fine as i check them regularly. All updates have been smooth since install.


i use a simple apt-fast script to update my system. it is located in /usr/bin/ here it is

#!/usr/bin/fish  sudo apt-fast clean  sudo dpkg --configure -a  sudo apt-fast autoclean  sudo apt-fast update  echo  echo  echo "Packages that will be updated:"  echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"  sudo apt list --upgradable -a  echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"  echo  echo  sudo apt-fast upgrade -y  sudo apt-fast full-upgrade -y  sudo apt-fast autoremove --purge --auto-remove -y  sudo apt-fast clean  sudo flatpak update  

this was what happened during the update https://pastebin.com/xh4EZXT5

i found out something went wrong.

so i ran

sudo dpkg --configure -a  

error persists i googled the error and tried to reinstall initramfs-tools i removed it using-

sudo apt remove initramfs-tools  sudo apt autoremove    

then i ran sudo apt install initramfs-tools still i get the error.

now i am getting this

~ ❯❯❯ sudo apt-get install -f initramfs-tools    Reading package lists... Done  Building dependency tree         Reading state information... Done  initramfs-tools is already the newest version (0.136ubuntu6.6).  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.  1 not fully installed or removed.  After this operation, 0 B of additional disk space will be used.  Do you want to continue? [Y/n] Y  Setting up initramfs-tools (0.136ubuntu6.6) ...  update-initramfs: deferring update (trigger activated)  Processing triggers for initramfs-tools (0.136ubuntu6.6) ...  update-initramfs: Generating /boot/initrd.img-5.14.15-xanmod1-cacule  I: The initramfs will attempt to resume from /dev/dm-2  I: (/dev/mapper/data-swap)  I: Set the RESUME variable to override this.  Error 24 : Write error : cannot write compressed block   E: mkinitramfs failure lz4 -9 -l 24  update-initramfs: failed for /boot/initrd.img-5.14.15-xanmod1-cacule with 1.  dpkg: error processing package initramfs-tools (--configure):   installed initramfs-tools package post-installation script subprocess returned error exit status 1  Errors were encountered while processing:   initramfs-tools  E: Sub-process /usr/bin/dpkg returned an error code (1)    
~ ❯❯❯ sudo dpkg --configure -a  Setting up initramfs-tools (0.136ubuntu6.6) ...  update-initramfs: deferring update (trigger activated)  Processing triggers for initramfs-tools (0.136ubuntu6.6) ...  update-initramfs: Generating /boot/initrd.img-5.14.15-xanmod1-cacule  I: The initramfs will attempt to resume from /dev/dm-2  I: (/dev/mapper/data-swap)  I: Set the RESUME variable to override this.  Error 24 : Write error : cannot write compressed block   E: mkinitramfs failure lz4 -9 -l 24  update-initramfs: failed for /boot/initrd.img-5.14.15-xanmod1-cacule with 1.  dpkg: error processing package initramfs-tools (--configure):   installed initramfs-tools package post-installation script subprocess returned error exit status 1  Errors were encountered while processing:   initramfs-tools    
~ ❯❯❯ sudo journalctl -p 3 -b  -- Logs begin at Fri 2021-10-22 13:47:38 IST, end at Sat 2021-10-30 16:55:55 IST. --  Oct 30 11:15:51 Strix kernel: x86/cpu: SGX disabled by BIOS.  Oct 30 11:15:51 Strix kernel: ACPI BIOS Error (bug): Failure creating named object [\_GPE._E4A], AE_ALREADY_EXISTS (20210604/dswload2-326)  Oct 30 11:15:51 Strix kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20210604/psobject-220)  Oct 30 11:15:51 Strix kernel:   Oct 30 11:15:55 Strix lightdm[2302]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  Oct 30 11:15:55 Strix lightdm[2302]: PAM adding faulty module: pam_kwallet.so  Oct 30 11:15:55 Strix lightdm[2302]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory  Oct 30 11:15:55 Strix lightdm[2302]: PAM adding faulty module: pam_kwallet5.so  Oct 30 11:15:56 Strix systemd[2306]: Failed to start Portal service (GTK+/GNOME implementation).  Oct 30 11:15:56 Strix lightdm[2496]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  Oct 30 11:15:56 Strix lightdm[2496]: PAM adding faulty module: pam_kwallet.so  Oct 30 11:15:56 Strix lightdm[2496]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory  Oct 30 11:15:56 Strix lightdm[2496]: PAM adding faulty module: pam_kwallet5.so  Oct 30 11:15:56 Strix lightdm[2521]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  Oct 30 11:15:56 Strix lightdm[2521]: PAM adding faulty module: pam_kwallet.so  Oct 30 11:15:56 Strix lightdm[2521]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory  Oct 30 11:15:56 Strix lightdm[2521]: PAM adding faulty module: pam_kwallet5.so  Oct 30 11:16:06 Strix lightdm[2521]: gkr-pam: unable to locate daemon control file  Oct 30 16:17:56 Strix systemd[1]: Failed to start Ubuntu Advantage APT and MOTD Messages.  Oct 30 16:17:56 Strix kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership  Oct 30 16:17:56 Strix kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership  Oct 30 16:18:00 Strix lightdm[36108]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  Oct 30 16:18:00 Strix lightdm[36108]: PAM adding faulty module: pam_kwallet.so  Oct 30 16:18:00 Strix lightdm[36108]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory  Oct 30 16:18:00 Strix lightdm[36108]: PAM adding faulty module: pam_kwallet5.so  Oct 30 16:18:00 Strix bluetoothd[851]: RFCOMM server failed for Headset Voice gateway: rfcomm_bind: Address already in use (98)  Oct 30 16:18:00 Strix bluetoothd[851]: RFCOMM server failed for :1.120/Profile/HSPHSProfile/00001108-0000-1000-8000-00805f9b34fb: rfcomm_bind: Address already in use (98)  Oct 30 16:18:01 Strix systemd[36112]: Failed to start Portal service (GTK+/GNOME implementation).  Oct 30 16:18:01 Strix lightdm[36277]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  Oct 30 16:18:01 Strix lightdm[36277]: PAM adding faulty module: pam_kwallet.so  Oct 30 16:18:01 Strix lightdm[36277]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory  Oct 30 16:18:01 Strix lightdm[36277]: PAM adding faulty module: pam_kwallet5.so  Oct 30 16:18:01 Strix lightdm[36318]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory  Oct 30 16:18:01 Strix lightdm[36318]: PAM adding faulty module: pam_kwallet.so  Oct 30 16:18:01 Strix lightdm[36318]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory  Oct 30 16:18:01 Strix lightdm[36318]: PAM adding faulty module: pam_kwallet5.so  Oct 30 16:18:09 Strix lightdm[36318]: gkr-pam: unable to locate daemon control file  Oct 30 16:18:10 Strix kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership  Oct 30 16:18:10 Strix kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership  Oct 30 16:18:10 Strix kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership  Oct 30 16:18:10 Strix kernel: [drm:drm_new_set_master [drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership  Oct 30 16:54:37 Strix systemd[1]: Failed to start Ubuntu Advantage APT and MOTD Messages.  Oct 30 16:54:52 Strix systemd[1]: Failed to start Ubuntu Advantage APT and MOTD Messages.  Oct 30 16:55:00 Strix systemd[1]: Failed to start Ubuntu Advantage APT and MOTD Messages.    
~ ❯❯❯ systemctl --failed    UNIT                 LOAD   ACTIVE SUB    DESCRIPTION                             ● ua-messaging.service loaded failed failed Ubuntu Advantage APT and MOTD Messages    LOAD   = Reflects whether the unit definition was properly loaded.  ACTIVE = The high-level unit activation state, i.e. generalization of SUB.  SUB    = The low-level unit activation state, values depend on unit type.    1 loaded units listed.  ~ ❯❯❯ sudo systemctl restart ua-messaging.service  Job for ua-messaging.service failed because the control process exited with error code.  See "systemctl status ua-messaging.service" and "journalctl -xe" for details.  ~ ❯❯❯ sudo systemctl start ua-messaging.service  Job for ua-messaging.service failed because the control process exited with error code.  See "systemctl status ua-messaging.service" and "journalctl -xe" for details.    

my preferable resolution would be to remove the postinstall script that is causing the problem. otherwise i wont prefer to remove the ppa for mesa and nvidia.

my computer is still able to reboot, but i am not able to use apt package manager. i need to install initramfs-tools which i removed following a solution on similar issue.

i was sent here from askubuntu: here is a link: https://askubuntu.com/questions/1372537/apt-upgrade-broke-initramfs-on-ubuntu-20-04

in what cases is possible re-adding a disk previously removed with mdadm?

Posted: 30 Oct 2021 05:12 AM PDT

Let's say that I have the following ARRAY:

mdadm  -Q --detail /dev/md0  /dev/md0:             Version : 1.2       Creation Time : Fri Oct 29 17:35:52 2021          Raid Level : raid1          Array Size : 8382464 (7.99 GiB 8.58 GB)       Used Dev Size : 8382464 (7.99 GiB 8.58 GB)        Raid Devices : 2       Total Devices : 2         Persistence : Superblock is persistent           Update Time : Sat Oct 30 07:29:40 2021               State : clean       Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0    Consistency Policy : resync                  Name : debian:0  (local to host debian)                UUID : 423096f2:994556ee:1a3ff40e:75475fc5              Events : 317        Number   Major   Minor   RaidDevice State         0       8       17        0      active sync   /dev/sdb1         2       8       65        1      active sync   /dev/sde1  

Then, I simulate a failure and remove the failing disk:

mdadm  /dev/md0 --verbose --fail /dev/sde1  mdadm: set /dev/sde1 faulty in /dev/md0  mdadm /dev/md0  --verbose --remove  /dev/sde1  mdadm: hot removed /dev/sde1 from /dev/md0  

This is the metadata of Arrays components:

mdadm  -E  /dev/sdb1  /dev/sdb1:            Magic : a92b4efc          Version : 1.2      Feature Map : 0x0       Array UUID : 423096f2:994556ee:1a3ff40e:75475fc5             Name : debian:0  (local to host debian)    Creation Time : Fri Oct 29 17:35:52 2021       Raid Level : raid1     Raid Devices : 2     Avail Dev Size : 16764928 (7.99 GiB 8.58 GB)       Array Size : 8382464 (7.99 GiB 8.58 GB)      Data Offset : 10240 sectors     Super Offset : 8 sectors     Unused Space : before=10160 sectors, after=0 sectors            State : clean      Device UUID : 701db404:61dbf37b:933d61d0:42b02759        Update Time : Sat Oct 30 07:30:15 2021    Bad Block Log : 512 entries available at offset 16 sectors         Checksum : 6739499b - correct           Events : 328         Device Role : Active device 0     Array State : A. ('A' == active, '.' == missing, 'R' == replacing)    mdadm  -E  /dev/sde1  /dev/sde1:            Magic : a92b4efc          Version : 1.2      Feature Map : 0x0       Array UUID : 423096f2:994556ee:1a3ff40e:75475fc5             Name : debian:0  (local to host debian)    Creation Time : Fri Oct 29 17:35:52 2021       Raid Level : raid1     Raid Devices : 2     Avail Dev Size : 16764928 (7.99 GiB 8.58 GB)       Array Size : 8382464 (7.99 GiB 8.58 GB)      Data Offset : 10240 sectors     Super Offset : 8 sectors     Unused Space : before=10160 sectors, after=0 sectors            State : clean      Device UUID : 779a1bbf:68684dcc:6efb0c73:af2c0759        Update Time : Sat Oct 30 07:29:40 2021    Bad Block Log : 512 entries available at offset 16 sectors         Checksum : 14848dc8 - correct           Events : 317         Device Role : Active device 1     Array State : AA ('A' == active, '.' == missing, 'R' == replacing)  

But if I try to re-add this what it happens:

mdadm /dev/md0  --verbose --re-add  /dev/sde1  mdadm: --re-add for /dev/sde1 to /dev/md0 is not possible  

However, I can --add without problems

The man pages states:

However based on the event count on the device, the recovery may only require sections that are flagged a write-intent bitmap to be recovered or may not require any recovery at all.

I don't fully understand what that means. For example in which cases the event count is close enough to re-adding to be possible?

I've found that even stopping and assembling the array is not possible either (I mean the array start but as "degraded")

So could you explain me in what cases is possible re-adding a disk previously removed?

Flatpak with custom installation path and user permission

Posted: 30 Oct 2021 04:44 AM PDT

I want to install my flatpaks on an external partition. So I created an "installation" that points to it, called extra.

I use it like: flatpak --installation=extra install flathub packagename

It works, however, the installed files are owned by root. As far as I know I didn't use sudo to install the flatpak. Is there a way to install it to extra but so that my user (which is the owner of the partition) gets to own the files?

Troubleshooting extreme boot time on Linux

Posted: 30 Oct 2021 05:19 AM PDT

I am not sure if this is the right place to ask such tech support related questions, but this definitely seems to be a Linux issue or at least regarding the way Linux interacts with my hardware.

I have a desktop PC built out of a HP Z800 Workstation, and it might be relevant that the system is not UEFI-capable, so all operating systems use legacy BIOS and MBR partition schemes.

I am usually dual booting Windows 10 and a Linux distribution (currently Linux Mint 20.2, but this issue exists for all distros that I have tried, including Debian 11, Ubuntu 20.04-21.10, Fedora 33-35, OpenSUSE Tumbleweed and Arch Linux).

Since I am a mostly non-technical user, I am not sure what the proper terminology is but to be able to correctly describe my issue I have to separate the boot process into three stages (these are my own terminology and my conflict with existing ones which I am not aware of!):

  • Stage 1: The part that starts with pressing the power button and ends with getting to the bootloader (GRUB2).
  • Stage 2: The part that starts with getting to the bootloader and ends when the actual OS starts booting, i.e. when I get console/systemd messages, the plymouth screen etc.
  • Stage 3: The part that starts with the end of Stage 2 end ends when the OS is fully booted and I am on the display manager.

The problem is that Stage 2 takes an insanely long time. So once I get to the bootloader and select (or autoselects) a Linux entry, the screen goes completely blank (based on the distro there might be a flashing prompt here, on Mint it is completely blank but eg. on Fedora I usually get a flashing prompt), the system idles here for an extremely long time (I have measured about 1 minute 44 secs last time), and then Stage 3 begins.

Since Stage 3 goes down without an issue, I am not sure how to troubleshoot this. For example systemd-analyze gives Startup finished in 16.129s (kernel) + 2.863s (userspace) = 18.993s graphical.target reached after 2.120s in userspace, which seems normal to me and definitely does not account for the 1 minute+ nothingness between the bootloader and the OS starting to boot.

Further information:

  • Windows does not behave this way. If I select the Windows 10 entry in the bootloader it starts the boot process instantly (even if fast startup is turned off).
  • It did not always behave this way. I am not sure when the behaviour started (probably about a year or so ago), and I think I did a complete reinstallation of both operating systems on the PC, as in I wiped all hard disks clean and installed both W10 and a Linux distro from scratch. But nothing extraordinary happened that could make think of any root cause for this issue.
  • Aside from small differences (like the flashing prompt I mentioned before), all Linux distros that I have tried since then behave the same way. I did not measure the boot times for different distros for variance though. But in each case the wait time is far more than it would be appropriate and it is always the same, between Stage 2 and Stage 3.
  • My PC has three hard disks, two SSDs and one spinning HDD. I usually use one SSD for Windows C:, another SSD for the Linux / partition and the spinning HDD for the Linux /home and Windows D: partitions. I have experimented with writing MBR boot code during the installation of Linux to each of these disks and the same issue happens in all cases. So it seems that which is the boot disk is immaterial.

I do not necessarily expect a magical fix, but as I have said I have absolutely no clue how to even start troubleshooting this, as during the wait time no feedback is given to me, and this problem is very difficult to search for (eg. searching for slow boot times usually assumes a Stage 3 issue).

EDIT:

  • I have removed quiet and splash and added systemd.show_status=yes to the boot parameters. The issue remains, i.e. there is minute+ wait time before any message appears.
  • The output of dmesg | grep command is [ 0.064784] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.11.0-38-generic root=UUID=78354078-8fcd-4223-8fb0-9137207cb415 ro systemd.show_status=yes.
  • About LED lights: During the "wait time" the green light next to my power button was constantly emitting light with no flashes. This is the only LED light I see on my chassis.
  • The output of fdisk -l and lsblk are pasted below:
Disk /dev/sda: 447,13 GiB, 480103981056 bytes, 937703088 sectors  Disk model: CT480BX500SSD1    Units: sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disklabel type: dos  Disk identifier: 0x00a879e5    Device     Boot     Start       End   Sectors   Size Id Type  /dev/sda1  *         2048    104447    102400    50M  7 HPFS/NTFS/exFAT  /dev/sda2          104448 936654957 936550510 446,6G  7 HPFS/NTFS/exFAT  /dev/sda3       936656896 937697279   1040384   508M 27 Hidden NTFS WinRE      Disk /dev/sdb: 1,84 TiB, 2000398934016 bytes, 3907029168 sectors  Disk model: WDC WD20EZRX-00D  Units: sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disklabel type: dos  Disk identifier: 0xfc1366de    Device     Boot      Start        End    Sectors  Size Id Type  /dev/sdb1  *          2048 2833283071 2833281024  1,3T  7 HPFS/NTFS/exFAT  /dev/sdb2       2833283072 3907028991 1073745920  512G 83 Linux      Disk /dev/sdc: 223,58 GiB, 240057409536 bytes, 468862128 sectors  Disk model: KINGSTON SA400S3  Units: sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disklabel type: dos  Disk identifier: 0x143a208b    Device     Boot     Start       End   Sectors  Size Id Type  /dev/sdc1       452857856 468860927  16003072  7,6G 82 Linux swap / Solaris  /dev/sdc2  *         2048 452857855 452855808  216G 83 Linux    Partition table entries are not in disk order.    

and

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT  sda      8:0    0 447,1G  0 disk   ├─sda1   8:1    0    50M  0 part   ├─sda2   8:2    0 446,6G  0 part   └─sda3   8:3    0   508M  0 part   sdb      8:16   0   1,8T  0 disk   ├─sdb1   8:17   0   1,3T  0 part   └─sdb2   8:18   0   512G  0 part /Storage  sdc      8:32   0 223,6G  0 disk   ├─sdc1   8:33   0   7,6G  0 part [SWAP]  └─sdc2   8:34   0   216G  0 part /    

Handling long-options with getopts

Posted: 30 Oct 2021 04:01 AM PDT

I am parsing options with getopts but would like to handle long-options as well.

getopts_test ()  {  aggr=()  for arg in "$@"; do     case $arg in      ("--context")   aggr+=( "-C" ) ;;      (*)  aggr+=( "$arg" ) ;;     esac  done    set -- "${aggr[@]}"    local OPTIND OPTARG  local shortopts="C:"  while getopts "$shortopts" arg; do     case $arg in      ("C") context="$OPTARG" ;;      (*) break ;;     esac  done  shift $(( OPTIND - 1 ))  }  

But I wonder whether the use of set -- "${aggr[@]}" is correct.

Or is the following (using eval) more appropriate?

eval set -- "${aggr[@]}"  

How can you use a address from ipv6 subnet?

Posted: 30 Oct 2021 04:08 AM PDT

I have a VPS running Debian 10 and I have for example the following /64 subnet: 2001:db8:abcd:abcd::/64 How can I use a single IP from this subnet? For example if I want to use this single IPv6 for a process: 2001:db8:abcd:abcd::1234/128, what do I have to add to /etc/network/interfaces to make it work? By default it doesn't respond to pings and it just timeouts. Thanks a lot!

why am i not able to give write permission to users using chmod in linux

Posted: 30 Oct 2021 04:17 AM PDT

displaying the file permissions

$ ls -l file  -rwxrwxr-x 1 chiranjitd chiranjitd 0 Oct 30 14:52 file  

giving write permissions using chmod

$ chmod +x+r+w file  

displaying the file permissions again

$ ls -l file  -rwxrwxr-x 1 chiranjitd chiranjitd 0 Oct 30 14:52 file  

The write permission is not given to the others why is this happening??

USB Mouse is not working on boot but on replugging it is

Posted: 30 Oct 2021 02:22 AM PDT

I'm on Debian unstable since years, upgrading packages almost daily. Since a few weeks I have a problem with my generic HP USB mouse that I use since years. On boot it is not working, when I unplug and replug it is working fine instantly until the next boot. I tried another generic USB mouse and different USB ports (I don't use a hub in between), but it is showing the same behavior.

I can see this in the logs: "No input driver specified, ignoring this device." But I don't understand why it would behave differently on re-plugging.

My system:

Linux 5.14.0-3-amd64 #1 SMP Debian 5.14.12-1 (2021-10-14) x86_64 GNU/Linux  Description:    Debian GNU/Linux bookworm/sid  Release:        unstable  

I copied from dmesg what happens on boot and on re-plugging:

[    1.883897] usb 1-2: new low-speed USB device number 2 using xhci_hcd  ...  [    2.035566] usb 1-2: New USB device found, idVendor=03f0, idProduct=0b4a, bcdDevice=72.00  [    2.035577] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0  [    2.035582] usb 1-2: Product: USB Optical Mouse  [    2.035585] usb 1-2: Manufacturer: Logitech  [    2.052776] hid: raw HID events driver (C) Jiri Kosina  [    2.061942] usbcore: registered new interface driver usbhid  [    2.061947] usbhid: USB HID core driver  [    2.065852] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:03F0:0B4A.0001/input/input6  [    2.066125] hid-generic 0003:03F0:0B4A.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:14.0-2/input0  [    2.163776] usb 1-5: new full-speed USB device number 3 using xhci_hcd  [    2.284461] psmouse serio1: synaptics: queried max coordinates: x [..5654], y [..4860]  [    2.312245] psmouse serio1: synaptics: queried min coordinates: x [1288..], y [994..]  [    2.312259] psmouse serio1: synaptics: Your touchpad (PNP: SYN3230 ETD0000 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.  ...  [    2.366304] psmouse serio1: synaptics: Touchpad model: 1, fw: 8.2, id: 0x1e2b1, caps: 0xf00123/0x840300/0x2e800/0x0, board id: 3127, fw id: 2158179  [    2.400624] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input4  

Re-plugging:

[   64.422719] usb 1-2: USB disconnect, device number 2  [   66.142892] usb 1-2: new low-speed USB device number 5 using xhci_hcd  [   66.295468] usb 1-2: New USB device found, idVendor=03f0, idProduct=0b4a, bcdDevice=72.00  [   66.295489] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0  [   66.295498] usb 1-2: Product: USB Optical Mouse  [   66.295504] usb 1-2: Manufacturer: Logitech  [   66.300766] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:03F0:0B4A.0002/input/input20  [   66.302955] hid-generic 0003:03F0:0B4A.0002: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:14.0-2/input0  

From /var/log/Xorg.0.log:

[     8.181] (II) config/udev: Adding input device Logitech USB Optical Mouse (/dev/input/event4)  [     8.181] (**) Logitech USB Optical Mouse: Applying InputClass "libinput pointer catchall"  [     8.181] (II) Using input driver 'libinput' for 'Logitech USB Optical Mouse'  [     8.181] (**) Logitech USB Optical Mouse: always reports core events  [     8.181] (**) Option "Device" "/dev/input/event4"  [     8.181] (**) Option "_source" "server/udev"  [     8.182] (II) event4  - Logitech USB Optical Mouse: is tagged by udev as: Mouse  [     8.182] (II) event4  - Logitech USB Optical Mouse: device is a pointer  [     8.182] (II) event4  - Logitech USB Optical Mouse: device removed  [     8.239] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:03F0:0B4A.0001/input/input6/event4"  [     8.239] (II) XINPUT: Adding extended input device "Logitech USB Optical Mouse" (type: MOUSE, id 8)  [     8.239] (**) Option "AccelerationScheme" "none"  [     8.239] (**) Logitech USB Optical Mouse: (accel) selected scheme none/0  [     8.239] (**) Logitech USB Optical Mouse: (accel) acceleration factor: 2.000  [     8.239] (**) Logitech USB Optical Mouse: (accel) acceleration threshold: 4  [     8.241] (II) event4  - Logitech USB Optical Mouse: is tagged by udev as: Mouse  [     8.241] (II) event4  - Logitech USB Optical Mouse: device is a pointer  [     8.243] (II) config/udev: Adding input device Logitech USB Optical Mouse (/dev/input/mouse0)  [     8.243] (II) No input driver specified, ignoring this device.  [     8.243] (II) This device may have been added with another device file.  

Replugging:

[    64.435] (II) event4  - Logitech USB Optical Mouse: device removed  [    64.459] (II) config/udev: removing device Logitech USB Optical Mouse  [    64.462] (II) UnloadModule: "libinput"  [    66.357] (II) config/udev: Adding input device Logitech USB Optical Mouse (/dev/input/mouse0)  [    66.357] (II) No input driver specified, ignoring this device.  [    66.357] (II) This device may have been added with another device file.  [    66.419] (II) config/udev: Adding input device Logitech USB Optical Mouse (/dev/input/event4)  [    66.419] (**) Logitech USB Optical Mouse: Applying InputClass "libinput pointer catchall"  [    66.419] (II) Using input driver 'libinput' for 'Logitech USB Optical Mouse'  [    66.419] (**) Logitech USB Optical Mouse: always reports core events  [    66.419] (**) Option "Device" "/dev/input/event4"  [    66.419] (**) Option "_source" "server/udev"  [    66.420] (II) event4  - Logitech USB Optical Mouse: is tagged by udev as: Mouse  [    66.421] (II) event4  - Logitech USB Optical Mouse: device is a pointer  [    66.421] (II) event4  - Logitech USB Optical Mouse: device removed  [    66.479] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:03F0:0B4A.0002/input/input20/event4"  [    66.479] (II) XINPUT: Adding extended input device "Logitech USB Optical Mouse" (type: MOUSE, id 8)  [    66.480] (**) Option "AccelerationScheme" "none"  [    66.481] (**) Logitech USB Optical Mouse: (accel) selected scheme none/0  [    66.481] (**) Logitech USB Optical Mouse: (accel) acceleration factor: 2.000  [    66.481] (**) Logitech USB Optical Mouse: (accel) acceleration threshold: 4  [    66.487] (II) event4  - Logitech USB Optical Mouse: is tagged by udev as: Mouse  [    66.488] (II) event4  - Logitech USB Optical Mouse: device is a pointer  

How to replace empty lines followed by a specific string by this string?

Posted: 30 Oct 2021 06:53 AM PDT

With sed or awk or whatever, how to replace empty lines followed by a specific string (for instance & or \end{align}) by this string (hence & or \end{align})?

As an example, here is the initial file (edit: less ambiguous example):

The quick brown fox jumps over the sleazy dog.    Indeed, the quick brown fox jumps over the sleazy dog.    \begin{align}      & foo    & bar    \end{align}    The quick brown fox jumps over the sleazy dog.    Indeed, the quick brown fox jumps over the sleazy dog.  

and here is what I'd like to get:

The quick brown fox jumps over the sleazy dog.    Indeed, the quick brown fox jumps over the sleazy dog.    \begin{align}  & foo  & bar  \end{align}    The quick brown fox jumps over the sleazy dog.    Indeed, the quick brown fox jumps over the sleazy dog.  

xinput keycodes do not align with xmodmap table

Posted: 30 Oct 2021 06:01 AM PDT

Is there a table that maps keycodes from the command xinput test-xi2 --root 3 to keysyms?

I've tried xmodmap -pke which I found in the ArchWiki but they don't correspond. How does X even interact with the keyboard? Can you guys point me to some resources that explains how X handles key input?

Why ssh.service doesn’t start automatically during boot despite being enabled by systemd?

Posted: 30 Oct 2021 05:49 AM PDT

I'm using Debian 11 on a Raspberry Pi 4 (image found here). sshd is properly configured (I only edited /etc/ssh/sshd_config, the rest is completely fresh from system installation) and works correctly when I start it manually. However it doesn't start automatically by systemd at boot. sudo systemctl status sshd returns this:

● ssh.service - OpenBSD Secure Shell server       Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)       Active: inactive (dead)         Docs: man:sshd(8)               man:sshd_config(5)  

There is nothing related to ssh in journalctl's output.

This is the content of /lib/systemd/system/ssh.service:

[Unit]  Description=OpenBSD Secure Shell server  Documentation=man:sshd(8) man:sshd_config(5)  After=network.target auditd.service  ConditionPathExists=!/etc/ssh/sshd_not_to_be_run    [Service]  EnvironmentFile=-/etc/default/ssh  ExecStartPre=/usr/sbin/sshd -t  ExecStart=/usr/sbin/sshd -D $SSHD_OPTS  ExecReload=/usr/sbin/sshd -t  ExecReload=/bin/kill -HUP $MAINPID  KillMode=process  Restart=on-failure  RestartPreventExitStatus=255  Type=notify  RuntimeDirectory=sshd  RuntimeDirectoryMode=0755    [Install]  WantedBy=multi-user.target  Alias=sshd.service  

The file sshd_not_to_be_run does not exist. network.target is active. I also installed auditd just for troubleshoot and it successfully starts automatically, but ssh.service is still dead after reboot.

I run out of ideas…


UPDATE:

I just discovered that a sshd process spawns on every connection demand. It is managed by systemd itself and it's clearly printed in the journal when some foreign computers try to connect to mine:

oct. 30 13:09:30 RaspServeur systemd[1]: Started OpenBSD Secure Shell server per-connection daemon (117.68.2.55:45784).  ░░ Subject: L'unité (unit) ssh@4-192.168.1.2:22-117.68.2.55:45784.service a terminé son démarrage  ░░ Defined-By: systemd  ░░ Support: https://www.debian.org/support  ░░   ░░ L'unité (unit) ssh@4-192.168.1.2:22-117.68.2.55:45784.service a terminé son démarrage, avec le résultat done.  oct. 30 13:09:30 RaspServeur audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=ssh@4-192.168.1.2:22-117.68.2.55:45784 comm="systemd" exe="/usr/lib/systemd/systemd" ho>  oct. 30 13:09:33 RaspServeur sshd[1861]: error: kex_exchange_identification: Connection closed by remote host  oct. 30 13:09:33 RaspServeur sshd[1861]: Connection closed by 117.68.2.55 port 45784  oct. 30 13:09:33 RaspServeur systemd[1]: ssh@4-192.168.1.2:22-117.68.2.55:45784.service: Succeeded.  ░░ Subject: Unit succeeded  ░░ Defined-By: systemd  ░░ Support: https://www.debian.org/support  ░░   ░░ The unit ssh@4-192.168.1.2:22-117.68.2.55:45784.service has successfully entered the 'dead' state.  oct. 30 13:09:33 RaspServeur audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=ssh@4-192.168.1.2:22-117.68.2.55:45784 comm="systemd" exe="/usr/lib/systemd/systemd" hos>  

It's like a parallel installation of sshd exists with a default configuration. My own configuration with settings like a specific port number to use can't work without starting manually the sshd.service. But I can successfully connect to that shadow sshd with default port, and systemctl status sshd still reports a dead service…

The situation becomes creepy, I'm now two fingers away to erase the SD card and install an image of another distribution with less pre-configuration.

What is the exact difference between a 'terminal' and a 'seat'?

Posted: 30 Oct 2021 03:00 AM PDT

Sequel to What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'?

That one forgot to mention the seat by a word.

Terminal and seat seem similar, but slightly different. How are they different in scope as terms?

Can a seat contain multiple terminals or is this a one-to-one?

Install browser inside LXD container and run it on host OS

Posted: 30 Oct 2021 06:41 AM PDT

I am trying to install Brave browser inside an LXD container (voidlinux - preferably, or linuxMint), create a shortcut for that app inside my host OS and launch it as any other linux app with the exception that it will run inside a container. I am not sure how to configure the display part or lxc profile on my non-ubuntu host OS.

Tries these tutorials with no success:

https://blog.simos.info/running-x11-software-in-lxd-containers/ and

https://blog.simos.info/running-x11-software-in-lxd-containers/

Tplink not working

Posted: 30 Oct 2021 02:37 AM PDT

My Desktop system has no inbuilt wifi adapter so I have to use tp-link, I installed Linux and got an error that keeps on coming that says "Buffer I/O error on dev sr1 "

because of this, I cannot install several services to do the routine stuff

How to update my ssh known hosts list?

Posted: 30 Oct 2021 05:12 AM PDT

I changed my /etc/hosts, added something like this:

10.188.x.x   client-1  10.188.y.y   client-2  

I used that setting for a while (ssh client-1), then I changed the file a second time to this:

10.188.x.x   cluster-0_1  10.188.y.y   cluster-0_2  

Now if I type ssh c<TAB>, I expect it to be like this:

 ➜  ssh c  cluster-0_1  cluster-0_2  

Instead it shows this:

 ➜  ssh c  client-1 client-2 cluster-0_1  cluster-0_2  

The auto-complete still showed the options of client-1 and client-2, together with cluster-0_* options. So I cleaned .zsh_history file, also updated ~/.ssh/kown_hosts file by removing lines referring to the previous names (client-*), also restarted the sshd service, and even rebooted my computer, which still wouldn't work.

Also, I checked my /etc/ssh/ directory, there wasn't one ssh_know_hosts file.

Maybe just headed to the wrong direction. So how can I fix this? Which file or which specific kind of files should go check? And is there a more proper way of changing my known hosts' names? Thanks a lot!

ps. By the way, the shell is zsh and I use oh-my-zsh (I wonder it might be top suspicious since offers the autocomplete part).

Enable Gnome Screen Sharing via Commandline?

Posted: 30 Oct 2021 06:40 AM PDT

I set up a automated kickstart-installation for a "digital-signage-client" based on Fedora 30 (soon 32), now I want to add the enabling of the "Gnome Screen Sharing" to the installation to be able to get an actual visual feedback what is on the screen right now. I got this to work via the settings in the GUI (Settings - Sharing - Screen Sharing) and I'm also able to set the "subsettings" via gesettings, e.g.

gsettings set org.gnome.desktop.remote-desktop.vnc view-only false  gsettings set org.gnome.desktop.remote-desktop.vnc auth-method 'password'  

But I wasn't able to find the setting to enable the "Screen Sharing" itself. When I enable it via the GUI, I can see via systemctl status:

systemctl status | grep gnome-remote | grep -v grep             │   │ ├─gnome-remote-desktop.service             │   │ │ └─5572 /usr/libexec/gnome-remote-desktop-daemon  

I tried to start this service and also the "daemon" directly with systemctl start, but it only results in Failed to start gnome-remote-desktop-daemon.service: Unit gnome-remote-desktop-daemon.service not found.

There are two quite similar questions, but the seem outdated, because I don't have a schema "org.gnome.Vino":

So: How can I enable Gnome Screen Sharing via Commandline?

Addition:

I've invested a lot of time to get this to work and could solve all but one problem. I now know, that I have to start the service as User, so my whole procedure is:

# Configuration  gsettings set org.gnome.desktop.remote-desktop.vnc auth-method 'password'  gsettings set org.gnome.desktop.remote-desktop.vnc view-only false  gsettings set org.gnome.settings-daemon.plugins.sharing.service:/org/gnome/settings-daemon/plugins/sharing/gnome-remote-desktop/ enabled-connections "['$( grep UUID /etc/sysconfig/network-scripts/ifcfg-enp1s0 | cut -d= -f2)']"    # Start the Remote-Desktop-Service  systemctl start --user gnome-remote-desktop  

I set it to "password" to not have someone to click on "accept", "view-only" to "false" to be able to control it and set the UUID of my network-interface. Afterwards I can start the service correctly configured.

So the last missing step is, that I'm not able to set the password via the commandline. I tried it like for vino and also with secret-tool, but it doesn't work

gsettings set org.gnome.Vino vnc-password $(echo -n "myPassword"|base64)  secret-tool store --label='Label' {attribute} {value}  

The problem with secret-tool is maybe, that the original entry in the Gnome keyring doesn't has a "attribute" and a "value", but those are mandatory for secret tool, so I can't reproduce the entry 1:1.

So: Has someone an idea, how I can set the password for gnome-screen-sharing correctly via cli?

CentOS 8: GPG check FAILED errors on sudo yum update

Posted: 30 Oct 2021 05:00 AM PDT

Immediately after an install from a verified ISO of CentOS 8.0.1905, I logged on as root, enabled the network, logged off; logged in as the user created in installation, and and ran sudo yum update. No plugins are loaded.

Many many errors followed regarding the GPG key, so I ran sudo yum clean all , sudo yum clean metadata , and dnf clean all then ran sudo yum update again with the same failure

Have not created local copies of packages or used a local repo which eliminates yum update on CentOS 6.6 fails

/etc/yum/pluginconf.d/fastestmirror.conf was empty which would seem to negate CentOs 5.3, Yum Update Fails as a source of solutions.

Fedora 30 gets stuck at Started Network Manager Script Dispatcher Service

Posted: 30 Oct 2021 04:01 AM PDT

After updating to Fedora 30 and reboot, the Maschine fell in a login LOOP, but after some reboots it gets stuck at something Like this: [OK] Started Network Manager Script Dispatcher Service Within a black background. And i don't know what to do now.

Could you help me with some ideas ? Thank you very much

XCompose multiple characters: ¯\_(ツ)_/¯

Posted: 30 Oct 2021 05:29 AM PDT

In my ~/.XCompose, I have this line:

<Multi_key> + <3> + <3> : "¯\_(ツ)_/¯" # Shrug.  

Which sadly, does not do what I want. Since only the first characters of the shrug is used.

Can I have multiple characters based of one key combinations?

SSH Key Permissions chmod settings?

Posted: 30 Oct 2021 05:48 AM PDT

I need to use SSH on my machine to access my website and its databases (setting up a symbolic link- but I digress).

Following problem

I enter the command:

ssh-keygen -t dsa  

To generate public/private dsa key pair. I save it in the default (/home/user/.ssh/id_dsa) and enter Enter passphrase twice.

Then I get this back:

WARNING: UNPROTECTED PRIVATE KEY FILE!    Permissions 0755 for '/home/etc.ssh/id_rsa' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: [then the FILE PATH in VAR/LIB/SOMEWHERE]  

Now to work round this I then tried

sudo chmod 600 ~/.ssh/id_rsa         sudo chmod 600 ~/.ssh/id_rsa.pub      

But shortly after my computer froze up, and on logging back on there was a could not find .ICEauthority error.

I got round this problem and deleted the SSH files but want to be able to use the correct permissions to avoid these issues in future.

How should I set up ICEauthority, or where should I save the SSH Keys- or what permissions should they have? Would using a virtual machine be best?

This is all very new and I am on a very steep learning curve, so any help appreciated.

FreeBSD: adding ip alias to interface breaks network on primary ip

Posted: 30 Oct 2021 03:04 AM PDT

I am trying to add an alias to my network card (I would like to use jails) on my FreeBSD box. It is running version 10.2-RELEASE-p7 (generic amd64 kernel). The machine is running in a Hyper-V virtual machine, but I experience the same thing on my physical box, the only difference is that is is running the x86 (32bit) version of the same 10.2 kernel.

The network interface hn0 has a static IP address: 192.168.0.51/24, my default router is 192.168.0.1. Everything works fine, until I add the alias:

ifconfig hn0 inet 192.168.0.200/32 alias  

This creates the alias on hn0 as ifconfig shows:

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384      options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>      inet6 ::1 prefixlen 128      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1      inet 127.0.0.1 netmask 0xff000000      nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>  hn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500      options=31b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,TSO6>      ether 00:15:5d:00:0f:00      inet 192.168.0.51 netmask 0xffffff00 broadcast 192.168.0.255      inet 192.168.0.200 netmask 0xffffffff broadcast 192.168.0.200      nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>  

The problem is that as soon as I have the alias in place, I cannot reach any host outside my subnet (even when using the host's IP address). E.g. a google nameserver:

ping 8.8.8.8  ping 8.8.8.8 (8.8.8.8): 56 data bytes  

However, I can ping anything using the alias as the source:

ping -S 192.168.0.200 8.8.8.8  PING 8.8.8.8 (8.8.8.8) from 192.168.0.200: 56 data bytes  64 bytes from 8.8.8.8: icmp_seq=0 ttl=56 time=11.137 ms  ...  

If the alias is created by jail(8) when starting a jail, the jail using the alias has network access, while the host does not. After removing the alias I have to restart the services netif and routing to regain network access on the primary IP of the host.

When the jail runs, I can ssh into it or I can ping it using the IP alias.

Based on the fact that I cannot ping external nodes using their IP my guess would be that there is something wrong with the routing. Name resolving does not work as my box is unable to reach the DNS servers. Here is my netstat -rn output before adding the alias:

Destination        Gateway            Flags      Netif Expire  default            192.168.0.1        UGS         hn0  127.0.0.1          link#1             UH          lo0  192.168.0.0/24     link#2             U           hn0  192.168.0.51       link#2             UHS         lo0  

and after the alias has been created:

Destination        Gateway            Flags      Netif Expire  default            192.168.0.1        UGS         hn0  127.0.0.1          link#1             UH          lo0  192.168.0.0/24     link#2             U           hn0  192.168.0.51       link#2             UHS         lo0  192.168.0.200      link#2             UHS         lo0  192.168.0.200/32   link#2             U           hn0  

IPv6 values are omitted as I have disabled IPv6 by adding

ipv6_network_interfaces="none"  ipv6_activate_all_interfaces="NO"  

to /etc/rc.conf

I am no expert at network setup, but I have read everything I could find about jails and IP aliases but I haven't found anything helpful. Maybe I am overlooking something trivial, but I have no idea what breaks network access on the host.

Request header for Cache-Control not working

Posted: 30 Oct 2021 06:06 AM PDT

I have set Cache-Control in apache for 1 week for my JS Files but when i check in the browser Cache-Control shows no-cache. Where i am missing the configuration ?

Below is my configuration in apache

<ifModule mod_headers.c>      <filesMatch "\.(html|htm|png|js|css)$">     Header set Cache-Control "max-age=604800, public"    </filesMatch>    </ifModule>  

Request Header in Browser

    Request URL:http://test.com/Script.js?buildInfo=1.1.200      Request Method:GET      Status Code:200 OK      Request Headersview source      Accept:*/*      Accept-Encoding:gzip,deflate,sdch      Accept-Language:en-US,en;q=0.8      **Cache-Control:no-cache**      Connection:keep-alive      Host:test.com      Pragma:no-cache      Referer:http://test.com/home.jsp      User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like            Gecko) Chrome/37.0.2062.120 Safari/537.36      Query String Parametersview sourceview URL encoded      buildInfo:1.1.200        Response Headersview source      Cache-Control:max-age=2592000      Connection:keep-alive      Content-Encoding:gzip      Content-Type:text/javascript      Date:Sun, 12 Oct 2014 16:17:46 GMT      Expires:Tue, 11 Nov 2014 16:17:46 GMT      Last-Modified:Tue, 07 Oct 2014 13:28:08 GMT      Server:Apache      Transfer-Encoding:chunked      Vary:Accept-Encoding  

How can I wrap text at a certain column size?

Posted: 30 Oct 2021 06:49 AM PDT

I know that I can use something like cat test.txt | pr -w 80 to wrap lines to 80 characters wide, but that puts a lot of space on the top and bottom of the printed lines and it does not work right on some systems

What's the best way to force a text file with long lines to be wrapped at a certain width?

Bonus points if you can keep it from breaking words.

No comments:

Post a Comment