Recent Questions - Unix & Linux Stack Exchange |
- Is it possible to "daemonize a command"?
- Giving superuser access to user directory binaries
- KDE display not working on NixOS - Thinkpad P15 Gen 2, NVIDIA RTX A4000
- How to remap a key combination to a key combination in X?
- Shell script loop issue
- avahi-resolve works but mdns
- How do I select the proprietary nvidia drivers on Fedora 35 after installing them from RPM?
- How to use Vim-like registers across programs
- Prohibit sudo commands when run from a SSH session
- Resizing Images in Linux
- Install teamviewer for debian 9 cli only
- insert comment in the beginning of specified line in file
- How to fake write-protected script's $0 (zeroth arg) to be a path where I have no write-access?
- How to connect Linux network namespace with other VM using internal network?
- problem with installing a repository on remote server with CentOS 7 without root permission
- how to print 2 consecutive lines separated by 1 blank line into one line separated by ,
- Disk showing in windows but not in Ubuntu
- Remove specific CSV columns from large CSV file and duplicated rows with Perl
- sorting files using string
- LINUX unable to create a directory | mkdir: cannot create directory ‘test_nfs’: Permission denied
- How can I extract a RAR file on Debian?
- using awk to print backslash
- Linking with GCC doesn't detect -fPIC flag
- What are the correct permissions for a systemd .service?
- openSUSE 42.3 does not start up from USB - black screen after loading kernel
- Buildroot Zero-W wireless
- Binding to systemd device units of connected bluetooth devices
- How to exit a git merge asking for commit message?
- how to test sco packets in bluetooth
- Cinnamon failed: desktop only, no panel, no dialog frame
Is it possible to "daemonize a command"? Posted: 20 Mar 2022 05:25 PM PDT I have a command line utility which is able to receive an image via stdin and convert it to a different format and output it to stdout. I use this from a program, but every time I run it, a subprocess needs to be invoked which is very slow. So I wonder is there a way, ideally using systemd, to turn this command line program into a "server" that remains in memory and somehow is able to receive image data and output it? |
Giving superuser access to user directory binaries Posted: 20 Mar 2022 04:43 PM PDT I am new to linux. I have installed rust on a linux box (AWS EC2) using the official documentation. The binaries are installed in my home directory and the paths have been added to the $PATH variable. As such I can use the cargo ... command with any local directories. However, when I try to run sudo cargo ..., I get cargo: command not found. I believe this is happening because the binaries for cargo, rust, etc. are not in the /usr/bin/ folder. How do I give the superuser access to these binaries? Do I have to move them to the /usr/bin/ directory? Any insights or pointers in the right direction would be greatly appreciated. Thanks |
KDE display not working on NixOS - Thinkpad P15 Gen 2, NVIDIA RTX A4000 Posted: 20 Mar 2022 04:38 PM PDT I'm trying to install NixOS on a new Thinkpad P15 Gen 2, and I can't get the desktop environment to show anything on my screen. Anytime I turn it on or reboot, the screen stays black until I ctrl+alt+F4 to get into a shell. I'm trying to use KDE Plasma 5, but I'm willing to try other DEs if they might work better. I used an installer ISO with KDE on it and it was able to show the graphical displays and everything. Then after installing on my partition, I can't get a graphical display going. Here is my configuration.nix (current channel is nixos/21.11): And my And the logs from display-manager are on this pastebin raw link: https://pastebin.com/raw/YycVPVVd And here is the output of Happy to post anymore logs or files if necessary and willing to try anything to get this working! Thank you in advance for any help! |
How to remap a key combination to a key combination in X? Posted: 20 Mar 2022 04:10 PM PDT How do I remap a key combination Ctrl+54 (keycode for C) to Ctrl+C? I want this because I am switching between keyboard layouts often, but many programs accept keyboard shortcuts only in latin layouts. For example Ctrl+U for pasting in nano doesn't work if I switch to the Russian keyboard layout. I saw solutions for remapping a key combination to a key here, but don't know how to adopt them. My current solution is to use packages xbindkeys and xvkbd and create a file ~/.xbindkeysrc that looks like: This works only for nano, but doesn't work for zathura, another console application, nor for geany, a GUI text editor. |
Posted: 20 Mar 2022 04:23 PM PDT I have code which need to run with pre-variables. I tired to run it with loop but, its not work. How can I edit script for correct work with pre-variables? I tried this script. But its not work |
Posted: 20 Mar 2022 01:50 PM PDT I have an updated debian 11 (bullseye) setup and want to use avahi to connect to locally connected computers. avahi works, for example: gives here I do not understand where the In hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 but getent hosts bhutan.local returns nothing. I have no What makes the connection between I fear that I miss some installation. I tried to install the package What is missing? How to debug? |
How do I select the proprietary nvidia drivers on Fedora 35 after installing them from RPM? Posted: 20 Mar 2022 12:43 PM PDT I'm trying Fedora after using Ubuntu for a while. After a fresh Ubuntu install, I would select the nvidia drivers by using the GUI application called "Additional Drivers". I do this because my monitors support 144 Hz refresh rate, which typically only works when I'm using the proprietary drivers. On Fedora, it doesn't for me, with the out of the box install. For Fedora, I noticed there is no Additional Drivers application and I wasn't able to find a similar application already installed. I found this tutorial which I followed (https://www.linuxcapable.com/how-to-install-the-latest-nvidia-graphic-drivers-on-fedora-35-gnome-41/) except for the part where you run Then I rebooted my system and when I booted up I ran So it seems like where I'm at right now is that I need to select the driver now that I've installed it. How do I do this? Data about my system: Card: 3070 Ti |
How to use Vim-like registers across programs Posted: 20 Mar 2022 12:37 PM PDT I'd like to be able to The ideal solution would allow Vim yank and put bindings across the OS. I'm using Arch Linux with DWM as my window manager. |
Prohibit sudo commands when run from a SSH session Posted: 20 Mar 2022 01:10 PM PDT |
Posted: 20 Mar 2022 02:25 PM PDT I have various folders with high res images sizes some more than 6000px x 4000px. some are 5000px x 3000px, size varies with folder to folder. I want to resize all images for saving resources like loading time/processing/memory space. I want to keep all images around minimum 3000x2000 max 3500x2200 . How I can do this with imagemagick in batch, Replacing original. Some one suggested my to use imagemagick with morgify on ubuntu? Earlier when i had windows PC I used photosizer software. Selecting folder one by one, then process images with jpegMini software. So 5 mb photos decrease to the size to around 1.5 mb. Every folder contains images with different resolution. Its a long time consuming process. For every folder i had to decrease % in fotosizer to keep image size around 3000*2000 more or less maintaining aspect ratio. |
Install teamviewer for debian 9 cli only Posted: 20 Mar 2022 03:23 PM PDT Until now I used zerotier in order to reach a remote linux debian 9 machine that is a sort of vpn service, it assign you virtual router and you can add machines to it. Something got really strange since last update of the remote client. The machine is unreacheable, I have a person there with root access that can write a small list of command but he isn't very practical so keeping the list short is better. What list of command can I send to him in order to get a 100% sure functioning teamviewer installation so that I can get back and login in this machine ? The machine is a full classic Debian 9 installation with NO X or anything, only CLI classic terminal. I've read various teamviewer installation threads but every one seems to be very technical for linux, while I need something easy and unattended where the person have to do a command once, tell me his id and let me enter to fix all the mess zerotier last update leaved. BONUS: The command list can be also put online so he have to write a single line like a command
Thanks! |
insert comment in the beginning of specified line in file Posted: 20 Mar 2022 01:24 PM PDT This is a pretty newbie question but what I am trying to do should be easy :( I am developing a script to automatically install a development environment but I need to comment out I have been able to remove a comment with the following command: |
How to fake write-protected script's $0 (zeroth arg) to be a path where I have no write-access? Posted: 20 Mar 2022 01:25 PM PDT It's said relying on $0 in a script is dangerous (often citing to fake it: exec -a ...). Yes, in dirs where I have write-access I can symlink to a script to fake its $0. But how to make $0 point to a path where I have no write-access (such as /bin/pwd below)? Below, provided my script uses a shebang, I cannot achieve it. Can it be done when target script uses a shebang? That is, if a script (& its parent-dirs) are write-protected, AND uses a shebang, then its use of $0 is safe (from faking another write-protected path)? Here using (on centos 7) bash's exec statement as easy fake of $0. C program using execve() won't be different? Is the failure to fake it downstream of the execve() (in kernel or shebang-target), not that bash's exec is too weak? EDIT: execve() in C also does NOT fake the $0 in shebang case, same output as above: I'm aware if users gain root, then fake $0 is least of your issues. But MY write-protected scripts, with shebang, cannot be $0 faked (to another write-protected path), by non-root users: the danger of $0 ('just use exec -a ...') seems false. |
How to connect Linux network namespace with other VM using internal network? Posted: 20 Mar 2022 05:43 PM PDT I have two Virtual Machnes (VM) in Virtualbox connected with internal network. On the first one I have network namespace named n0. I want to connect this namespace to network interface and finally connect it with the second Virtual Machine (VM2) using internal connection. Network example: As you can see, I want to have connection between 192.168.127.2/24 and 192.168.127.1/24. My attempt to solve this problem using openvswitch (not working): Could you please help me with this? Do you see how can I improve my solution to work properly? Extended network topology: There is a working connection between ns1 and ns0, but I try to connect ns1 with 192.168.127.1/24. To do this, besides the connection between 192.168.127.2/24 and 192.168.127.1/24, I need to add static routing but I can't do it. I was planning on trying to do this using openvswitch and commands: where br0 is openvswitch - bridge. |
problem with installing a repository on remote server with CentOS 7 without root permission Posted: 20 Mar 2022 12:25 PM PDT I am trying to install Chipyard Toolchain on a remote system with cshrc. I am connecting to it via ssh. All the required dependencies were already installed on the system. I checked them with I've done the setup phase as well (i.e. ./scripts/init-submodules-no-riscv-tools.sh was successful-- generated the expected output on env.sh file) My problem is with the buiding the toolchains where I'm getting the errors: I also recorded the full build process and its here. My question is do i need to install the dependecies again (or upadate them) to get rid of the errors? if so could you please guide me how becaues I'm not the sudo. I asked the admin but they replied that the admin is only for advanced stuff. I'm not very experinced with linux. Any guidance will be appreciated. EDIT |
how to print 2 consecutive lines separated by 1 blank line into one line separated by , Posted: 20 Mar 2022 03:35 PM PDT How to turn this text: In to this one: |
Disk showing in windows but not in Ubuntu Posted: 20 Mar 2022 12:21 PM PDT New to linux but have been researching this for a few evenings without success. I have two disks in my machine. I wiped windows and installed Ubuntu on one of the disks. I can't seem to access the other disk.
I have a completely different computer running windows 11 so I plugged the drive in there and it showed up. I tried reformatting as NTFS and plugging back into Ubuntu but still nothing. Any help greatly appreciated. Output of lsblk: Update / solution I have found the problem and I have to apologise but it was something I did without realising. When I wiped windows off I also removed the graphics card and stuck in a really old one. When doing so I must have plugged the SATA cable back into a different port on the motherboard. On this Gigabyte motherboard there are two SATA ports that are disabled when using an M.2 drive. I didn't know this but just found out today when troubleshooting this problem. Moved the cable to another port and now the drive shows up in Ubuntu. I'm terribly sorry for wasting anybodies time but hope posting this outcome might help others. |
Remove specific CSV columns from large CSV file and duplicated rows with Perl Posted: 20 Mar 2022 04:26 PM PDT I have a large CSV file (300MB+) and I want to remove only columns 2,3 and 6-8 using Perl AND remove duplicated rows: Note 1: all columns are separated by Note 2: I've added links to the input.csv and output.csv files: I've found a Perl command that would remove the last column using regex, but don't know if it's good enough or how to tweak it to suit my case (any other suggestion is more than welcomed!): Is it possible to remove only columns 2,3 and 6-8 using Perl and remove any duplicated rows? PS: updated the input.csv file to include duplicate rows as well Thank you! |
Posted: 20 Mar 2022 11:37 AM PDT I have a directory of 1000+ files (follow the same formatting) example file would be Where year is 2020 month is 07 day is 02 hour is 08 min is 32 elevation is 10 I'd like to create a script that reads the day and hour and sorts it in a folder with that same name then into a sub directory based on elevation. example file would be copied into folder I was able to use string features to read the day and hour and create the corresponding folders and also able to create the directories (see below). My issue is that I can't seem to copy the files while using "string reading". This is where the files are located (may help explain my script attempt and why I used the cut function the way I did. This is the area of my script that I would like to improve. I want it to copy files into the corresponding directory and subdirectory even if the days and hours change. |
LINUX unable to create a directory | mkdir: cannot create directory ‘test_nfs’: Permission denied Posted: 20 Mar 2022 05:07 PM PDT I am trying to create a new directory under I have presented a volume through nfs server to client. Any help would be highly appreciated. Thanks in advance. |
How can I extract a RAR file on Debian? Posted: 20 Mar 2022 11:56 AM PDT I've got a 20GB RAR file to extract with a password on Debian Linux Google Cloud VM. I first tried I found that this is likely to be because I don't have the multiverse activated, so I tried I eventually found a post saying that 'unrar free' could be installed. I installed it, and ran Apparently unrar-free is unable to extract archives in the RAR 3.0 format. I don't know how to tell which version of RAR this archive was compressed in. How can I extract this RAR file? I don't mind paying some money if it means faster extraction - I've got 140GB of RAR files to get through. |
Posted: 20 Mar 2022 02:03 PM PDT I am having trouble printing (or searching) for sequences containing backslashes when using awk For example - will give the result: because the \t will be interperted as tab. I want to be able to have the string as is, meaning: The echo command is just another way for me to check a 1 liner for the awk command to see if it can find a pattern such as \t in a file (using a bash script). To be more sprcific - If I want to have an awk cmd that needs to find a sequence of I am using the following: but the cmd does not work: for a file with : it will output: What is the right way to use awk to find the Thanks |
Linking with GCC doesn't detect -fPIC flag Posted: 20 Mar 2022 04:01 PM PDT I am trying to link some files. Here is my command: How ever, I get this error: I have included the |
What are the correct permissions for a systemd .service? Posted: 20 Mar 2022 02:46 PM PDT I need to create a service for a web server called daphne I would like to know what are the correct linux permissions for this. or if exists a general rule for whatever systemd service? |
openSUSE 42.3 does not start up from USB - black screen after loading kernel Posted: 20 Mar 2022 03:03 PM PDT I tried to install openSUSE on my desktop PC and load openSUSE 42.3 to my USB stick by using SUSE Studio Imagewriter (my laptop is running openSUSE). However, after a while the screen turns black and nothing happens. My desktop PC loads the GRUB (at least it looks like GRUB) from USB and I choose the option Installation. The kernel seems to be loaded and things are printed on the screen. The last things printed on the screen before turning black are:
After this, the PC seems to do nothing and my display turns black. First, I thought this was a problem of the USB stick, downloaded openSUSE a second time, checked its hash, and tried on my laptop (where everything seems to be OK) but nothing changed. Both, the DVD install and Net install showed the same issue or at least symptoms. So I assume it has something to do with my desktop PC. It has AMD CPU and NVidia graphics card (my laptop has both from Intel). Maybe this needs some special attention? Any suggestions what could be the problem or what to try next? Many thanks and have a nice day. |
Posted: 20 Mar 2022 03:43 PM PDT Has anyone got WiFi working in buildroot for the Raspberry Pi Zero W? I can't find any online notes or walkthroughs on it. The raspberrypi0_defconfig works fairly well, but doesn't include wireless. I'm using the latest iteration of buildroot, 2017-08. I've added the rpi-wifi-firmware. Which packages are needed as a bare minimum to connect to a WiFi network? |
Binding to systemd device units of connected bluetooth devices Posted: 20 Mar 2022 03:48 PM PDT When I connect a bluetooth device (e.g. a wiimote) to my machine and list all device units of systemd via Problem:I want to bind a systemd service to a specific bluetooth device unit (e.g. wiimote). Thus, I will need an idea about the name. The ID differs on two Arch linux machines. Questions:
Attempts:I tried to change the ID with an udev rule following this description on the Arch wiki. Via All But that doesn't create any additional device unit. |
How to exit a git merge asking for commit message? Posted: 20 Mar 2022 01:18 PM PDT I'm using git. I did a normal merge, but it keeps asking this: And even if I write something, I can't exit from here. I can't find docs explaining this. How should I do? |
how to test sco packets in bluetooth Posted: 20 Mar 2022 01:00 PM PDT Issue : Monitor sco packets between master and slave bluetooth. Description of problem. I have small in-house Bluetooth device (developed in Linux fedora OS) and is configured as slave device. I am interested in following things:
What I did so far:
And I can successfully hear sound on my windows laptop. So far so good. acl packets have increase but sco remain at 0 Will this proof that audio is working but not via sco?
|
Cinnamon failed: desktop only, no panel, no dialog frame Posted: 20 Mar 2022 12:01 PM PDT I am using Linux Mint 14 (MATE) with Cinnamon installed. Cinnamon failed when I tried to delete an item on the menu with menu editor. The system froze, so I logged out by pressing Ctrl+Alt+Delete. When I logged back in, the desktop panel was not loaded (shortcuts were there as normal, and right-click works as well). I can barely do anyting but get the terminal with Ctrl+Alt+t. But all the dialogue windows are presented without any frames. Here are screenshots: I tried reinstalling Cinnamon in the MATE desktop interface (it works fine), but it failed to solve the problem. |
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