Monday, August 23, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to monitor a quietly dying Java server app?

Posted: 23 Aug 2021 11:21 AM PDT

We run a cluster of Java Spring server apps on AWS EC2 instances running Centos 7. We have health monitors on them, and occasionally an alarm will go off and we'll find that the Java process has quietly just disappeared. We can find nothing in any of the logs...either our own, or system logs. We have an outer "catch Throwable" around our own code that logs what it catches, but we run Tomcat, which has may of its own threads. We've added extra logging to try to capture the moment when it disappears, but so far, that has yielded no information.

I've looked over this question: How to find out why a Java process died without a trace in Linux. I see nothing helpful there.

We currently can't involve the launcher of these processes in a solution. It's a long story. Trust me that we've tried to go down that road.

Any suggestions? I'm wondering if maybe I should wrap the Java process in an outer parent process that carefully monitors and logs all signals from the Java child process. I'm wondering if there's such an off-the-shelf solution that I haven't found yet. Any ideas would be greatly appreciated.

Grammar highlight using VIM is unreadable

Posted: 23 Aug 2021 11:16 AM PDT

I enjoy the SpellBad highlight that I have.. it makes since. What's the magic way of adjusting the grammar portion of it?

Here's my .vimrc

set spell spelllang=en_us  hi clear SpellBad  hi SpellBad cterm=underline ctermfg=red  

ugly highlight

Install .tar.bz2 program on Debian

Posted: 23 Aug 2021 11:15 AM PDT

All the guides/StackExchange posts say use the 'make' command, or ./configure, or autogen.sh, after extracting the tar.bz2 with the help of tar -xvjf.

However, this package (Sublime Text 32 bit linux) has none of those in the directory, only a pre-compiled program, which works, but is not visible to the system. How can I add this program to the Debian Linux directory so that it is registered as an application? Ex. If I open a file, and click on 'Open With', Sublime Text should show up among all the other applications.

how do i check if my linux is deb or rpm

Posted: 23 Aug 2021 10:58 AM PDT

The skype website offers downloads for linux in 2 versions DEB and RPM. I don't know which one is right for my computer.

How can I add the marked track to a playlist in cmus?

Posted: 23 Aug 2021 10:49 AM PDT

Title is the question. I'd like to quickly add the currently marked track (in view 1, 2 or 4) to my playlist of favorites with a key-bindable command.

cmus' man page doesn't reveal a winning strategy. How to do it?

:add -p <path> only seems to accept paths as arguments, and it works on the currently marked playlist.

Can't download torrents from CLI but can from desktop environment

Posted: 23 Aug 2021 11:28 AM PDT

I've an Headless Raspberry Pi 4B+ (4GB RAM) with Raspbian 10 buster on (uname result: Linux raspberrypi 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l GNU/Linux). I've tried multiple ways of downloading torrents through CLI:

  • transmission (even tweaked some settings such as random peer port on start, no rpc authentication required, changed peer port in transmission-daemon but without result)
  • deluge (can't even start it under CLI or web because it says that some modules are missing in python)
  • rtorrent (did everything correctly in configuring the template file but without result)
  • aria2c (no result)

I also made sure that I could actually download things by trying a wget with some random files, it worked...

At this time I gave up and decided to try with qBittorent on Desktop Environment through an RDP server. Everything worked FINE.

Anybody know what the issue could be and how to fix it?

problem installing mathpix snip

Posted: 23 Aug 2021 10:36 AM PDT

I'm trying to install mathpix snip to convert an equation from a pdf to LaTeX code following the instructions on the website

https://mathpix.com/docs/snip/linux-overview

and when i try to run the command: sudo snap install mathpix-snipping-tool

I get the following error: snap "mathpix-snipping-tool" not found.

I don't know what can I do to install it correctly. I'm using ubuntu 20.04 LTS

Thanks!

Restrict access to a directory to just one process and its children

Posted: 23 Aug 2021 10:33 AM PDT

I want to mount a remote directory via sshfs to the local machine in order to use a code editor (Visual Studio Code) to locally edit files on the remote location.

Is there a way to limit access to that local mount to just the code editor? I don't want any other process to be able to access it as a safety measure, since those mounts will be up for hours, while the editor will likely be not. I'd start the editor and execute a command which fetches the process id of the editor and somehow magically applies the access restriction to the directory. This is wishful thinking, but what are my options? I'd consider using chroot (which I don't know if it could be the solution) as a last resort because I have no idea how to use it.

Sudo echo path does not show the path that is used to execute as sudo

Posted: 23 Aug 2021 10:39 AM PDT

I'm confused by the following:

[user@QVr740-11 ~]$ which ninja  /usr/local/bin/ninja  [user@QVr740-11 ~]$ sudo which ninja  which: no ninja in (/sbin:/bin:/usr/sbin:/usr/bin)  [user@QVr740-11 ~]$ sudo echo $PATH  /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/user/.local/bin:/home/user/bin  

ls -l /usr/local/bin/ninja shows that the binary is owned by root:root, and executable by all (three x's), and $PATH shows that even as sudo, it should be in the path, however when I go to execute which, the path has somehow changed.

sudo -E does not change this behaviour.

What gives? Is $PATH being preserved? Is which looking elsewhere for a path (note that I can't execute this binary as sudo).

remove rest of line after n characters for specific line [duplicate]

Posted: 23 Aug 2021 10:40 AM PDT

I have multiple files which have too many characters in the first line. I would line to trim the first line only after n characters. the characters to remove after different in every file and the characters before those to be removed. The rest of the lines of the file I need to remain unchanged.

For example

123456789123456789  important  important  important  

will become

123456789  important  important  important  

I have got this so far:

for i in *.txt; do sed -r 's/(.{10}).*/\1/' $i; done   

but this trims all the lines, I only want to trim the first line and I cant figure out how to make it only apply to line 1.

Wine gives error: "Failed to import system certs into registry, 00000057"

Posted: 23 Aug 2021 09:15 AM PDT

I have been trying to use WINE to run a Windows driver for a digital audio interface in Linux. However, running:

wine saffire-mixcontrol-3.4.exe  

yields this result:

002c:err:winediag:load_gssapi_krb5 Failed to load libgssapi_krb5, Kerberos SSP support will not be available.  002c:err:crypt:CRYPT_ImportSystemRootCertsToReg Failed to import system certs into registry, 00000057  

It also presents a WINE dialog with this warning:

Runtime error (at 15:863):    Access violation at address 7DF1B5D3.  Read of address 00000008.  

Any suggestions as to what I might try?

(Note: My OS is MX Linux 19.4 Patito Feo 64-bit.)

Chrome Kiosk sometimes not Starting - Making Chrome Kiosk more reliable and Stable

Posted: 23 Aug 2021 09:22 AM PDT

Our company provides customers with a kiosk machine that is running customized Ubuntu 20.04 and acts as a digital signage kiosk machine and is using a shell script to automatically start Chromium in a kiosk mode which leads them to our web application. This works well most of the time, however there are cases where Chromium does not start after a reboot and we are unsure why this happens. Right now, the way we put it into the auto start is the default gnome startup applications manager. We were thinking about using a systemd service file for it, but about that we are also unsure if it fixes this problem. Any advice about making a good and reliable Linux kiosk system?

We are also searching for some advice on how to make kiosk machine that runs 24/7 more stable. Is it even good to have a kiosk machine running 24/7 or is it recommended to restart the kiosk machine at least once a week or so? What are the needs for a reliable kiosk web system?

how can i stop a while loop background process without using kill?

Posted: 23 Aug 2021 09:30 AM PDT

i have a bash script with a while loop background processes how can i stop the while loop without kill the process so by set a STOP flag

Note: my script is works if i use kill but with stop flag didn't work

this is a demo of my script(using Kill):

#!/bin/bash      background_processes=()      trap ctrl_c INT  ctrl_c() {      printf "\n[~] Killing background processes...\n"      for pid in "${background_processes[@]}"          do            kill $pid > /dev/null 2>&1          done    }    background_process() {      while true          do           sleep 5           printf "Hello World!\n"          done    }    start() {        for t in $(seq 1 10)          do               background_process &              background_processes+=(${!})          done        wait  }  printf "\n[I] Press 'ctrl+c' to kill background processes! \n"  start    

This one works fine but the other method not work !

This is my same demo but with stop flag(not work!)

#!/bin/bash      STOP=0  threads=10  finished_threads=0    trap ctrl_c INT  ctrl_c() {      printf "\n[~] Stopping background processes...\n"      STOP=1      # here i was checking that all the background processes is finish      while true          do           if [[ $finished_threads == $threads ]]               then                  break           fi          done      printf "\n[+] Done\n"       }    background_process() {      while true          do           sleep 5           printf "Hello World!\n"           if [[ $STOP = 1 ]]               then                  ((finished_threads++))                  break           fi          done    }    start() {        for t in $(seq 1 $threads)          do               background_process &          done        wait  }  printf "\n[I] Press 'ctrl+c' to stop background processes! \n"  start  

Can anyone tell me why this not works please ?

P.S: i am arabian btw so sorry if my English grammar is not good

Create an array of all possible combinations among N arrays

Posted: 23 Aug 2021 08:41 AM PDT

I have a script that runs another bash script with N optional parameters, such as:

./my_script.sh --param_1 <value> --param_2 <value> ... --param_N <value>  

In my main script, i would like to have N arrays with possible values for each of the N parameters, such as:

PARAM_1_VALS=(1 10 50)  PARAM_2_VALS=(50 10 20)  PARAM_N_VALS=("a" "b" "c")  

I'd like to know if there is any function that, given an array of N arrays, returns all the possible combinations among those arrays (ex: (1 50 "a"), (1 50 "b"), ..., (50 20 "c"))

The desired script would be:

all_combinations=get_all_combinations(params_array)  for combination in ${all_combinations[@]}; do     #execute my_script.sh with combination  done  

My current solution is performing badly since i'm just iterating through all arrays in nested loops to get all values. I would like to remove the nested loops and look for a better approach.

ps: what i'm looking is very similar to python's itertools.combinations() solution

Thanks

How to expeand zsh compctl completions with same prefix (from z script)?

Posted: 23 Aug 2021 10:46 AM PDT

I have as zsh setup via .oh-my-zsh. The z plugin allows to jump to last recently used directories.

When you press z name<TAB> it autocompletes name fron the list of recently visited dir by matching name against the list.

https://github.com/ohmyzsh/ohmyzsh/blob/6d5b8484ce7198161d5f617c3db9fd7d3833d48c/plugins/z/z.sh#L250

Sometimes the result contain only a single entry, when i know there should be multiple. I have debugged the reply variable and it happens if all entries have the same prefix, e.g. /path/to/dir, containing dirs with name In this case there is only the prefix in the autocomplete menu instead of full list of matched dirs. Hitting <TAB> again after expansion, triggers a new call to z script complete function now with the full common prefix instead of my search query , e.g. /path/to/dir

When i press <Shift+Tab> which is bound to reverse-menu-complete zsh properly selects the last item and shows the full list.

Is there supposed to be a further keybinding to expand the common prefix for compctl after it grouped all entries with a common prefix?

What is HIT Archive Data?

Posted: 23 Aug 2021 09:04 AM PDT

When I run file image.bin the output I get is: image.bin: HIT archive data

I'm not sure exactly what this file/archive type is and Google isn't giving me a solid answer

How to sort the results of `find` alphabetically and topologically?

Posted: 23 Aug 2021 08:59 AM PDT

Let's say I have the following files laid out like this:

$ tree  .  ├── 01/  │   ├── example.txt  │   └── foobar.txt  ├── 02/  │   └── example.txt  └── 03/      ├── example.txt      └── test.txt    3 directories, 5 files  

I would like find . to print out the directories and files in order, topologically (that is directory names before their contents), and within the same directory, alphabetically. Instead, these are the results I get:

$ find .  .  ./02  ./02/example.txt  ./01  ./01/foobar.txt  ./01/example.txt  ./03  ./03/test.txt  ./03/example.txt  

I would like the output to look like:

.  ./01  ./01/foobar.txt  ./01/example.txt  ./02  ./02/example.txt  ./03  ./03/example.txt  ./03/test.txt  

I don't want to pipe to sort or to any other command, because I would like to process the lines one by one in order before the find command completes.

Removing the first 4 symbols of a file name

Posted: 23 Aug 2021 11:20 AM PDT

I got the following problem: I want to rename files in the format of "12xy[..].log" to "[...].log".

My problem is, that some of them have an "a" following the first time and some of them got a "v" - so I cannot use commands, that follow the logic of replacing part of the name up to a certain character. (Like an underscore etc.)

Is there anyway to rename them quickly?

Edit: There is always the same prefix of "MD18". So for example there are some files named "MD18v230_SHAPE.log" or another one named "MD18a004_FACES.log" and so forth. I would like to have them named "v230_SHAPE.log" and "a004_FACES.log"

Thank you in advance!

Microphone doesn't work in Arch

Posted: 23 Aug 2021 10:40 AM PDT

I'm using Alsa. arecord -l gives me

card 0: AudioPCI [Ensoniq AudioPCI], device 0: ES1370/1 [ES1370 DAC2/ADC]  Subdevices 1/1  Subdevice #0: subdevice #0  

However, when I try to record arecord -vvv -fdat /tmp/mic.wav, nothing is saved (aplay plays nothing back`).

When I try out an online microphone test, all that is played back is a beep, indicating that my microphone isn't even recognized.

One-liner to run commands from a file in parallel using xargs

Posted: 23 Aug 2021 09:53 AM PDT

I have a script like this:

#!/bin/csh     command 1 \     -f \"input1\" \     -l input2 -other_swithes1     command 2 \     -f \"input1\" \     -m input2 \     -l input3 -other_swithes1      command 3 \     -f \"input1\" \     -l input2 -other_swithes2  

so any idea for an one-liner with xargs to run these commands in parallel. I tried various variants but all failed. I do not really want to write a script, I think that should have been possible with -d switch and -c, not sure though.

To simplify and extend the problem further, what I have is cat file | grep -v "#.*" | sed -z 's/[\]\n/ /g' | xargs -I {} -n1 -P10 sh -c '{}', and while this does the job there is a particular problem and that is that \" get removed. So any clue how to solve that?!

Thanks in advance

copy ssd to hdd using dd, hdd won't boot

Posted: 23 Aug 2021 09:11 AM PDT

I am trying to copy a ubuntu 20.04 on 64G SSD to a 160G HDD between two computers.

I have created the SSD disk image using dd and restored the image to the HDD. However, the new system with HDD stuck on the boot screen(PCI devices listing) before the linux bootloader.

here is the disk image info.

~$ file /mnt/usb/linux.iso  /mnt/usb/linux.iso: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 125045423 sectors, extended partition table (last)    ~$ sfdisk -l /mnt/usb/linux.iso  GPT PMBR size mismatch (125045423 != 125045503) will be corrected by write.  The backup GPT table is not on the end of the device. This problem will be corrected by write.  Disk /mnt/usb/linux.iso: 59.64 GiB, 64023298048 bytes, 125045504 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  Disklabel type: gpt  Disk identifier: BBF8B52F-C483-418B-9A3C-22A48CEC051A    Device                Start       End   Sectors  Size Type  /mnt/usb/linux.iso1    2048   1050623   1048576  512M EFI System  /mnt/usb/linux.iso2 1050624   3147775   2097152    1G Linux filesystem  /mnt/usb/linux.iso3 3147776 125042687 121894912 58.1G Linux filesystem  

here is the SSD info.

~$ sudo parted -l  Model: ATA INTEL SSDSCKKR06 (scsi)  Disk /dev/sda: 64.0GB  Sector size (logical/physical): 512B/512B  Partition Table: gpt  Disk Flags:    Number  Start   End     Size    File system  Name  Flags   1      1049kB  538MB   537MB   fat32              boot, esp   2      538MB   1612MB  1074MB  ext4   3      1612MB  64.0GB  62.4GB   

UPDATE

I have also run the following commands on the source machine:

~$ efibootmgr -v  BootCurrent: 0000  Timeout: 1 seconds  BootOrder: 0000  Boot0000* ubuntu    HD(1,GPT,6931776f-1471-44d8-bd59-29746673cdb1,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)      ~$ ls -lR /boot/efi/EFI/  /boot/efi/EFI/:  total 8  drwxr-xr-x 2 root root 4096 Aug 16 14:56 BOOT  drwxr-xr-x 2 root root 4096 Aug 16 14:56 ubuntu    /boot/efi/EFI/BOOT:  total 1860  -rwxr-xr-x 1 root root 954592 Aug 16 14:56 BOOTX64.EFI  -rwxr-xr-x 1 root root  85672 Aug 16 14:56 fbx64.efi  -rwxr-xr-x 1 root root 856232 Aug 16 14:56 mmx64.efi    /boot/efi/EFI/ubuntu:  total 3480  -rwxr-xr-x 1 root root     108 Aug 16 14:56 BOOTX64.CSV  -rwxr-xr-x 1 root root     121 Aug 16 14:56 grub.cfg  -rwxr-xr-x 1 root root 1734528 Aug 16 14:56 grubx64.efi  -rwxr-xr-x 1 root root  856232 Aug 16 14:56 mmx64.efi  -rwxr-xr-x 1 root root  954592 Aug 16 14:56 shimx64.efi  

the target machine has the same /boot/efi/EFI/ content as the source machine.

I am not really versed in this area so detail instructions are much appreciated. thanks!

Playing, recording, and streaming sound with cat and /dev/dsp

Posted: 23 Aug 2021 08:55 AM PDT

A couple of comments on Hacker News suggest that, on FreeBSD, you can:

  1. use cat to send a file ( a .wav file for instance ) to the audio speaker (/dev/dsp).
  2. record from the mic using a similar method.
  3. send a live stream across the network (using netcat?)

I can nearly do the first one. I do cat /dev/random > /dev/dsp and it makes white noise. Can't work out how to record that to a file. And 2 and 3 I can't figure out. Any ideas?

https://news.ycombinator.com/item?id=28054789

https://news.ycombinator.com/item?id=28055498

ffmpeg across .avi files in subdirectories

Posted: 23 Aug 2021 09:08 AM PDT

Situation:

  • Running macOS 10.13.6 and using bash 5.0.17(1)
  • A lot of subdirectories which hold multiple files.
  • Need to filter out files in subdirectories with a specific extension (.avi).
  • Need to process all .avi files and remux to .mp4 using ffmpeg. ffmpeg uses the following syntax for remuxing: ffmpeg -i in.avi -c copy out.mp4
  • Output format: in the same folder as the source .avi file, and using the same filename (apart from the .avi extension)

Example file structure:

$ find . -maxdepth 2  .  ./abc  ./abc/abc.avi  ./xyz  ./xyz/xyz.avi.mp4  ./123  ./123/123.avi  

In this case I would like to filter out the files ./abc/abc.avi and ./123/123.avi , which I can do using regular expressions and find:

$ find -E . -iregex ".*\.avi"  ./abc/abc.avi  ./123/123.avi  

The desired remuxed .mp4 output filenames would then be:

./abc/abc.mp4  ./123/123.mp4  

How can I:

  1. using a script, remux all these .avi files to .mp4 container with one command? I am not sure how to pipe the output of find to the input of ffmpeg, and at the same time specify the desired output filenames.
  2. delete the original .avi files, but only if the remux was successful?

Screen active but no sockets in /var/run/screen

Posted: 23 Aug 2021 10:59 AM PDT

I have a game server running on Centos 7 via screen.

I can confirm that the game server is running, I can connect to it with the client, and ps faux gives me this output:

steam    10111  0.0  0.0 127904  3028 ?        Ss   Jul09   0:00 SCREEN  steam    10112  0.0  0.0 115444  3548 pts/2    Ss   Jul09   0:00  \_ /bin/bash  steam    16558  0.0  0.0 113180  2700 pts/2    S+   Jul09   0:00      \_ /bin/bash ./avorionsrv.sh  steam    16564  4.1  5.7 2276908 944748 pts/2  Sl+  Jul09 234:32          \_ ./bin/AvorionServer --gala[...]  

However, I can't reattach to that screen session (it was started by the "steam" user):

[steam@atlantis ~]$ screen -r   There is no screen to be resumed.  

And trying to get the list of screens yields "no sockets found"

[steam@atlantis ~]$ screen -ls  No Sockets found in /var/run/screen/S-steam.  

The same happens with the root user, and a find in the screen socket directory tells me that there is nothing there.

┌─(/root)──────────────────────────────────────────────────(ROOT@atlantis:pts/0)─┐  └─(11:54:05)──> find /var/run/screen                             <──(Fri 13 Jul)─┘  /var/run/screen  /var/run/screen/S-root  /var/run/screen/S-steam  

Any ideas on how to reattach to that screen?

Using xfreerdp to connect to Remote Desktop Gateway Server

Posted: 23 Aug 2021 10:03 AM PDT

I am trying to use Remote Desktop connection on Linux. After some research, it seems that xfreerdp can do what I need. The basic usage example provided by that tool is:

xfreerdp /u:CONTOSO\\JohnDoe /p:Pwd123! /v:rdp.contoso.com  

Some comments:

  • /u corresponds to User name: in picture 1
  • /v corresponds to Server name: in picture 2

I also need to enter a Computer name: (see picture 1). How could xfreerdp take this into account?

enter image description here enter image description here

I am ok with using another tool other than xfreerdp if it can accomplish this as well.

systemd: autofs containing autofs does not unmount

Posted: 23 Aug 2021 11:08 AM PDT

I'm trying to set up two directories, each automounted:

  • /mnt/dir
  • /mnt/dir/subdir

In my case, these are:

  • /mnt/btrfs-vol/rootfs (read only)
  • /mnt/btrfs-vol/rootfs/btrbk-snap (RW for taking snapshots with btrbk)

My /etc/fstab contains:

LABEL=rootfs    /mnt/btrfs-vol/rootfs               btrfs   ro,subvol=/,lazytime,compress=lzo,ssd,discard,noauto,x-systemd.automount,x-systemd.idle-timeout=2  LABEL=rootfs    /mnt/btrfs-vol/rootfs/btrbk-snap    btrfs   rw,subvol=/btrbk-snap,lazytime,compress=lzo,ssd,discard,noauto,x-systemd.automount,x-systemd.idle-timeout=2,x-systemd.requires-mounts-for=/mnt/btrfs-vol/rootfs  

I do:

svelte ~# systemctl daemon-reload && systemctl restart local-fs.target  svelte ~# mount | grep btrfs-vol/rootfs  systemd-1 on /mnt/btrfs-vol/rootfs type autofs (rw,relatime,fd=32,pgrp=1,timeout=2,minproto=5,maxproto=5,direct)  

Strangely, /mnt/btrfs-vol/rootfs, is already mounted.

If I unmount /mnt/btrfs-vol/rootfs, it is immediately remounted:

svelte ~# umount /mnt/btrfs-vol/rootfs  svelte ~# mount | grep btrfs-vol/rootfs  systemd-1 on /mnt/btrfs-vol/rootfs type autofs (rw,relatime,fd=32,pgrp=1,timeout=2,minproto=5,maxproto=5,direct)  

Now if I ping the subdirectory, it automounts:

svelte ~# (cd /mnt/btrfs-vol/rootfs/btrbk-snap/ && mount | grep btrfs-vol/rootfs)  systemd-1 on /mnt/btrfs-vol/rootfs type autofs (rw,relatime,fd=32,pgrp=1,timeout=2,minproto=5,maxproto=5,direct)  /dev/mapper/vg_svelte-rootfs on /mnt/btrfs-vol/rootfs type btrfs (ro,relatime,lazytime,compress=lzo,ssd,discard,space_cache,subvolid=5,subvol=/)  

Note that the fstype of /dev/mapper/vg_svelte-rootfs has changed from autofs to btrfs.

A few seconds later (I have timeout=2 for testing`):

svelte ~# mount | grep btrfs-vol/rootfssystemd-1 on /mnt/btrfs-vol/rootfs type autofs (rw,relatime,fd=32,pgrp=1,timeout=2,minproto=5,maxproto=5,direct)  

The subdirectory is unmounted, and the fstype of /dev/mapper/vg_svelte-rootfs reverts to autofs, but it stays mounted.

How do I get it to automatically unmount?


Possibly useful information:

journal output:

Feb 21 17:16:07 svelte systemd[1]: Reloading.  Feb 21 17:16:23 svelte systemd[1]: Mounting /mnt/btrfs-vol/rootfs...  Feb 21 17:16:23 svelte systemd[1]: Set up automount mnt-btrfs\x2dvol-home-btrbk\x2dsnap.automount.  Feb 21 17:16:23 svelte systemd[1]: Mounted /mnt/btrfs-vol/rootfs.  Feb 21 17:16:23 svelte systemd[1]: mnt-btrfs\x2dvol-rootfs-btrbk\x2dsnap.automount: Directory /mnt/btrfs-vol/rootfs/btrbk-snap to mount over is not empty, mounting anyway.  Feb 21 17:16:23 svelte systemd[1]: Set up automount mnt-btrfs\x2dvol-rootfs-btrbk\x2dsnap.automount.  Feb 21 17:16:23 svelte systemd[1]: Reached target Local File Systems.  Feb 21 17:16:25 svelte systemd[1]: Stopped target Local File Systems.  Feb 21 17:16:25 svelte systemd[1]: Unset automount mnt-btrfs\x2dvol-rootfs-btrbk\x2dsnap.automount.  Feb 21 17:16:25 svelte systemd[1]: Unmounting /mnt/btrfs-vol/rootfs...  Feb 21 17:16:25 svelte systemd[1]: Unmounted /mnt/btrfs-vol/rootfs.  Feb 21 17:17:44 svelte systemd[1]: Unset automount mnt-btrfs\x2dvol-home-btrbk\x2dsnap.automount.  

Checking that nothing has the directory open:

svelte ~# lsof /mnt/btrfs-vol/rootfs  lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs        Output information may be incomplete.  svelte ~[2]# ls -l /run/user/1000 | grep gvfs  ls: cannot access '/run/user/1000/gvfs': Permission denied  d????????? ? ?    ?      ?            ? gvfs  

I've never seen ? where I'd expect the rwx placehoders to be before.

How can I fix my Debian's /etc/network/interfaces?

Posted: 23 Aug 2021 09:17 AM PDT

I just need to edit the /etc/network/interfaces file in my otherwise-functional Debian installation, but I can't boot up because it gets stuck at "Configuring network interfaces". So how can I access this file without booting up? Do I need a Live USB?

I'm using the amd64 port of Debian 7.8.

Need to delete mails for a range of dates in Linux

Posted: 23 Aug 2021 10:31 AM PDT

I have 1 million mails generated in a Linux sever due to a cron job. I want to delete the mails, but not all as this cron mails useful to troubleshoot and find out the issue with cron job's execution. So I need to keep 1 month's mail and remove the remaining.

phpmyadmin doesn't work after installing php5-mysqlnd

Posted: 23 Aug 2021 09:01 AM PDT

I am currently running into some problems with phpMyAdmin. I set everything up correctly and made sure everything worked. Then later after some developing on some pages I noticed I couldn't execute mysqli_result::fetch_all().

So I did my research and found out I only had to install the package php5-mysqlnd. So I did (apt-get install php5-mysqlnd). The installation did not fail and my PHP script could execute the mysqli_result::fetch_all() method.

However, phpmyadmin doesn't work anymore. It simply can't connect to the MySQL server anymore (all logins fail).

NOTE: every other script still has no problem connecting and logging in into the MySQL server. I also did not change any passwords. Login over the console is also possible.

I couldn't get it to work with the package installed. Then I reinstalled php5-mysql (which uninstalled php5-mysqlnd) and phpmyadmin worked again!

Not having the mysqli_result::fetch_all() method is not a major issue but if it is possible I would like to use it anyways. Simply because it is so convenient for debugging!

I am running a Nginx server and Debian 7.5 3.10.23 system.

USB SD card reader recognized with lsusb but no storage device shown with lsblk

Posted: 23 Aug 2021 10:54 AM PDT

I have a 2GB Micro SD card and a USB card reader. When I run lsusb I can see the card reader is recognized, but when I run lsblk I see no additional storage devices.

[lane@Lane-ArchSystem 19:38:08 ~]$ lsusb  Bus 001 Device 003: ID 041e:4069 Creative Technology, Ltd   Bus 002 Device 002: ID 046d:c00e Logitech, Inc. M-BJ58/M-BJ69 Optical Wheel Mouse  Bus 002 Device 003: ID 0b38:0010 Gear Head 107-Key Keyboard  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  [lane@Lane-ArchSystem 19:38:13 ~]$ lsblk  NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT  sda      8:0    0  1.4T  0 disk   ├─sda1   8:1    0  1.4T  0 part /  ├─sda2   8:2    0    1K  0 part   └─sda5   8:5    0 1023M  0 part   sr0     11:0    1 1024M  0 rom    [lane@Lane-ArchSystem 19:38:17 ~]$   

Not sure what the problem might be I've never run into anything like this before.

EDIT: Forgot to mention that I did have the SD card in the reader before I plugged it into the USB port.

No comments:

Post a Comment