Wednesday, July 20, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Add Windows boot option on kali

Posted: 19 Jul 2022 10:02 PM PDT

I am facing this problem.Windows boot removed after Upgrade from grub.

Tried this way but not solved.

https://imgur.com/uXMlszt.png

bash: How to add column numbers to the first row

Posted: 19 Jul 2022 08:36 PM PDT

I had many large .txt like:

xx yy ... zz

XX YY ... ZZ

I want to add a header row to them, each with a different number of columns:

1 2 ... 999

xx yy ... zz

XX YY ... ZZ

Since they have a different number of columns, I could not directly type "1\t2\t....", and I guess that the code should include variables like $NF. Do you have any idea? Thanks for your help.

how can i delete the content outside the brackets

Posted: 19 Jul 2022 09:24 PM PDT

here is my file which contains two cloumns and separated by "\t"

a    HK97 family prohead protease [Lomovskayavirus C31]  b    major capsid protein [Lomovskayavirus C31]  c    gp12 [Lomovskayavirus C31]  d    gp19 [Lomovskayavirus C31]     

and i want wo get the file like this by sed

a    Lomovskayavirus C31  b    Lomovskayavirus C31  c    Lomovskayavirus C31  d    Lomovskayavirus C31  

i have tried the command sed 's/.*[\(.*\)].*/\1/', it seems useless. so what should i change? thanks.

Set maximum number of parallel connections

Posted: 19 Jul 2022 08:05 PM PDT

I have a server with some code, and for x parallel connections/requests that one IP sends, the server runs x parallel threads (so it runs the code x times in parallel). To put a limit to the currently opened threads by a single IP, I want to configure my csf firewall to make it accept a maximum of x parallel connections for each IP.

  • Note: I've seen solutions that let you set a maximum number of IPs that can connect to the server, or a maximum number of total connections, but it's different from what i want.

Blocking and unblocking internet access of a running process

Posted: 19 Jul 2022 08:33 PM PDT

Is it possible to block the internet access of a process and then later unblock it while the process is still running?

How to make bash commands a specific color

Posted: 19 Jul 2022 05:27 PM PDT

I have my bash prompt on one line colored green with file path in blue. When I type a command it appears on the next line. After I press enter the output appears on the next line(s). Then there is an empty line.

I would really like the command to be in a color of my choosing (preferably not green or blue) or bold to differentiate it from the line before it and output line(s) after it. I do not want to alter the output color as that is used to indicate different things like executables and different types of links.

In the example in the image I would like 'ls -la var' to be a different color. Any advice would be very welcome.

enter image description here

Did Unix have a package manager?

Posted: 19 Jul 2022 07:23 PM PDT

I've looked online but couldn't get a straight answer. Plus, there are no mentions of package managers on the Unix books that I've read.

One would imagine that someone/something needed to manage the installation/update/removal of programs; like we have today. But did the people at Bell Labs have a package manager? Did they have a centralized repository with a bunch of programs? Or was it like Slackware today where each person manages their own packages?

Thanks in advance

Awk variable passing error

Posted: 19 Jul 2022 09:27 PM PDT

Below works fine:

awk '{print $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54}' FS='\t' OFS='\t' file.csv > file.csv.updated  

But when I pass the column list through a variable it starts giving syntax errors.

awk -v FinalColumnVal=$FinalColumnValue '{$FinalColumnVal}' FS='\t' OFS='\t' file.csv > file.csv.updated  

For Ref: I confirmed by printing the FinalColumnValue variable and it has the correct data. FinalColumnValue is: print $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54

Error:

awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:      ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:            ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                  ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                        ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                                                                       ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:                                                                                                                                                                                                               ^ syntax error  awk: $1,$2,$3,$4,$5,$6,$7,$8,$57,$9,$55,$10,$11,$12,$56,$13,$53,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$54  awk:    

I cannot get sed to insert or append

Posted: 19 Jul 2022 04:13 PM PDT

I have a large file that consists of many machine programs all together as one large txt file. I want to use sed to look for lines that start with an Oxxxx format like-

O00002 (A36 RETAINER ASSEMBLY .2495 HOLE OP 1)   (RUN OPTIONAL STOP TO MOVE COOLANT)     N2 (CD)   T9 M06   T3   G00 G90 G54 G43 H09 Z5. X0. Y0. S2000 M03   Z2. M08   

I have tried the following and many variations-

sed -i.gap '/^O[0-9]{4,5}.*/i testtest \n' ALL.NC  

I have tried every example I've seen and nothing works. Any pointers towards syntax also appreciated.

Thank you!

/boot out of space for upgrade

Posted: 19 Jul 2022 06:22 PM PDT

I'm trying to upgrade from Debian Stretch to Bullseye and running through the apt update process. I can't get past the new kernel install due to insufficient space on /boot. I've done the main suggestion, which is to apt autoremove and clear out all unused kernels/images. My boot partition is 90mb... terribly small, but was fine for older releases. The newer kernels are just bigger.

Filesystem      Size  Used Avail Use% Mounted on  udev            4.0G     0  4.0G   0% /dev  tmpfs           803M  8.7M  794M   2% /run  /dev/sda3        75G   12G   60G  17% /  tmpfs           4.0G     0  4.0G   0% /dev/shm  tmpfs           5.0M     0  5.0M   0% /run/lock  tmpfs           4.0G     0  4.0G   0% /sys/fs/cgroup  /dev/sda1        86M   68M   14M  83% /boot  tmpfs           803M     0  803M   0% /run/user/0  

There are only two images in boot now:

  • initrd.img-4.19.0-21-686-pae (which is currently loaded)
  • initrd.img-5.10.0-16-686-pae (this is what is trying to get configured)
Setting up initramfs-tools (0.140) ...  update-initramfs: deferring update (trigger activated)  Processing triggers for initramfs-tools (0.140) ...  update-initramfs: Generating /boot/initrd.img-5.10.0-16-686-pae  pigz: abort: write error on <stdout> (No space left on device)  E: mkinitramfs failure pigz 28  update-initramfs: failed for /boot/initrd.img-5.10.0-16-686-pae 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  

Is there a straight forward way to resize, or change the boot location??? This is a virtual machine so I don have access to be in front of the system if it can't boot and I cant risk getting stuck.

Any recommendations? I know my way around linux, but mostly with the help of the internet.

Which GTK libgio API's will allow a GATT client to read/write a characteristic?

Posted: 19 Jul 2022 02:51 PM PDT

I would like to connect with multiple similar BLE devices simultaneously, with one task (thread) accessing each device.

I do:

g_dbus_connection_signal_subscribe(...,"InterfacesAdded",...)  

The callback for this function then starts a new task for each BLE device passing in the device path.

Then the new thread does:

g_dbus_connection_call_sync(...,"org.bluez.Device1","Connect",...).  

This causes a set of characteristics to appear in my original main loop thread which did the "InterfacesAdded" callback. If required, I could notify the thread handling the server (remote) device that a new characteristic has appeared.

What libgio API's are used to read and write values to characteristics for BLE? I have not been able to find any sources for this.

I could put a table of DBUS paths in the program for each characteristic I care about. Or should I somehow look up the UUID? The characteristics are fixed.

OpenVPN generates incorrect remote instruction in profile file

Posted: 19 Jul 2022 02:25 PM PDT

I have OpenVPN running in subnet behind a firewall. It's Web UI is accessible via public IP. Unfortunately, it generates ovpn file with incorrect remote instruction, pointing to private IP instead of global.

How to fix?

Changing

Configuration -> Network Settings -> Hostname or IP Address  

to public IP doesn't help although it is written

Changing the Hostname, Protocol or Port Number after VPN clients are deployed will cause the existing clients to be unusable (until a new client configuration or VPN installer is downloaded from the Client Web Server)

How to accomplish?

reverse ssh tunneling: is there a 3rd machine between local and remote machines?

Posted: 19 Jul 2022 07:29 PM PDT

I'm facing for first time the need to connect my local pc (call it 'home') to my work pc (call it 'work') . Work pc CANNOT accept ssh connection because it's beside a firewall I cannot control.

I read that I could do something called "reverse ssh tunnelling". But it's not clear to me the number and the role of machines involved

Are involved 2 machines only? (home and work) or do we need a 3rd machine (call it a vps) to estabilish bridge between home and work!?

cert expired report per date

Posted: 19 Jul 2022 02:54 PM PDT

Hi How can i sort below file so as to have cert expiration date is used to sort this, thanks

Cluster10*  expire date: Feb 22 23:59:59 2024 GMT  Cluster11*  expire date: Feb  1 23:59:59 2023 GMT  Cluster23*  expire date: Jan 24 23:59:59 2021 GMT  Cluster24*  expire date: May 23 23:59:59 2023 GMT  

Prevent users abusing private ssh keys

Posted: 19 Jul 2022 03:55 PM PDT

It's my experience that users will sprinkle an infrastructure with both public and private keys. While openssh allows for restricting public keys to a specific directory (which discourages them from generating lots of keys) it does NOT provide a similar mechanism for private keys (you can define a default, but not enforce its use).

In an ideal world, I'd want to be able to access hosts without entering a password or passphrase (apart from an initial passphrase for the ssh-agent).

Although the users at my $WORK start their ssh journeys with putty on MS-Windows I am only concerned with preventing them copying a usable private key to a machine which is acting as an ssh server.

These target hosts require the ability to make ssh connections elsewhere so I can't simply block outgoing ssh connections.

Short of implementing a full privileged access solution, is there a way I can let my users authenticate with key pairs but prevent them from copying their private keys (or generating their own keys and deploying either of the private/public keys)?

How do I resolve an error with the pNFS mapping daemon?

Posted: 19 Jul 2022 08:56 PM PDT

I get an annoying error on my Ubuntu Server installation with nfs-blkmap. Running the command

~$ systemctl status nfs-blkmap.service  

Yields the following

× nfs-blkmap.service - pNFS block layout mapping daemon       Loaded: loaded (/lib/systemd/system/nfs-blkmap.service; enabled; vendor preset: enabled)       Active: failed (Result: protocol) since Wed 2022-07-13 16:16:36 UTC; 2 days ago          CPU: 1ms    Jul 13 16:16:36 homeserver systemd[1]: Starting pNFS block layout mapping daemon...  Jul 13 16:16:36 homeserver blkmapd[1511]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory  Jul 13 16:16:36 homeserver systemd[1]: nfs-blkmap.service: New main PID 1511 does not exist or is a zombie.  Jul 13 16:16:36 homeserver systemd[1]: nfs-blkmap.service: Failed with result 'protocol'.  Jul 13 16:16:36 homeserver systemd[1]: Failed to start pNFS block layout mapping daemon.  

I'll admit I haven't done much except some googling because I'm kinda afraid to mess up something. Could someone help me out?

EDIT: what I've tried so far:

  1. Creating the following file did not work, because /run/rpc_pipefs/nfs/blocklayout does not exist and trying to create it is impossible, due to ACL permissions (I think).
# /etc/systemd/system/nfs-blkmap.service.d/override.conf  [Service]  ExecStartPre=/usr/sbin/modprobe blocklayoutdriver  
  1. Renaming nfs-blkmap.service to nfs-blkmap.service.old. This one worked, but that's (of course) because the service technically "doesn't exist".

As far as I can tell, NFS seems to work regardless of the service failing or not existing, so maybe the package isn't maintained properly and/or not needed at all?

Also, the bug seems to be affecting both Debian and Ubuntu.

Command line tool to install GNOME Shell extensions

Posted: 19 Jul 2022 06:03 PM PDT

Is it possible to install an extension from https://extensions.gnome.org/ without using GNOME Shell integration browser add-on?

I'm looking for a tool that will be able to search and install extensions from the above web-site, for example:

$ gnome-extensions search <keyword>  $ gnome-extensions install <extension-id>  

Restart application after crash

Posted: 19 Jul 2022 04:02 PM PDT

I have some application (net core 2.1 app) which I run like this:

nohup dotnet publish/TestApp.dll  

This application crashes sometimes, and I need to restart it when that happens. What do I need to do?

Sound on Dell XPS 9570 only works on headphones

Posted: 19 Jul 2022 08:02 PM PDT

I have a Dell XPS 15 9570 and it's great, except that no sound comes out of the speakers. Weirdly enough it works just fine out of headphones! Just the built-in speakers are the problem.

Everything I can find reports all systems go. pavucontrol looks great:

All my apps report working sound in pavucontrol

The Output Devices panel in pavucontrol also shows sound working

pactl list sinks doesn't show anything that stands out to me:

Sink #0  State: RUNNING  Name: alsa_output.pci-0000_00_1f.3.analog-stereo  Description: Built-in Audio Analog Stereo  Driver: module-alsa-card.c  Sample Specification: s16le 2ch 44100Hz  Channel Map: front-left,front-right  Owner Module: 6  Mute: no  Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB          balance 0.00  Base Volume: 65536 / 100% / 0.00 dB  Monitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor  Latency: 22200 usec, configured 25000 usec  Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY   Properties:      alsa.resolution_bits = "16"      device.api = "alsa"      device.class = "sound"      alsa.class = "generic"      alsa.subclass = "generic-mix"      alsa.name = "ALC3266 Analog"      alsa.id = "ALC3266 Analog"      alsa.subdevice = "0"      alsa.subdevice_name = "subdevice #0"      alsa.device = "0"      alsa.card = "0"      alsa.card_name = "HDA Intel PCH"      alsa.long_card_name = "HDA Intel PCH at 0xed618000 irq 146"      alsa.driver_name = "snd_hda_intel"      device.bus_path = "pci-0000:00:1f.3"      sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"      device.bus = "pci"      device.vendor.id = "8086"      device.vendor.name = "Intel Corporation"      device.product.id = "a348"      device.product.name = "Cannon Lake PCH cAVS"      device.form_factor = "internal"      device.string = "front:0"      device.buffering.buffer_size = "352800"      device.buffering.fragment_size = "176400"      device.access_mode = "mmap+timer"      device.profile.name = "analog-stereo"      device.profile.description = "Analog Stereo"      device.description = "Built-in Audio Analog Stereo"      alsa.mixer_name = "Realtek ALC3266"      alsa.components = "HDA:10ec0298,1028087c,00100103 HDA:8086280b,80860101,00100000"      module-udev-detect.discovered = "1"      device.icon_name = "audio-card-pci"  Ports:      analog-output-speaker: Speakers (priority: 10000)      analog-output-headphones: Headphones (priority: 9000, not available)  Active Port: analog-output-speaker  Formats:      pcm  

I also looked into a theory that the headphone jack wasn't registering plugs/unplugs, but as far as I can tell that's working just fine.

Anyway, I'm at a loss. Any ideas? I'm using Arch linux,and I'm using pulseaudio.

Add Prime OS (Android_x86_x64) to grub menu

Posted: 19 Jul 2022 02:02 PM PDT

I have debian dual boot with windows and try to install prime os also, while install it i didn't install it's grub because i have debian grub, but after installation i can't found it in grub .

result in fdisk -l /dev/sda2 112687104 133169151 20482048 9.8G 83 Linux i try to install grub-customizer and add it by code

set root='(hd0,2)'  search --no-floppy --fs-uuid --set=root e5d445e4-f59f-5158-b9c7-465f7009bc23  linux android/kernel root=UUID=e5d445e4-f59f-5158-b9c7-465f7009bc23 quiet      androidboot.hardware=generic_x86 SRC=/android acpi_sleep=s3_bios,s3_mode  initrd android/initrd.img  

then it was added successfully but when i open it it's show

android/kernel not found  file located at partition `PrimeOS/android/kernel  

screenshot for partition details
partition details

Could not find libmount

Posted: 19 Jul 2022 05:04 PM PDT

During compilation of customized distribution (using buildroot v. 11.2018) I have problem with libmount library (the problem appeared after I had included efl package in buildroot menuconfig - Target packages -> Graphic lib... -> efl ). I have additionaly installed package libmount-dev with no results.

checking for getxattr in -lc... yes  checking sys/xattr.h usability... yes  checking sys/xattr.h presence... yes  checking for sys/xattr.h... yes  checking for XATTR_NOFOLLOW... no  checking for LIBMOUNT... no  configure: error: *** Could not find libmount  

How to include this library to obtain succesful compilation?

Connect to RemoteApp Linux Mint 18.3

Posted: 19 Jul 2022 09:02 PM PDT

At our company we run a Remote Desktop Gateway with RemoteApps Does anyone have a good and easy way to connect and use these from within Linux Mint 18.3?

Been trying different things and a work around is an openVPN server and just connect directly to the Domain Controller and Remote Desktop Server.

It would how ever be very neat to be able to just launch the RemoteApp instead.

SSH command without prompting the message for ssh key save or cancel options

Posted: 19 Jul 2022 08:21 PM PDT

Need ssh command to connect another linux box from a linux box and fetch a output of particular command but connection should be established forcibly without prompting any ssh key to save, cancel.

So far tried command to connect and fetch output but receiving prompt to save public ssh key

value=$(ssh -q -P $passwd $userid@$box "head -1 /users/SB1.txt")  

Formatting the date in bash

Posted: 19 Jul 2022 08:51 PM PDT

I would like to format the date in bash in a script.

The format is: 2016-10-05T12:18:36.890+02:00

I'm currently using: $(date +%Y%m%d%H%M%S)

Any idea how this can be done?

Something (ALSA or pulseaudio) changes sink volume upon bluetooth connect

Posted: 19 Jul 2022 07:07 PM PDT

The problem

I am setting up a small linux computer (C.H.I.P.) to be a bluetooth receiver using pulseaudio. The device is headless so I would like to get a configuration that works on boot. Everything is good except when my phone connects to C.H.I.P. something always sets its sink volume to 0%.

How do I get Pulse/ALSA to leave the Master volume alone when pulseaudio sets up the sink-input? Or maybe pulse is to blame - I'm not sure.

Things I have tried

  • Removing module-*-restore from pulseaudio.
  • Setting flat-volumes to no
  • alsactl store
  • Adding a directive to system.pa and/or default.pa to make pulseaudio set the volume of that sink to 100%

If I'm running alsamixer while my phone connects I see the volume go from 100% to 0% around the following log line:

D: [pulseaudio] protocol-native.c: Client amixer changes volume of sink alsa_output.platform-1c22c00.codec.analog-stereo.  

The set up

  • Bluez advertises as a media/sink device
  • Pulseaudio runs as a system-instance (yes, I know why this is bad)
  • It watches bluez for connections
  • When my phone connects PA sets up a loopback sink-input to the ALSA sink
  • ALSA promptly sets the volume to 0%. This happens every time my phone connects via bluetooth

All I have to do is run alsamixer and set the Master volume to 100%.

Much more information

Here's my message to pulseaudio-discuss (zero replies as of this writing).

The nearby debug log lines:

I: [pulseaudio] client.c: Created 26 "Native client (UNIX socket client)"  I: [pulseaudio] protocol-native.c: Client authenticated anonymously.  D: [pulseaudio] protocol-native.c: Protocol version: remote 29, local 29  D: [pulseaudio] protocol-native.c: SHM possible: no  D: [pulseaudio] protocol-native.c: Negotiated SHM: no  D: [pulseaudio] protocol-native.c: Client amixer changes volume of sink alsa_output.platform-1c22c00.codec.analog-stereo.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Requested to rewind 524288 bytes.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Limited to 18200 bytes.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: before: 2275  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: after: 2275  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Rewound 18200 bytes.  D: [alsa-sink-CDC PCM Codec-0] sink.c: Processing rewind...  D: [alsa-sink-CDC PCM Codec-0] sink-input.c: Have to rewind 18200 bytes on render memblockq.  D: [alsa-sink-CDC PCM Codec-0] source.c: Processing rewind...  I: [pulseaudio] module-device-restore.c: Storing volume/mute for device+port sink:alsa_output.platform-1c22c00.codec.analog-stereo:analog-output.  I: [pulseaudio] client.c: Freed 26 "ALSA plug-in [amixer]"  I: [pulseaudio] protocol-native.c: Connection died.  

The full connection debug.

D: [pulseaudio] bluez5-util.c: Properties changed in device /org/bluez/hci0/dev_1C_56_FE_9D_1B_0E  D: [pulseaudio] bluez4-util.c: dbus: interface=org.freedesktop.DBus.Properties, path=/org/bluez/hci0/dev_1C_56_FE_9D_1B_0E, member=PropertiesChanged  D: [pulseaudio] bluez5-util.c: Unknown interface org.freedesktop.DBus.Introspectable found, skipping  D: [pulseaudio] bluez5-util.c: Unknown interface org.bluez.MediaTransport1 found, skipping  D: [pulseaudio] bluez5-util.c: Unknown interface org.freedesktop.DBus.Properties found, skipping  D: [pulseaudio] bluez4-util.c: dbus: interface=org.freedesktop.DBus.ObjectManager, path=/, member=InterfacesAdded  D: [pulseaudio] bluez4-util.c: dbus: interface=org.bluez.MediaEndpoint1, path=/MediaEndpoint/A2DPSink, member=SetConfiguration  D: [pulseaudio] bluez5-util.c: dbus: path=/MediaEndpoint/A2DPSink, interface=org.bluez.MediaEndpoint1, member=SetConfiguration  D: [pulseaudio] bluez5-util.c: Transport /org/bluez/hci0/dev_1C_56_FE_9D_1B_0E/fd11 state changed from disconnected to idle  D: [pulseaudio] module-bluez5-discover.c: Loading module-bluez5-device path=/org/bluez/hci0/dev_1C_56_FE_9D_1B_0E  I: [pulseaudio] card.c: Created 4 "bluez_card.1C_56_FE_9D_1B_0E"  D: [pulseaudio] module-bluez5-device.c: Acquiring transport /org/bluez/hci0/dev_1C_56_FE_9D_1B_0E/fd11  I: [pulseaudio] bluez5-util.c: Failed optional acquire of unavailable transport /org/bluez/hci0/dev_1C_56_FE_9D_1B_0E/fd11  I: [pulseaudio] module-bluez5-device.c: SBC parameters: allocation=0, subbands=1, blocks=3, bitpool=2  D: [pulseaudio] module-device-restore.c: Database contains invalid data for key: source:bluez_source.1C_56_FE_9D_1B_0E:null  I: [pulseaudio] source.c: Created source 5 "bluez_source.1C_56_FE_9D_1B_0E" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right  I: [pulseaudio] source.c:     bluetooth.protocol = "a2dp_source"  I: [pulseaudio] source.c:     device.description = "MotoG3"  I: [pulseaudio] source.c:     device.string = "1C:56:FE:9D:1B:0E"  I: [pulseaudio] source.c:     device.api = "bluez"  I: [pulseaudio] source.c:     device.class = "sound"  I: [pulseaudio] source.c:     device.bus = "bluetooth"  I: [pulseaudio] source.c:     device.form_factor = "phone"  I: [pulseaudio] source.c:     bluez.path = "/org/bluez/hci0/dev_1C_56_FE_9D_1B_0E"  I: [pulseaudio] source.c:     bluez.class = "0x5a020c"  I: [pulseaudio] source.c:     bluez.alias = "MotoG3"  I: [pulseaudio] source.c:     device.icon_name = "audio-card-bluetooth"  D: [bluetooth] module-bluez5-device.c: IO Thread starting up  D: [pulseaudio] module-suspend-on-idle.c: Source bluez_source.1C_56_FE_9D_1B_0E becomes idle, timeout in 5 seconds.  D: [pulseaudio] sink-input.c: Negotiated format: pcm, format.sample_format = "\"s16le\""  format.rate = "44100"  format.channels = "2" format.channel_map = "\"front-left,front-right\""  D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.platform-1c22c00.codec.analog-stereo becomes busy, resuming.  D: [pulseaudio] sink.c: Suspend cause of sink alsa_output.platform-1c22c00.codec.analog-stereo is 0x0000, resuming  I: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Trying resume...  I: [alsa-sink-CDC PCM Codec-0] alsa-util.c: cannot disable ALSA period wakeups  D: [alsa-sink-CDC PCM Codec-0] alsa-util.c: Maximum hw buffer size is 1489 ms  D: [alsa-sink-CDC PCM Codec-0] alsa-util.c: Set buffer size first (to 65536 samples), period size second (to 8192 samples).  I: [alsa-sink-CDC PCM Codec-0] alsa-util.c: ALSA period wakeups were not disabled  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: hwbuf_unused=0  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: setting avail_min=64656  I: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Time scheduling watermark is 20.00ms  I: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Resumed successfully...  D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.platform-1c22c00.codec.analog-stereo becomes idle, timeout in 5 seconds.  I: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Starting playback.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Cutting sleep time for the initial iterations by half.  D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.platform-1c22c00.codec.analog-stereo becomes idle, timeout in 5 seconds.  I: [pulseaudio] resampler.c: Resampler 'ffmpeg' cannot do variable rate, reverting to resampler 'auto'.  D: [pulseaudio] resampler.c: Resampler:  D: [pulseaudio] resampler.c:   rate 44100 -> 44000 (method speex-fixed-1)  D: [pulseaudio] resampler.c:   format s16le -> s32le (intermediate s16le)  D: [pulseaudio] resampler.c:   channels 2 -> 2 (resampling 2)  I: [pulseaudio] resampler.c: Choosing speex quality setting 1.  D: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=8, prebuf=0, minreq=1 maxrewind=0  D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554432, tlength=33554432, base=8, prebuf=0, minreq=8 maxrewind=0  I: [pulseaudio] sink-input.c: Created input 3 "(null)" on alsa_output.platform-1c22c00.codec.analog-stereo with sample spec s16le 2ch 44100Hz and channel map front-left,front-right  I: [pulseaudio] sink-input.c:     media.role = "music"  I: [pulseaudio] sink-input.c:     module-stream-restore.id = "sink-input-by-media-role:music"  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Cutting sleep time for the initial iterations by half.  D: [pulseaudio] module-stream-restore.c: Not restoring device for stream source-output-by-media-role:abstract, because already set  D: [pulseaudio] source-output.c: Negotiated format: pcm, format.sample_format = "\"s16le\""  format.rate = "44100"  format.channels = "2"  format.channel_map = "\"front-left,front-right\""  D: [pulseaudio] module-suspend-on-idle.c: Source bluez_source.1C_56_FE_9D_1B_0E becomes busy, resuming.  D: [pulseaudio] module-suspend-on-idle.c: Source bluez_source.1C_56_FE_9D_1B_0E becomes idle, timeout in 5 seconds.  D: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=4, prebuf=0, minreq=1 maxrewind=0  D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554432, tlength=33554432, base=4, prebuf=0, minreq=4 maxrewind=0  I: [pulseaudio] source-output.c: Created output 3 "(null)" on bluez_source.1C_56_FE_9D_1B_0E with sample spec s16le 2ch 44100Hz and channel map front-left,front-right  I: [pulseaudio] source-output.c:     media.role = "abstract"  I: [pulseaudio] source-output.c:     module-stream-restore.id = "source-output-by-media-role:abstract"  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Cutting sleep time for the initial iterations by half.  D: [pulseaudio] memblockq.c: memblockq requested: maxlength=16777216, tlength=16777216, base=4, prebuf=0, minreq=0 maxrewind=0  D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=16777216, tlength=16777216, base=4, prebuf=0, minreq=4 maxrewind=0  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Cutting sleep time for the initial iterations by half.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Latency set to 66.67ms  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: hwbuf_unused=500824  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: setting avail_min=64657  I: [alsa-sink-CDC PCM Codec-0] module-loopback.c: Max request changed  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Requesting rewind due to latency change.  I: [alsa-sink-CDC PCM Codec-0] module-loopback.c: Max request changed  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Requested to rewind 524288 bytes.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Limited to 518560 bytes.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: before: 64820  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: after: 64820  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Rewound 518560 bytes.  D: [alsa-sink-CDC PCM Codec-0] sink.c: Processing rewind...  D: [alsa-sink-CDC PCM Codec-0] sink-input.c: Have to rewind 518560 bytes on render memblockq.  D: [alsa-sink-CDC PCM Codec-0] source.c: Processing rewind...  I: [bluetooth] module-loopback.c: Skipping 0 bytes  D: [pulseaudio] module-suspend-on-idle.c: Source bluez_source.1C_56_FE_9D_1B_0E becomes busy, resuming.  D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.  I: [pulseaudio] module.c: Loaded "module-loopback" (index: #22; argument: "source="bluez_source.1C_56_FE_9D_1B_0E" source_dont_move="true" sink_input_properties="media.role=music"").  I: [pulseaudio] module.c: Loaded "module-bluez5-device" (index: #21; argument: "path=/org/bluez/hci0/dev_1C_56_FE_9D_1B_0E").  D: [pulseaudio] bluez5-util.c: Transport /org/bluez/hci0/dev_1C_56_FE_9D_1B_0E/fd11 available for profile a2dp_source  D: [pulseaudio] bluez5-util.c: Unknown interface org.freedesktop.DBus.Introspectable found, skipping  D: [pulseaudio] bluez5-util.c: Unknown interface org.bluez.MediaPlayer1 found, skipping  D: [pulseaudio] bluez5-util.c: Unknown interface org.freedesktop.DBus.Properties found, skipping  D: [pulseaudio] bluez4-util.c: dbus: interface=org.freedesktop.DBus.ObjectManager, path=/, member=InterfacesAdded  D: [pulseaudio] bluez5-util.c: Properties changed in adapter /org/bluez/hci0  D: [pulseaudio] bluez4-util.c: dbus: interface=org.freedesktop.DBus.Properties, path=/org/bluez/hci0, member=PropertiesChanged  I: [pulseaudio] client.c: Created 25 "Native client (UNIX socket client)"  I: [pulseaudio] protocol-native.c: Client authenticated anonymously.  I: [pulseaudio] client.c: Freed 25 "Native client (UNIX socket client)"  I: [pulseaudio] protocol-native.c: Connection died.  I: [pulseaudio] client.c: Created 26 "Native client (UNIX socket client)"  I: [pulseaudio] protocol-native.c: Client authenticated anonymously.  D: [pulseaudio] protocol-native.c: Protocol version: remote 29, local 29  D: [pulseaudio] protocol-native.c: SHM possible: no  D: [pulseaudio] protocol-native.c: Negotiated SHM: no  D: [pulseaudio] protocol-native.c: Client amixer changes volume of sink alsa_output.platform-1c22c00.codec.analog-stereo.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Requested to rewind 524288 bytes.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Limited to 18200 bytes.  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: before: 2275  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: after: 2275  D: [alsa-sink-CDC PCM Codec-0] alsa-sink.c: Rewound 18200 bytes.  D: [alsa-sink-CDC PCM Codec-0] sink.c: Processing rewind...  D: [alsa-sink-CDC PCM Codec-0] sink-input.c: Have to rewind 18200 bytes on render memblockq.  D: [alsa-sink-CDC PCM Codec-0] source.c: Processing rewind...  I: [pulseaudio] module-device-restore.c: Storing volume/mute for device+port sink:alsa_output.platform-1c22c00.codec.analog-stereo:analog-output.  I: [pulseaudio] client.c: Freed 26 "ALSA plug-in [amixer]"  I: [pulseaudio] protocol-native.c: Connection died.  I: [pulseaudio] client.c: Created 27 "Native client (UNIX socket client)"  I: [pulseaudio] protocol-native.c: Client authenticated anonymously.  D: [pulseaudio] protocol-native.c: Protocol version: remote 29, local 29  D: [pulseaudio] protocol-native.c: SHM possible: no  D: [pulseaudio] protocol-native.c: Negotiated SHM: no  I: [pulseaudio] client.c: Freed 27 "ALSA plug-in [amixer]"  I: [pulseaudio] protocol-native.c: Connection died.  I: [pulseaudio] client.c: Created 28 "Native client (UNIX socket client)"  I: [pulseaudio] protocol-native.c: Client authenticated anonymously.  D: [pulseaudio] protocol-native.c: Protocol version: remote 29, local 29  D: [pulseaudio] protocol-native.c: SHM possible: no  D: [pulseaudio] protocol-native.c: Negotiated SHM: no  I: [pulseaudio] client.c: Freed 28 "pactl"  I: [pulseaudio] protocol-native.c: Connection died.  

/etc/pulse/daemon.conf

daemonize = no  allow-module-loading = yes  allow-exit = no  use-pid-file = yes  system-instance = yes  high-priority = yes  realtime-scheduling = no  log-target = journal  resample-method = ffmpeg  enable-remixing = no  enable-lfe-remixing = no  flat-volumes = yes  default-sample-format = s32le  default-sample-rate = 44000  alternate-sample-rate = 192000  default-sample-channels = 2  default-fragments = 10  default-fragment-size-msec = 50  

/etc/pulse/client.conf

extra-arguments = --log-target=syslog --system --disallow-exit -v  

/etc/pulse/system.pa

.ifexists module-udev-detect.so  load-module module-udev-detect  .else  load-module module-detect  .endif  .ifexists module-esound-protocol-unix.so  load-module module-esound-protocol-unix auth-anonymous=1  .endif  load-module module-native-protocol-unix auth-anonymous=1  load-module module-stream-restore  load-module module-device-restore  load-module module-default-device-restore  load-module module-rescue-streams  load-module module-always-sink  load-module module-suspend-on-idle  load-module module-position-event-sounds  load-module module-bluetooth-discover  load-module module-bluetooth-policy  load-module module-switch-on-connect  

/etc/pulse/default.pa

.nofail  .fail  load-module module-device-restore  load-module module-stream-restore  load-module module-card-restore  load-module module-augment-properties  load-module module-switch-on-port-available  .ifexists module-udev-detect.so  load-module module-udev-detect  .else  load-module module-detect  .endif  .ifexists module-jackdbus-detect.so  .nofail  load-module module-jackdbus-detect channels=2  .fail  .endif  .ifexists module-bluetooth-policy.so  load-module module-bluetooth-policy  .endif  .ifexists module-bluetooth-discover.so  load-module module-bluetooth-discover  .endif  .ifexists module-esound-protocol-unix.so  load-module module-esound-protocol-unix  .endif  load-module module-native-protocol-unix  .ifexists module-gconf.so  .nofail  load-module module-gconf  .fail  .endif  load-module module-default-device-restore  load-module module-rescue-streams  load-module module-always-sink  load-module module-intended-roles  load-module module-suspend-on-idle  .ifexists module-console-kit.so  load-module module-console-kit  .endif  .ifexists module-systemd-login.so  load-module module-systemd-login  .endif  load-module module-position-event-sounds  load-module module-role-cork  load-module module-filter-heuristics  load-module module-filter-apply  

The sink-input that gets "muted".

0 ol-blue /etc/pulse # pactl list sink-inputs  Sink Input #0      Driver: module-loopback.c      Owner Module: 16      Client: n/a      Sink: 0      Sample Specification: s16le 2ch 44100Hz      Channel Map: front-left,front-right      Format: pcm, format.sample_format = "\"s16le\""  format.rate = "44100" format.channels = "2"  format.channel_map = "\"front-left,front-right\""      Corked: yes      Mute: no      Volume: front-left: 1 /   0% / -288.99 d,   front-right: 1 /   0% /  -288.99 d              balance 0.00      Buffer Latency: 0 usec      Sink Latency: 0 usec      Resample method: speex-fixed-1      Properties:          media.role = "music"          module-stream-restore.id = "sink-input-by-media-role:music"          media.name = "Loopback from MotoG3"          media.icon_name = "audio-card-bluetooth"  

The ALSA sink:

0 ol-blue /etc/pulse # pactl list sinks  Sink #0      State: SUSPENDED      Name: alsa_output.platform-1c22c00.codec.analog-stereo      Description: sun4i-codec Analog Stereo      Driver: module-alsa-card.c      Sample Specification: s32le 2ch 44000Hz      Channel Map: front-left,front-right      Owner Module: 1      Mute: no      Volume: front-left: 1 /   0% / -288.99 d,   front-right: 1 /   0% / -288.99 d              balance 0.00      Base Volume: 65536 / 100% / 0.00 dB      Monitor Source: alsa_output.platform-1c22c00.codec.analog-stereo.monitor      Latency: 0 usec, configured 0 usec      Flags: HARDWARE DECIBEL_VOLUME LATENCY      Properties:          alsa.resolution_bits = "24"          device.api = "alsa"          device.class = "sound"          alsa.class = "generic"          alsa.subclass = "generic-mix"          alsa.name = ""          alsa.id = "CDC PCM Codec-0"          alsa.subdevice = "0"          alsa.subdevice_name = "subdevice #0"          alsa.device = "0"          alsa.card = "0"          alsa.card_name = "sun4i-codec"          alsa.long_card_name = "sun4i-codec"          alsa.driver_name = "sun4i_codec"          device.bus_path = "platform-1c22c00.codec"          sysfs.path = "/devices/platform/soc at 01c00000 /1c22c00.codec/sound/card0"          device.string = "hw:0"          device.buffering.buffer_size = "524288"          device.buffering.fragment_size = "65536"          device.access_mode = "mmap+timer"          device.profile.name = "analog-stereo"          device.profile.description = "Analog Stereo"          device.description = "sun4i-codec Analog Stereo"          module-udev-detect.discovered = "1"          device.icon_name = "audio-card"      Ports:          analog-output: Analog Output (priority: 9900)      Active Port: analog-output      Formats:          pcm  

Can't restore/reformat my USB flash drive after moving to GPT

Posted: 19 Jul 2022 06:06 PM PDT

I have 8GB flash memory stick. Sometimes ago I formatted it to be able to install Windows from it. I can't remember what exactly I did but I think I wanted to be able to install Win 7 64-bit to boot in EFI mode.

Now I can't reformat it nor in Windows nor in Linux.

I tried to convert it to MBR from GPT with gdisk by gdisk /dev/sdc, then w (to write GPT from memory to the drive as the tool reported "Found invalid GPT and valid MBR; converting MBR to GPT format in memory"). Then gdisk /dev/sdc again:

    # gdisk /dev/sdc  GPT fdisk (gdisk) version 0.8.8    Partition table scan:    MBR: MBR only    BSD: not present    APM: not present    GPT: not present      ***************************************************************  Found invalid GPT and valid MBR; converting MBR to GPT format  in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by  typing 'q' if you don't want to convert your MBR partitions  to GPT format!  ***************************************************************  

, opened expert tools with x, z (to destroy GPT). Here is the output:

Expert command (? for help): z  About to wipe out GPT on /dev/sdc. Proceed? (Y/N): Y  GPT data structures destroyed! You may now partition the disk using fdisk or  other utilities.  Blank out MBR? (Y/N): Y  #  

then tried to delete a partition with fdisk

# fdisk /dev/sdc    Command (m for help): p    Disk /dev/sdc: 8086 MB, 8086618112 bytes  249 heads, 62 sectors/track, 1023 cylinders, total 15794176 sectors  Units = sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disk identifier: 0x000a07ca       Device Boot      Start         End      Blocks   Id  System  /dev/sdc1   *          62    15793073     7896506    7  HPFS/NTFS/exFAT    Command (m for help): d  Selected partition 1    Command (m for help): p    Disk /dev/sdc: 8086 MB, 8086618112 bytes  249 heads, 62 sectors/track, 1023 cylinders, total 15794176 sectors  Units = sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disk identifier: 0x000a07ca       Device Boot      Start         End      Blocks   Id  System    Command (m for help): w  The partition table has been altered!    Calling ioctl() to re-read partition table.    Error closing file  

After this I tried to pull out and plug in the stick again but NTFS mount error window appeared each time.

enter image description here

I also tried to rewrite an initial drive area with a test content with badblocks

sudo badblocks -w -s -o /tmp/usbstick.log /dev/sdc  

and with dd

sudo dd if=/dev/zero of=/dev/sdc bs=1024k count=2  

but I couldn't reformat it to usable state.

Is there a way I can restore its factory state?

My system: Linux Mint 17.3

UPDATE

# blkid  /dev/sdc1: UUID="675599A00CE338FC" TYPE="ntfs"    # usb-devices  T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#=  4 Spd=480 MxCh= 0  D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1  P:  Vendor=1307 ProdID=0190 Rev=01.00  S:  Manufacturer=USBest Technology  S:  Product=USB Mass Storage Device  S:  SerialNumber=00000000000004  C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=98mA  I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage  

Use aliases as custom commands in terminator

Posted: 19 Jul 2022 10:00 PM PDT

I am using a terminator layout to start multiple terminals, and would like to call an alias at each terminal start which is defined in my .bash_aliases (called by both .bashrc and .profile). Terminator unfortunately doesn't know about those aliases when starting the terminals. How can I fix that?

I start terminator with this command:

terminator -l my_layout -f  

EDIT:

As a temporary solution, I ssh -A -YC into myself and then run the alias. All this as a custom command.

Restricting who can send to an email address

Posted: 19 Jul 2022 03:06 PM PDT

I'd like to do so that only certain From: addresses can send to an email address (mailing list) on an Ubuntu system running Postfix.

Understanding the Postfix the manuals are requires a lot of knowledge, so I'm hoping to get a complete recipe I can use. Currently this is what I have:

/etc/postfix/main.cf:  smtpd_recipient_restrictions =    check_recipient_access hash:/etc/postfix/protected_destinations  smtpd_restriction_classes = insiders_only  insiders_only = check_sender_access hash:/etc/postfix/insiders, reject    /etc/postfix/protected_destinations:  protected.list@example.com insiders_only    /etc/postfix/insiders:  allowed.user@example.com OK  another.allowed.user@example.com OK  

This gives:

fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit  

I am open to any suggestions. It doesn't have to be Postfix. It can be procmail or any other standard solution.

Note: the recipient is a mailing list, and thus does not have a user account on the system account. So any solution must work without an account.

Current mailing list implementation

/etc/postfix/virtual:  protected.list@example.com user1@example.com, user2.example.com, ...  

No comments:

Post a Comment