Skip to main content

New answers tagged

0 votes

How to reload/restart/kill VSCode server/service/process in Linux/Ubuntu?

You can kill code-server with : pkill -f -u $EUID /code-server
Philippe's user avatar
  • 24.7k
0 votes

WinForms DateTimePicker and Linux Wine

I'm not completely sure of the correctness of the decision, however, it helped me like this. Maybe there is something to fix. public static class DateTimePickerHelper { [DllImport("user32.dll&...
egeo's user avatar
  • 193
0 votes

When is it necessary to explicitly link to pthreads?

Starting with glibc-2.34 (released 2021-08-02), new applications do not need to link with -lpthread. See also: Why glibc 2.34 removed libpthread
Steve Ward's user avatar
0 votes

CUDA initialization: Unexpected error from cudaGetDeviceCount()

Check the guide here -> https://docs.nvidia.com/datacenter/tesla/pdf/fabric-manager-user-guide.pdf Check the status of the fabricmanager with: nvidia-smi -q -i 0 | grep -i -A 2 Fabric If you see ...
Juan's user avatar
  • 816
0 votes

dracut Warning: Duplicate address detected for 10.0.2.15 while doing dhcp. retrying

I was using "ARPing 2.22, by Thomas Habets" later I removed it and installed "arping from iputils 20211215" in my Ubuntu machine and rebuilted the image which worked fine. keeping ...
vaibhav0320's user avatar
0 votes

"Permission denied" when using WebDAV mount as docker volume

This solution involves running the Docker container as a user with the necessary permissions to access the mounted WebDAV volume. This can be achieved by using the USER instruction in the Dockerfile ...
long-blade's user avatar
1 vote

Access host data when running a program from docker container

Not really, especially when it comes to managing raw physical devices. If you can access /dev/sda then you can access the raw bits of the physical disk and break or circumvent any sort of security ...
David Maze's user avatar
  • 150k
0 votes

Fail2ban ban my ip but not reject with iptable

After several hours of research I was missing kernel modules : xt_multiport ipt_REJECT
Tazounet's user avatar
0 votes

Prevent sleep mode python (Wakelock on python)

I've written this Python Code that doesn't only keep your screen active but also let's you work without disturbing you. Basically, You don't have to turn it on and off. You can keep it running and ...
Supercool's user avatar
  • 558
0 votes

Running shell script using .env file

I've ended up using (. 'filename.env'; bash 'scriptname.sh') And in some cases: (set -a && . 'filename.env' && set +a; bash 'scriptname.sh')
Konard's user avatar
  • 2,826
0 votes

Any way to run a script on Linux VM connected via SSH from a python program

Note that it could be easier to just use the Paramiko SFTP client to read /etc/ssh/sshd_config directly from the server and do the "grep" in Python code. --@AKX And took reference from this ...
Ritika's user avatar
  • 21
0 votes

Postfix + Dovecot Connect failed to database

I know it is an old post but, after struggling for a few days, I solved this issue by removing any special chars used in the account's password. Hope this helps.
John Kravicz's user avatar
0 votes

How to split a file and keep the first line in each of the pieces?

Late to the party... After reading through all of this, I added this to my bashrc: split_csv_file() { _split_csv_filter() { { head -n 1 "${1}"; cat; } >| "$FILE"; ...
Michel's user avatar
  • 1
0 votes

Avahi Hostname Resolution: Is it caching somewhere?

just stumbled upon this old question, having the same problem (a machine was assigned a new IP address, and even after rebooting that machine i could not connect via mymachine.local anymore - my ...
umläute's user avatar
  • 30.6k
0 votes

Python - Clear and Print to Same Line for Multiple Lines on Command Prompt

The "command prompt" as it comes in a fresh windows install is a 45+ year old program that has not seem updates in the last 30. Install the "Windows Terminal" program (it allows ...
jsbueno's user avatar
  • 107k
0 votes

Linux how to mount filesystem image file read/write using the loop option

The .img file is a fixed version of the source that you built it from, much the same as a .iso file, and it cannot dynamically grow or shrink. If you have the source files that you created the .img ...
Nick Clifton's user avatar
1 vote

subprocess.CalledProcessError: returned non-zero exit status 1 for non-pingable destination

We have to capture the exception from the subprocess.CalledProcessError when the IP is not reachable or the given Subprocess argument has an issue. Original code: hostname = '1.0.2.1' output = ...
Muthukumar S's user avatar
0 votes

Pen pointer events in Linux Chrome and Firefox not working as intended

Welcome to the world of stuff that isn't fully implemented yet! Stuff that require special hardware and thus only a few developers are able to test. You faced multiple bugs, let me try to make some ...
Denilson Sá Maia's user avatar
1 vote

"Permission denied" when using WebDAV mount as docker volume

rm -rf /mnt/yandex_webdev podman volume create yandex_webdev podman run -d -v yandex_webdev:/tmp/yandex_webdev --name webdev docker.io/heartexlabs/label-studio:latest tail -f /dev/null podman ps -as ...
ZHUZHA CORP's user avatar
0 votes

"Permission denied" when using WebDAV mount as docker volume

Perhaps you should try mounting the disk via a driver plugin? https://github.com/fentas/docker-volume-davfs
Negash's user avatar
  • 156
0 votes

aws cli output automatically being sent to vi

Set PAGER to cat in your shell profile like .zshrc or .bashrc export PAGER="cat"
Kushal Gangan's user avatar
0 votes

fail to compiled glib

use apt install docbook-xsl solve this problem.Not the internet problem.
Chilkings's user avatar
0 votes

Simulating a spinner for progress in Bash

https://github.com/kattouf/ProgressLine If someone looking for ready for use spinner solutions. I made a utility that allows to compactly track the progress(1) of execution for almost any command or ...
Vasiliy Kattouf's user avatar
0 votes

Is there any way to setup alarm for ubuntu's /var/mail via SSH or else?

#!/bin/bash # Monitor /var/mail directory for changes inotifywait -m /var/mail -e create -e moved_to | while read path action file; do # When a new file (mail) is created or moved into /var/mail, ...
Javad Ibrahimli's user avatar
0 votes

How to reload/restart/kill VSCode server/service/process in Linux/Ubuntu?

you can kill the process using name like this pkill -f "code"
slowdancer's user avatar
1 vote

What causes inter-process communication to take millions of cycles?

In the best case, Inter-process communication is obviously faster than communication between threads, as threads share resources, such as the heap. This is not true. It is actually often the opposite....
Jérôme Richard's user avatar
0 votes

Capture shutdown command for graceful close in .NET Core

These days I think the recommended way is using 'Program.cs'. If you look at your 'Program.cs' you'll probably see: app.Run(); at the bottom. You can add shutdown code below that, e.g. a call to a ...
Tim Cooper's user avatar
  • 10.3k
0 votes

Can I configure `logrotate` to just delete old files and do not rotate them?

It looks like your program is creating all the separate (maybe daily) log files (the test1.log, test2.log, and test3.log files) and you only want logrotate to delete any older than 7 days. You say ...
onlynone's user avatar
  • 8,065
0 votes

How do install these packages on Ubuntu?

make a viertual environment IN Ubuntu on EC2? I do this on Windows as i have multiple python versions and projects. But this Ubuntu machine on Amazon EC2 is only for one Pyhton version and a single ...
AKX's user avatar
  • 164k
0 votes

Find files that does not contain a string

In case you need to find files with a specific extension (or name pattern) not containing a string (or pattern): find . -name "*.ext" | xargs -n1 grep -r -L -P "(foo|bar)"
vhtc's user avatar
  • 840
1 vote
Accepted

If the Linux kernel reassigns a PID, can this cause errors/UB when using C pthread mutexes?

Your next attempt to lock the mutex, by whichever process or thread that tries it will succeed with EOWNERDEAD (after which that thread should call pthread_mutex_consistent). The mechanism that ...
Hasturkun's user avatar
  • 36.1k
0 votes

mmap File-backed mapping vs Anonymous mapping in Linux

Will try to summarize in points. Main Differences Between File-backed Mapping & Anonymous Mapping: File-backed Mapping: Definition: Memory mapping that is backed by a file on disk. Creation: Uses ...
user3518295's user avatar
-3 votes

How do install these packages on Ubuntu?

Either create virtual environment for python or remove External managed Run this command then you will be able to install through pip rm /usr/lib/python*/EXTERNALLY-MANAGED Update: This command can ...
NoobCoder's user avatar
0 votes

Is it possible to install PHP7.4 on stock Alpine 3.12 Docker image?

Use alpine: FROM alpine:3.14 php 7.4.33
denmely's user avatar
  • 31
0 votes

How to make an alias's command for changing directories work for all users without changing the path for every user

I'd like to change the "Bob" part of the directory so if Nat or Dan use it, it'll work for them. alias Doc='cd /home/$USER/Documents'
Armali's user avatar
  • 19.1k
0 votes

cryptsetup and umount fail with "target is busy." error

With the cd mount_point, your shell has its cwd (current working directory) inside the mounted fs and thus holds a reference to it. If you ran fuser -vm . at this point in your script, you would see ...
zerodeux's user avatar
  • 3,571
0 votes

How to setup environmental variable from inside qmake .pro file on linux?

You cannot set the environment variables of a parent process. When you call qmake, bash does a fork. That is basically copying the complete environment. In the forked process, qmake is executed, so in ...
Ljm Dullaart's user avatar
  • 4,889
0 votes

Bash - Calculate the Average of Numbers Inputted

Similar to the Compute the Average problem on HackerRank, here's a cleaned and optimized version of the code: # Read the count of numbers read count # Initialize sum to 0 sum=0 # Loop to read each ...
Penny Liu's user avatar
  • 16.7k
0 votes

How to convert json to yaml and vice versa in command line?

Below code help to convert yml to json after installing yq version 4.44.2 yq -o=json your_file.yml > your_file.json
Jajikanth pydimarla's user avatar
0 votes

Are Linux's timezone files always in /usr/share/zoneinfo?

No, they are not always under /usr/share/zoneinfo. NixOS has them under /etc/zoneinfo, but it sets the TZDIR environment variable to point there, following the glibc rules described in Roman's answer. ...
szaszm's user avatar
  • 34
0 votes

terminate called recursively

terminate called recursively: This is because the memory is continuously increasing in dynamic memory int*ptr=new int; and also the loop is repeating continuously by while(true) by this code:- #...
Girish Nalawade's user avatar
1 vote
Accepted

Dynamic update of plot in Matplotlib generating strange lines

As explained by @JohanC, the >=4 lines appear because Axes.plot(*args, ...) is treating the rectangles (which is a list of 4-tuple elements) as a list of sequences to be plotted. You can visualize ...
Timeless's user avatar
  • 36.2k
0 votes

Linux: file locking from python script which is running inside docker container

Don't update the file in place. Write to temporary file, and then rename it when you're done. Renaming a file is an atomic operation, so the application reading it will always see consistent data. ...
larsks's user avatar
  • 301k
0 votes

picom dimming inactive windows removes corner-radius on i3wm

had the same issue found the fix here in your picom.conf change the values for ################################# # General Settings # ################################# backend = "...
Abba Adamu's user avatar
0 votes

SentinelOne LinuxExtension - Azure

The above code does not work for me. Same error also comes from the portal when I try to add the extension. Error. Could not get SentinelOne agent package download link
Naushad Alam's user avatar
1 vote

Controlling a USB power supply (on/off) with Linux

On kernels version 6 and newer there is a sysfs entry for that. Go to the hub device: cd /sys/bus/usb/devices/3-1:1.0 3-1:1.0# ls 3-1-port1 3-1-port2 3-1-port3 3-1-port4 ... Now for example check ...
Adam Trhon's user avatar
  • 2,925
0 votes

Can't add user to docker group

Try this sudo groupadd docker sudo usermod -aG docker $USER newgrp docker Restart is required for the changes to take effect.
subhashis's user avatar
  • 4,733
1 vote
Accepted

Why I have to specify - sh - -c - command instead of just - command in k8s livenessProbe exec command (and potentially elsewhere)

A script written in a language is not the program that is used to run it. Let's instead of shell, imagine python. Imagine: livenessProbe: exec: command: - import datetime; exit(datetime....
KamilCuk's user avatar
  • 135k
1 vote

Why I have to specify - sh - -c - command instead of just - command in k8s livenessProbe exec command (and potentially elsewhere)

command: - exit $(test $(date +%H) -eq 3 && echo 1 || echo 0) Tries to exec the full line as single command name (1 argument to exec). It's akin to running 'exit $(test $(date +%H) -eq 3 &...
knittl's user avatar
  • 261k
1 vote

Why I have to specify - sh - -c - command instead of just - command in k8s livenessProbe exec command (and potentially elsewhere)

For me it is because when you specify the command directly in the exec probe without sh -c, Kubernetes tries to execute it as if it were a script. But when you use sh -c, you're telling Kubernetes to ...
LeDevNovice's user avatar

Top 50 recent answers are included