Saturday, November 6, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to transform the text file to the given XML Schema

Posted: 06 Nov 2021 10:23 AM PDT

I have to write a script that take as input EBCDIC encoded file and after that to transform it to given XML schema needed for later that I will extract the information between the tags and use it as input file for database. So far I have done the decriptiting using

dd if=~/KSH_Advanced/data/TST.DATA_INPUT of=~/KSH_Advanced/data/txtTestFile.csv ibs=800 cbs=80 conv=ascii;  

the txtTestFile.csv looks like that:

enter image description here

p.s thats just 1/100 of the text file I currently have this is just an example.

I should select and export only segments that are like the following:

Header:  Rec_type string(3) 'HDR';  Data_date date('YYYYMMDD');  Create_timestamp date('YYYYMMDDHH24MMSSNNNNNN);  Filler string(492);  Newline string(1)="\n";  Total length: 524  Body:  Rec_type string(3) 'BDY'  ID_XML decimal(10);  ID_SEGMENT decimal(10);  XML_DATA string(500);  Newline string(1)="\n"  Total length: 524  Trailer:  Rec_type string(3) 'TRL'  Num_records Decimal(9); //Note: leftpaded with leading zeros, number of body records  Num_xml_entries Decimal(9); //Note: leftpaded with leading zeros, number of xml … tags  Filler string(502);  Newline string(1)="\n";  Total length: 524  

The XML Schema I am given is:

  <xml version="1.0" encoding="ISO-8859-1" >    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">    <xs:element name="record">     <xs:complexType>        <xs:sequence>        <xs:element name="entry" maxOccurs="unbounded">          <xs:complexType>            <xs:sequence>               <xs:element name="name" type="xs:string"/>               <xs:element name="value" type="xs:string"/>            </xs:sequence>            <xs:attribute name="unit" type="xs:string" use="required"/>          </xs:complexType>        </xs:element>        </xs:sequence>     </xs:complexType>   </xs:element>   </xs:schema>  

After getting the correct segments I have to use awk/sed to get the data like the following:

 D_XML ID_SEGMENT UNIT NAME VALUE   1 1 Baneling SPEED 2.50   1 1 Baneling TYPE null   1 2 Baneling UPG_SPEED 2.95  

So I can use it as input file for SQL Database.

Bash commands using smb:// -> No such file or directory

Posted: 06 Nov 2021 10:09 AM PDT

I have an smb share that I see in the Files explorer as smb://whitebox.local/photos/ If I try to use commands on this smb share using the smb:// syntax, I get a "No such file or directory" error message:

hippo@hippo-camp:~/Desktop$ ls smb://whitebox.local/photos/  ls: cannot access 'smb://whitebox.local/photos/': No such file or directory  

How do I solve this?

Suddenly cannot change ownership nor permissions of files/folders on internal drive: chown, chmod

Posted: 06 Nov 2021 09:37 AM PDT

I have suddenly lost the ability to use chmod and chown. I am operating within my /home directory. I can still create and delete files. In verbose mode, they both say that the requested changes have been made, but they haven't. I am trying to change ownership from jim:jim to root:root so that my Python app can run from /usr/bin. I have done this many times, but suddenly, I cannot. I also tried using 'sudo nautilus' to make the changes. The ownership briefly shows as changed, then flips back to jim:jim OS: ZorinOS 16 based on Ubuntu 20.04 (I've been using it for over 5 months) Drive: /home partition of system SSD on my private, home machine File System: ext4 Read/Write: can still create and delete files in the same folders Example command: $sudo chown -v root:root password.py Results: chown states the ownership has been changed, but it has not. chmod also says it worked, but it hasn't.a Please help me to step back out of the twilight zone.

ALSA/Pipewire: Make both internal speakers and headphone jack visible for selection

Posted: 06 Nov 2021 09:03 AM PDT

I am running Fedora 35 (previously 34) on a laptop. All is well except that I can't make the system auto-detect the sound card. So I manually created the ~/.asoundrc file:

defaults.pcm.card 0  defaults.pcm.device 5  defaults.ctl.card 0  

This sent sound to internal speakers. To send sound to headphones, I manually:

1/ Change the contents of .asoundrc to:

defaults.pcm.card 0  defaults.pcm.device 0  defaults.ctl.card 0  

2/ Restart the pipewire service:

systemctl --user restart pipewire.service  

Is there a way to specify BOTH device 0 and device 5 in this file (or elsewhere) so that I can select one or the other from the Sound control panel?

Many thanks!!!

bash-5.1$ aplay -l  **** List of PLAYBACK Hardware Devices ****  card 0: sofrt5682 [sof-rt5682], device 0: Port1 (*) []    Subdevices: 1/1    Subdevice #0: subdevice #0  card 0: sofrt5682 [sof-rt5682], device 2: HDMI1 (*) []    Subdevices: 1/1    Subdevice #0: subdevice #0  card 0: sofrt5682 [sof-rt5682], device 3: HDMI2 (*) []    Subdevices: 1/1    Subdevice #0: subdevice #0  card 0: sofrt5682 [sof-rt5682], device 4: HDMI3 (*) []    Subdevices: 1/1    Subdevice #0: subdevice #0  card 0: sofrt5682 [sof-rt5682], device 5: Speakers (*) []    Subdevices: 1/1    Subdevice #0: subdevice #0      bash-5.1$ aplay -L  null      Discard all samples (playback) or generate zero samples (capture)  pipewire      PipeWire Sound Server  sysdefault:CARD=sofrt5682      sof-rt5682,       Default Audio Device  

Text Input GUI CLI for Gnome

Posted: 06 Nov 2021 10:13 AM PDT

I'd like to set up the following workflow on my (Gnome) Ubuntu 21.10 laptop.

  • Enter a shortcut to run a program (let's say a bash script)
  • A GUI text-input (preferably GTK) pops up and offers a text input
  • I type in some task
  • I call an API and send task information to my todolist via a REST api

I know how to implement each part, except which CLI to use to prompt for text from a GUI (rather than a CLI).

Question

  • Which CLI can I use to perform to prompt for user input via a GUI textbox?

I can run progam from my terminal just fine, but not vs code terminal

Posted: 06 Nov 2021 09:36 AM PDT

I have just installed gradle on my ubuntu machine, and now I can run it in my terminal like this:

ask@Garsy:~$ gradle    Welcome to Gradle 7.2!    Here are the highlights of this release:   - Toolchain support for Scala   - More cache hits when Java source files have platform-specific line endings   - More resilient remote HTTP build cache behavior  

But, if I try to open from the terminal in vs code:

ask@Garsy:~/Notes/Xdit/code/kt$  gradle build    Command 'build' not found, did you mean:      command 'sbuild' from deb sbuild (0.79.0-1ubuntu1)    ...  

It cannot find it at all. Why could this be?

EDIT

If I instead write gradle buildfrom my regular terminal, then if I am I a directory with a build.gradle file, it then it builds as it should. If not then it just complains that there is no build file

`gpg: error retrieving "email" via WKD: No data` when trying credential storage for DockerHub login

Posted: 06 Nov 2021 08:27 AM PDT

I want to use the pass credential store for DockerHub login. Therefore, following mainly this link

  1. I installed pass (apt install pass)
  2. I installed docker-credential-pass, but following the instruction 4 to 7 under How to set up credential storage in this other link
  3. I modified the ~/.docker/config.json file adding the key-value pair "credsStore": "pass"
  4. Since I have a GPG ID, which I can see by means of the instruction gpg --list-secret-keys or also gpg -K (in the row next to uid I see [ultimate] MY_NAME <MY_EMAIL>), and which I use often to encrypt and decrypt some files, following again the second link or also the point 2 in this one, I did pass init MY_EMAIL. Here I got
mkdir: created directory '/home/user/.password-store/'  Password store initialized for MY_EMAIL  

So, it seems that all goes right until here, but then, when I try either docker login or pass insert docker-credential-helpers/docker-pass-initialized-check I get

gpg: error retrieving 'MY_EMAIL' via WKD: No data  gpg: MY_EMAIL: skipped: No data  gpg: [stdin]: encryption failed: No data  Password encryption aborted.  

However, as I said before, I use often gpg --output out_file.gpg --encrypt --recipient MY_EMAIL input_file without any problem.

Further, the solution in gpg: error retrieving 'me@example.com' via WKD does not seem suitable to my issue, since when I look for my key with the gpg commands I mentioned above, I can see expires: 2023-07-20].

So, which is now the problem and what can I do? I work on Debian 11.

Maybe the issue is related to the next claim under https://github.com/docker/docker-credential-helpers:

`pass` needs to be configured for `docker-credential-pass` to work properly. It must be initialized with a `gpg2` key ID. Make sure your GPG key exists is in `gpg2` keyring as `pass` uses `gpg2` instead of the regular `gpg`.  

What should I do if this is the problem?

I have also tried doing pass init ID instead of pass init MY_EMAIL getting the ID from gpg2 --list-secret-keys --keyid-format=long and the line sec rsa3072/ID date ..., getting a problem such as in here, but the solutions given there do not work too.

Thanks in advance!

Can't change my resolution

Posted: 06 Nov 2021 07:52 AM PDT

Just to say I'm new to Linux.

I just installed Manjaro with KDE Plasma. Tried running a game through Lutris and it changed my resolution 800x600. Now I can't change it to my resolution of 1680x1050.

When I run xrandr I get this:

Screen 0: minimum 8 x 8, current 1280 x 1024, maximum 32767 x 32767  DP-0 connected primary 1280x1024+0+0 (normal left inverted right x axis y axis) 470mm x 300mm     1680x1050     59.95 +     1440x900      59.89       1280x1024     75.02    60.02*      1280x800      59.81       1024x768      75.03    60.00       800x600       75.00    60.32       640x480       75.00    59.94    DP-1 disconnected (normal left inverted right x axis y axis)  HDMI-0 disconnected (normal left inverted right x axis y axis)  

I try xrandr -s 1680x1050

and it says Size 1680x1050 not found in available modes

What do I do?

EDIT: Maybe I should mention that the resolution is good on the login screen and then when I log in it gets smaller.

User not getting forced to change password

Posted: 06 Nov 2021 07:29 AM PDT

Any one has idea why user don't get prompted to change password after running below command on user account

chage -d 0 user  

Mounting NTFS hard drive on boot

Posted: 06 Nov 2021 06:54 AM PDT

I am trying to mount a hard drive with an NTFS filesystem on it on boot.

It doesn't need a special location. /mnt/ or something similar should be enough.

I had already done that with a drive but it is way back and i can't remember how I did it. Also I am too scared to just go dive into the fstab file.

I am on the latest Arch Linux 64 bit version

The drive is called /dev/sda1 (idk if thats important)

Does writing tcpdump output to a file on ramdisk have effect on the number of packets dropped?

Posted: 06 Nov 2021 06:49 AM PDT

When running tcpdump, I see that sometimes number of packets dropped by kernel is greater than zero (0). I was told to write to a file on ramdisk instead of a file on harddisk. I am not expert on Linux kernel or network stack, and I could not get any decent explanation about why.

Based on the man page of tcpdump, it seems like it happens due to a lack of buffer space, which means I need to change -B, not the path of output file, isn't that correct? Let's say I created a ramdisk;

# <SIZE> is big enough to capture all output  > mount -t tmpfs tmpfs /var/myramdisk -o <SIZE>  

and ran tcpdump with two different paths;

# Option I  > tcpdump -U -C <FILE_SIZE> -w /var/myramdisk/option_one.pcap host 1.2.3.4 and port X    # Option II  > tcpdump -U -C <FILE_SIZE> -w /home/myhome/option_two.pcap host 1.2.3.4 and port X  

Is there really any difference between those two commands?

Describe an implementation of an imaginary "read-only" type in C [closed]

Posted: 06 Nov 2021 07:31 AM PDT

Currently, I'm reading the M.Bach book "The design of the UNIX operating system". There is a tricky question (ch7, q22) I'm struggling with. Could you help with this/give some hints?

  1. Suppose the C language supported a new data type "read-only," such that a process incurs a protection fault whenever it attempts to write "read-only" data. Describe an implementation. (Hint: Compare to shared text.) What algorithms in the kernel change? What other objects could one consider for implementation as regions?

Preserve permissions and ownership with install command

Posted: 06 Nov 2021 06:32 AM PDT

When running install (GNU Coreutils implementation), I'd like to know if it is possible to preserve ownership and permissions of the source files. I know that by default it installs as 755, and you can change this with -m, however is it possible to preserve the permissions and ownership to be the same as that of the source files?

I am aware that cp has functionality to preserve ownership and permissions, however under my circumstances, I need to use install, if possible.

wondershaper has no effect

Posted: 06 Nov 2021 08:50 AM PDT

I want to use wondershaper to limit my bandwidth. I used

sudo wondershaper enp0s31f6 1000 9000  

This should limit my download to 1 MBit/s and my upload to 9 MBit/s

However, when I run a speedtest in Google Chrome, I still get a result of 50 MBit/s in download.

How is that possible?

Edit:

I cannot tell the version of wondershaper certainly.

For -v or --version wondershaper says

Cannot find device  

In man wondershaper there's also no version.

apt show wondershaper  

says version 1.1a-10. But is this the version of wondershaper or the version of the apt package?

I am using debian buster LTS.

How to auto-mount a prerequisite mountpoint for the one I'm mounting?

Posted: 06 Nov 2021 07:35 AM PDT

I'm running Arch Linux and systemd.

In /etc/fstab I have something like this:

LABEL=XYZ       /mypath       vfat    noauto,[...]  /mypath/main    /newplace     none    bind,noauto    0 0  

I currently have to mount /newplace with two commands:

mount /mypath  mount /newplace  

I also have to umount both.

I need to simplify that to just one mount (or umount) command:

mount /newplace  

I need to use the exact mount (and related umount) command shown immediately above because of an existing script. Is it possible? If so, how?

I can change /etc/fstab and some other details of my device. But I cannot change the script that calls mount /newplace. I also cannot automount /newplace because it needs to usually remain unmounted except when the script is run.

I have been reading about recursive bind mounts, shared, private, slave and other mount options, but I have not seen a way to achieve what I'm seeking. (I'm also so unfamiliar with this topic that I don't even know the best title for the question. It's not a recursive mount, so I called it a prerequisite mount.)

Raspbian running headless doing scripted procedures on a internet page using text browser

Posted: 06 Nov 2021 09:15 AM PDT

I am somewhere between a new and intermediate linux user.

I am setting up a local network for a small group, and I need to configure an automatic sign-in to a webportal when internet connectivity is lost.

I have this working when I run my bash script with a monitor on the raspberry (RASPBIAN OS) itself, the sequence of things are:

Check if internet is down with fping --> Open xterm --> have xdotool open w3m and automate the clicks and inputting password.

Here is my code in condensed form:

    DNSPing=$(fping 9.9.9.9)  EtecsaPing=$(fping 10.180.0.30)  ...  if [[  ( $EtecsaPing == "10.180.0.30 is alive" ) && ( $DNSPing == "9.9.9.9 is unreachable" ) ]]  then  echo "ETECSA UP - Internet all down - Run login script now"    xterm &  sleep 2  xdotool type "w3m -m https://10.180.0.30:8443/"  xdotool key Return  ...  xdotool type <USER>  xdotool key Return  xdotool sleep 1  ...  xdotool key Return  xdotool type <PASSWORD>  xdotool sleep 1  ...  xdotool key Return    sleep 5    killall xterm    fi  

So when I connect a monitor and mouse and run this it works just fine.

I want to have this running headless and with the script in crontab, and after 2 days of trying I feel like I'm just going in circles.

The problem is that both the new xterm session and xdotool requires a DISPLAY defined to run.

To that end I have installed xvfb which creates a simulated display.

sudo Xvfb :10 -ac -screen 0 1024x768x24  DISPLAY=:10 xterm & (the script from above)  

That runs without any errors, but it also does not work.

If I run:

 sudo Xvfb :10 -ac -screen 0 1024x768x24   DISPLAY=:10 xterm -e "echo 'deb blah ... blah' | sudo tee -a /CronJobs/yap.txt > /dev/null"  

It adds the echo to the file, so I know that my display is running the xterm session, and I conclude the simulated display and xterm session is all working.

If I do:

sudo Xvfb :10 -ac -screen 0 1024x768x24  DISPLAY=:10 xterm &  DISPLAY=:10 xdotool type "sudo echo 'deb blah ... blah' | sudo tee -a /CronJobs/yap.txt > /dev/null"  DISPLAY=:10 xdotool key Return  

It does not work.

In conclusion, xdotool is working (no errors), but not doing anything!

So I'm thinking xdotool is not typing into the xterm terminal because the window is not selected, and I try to select the xterm window and I get:

DISPLAY=:10 xdotool getactivewindow  Your windowmanager claims not to support _NET_ACTIVE_WINDOW, so the attempt to query the active window aborted.  xdo_get_active_window reported an error  

And at this point my project is so unique that I can't find any good suggestions on what to do. A few people have tried to exchange the windowmanager for Xvfd but it's few and complicated.

Put in simple words:

  • How can I make Xvfd act better like a real display?

  • Can I make the linux forget all about DISPLAY variables and windowmanager, and just unconditionally run the script as a normal user? How?

  • Can I automate my login sequence in a smarter way that would avoid xdotool?

My network is private and I have no issue with solutions that can compromise the security on the raspberry, so disabling whatever xhost etc is fine, I just don't see how/what.

Thanks in advance.

Duplicate Timeshift backups name

Posted: 06 Nov 2021 06:16 AM PDT

So I have 3 different linux distros using the same partition to store backups using timeshift.

  1. Arch linux
  2. Arch linux
  3. Ubuntu 20.04

I installed one of the arch linux a few days ago, and now after doing all the base setup to get me started, I finally setup the timeshift in the end. But the problem is that both the arch linux installations have the same name when opening the timeshift app. See the image.enter image description here

See, both the arch installations have the same entry under System.
So, I just want a way to differentiate between the two installations of arch linux. So, what options have I got.

All are rsync backups, if that makes any difference.

Ubuntu frozen boot after moving root partition

Posted: 06 Nov 2021 06:46 AM PDT

I have a dual boot system with Ubuntu and Windows 10. I have enlarged and moved (to the left) Ubuntu's "/" partition with GParted.

When I boot my system, I correctly visualize the grub menu from which I can select either Ubuntu or Windows 10. Windows is perfectly working, whereas when I try to boot Linux it gets stuck on a black screen. I have tried to launch the kernel in recovery mode, but it freezes after having printed the following:

Loading Linux 5.4.0-65-generic ...  Loading initial ramdisk ...  

I guess the partition data was not damaged. Do you know a solution better than system reinstall?


Update
I have executed boot-repair from a live usb in order to generate the Bootinfo summary report (as suggested by @oldfred): https://paste.ubuntu.com/p/wn3XRs94Jq/

I have also tried the followin 3 strategies, without success.

1. Reinstall grub from boot-repair GUI

As explained here: https://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/. It tells me it cannot find the packages grub-efi or grub-efi-amd64-signed.
References:

2. From terminal:

Mount root and efi partition (yes, I have a separate efi partition) and import useful partitions from live usb Ubuntu

sudo mount /dev/nvme0n1p3 /mnt  for i in /sys /proc /run /dev /var /lib /usr /etc; do sudo mount --bind "$i" "/mnt$i"; done  sudo mount /dev/nvme0n1p1 /mnt/boot/efi  

Chroot in root partition

sudo chroot /mnt  

Reinstall grub (efi).
Since I do it from the Ubuntu root partition (thanks to chroot), it correctly identifies Windows OS as well.

sudo apt-get update  sudo apt-get purge grub-common  sudo apt-get install grub-efi-amd64  sudo update-grub  grub-probe -t device /boot/grub  sudo grub-install /dev/nvme0n1p1 # also tried with /dev/nvme0n1  sudo update-grub  

But nothing changed.
References:

3. From GParted live USB

  • Perform "check" of the Ubuntu root partition /dev/nvme0n1p13 (passed)
  • sudo fsck /dev/nvme0n1p3 -y
  • sudo e2fsck -C0 -p -f -v /dev/nvme0n1p3
  • sudo e2fsck -f -y -v /dev/nvme0n1p3

References:


Update.
After reinstalling the kernel from live usb in chroot, I get a kernel panic log when booting in recovery mode.
The last lines are:

0.4762681 eun: security.SMACK64TRANSMUTE    0.477044] eun: security.SMACK64MMAP 0.477951) eun: security.apparnor    0.4787371 eun: security. ina    8.479513] eum: security.capability    0.4802771 eum: HMAC attrs: 0x1    0.4819921 PM: Magic number: 13:566:676 0.482765] vtconsole vtcon1: hash matches    0.4837521 rtc_chos 00:01: setting system clock to 2021-11-06T09:39:59 UTC (1636191599) 0.4848431 md: Maiting for all devices to be available before autodetect    0.485623] nd: If you don't use raid, use raid-noautodetect 0.486981) nd: Autodetecting RAID arrays.    0.4877591 nd: autorun ...    0.488526] md: ... autorun DONE.    0.4893201 UFS: Cannot open root device "UUID-b13c4a4c-9205-4547-83d8-641391500749" or unknown-block(0,0): error -6    8.4903641 Please append a correct "root=" boot option: here are the available partitions: 0.4911841 Kernel panic - not syncing: UFS: Unable to mount root fs on unknown-black(0,0)    8.4919711 CPU: 1 PID: 1 Conn: suapper/0 Not tainted 5.4.0-65-generic #73-Ubuntu 8.4927551 Hardware name: Dell Inc. Inspiron 5593/09PY2G, BIOS 1.17.0 07/27/2821    0.4935341 Call Trace:    8.494659] dump_stack Ox6d/0x9a    8.4957351 panic +0x101/0x2e3    8.496847] mount block_root+0x23f/0x2e8    0.4988051 mount_root 0x38/0x3a 0.4991241 prepare_nanespace 0x13f/0x194    8.580253] kernel_init_freeable 0x231/0x255    0.5013811 ? rest_init+0xb0/0xb0    8.5825991 kernel_init+0xe/0x110    0.503723] ret_from_fork 0x1f/0x10    8.5049351 Kernel Offset: 0x24000000 from Oxffffffff81000000 (relocation range: 0xffffffff80000000-0xfffffffffffffff) 8.586156] [ end Kernel panic - not syncing: UFS: Unable to mount root fs on unknown-block(0.0) 1  

NOTE: this text has been extracted by a picture with Google lens. So there may be some small typos. The original picture is enter image description here

I don't know how to download and install internet explorer on raspberry pi running Ubuntu 21.04

Posted: 06 Nov 2021 09:57 AM PDT

I just installed ubuntu desktop 21.04 on my raspberry pi 4b. I want to switch from mozilla firefox, the default browser, to Inetrnet explorer. The only download I could find was an .exe and those are for wondows. I've looked into it, and I found that I need wine, I've intslled that, but the version I've tried only works on amd64 processors, but what I have is an arm64 procesor. Does anyone know were to find an emulator for arm64 that is free and easy to configure? I've looked around for one and I could not find how to do it on a pi 4b anywhwere at all. Not even a download for an emulator.

Failed to start nfs-server.service:Transaction order is cyclic

Posted: 06 Nov 2021 09:36 AM PDT

OS: CentOS 7.5 1804

systemctl enable rpcbind  systemctl enable nfs    # /etc/exports    /mnt/FileServer *(insecure,rw,sync,no_root_squash,no_all_squash)  

nfs not start at boot, and failed when start manually.

systemd[1]:Found ordering cycle on nfs-server.service/start  systemd[1]:Found dependency on mnt-FileServer.mount/start  systemd[1]:Found dependency on nfs-server.service/start  systemd[1]:Breaking ordering cycle by deleting job mnt-FileServer.mount/start  

Found same issue at https://support.oracle.com/knowledge/Oracle%20Cloud/2649787_1.html

but don't have oracle support account.

zsh completion: only offer specific file extensions for completion

Posted: 06 Nov 2021 09:24 AM PDT

currently, I have this in my .zshrc:

 zstyle ':completion::complete:mpv:*' menu yes select  

In addition to using menu for mpv completion, I would like to limit the completions offered to only files with specified file extensions, ie mp4, mp3, ...

how can I integrate that into my existing rule ?

Watch systemd service status with systemctl

Posted: 06 Nov 2021 07:12 AM PDT

Is there any option that allow watching the status of a systemd service in real time with systemctl

What I actually do:

systemctl status tor  

For example:

systemctl watch tor  

How to verify a checksum using one command line?

Posted: 06 Nov 2021 08:34 AM PDT

Suppose I type and run the following command:

sha256sum ubuntu-18.04.1-desktop-amd64.iso  

After a delay, this outputs the following:

5748706937539418ee5707bd538c4f5eabae485d17aa49fb13ce2c9b70532433  ubuntu-18.04.1-desktop-amd64.iso  

Then, I realize that I should have typed the following command to more rapidly assess whether the SHA‐256 hash matches:

sha256sum ubuntu-18.04.1-desktop-amd64.iso | grep 5748706937539418ee5707bd538c4f5eabae485d17aa49fb13ce2c9b70532433  

Is there a way to act on the first output without using the sha256sum command to verify the checksum a second time (i.e., to avoid the delay that would be caused by doing so)? Specifically:

  1. I'd like to know how to do this using a command that does not require copy and pasting of the first output's checksum (if it's possible).
  2. I'd like to know the simplest way to do this using a command that does require copy and pasting of the first output's checksum. (Simply attempting to use grep on a double‐quoted pasted checksum (i.e., as a string) doesn't work.)

Debian increase ulimit for Asterisk

Posted: 06 Nov 2021 10:05 AM PDT

I've been facing an issue with Asterisk 13.11.2 on Debian 8 where it's crashing after reaching the limit of open files

bridge_channel.c: Can't create pipe! Try increasing max file descriptors with ulimit -n  

I have managed to increase the limit from 65536 to 150000 using the /etc/security/limits.conf

I have added the following:

root soft nofile 150000  root hard nofile 150000  * soft nofile 150000  * hard nofile 150000  

The result of ulimit -n is now 150000

When i try check the limit for the Asterisk process cat /proc/xxx/limits

I still get the old limit!

Limit                     Soft Limit           Hard Limit           Units  Max cpu time              unlimited            unlimited            seconds  Max file size             unlimited            unlimited            bytes  Max data size             unlimited            unlimited            bytes  Max stack size            8388608              unlimited            bytes  Max core file size        0                    unlimited            bytes  Max resident set          unlimited            unlimited            bytes  Max processes             31945                31945                processes  Max open files            1024                 4096                 files  Max locked memory         65536                65536                bytes  Max address space         unlimited            unlimited            bytes  Max file locks            unlimited            unlimited            locks  Max pending signals       31945                31945                signals  Max msgqueue size         819200               819200               bytes  Max nice priority         0                    0  Max realtime priority     0                    0  Max realtime timeout      unlimited            unlimited            us  

How to solve this?

Asterisk v13 on Kali Linux: No RTP engine was found. Do you have one loaded?

Posted: 06 Nov 2021 07:05 AM PDT

I installed Asterisk and tried to make a call with zoiper but I get an error [call failure 401 forbidden] and Asterisk return this message :

Connected to Asterisk UNKNOWN__and_probably_unsupported currently running on kali (pid = 14877)  [Jan 22 17:57:00] ERROR[14937][C-00000007]: rtp_engine.c:401 ast_rtp_instance_new: No RTP engine was found. Do you have one loaded?  [Jan 22 17:57:00] NOTICE[14937][C-00000007]: chan_sip.c:25550 handle_request_invite: Failed to authenticate device <sip:5002@192.168.88.135;transport=UDP>;tag=9a473a54  

I opened the menuselect and selected res_rtp_asterisk.

When I try to reinstall (recompile!) Asterisk, I do ./configure

This says it's ok! But when I put make or make install, I get this error:

CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts  make[1]: Entering directory `/etc/asterisk/asterisk/menuselect'  make[1]: `makeopts' is up to date.  make[1]: Leaving directory `/etc/asterisk/asterisk/menuselect'     [CC] res_rtp_asterisk.c -> res_rtp_asterisk.o  res_rtp_asterisk.c: In function 'ice_create':  res_rtp_asterisk.c:2421:4: error: too many arguments to function 'pj_ice_sess_create'  In file included from /usr/include/pjnath.h:23:0,                   from res_rtp_asterisk.c:53:  /usr/include/pjnath/ice_session.h:736:22: note: declared here  make[1]: *** [res_rtp_asterisk.o] Error 1  make: *** [res] Error   

What are the POSIX "mandatory utilities"?

Posted: 06 Nov 2021 10:09 AM PDT

The POSIX docs here and here refer to "mandatory utilities", but I can't find any listing of such utilities. Is there one somewhere in the POSIX docs?

Granted, the links given above point to older version of the docs. Maybe the nomenclature has changed since then (E.g., maybe what used to be called "mandatory utilities" are now called "required utilities", or "obligatory utilities", or "core utilities", etc.) or the mandatory/optional distinction has been dropped altogether? Clarifications welcome.

apache2 debian mod folder location

Posted: 06 Nov 2021 06:13 AM PDT

I have apache folder on Debian with configuration (apache2.conf file, not httpd.conf) in /etc/apache2. On another configuration I hasn't this folder, but it was located in /usr/local/apache2/bin. Config file was httpd.conf. I need location of folders bin, and especially apxs. Thank you very much.

Server version: Apache/2.2.22 (Debian)  Server built:   Jan 10 2015 15:51:04  Server's Module Magic Number: 20051115:30  Server loaded:  APR 1.4.6, APR-Util 1.4.1  Compiled using: APR 1.4.6, APR-Util 1.4.1  Architecture:   32-bit  Server MPM:     Prefork    threaded:     no      forked:     yes (variable process count)  Server compiled with....   -D APACHE_MPM_DIR="server/mpm/prefork"   -D APR_HAS_SENDFILE   -D APR_HAS_MMAP   -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)   -D APR_USE_SYSVSEM_SERIALIZE   -D APR_USE_PTHREAD_SERIALIZE   -D APR_HAS_OTHER_CHILD   -D AP_HAVE_RELIABLE_PIPED_LOGS   -D DYNAMIC_MODULE_LIMIT=128   -D HTTPD_ROOT="/etc/apache2"   -D SUEXEC_BIN="/usr/lib/apache2/suexec"   -D DEFAULT_PIDLOG="/var/run/apache2.pid"   -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"   -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"   -D DEFAULT_ERRORLOG="logs/error_log"   -D AP_TYPES_CONFIG_FILE="mime.types"   -D SERVER_CONFIG_FILE="apache2.conf"  

The point is, that I want install PHP from source, and don't know apxs folder.

gnome-keyring-daemon components and their use

Posted: 06 Nov 2021 08:03 AM PDT

When reading gnome-keyring-daemon manual, one can see pretty clearly that the --components option has four valid values: ssh, secrets, gpg, and pkcs11.

However, I couldn't find any detailed explanation on these four options. Could someone detail the use and the field of use of each component of gnome-keyring-daemon?

(For instance it is obvious to me the ssh component is used to automatically decrypt ssh private-keys passphrases and feed them to ssh but other components (especially their field of use) remain obscure to me.)

How can I increase the acceleration of the mouse wheel via xinput?

Posted: 06 Nov 2021 10:24 AM PDT

I have a Microsoft wireless USB mouse whose scroll wheel seems to have absolutely no acceleration whatsoever on Linux. On Windows and OSX, the faster I scroll, the faster the page scrolls, and vice versa.

I managed to use xinput to change the mouse sensitivity settings following this guide, and it worked great. But when I follow the same steps to change the mouse wheel settings, nothing seems to change.

Here is the output of $ xinput --list-props on my device:

Device 'Microsoft Microsoft® 2.4GHz Transceiver v8.0':      Device Enabled (133):   1      Coordinate Transformation Matrix (135): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000      Device Accel Profile (259): 0      Device Accel Constant Deceleration (260):   1.000000      Device Accel Adaptive Deceleration (261):   1.500000      Device Accel Velocity Scaling (262):    0.125000      Device Product ID (250):    1118, 1970      Device Node (251):  "/dev/input/event2"      Evdev Axis Inversion (263): 0, 0      Evdev Axes Swap (265):  0      Axis Labels (266):  "Rel X" (143), "Rel Y" (144), "Rel Horiz Wheel" (256), "Rel Dial" (257), "Rel Vert Wheel" (258)      Button Labels (267):    "Button Left" (136), "Button Middle" (137), "Button Right" (138), "Button Wheel Up" (139), "Button Wheel Down" (140), "Button Horiz Wheel Left" (141), "Button Horiz Wheel Right" (142), "Button Side" (254), "Button Extra" (255), "Button Unknown" (253), "Button Unknown" (253), "Button Unknown" (253), "Button Unknown" (253)      Evdev Middle Button Emulation (268):    0      Evdev Middle Button Timeout (269):  50      Evdev Third Button Emulation (270): 0      Evdev Third Button Emulation Timeout (271): 1000      Evdev Third Button Emulation Button (272):  3      Evdev Third Button Emulation Threshold (273):   20a      Evdev Wheel Emulation (274):    0      Evdev Wheel Emulation Axes (275):   0, 0, 4, 5      Evdev Wheel Emulation Inertia (276):    10      Evdev Wheel Emulation Timeout (277):    200      Evdev Wheel Emulation Button (278): 4      Evdev Drag Lock Buttons (279):  0  

I've modified properties 274 to 278, but no changes resulted.

My distribution is Debian Linux, desktop environment is Xfce, and computer is a Lenovo Thinkpad X201, though this problem seems to only be specific to this mouse rather than any of those things. Am I missing something via the xinput method, or should I try something else entirely?

edit: I should specify that I am trying to increase the speed of the mouse wheel, preferably via acceleration, as scrolling is painfully slow at the moment.

How can I wrap text at a certain column size?

Posted: 06 Nov 2021 09:47 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