Recent Questions - Unix & Linux Stack Exchange |
- ipcrm won't delete some shared memory blocks
- Crontab is overwritten by HiveOS on boot
- Stop command in ssh session without exiting ssh
- sed replacing a string with itself and a new line
- Launch terminal and 'conda activate env' from bash script
- Understanding the various Python directories
- Getting newer GCC version in Ubuntu
- Disabling writing dump files to efivars
- KDE Plasma changes brightness on wrong GPU
- RPM macro and quotes
- Multimonitor with two graphic cards
- export function with different name
- Using sed to replace one character with another within an xml tag
- reformat json using jq
- Blank screen at startup, xset is unable to open display ""
- Linux command to list all files readable by others
- grep with pipe and variables NOT working on remote server through ssh (working locally)
- Stuck in initramfs after reboot
- Simulate human mouse movement using xdotool
- Docker reporting that my Linux kernel doesn't support cgroup cpu real-time period
- Python3 - Too many levels of symbolic links
- How to edit grub config manually?
- Mutt error SMTP session failed: read error
- PAM: Authentication failure, with valid password
- Why is systemd stopping service immediately after it is started?
- How to test linux NAPI feature?
- Scalability of 'sort -u' for gigantic files
- Bash limiting precision of floating point variables
- How can I investigate what other users are currently logged in?
- How to check if $PWD is a subdirectory of a given path
ipcrm won't delete some shared memory blocks Posted: 03 Feb 2022 10:57 AM PST I have shared memory I am trying to delete using I managed to delete all segments except the below: I am executing
How can I delete these four blocks? |
Crontab is overwritten by HiveOS on boot Posted: 03 Feb 2022 10:53 AM PST I am trying to add some additional cronjobs to a rig running on HiveOS, which is running on linux. I am adding the cronjobs, for example one for duckdns and then after I reboot the system, the line in crontab dissapeared. The crontab contains some lines that are used for HiveOS, so I assume that HiveOS overwrites the crontab on startup. Is there any possibility to run cronjobs without the lines being overwriten by HiveOS on the next restart? Thank you in advance |
Stop command in ssh session without exiting ssh Posted: 03 Feb 2022 10:53 AM PST I've a ssh session and I'm running a script. I want to terminate the script without exiting the ssh session. In a local PC I press Ctrl-C and the script stops, while if I press Ctrl-C in remote session I close the ssh session itself (and also the script in this case). How can I stop the script in remote shell without interrupting the ssh connection? |
sed replacing a string with itself and a new line Posted: 03 Feb 2022 11:07 AM PST I have the following string multiple times in a html file Now, I know sed might not be perfect for html editing, but could tell me how can I I'd tried Update: I'm running from a windows machine with Visual Studio Code bash terminal and (Git) Bash (which is some sort of MINGW64) |
Launch terminal and 'conda activate env' from bash script Posted: 03 Feb 2022 10:28 AM PST I've seen some similar questions on here, but they haven't covered this particular use-case and I haven't been able to make it work on my own. I'm trying to do the following using a script:
I've tried this: But receive this error message:
I've also tried the following code, which results in a conda not found error: The following code opens a terminal and displays the expected python version for that environment, but doesn't carry-over the activation to the 'bash -i' window: Please let me know if there is a simple way to accomplish this task. |
Understanding the various Python directories Posted: 03 Feb 2022 10:25 AM PST according to I'm struggling to work out what the difference between these two directories is. This post suggests that the former is a convention of Debian and it's derivatives, and a location where Python packages and modules are placed if they are installed by the native package manager. Is that the case? And if so, what is |
Getting newer GCC version in Ubuntu Posted: 03 Feb 2022 10:19 AM PST I have Ubuntu 18.04. I want to get newer GCC version. How to do that from ternimal? I am getting this: |
Disabling writing dump files to efivars Posted: 03 Feb 2022 11:04 AM PST Recently I noticed an issue where both of my machines (ThinkPad X230 and W530) independently started running out of NVRAM which stores UEFI boot variables. This prevents them from booting. Fortunately, I managed to boot the OS (Ubuntu 20.04.1 on both) after switching to Legacy boot mode, but this is no fix. Upon further inspection, it turns out that after every boot, there are numerous "dump-type0" variables created in I started digging further and searched for parts of these variables' names in journalctl. I found out that these are written to efivars by pstore, evidenced by logs such as this one: As I understand, it's systemd-pstore which is responsible for moving kernel dumps from For reference, systemd-pstore is running fine: For now, I would simply want to disable writing of these EDIT: After some detective work I found out the root cause. A good overview is provided in this Gist. |
KDE Plasma changes brightness on wrong GPU Posted: 03 Feb 2022 09:53 AM PST I am able to change brightness manually by issuing the command: This changes the brightness output of my Intel integrated GPU on my laptop. However, this laptop also has a dedicated NVIDIA video card which also has a backlight section: The problem is that when I change the brightness using the brightness changing hotkeys, Plasma (or whatever program is responsible for changing brightness) thinks it should change the brightness in the nvidia_0 section of the backlight instead of the intel_backlight. How do I fix this? BTW I'm running Arch Linux. |
Posted: 03 Feb 2022 09:31 AM PST I would like to include a file in a package with a directory which is dependendat on the system. I define the directory with and I can use it successfully for example The problem is when I have to define the list of files The file is there. The following works If I use the variable I get the following error: To debug I tried with and in this case I get The path is correct but the quotes are a problem. How do I include a file using a path defined with a macro? |
Multimonitor with two graphic cards Posted: 03 Feb 2022 10:49 AM PST Today I connected a second monitor to my PC (OpenSuse Leap 15.3 with KDE Desktop ). So far I had only one (Lenovo ThinkVision T27i-10) connected to my Nvidia GeForce GTX 660 and now I Connected a second one (Dell 2007FP) to my internal graphics card. Here some infos about the graphic cards: Code For the Nvidia graphics card I use the proprietary driver from the repos. To get a picture on the second screen at all, I had to delete the /etc/X11/xorg.conf. This was created by the nvidia-settings when I enabled the setting to prevent tearing, now that the file is gone the picture tears again of course. But now I have the problem that the mouse pointer in the taskbar, start menu and some menus on both screens becomes oversized, otherwise it has a normal size. I think this is also related to the fact that the login screen shifts when I get to the edge of the screen and the screen order is not correct there. Does anyone whats the reason for this and how to solve it? |
export function with different name Posted: 03 Feb 2022 10:55 AM PST I have a script that exports a function for child scripts to use and would like to change what function is exported based on a conditional. I know I could just declare the two different functions within the conditional but would prefer to avoid that if possible. So an example would be: I guess I could also just make a simple inception function like |
Using sed to replace one character with another within an xml tag Posted: 03 Feb 2022 10:23 AM PST I need to replace the character The result I expect: I don't know how Git works in depth, I'm just using it to replace that character in my xml tag, researching in forums I found some information and tried the following command line: But it does not work, I hope you can help me please. |
Posted: 03 Feb 2022 08:50 AM PST I have the below JSON file: I would like to have CSV file in this format: Is this possible by using only jq? |
Blank screen at startup, xset is unable to open display "" Posted: 03 Feb 2022 10:27 AM PST Seemingly from out of nowhere, I get a blank screen during startup on Arch Linux. Going into the TTY shows me I use X11, LightDM and i3. Here LightDM seems to be able to show a blank screen with a cross as a cursor (both during startup and after running I suspect it can be can be caused of i3, since the file However, running When running which should tell me that the correct display indeed is I did update my system yesterday via pacman, could something there have caused this? I see that What should I do in order to get it working? |
Linux command to list all files readable by others Posted: 03 Feb 2022 09:42 AM PST I need to list all files that are readable by public, in any directory. For example, files with permission 777, 444, 604, etc. How can I do this? |
grep with pipe and variables NOT working on remote server through ssh (working locally) Posted: 03 Feb 2022 09:23 AM PST Below grep command is not giving expected result (matching line number) if I run it through ssh from a remote machine (passwordless authentication enabled). Variables have been defined correctly as well. From Server 1 : above command returns blank output. From Server 2 (running locally) returns expected output i.e., a line number: (expected out i.e., a line number of matching string specified in $J2C_ID, on the specified file resources.xml) I tried modifying the command which is giving me full line as output, though I just need the line number and not the full line: Need to get rid of redundant text and see just the line number as o/p. Can you please help fix the command to run successfully and return the line number of matching string IF run as ssh from another server? Quick help is highly appreciated. Thanks |
Stuck in initramfs after reboot Posted: 03 Feb 2022 09:41 AM PST I got that error already twice while having my laptop, and I previously were able to fix it after them google search and switching to AHCI in BIOS. However, this time it seems to be another problem because even though sata-mode is AHCI it kicks me back to initramfs. I tried this, How to switch from IDE to AHCI, with the hope to not get that error in the future. After that I sadly got the error that I am now stuck on. Original error message Output from Help is greatly appreciated. |
Simulate human mouse movement using xdotool Posted: 03 Feb 2022 09:30 AM PST I'm currently using bash and xdotool to write a simple script which will hold down a few keys and, at the same time, move the mouse relative to the current pointer position. Everything works, except I dislike the choppiness the instant mouse movement from xdotool provides. Is there any way to make xdotool move the mouse over a period of time or a curve? Or even a flag to "smoothen" the mouse that I missed? Any help is appreciated. My current code is pasted below. |
Docker reporting that my Linux kernel doesn't support cgroup cpu real-time period Posted: 03 Feb 2022 10:05 AM PST I've configured Docker on my Ubuntu 18.04 Server to expose its API so I can create and deploy Docker containers via REST requests, which I need to add certain features to my project. This worked fine for first few endpoints I tried. However, when I attempt to create a new Docker container (the main point of the exercise), I get the message: Is this true? Alternatively is it instead that I need to set something up to enable this functionality, or is Docker reporting incorrectly? Very grateful for any assistance given as this functionality is critical to my project. |
Python3 - Too many levels of symbolic links Posted: 03 Feb 2022 09:52 AM PST Everytime I open up a terminal, I get the below message printed on the shell screen. Could someone help me understand what is happening here and how I could fix this issue? EDIT: returned the below Thanks, Zaman |
How to edit grub config manually? Posted: 03 Feb 2022 09:04 AM PST I have a USB Debian installer and I would like to add a new menu item to the grub menu (Automated install with some boot parameters). I did find grub.cfg and I added my custom menu item but it does not show up in the grub menu. Rechecked the grub.cfg file, my menu item is still there so it did not get overwritten but it does not work. Any idea what I am doing wrong? |
Mutt error SMTP session failed: read error Posted: 03 Feb 2022 10:05 AM PST When sending a mail got that error. Firewall also off on server and port 465 open on Security group. Is it required to install postfix with mutt? I can read the mails on my inbox but can't send emails. This is on my maillog, |
PAM: Authentication failure, with valid password Posted: 03 Feb 2022 09:24 AM PST Command journctl As it stands right now, every lock screen will prevent me from "unlocking" (KDE lock screen, If I start Here is my PAM config for Running This is a fresh install of Arch, so I don't think the configuration is too wonky. What should I be looking for to debug this? Running |
Why is systemd stopping service immediately after it is started? Posted: 03 Feb 2022 09:23 AM PST I have a C++ based application which I'm running(executable) as a daemon with systemd. Unit File: [Unit] Description=Console Service After=network.target [Service] Environment="USER=ubuntu" "Path=/home/ubuntu/console/bin" WorkingDirectory=/home/ubuntu/console/bin ExecStart=/bin/sh -ec "exec /sbin/start-stop-daemon -S -c ${USER} -d ${Path} --pidfile=/var/run/console.pid --oknodo --exec consoleExecutable " #2>/dev/null ExecStop=/bin/sh -ec "exec /sbin/start-stop-daemon -K --quiet -c ${USER} -d ${Path} --pidfile=/var/run/console.pid --retry=TERM/30/KILL/5 --oknodo --exec consoleExecutable" #2>/dev/null Restart=on-failure RemainAfterExit=no TimeoutStopSec=10 SuccessExitStatus=0 1 TimeoutStartSec=360 [Install] WantedBy=multi-user.target When I issue start command the service is starting up, but then it immediately receives a shutdown signal and then exits. Any clue, what is happening? sudo systemctl status console.service ● console.service - Console Service Loaded: loaded (/etc/systemd/system/console.service; enabled; vendor preset: enabled) Active: deactivating (stop-sigterm) since Mon 2017-09-25 19:58:58 UTC; 1s ago Process: 8706 ExecStop=/bin/sh -ec exec /sbin/start-stop-daemon -K --quiet -c ${USER} -d ${Path} --pidfile=/var/run/console.pid --retry=TERM/30/KILL/5 --oknodo --exec consoleExecutable #2>/dev/null (code=exited, status=0/SUCCESS) Process: 8701 ExecStart=/bin/sh -ec exec /sbin/start-stop-daemon -S -c ${USER} -d ${Path} --pidfile=/var/run/console.pid --oknodo --exec consoleExecutable #2>/dev/null (code=exited, status=0/SUCCESS) Main PID: 8701 (code=exited, status=0/SUCCESS) Tasks: 1 Memory: 1.8M CPU: 53ms CGroup: /system.slice/console.service └─8705 consoleExecutable Sep 25 19:58:58 mgmt1 systemd[1]: Started Console Service. sudo systemctl status console.service ● console.service - Console Service Loaded: loaded (/etc/systemd/system/console.service; enabled; vendor preset: enabled) Active: inactive (dead) since Mon 2017-09-25 19:59:01 UTC; 947ms ago Process: 8706 ExecStop=/bin/sh -ec exec /sbin/start-stop-daemon -K --quiet -c ${USER} -d ${Path} --pidfile=/var/run/console.pid --retry=TERM/30/KILL/5 --oknodo --exec consoleExecutable #2>/dev/null (code=exited, status=0/SUCCESS) Process: 8701 ExecStart=/bin/sh -ec exec /sbin/start-stop-daemon -S -c ${USER} -d ${Path} --pidfile=/var/run/console.pid --oknodo --exec consoleExecutable #2>/dev/null (code=exited, status=0/SUCCESS) Main PID: 8701 (code=exited, status=0/SUCCESS) Sep 25 19:58:58 mgmt1 systemd[1]: Started Console Service. |
How to test linux NAPI feature? Posted: 03 Feb 2022 09:46 AM PST I am trying to test the NAPI functionalities on embedded linux environment. I used 'pktgen' to generate the large number of packets and tried to verify the interrupt count of my network interface at /proc/interrupts. I found out that interrupt count is comparatively less than the packets generated. Also I am trying to tune the 'netdev_budget' value from 1 to 1000(default is 300) so that I can observe the reduction in interrupt count when netdev_budget is increased. However increasing the netdev_budget doesn't seems to help. The interrupt is similar to that of interrupt count observed with netdev_budget set to 300. So here are my queries:
Any help is much appreciated. Thanks in advance. |
Scalability of 'sort -u' for gigantic files Posted: 03 Feb 2022 09:23 AM PST What is reasonable scalability limit of What is Unix alternative for files exceeding this in dimension of "amount of lines"? Of course I can easily implement one, but I wondered if there is something that can be done with few standard Linux commands. |
Bash limiting precision of floating point variables Posted: 03 Feb 2022 10:27 AM PST In Ubuntu UPDATE: Can I use it for already defined shell variables and redefining them? The following code gives me an error. The output of locale The output of |
How can I investigate what other users are currently logged in? Posted: 03 Feb 2022 11:04 AM PST Since the last few days I get an error message when I try to shut my laptop down:
This error message includes a prompt for administrator password. I don't think that there should be other users logged in. How can I find out what the problem is? What I've tried 2 sessions listed. I'm not sure: is that already the problem?
How I shut the computer downBy clicking on System informationI have Linux Mint MATE: |
How to check if $PWD is a subdirectory of a given path Posted: 03 Feb 2022 09:25 AM PST E.g. check if |
You are subscribed to email updates from Recent Questions - Unix & Linux Stack Exchange. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment