Recent Questions - Unix & Linux Stack Exchange |
- Linux shell command pasting issue
- remove lines that contain some string from another file
- Start VM with Script with a delay and reset the vm once?
- How to get all files that are denied for a user by using getfacl
- How can I use both PKI and Kerberos Authentication for login
- Arch Linux error when running startx
- When using Spice and remote-viewer with multiple virtual monitors, stuck on "Waiting for display 2" indefinately
- How to add and change display resolution in (Wayland)Gnome 34?
- Cannot connect to serial port after reboot
- Field extraction in fixed width file and validating format
- Most popular, trusted rpm dnf repos for CentOS Stream 8 ans RedHat 8 Enterprise Linux
- How do I get a list of screen session names for a loop
- dd: writing to Invalid argument with 4k blocksize on iSCSI LUN
- How to build & install Debian package from source on Ubuntu 18.04
- move all files except one that matches filename
- How to display the content of a file using pipe?
- Is there a way to disable all write access for a specific user in a directory?
- Command works in terminal, but not in crontab
- Linux 64-bit SSH port numbers?
- How to sort files based on barcode and bubble forms?
- No matching VNC server running for this user!
- Can't set DisplayPort output to 4k@60hz on the new Huawei Matebook 14 AMD
- How to remove newline character within a column in a tsv file?
- Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
- Finding and deleting files with a specific date
- Logging in with 'su' without entering a password
- How can I configure Postfix to silently drop/discard/reject mails that were sent from specific users to an external address?
- Create a tar archive split into blocks of a maximum size
- SSH not landing in the home directory
Linux shell command pasting issue Posted: 17 May 2021 10:54 AM PDT I frequently need to run a script and provide it several lines of STDIN. When doing this, I'll typically prepare the invocations, and then copy & paste them from one terminal window to another. Ideally, I'd like to be able to paste blocks of text such as: after which I'll hit control-d to indicate to the script that STDIN has reached the end of input. If I do this in bash (as a single paste), the script executes, none of the STDIN echos in the session, an extra If I do this under zsh, most of the STDIN lines don't echo (if there are a lot of them, some of the last lines will echo, the first of which may only echo a trailing fragment of the line), and again, an extra It doesn't matter if the script in question is python or perl...both behave the same, which leads me to believe this is a shell issue. The question is, what's the issue, and is there a fix that would allow doing each execution as a single paste? |
remove lines that contain some string from another file Posted: 17 May 2021 11:08 AM PDT I tried this but not work cause I have f2: f1: The idea is to remove the line It removes when I just typed exactly but not if contains that only 4s. |
Start VM with Script with a delay and reset the vm once? Posted: 17 May 2021 10:44 AM PDT Can Someone help me make a simple script to start a vm and reset the vm after 10 seconds of delay in the background while the VM Running in Virt manager in Arch linkux (manjaro) |
How to get all files that are denied for a user by using getfacl Posted: 17 May 2021 10:30 AM PDT How to get all files that are denied for a user by using I've used example: using Ubuntu 20.04 LTS |
How can I use both PKI and Kerberos Authentication for login Posted: 17 May 2021 10:29 AM PDT I am trying to implement PKI and Kerberos authentication when using PuttyCAC to ssh into a Linux VM using my smart card. What configuration files do I need to configure and what should I add to those files? Kerberos is already implemented and works with ad accounts with passwords. When I enter using PuttyCAC I have to enter a pin and then it unlocks the private ssh key to the Linux VM but it's not verifying my user to the AD with Kerberos. |
Arch Linux error when running startx Posted: 17 May 2021 10:35 AM PDT I have an Arch Linux setup running BSPWM, I don't use a login manager, but instead just run I have an NVIDIA GPU (RTX 2070 Super) and have installed the (latest) proprietary drivers. I'm not sure what is relevant to the issue, but I'll gladly include more info. I did find this question, I didn't try the solution because frankly I'm not entirely sure what the impact of this would be (it's not really explained). EDIT I ended up trying the linked suggestion and it didn't work. |
Posted: 17 May 2021 09:52 AM PDT Following some research, I learned that the proper method to setup multiple virtual monitors with virt-manager, libvirtd, and qemu is to use spice (link, link, link). At first, I added three total Video QXL instances, and then connected to Spice via remote-viewer. This did not work because I saw a window such as this when opening a VM's second or third virtual display (the primary one works fine): The extra monitors also were not shown the virtual machine. As such, I tried removing the extra Video QXL hardwares, and instead set the one that was there by default to have three heads: This unfortunately produced the same error when opening the additional virtual displays, except not when I do so graphical artifacts appear in the primary display and it becomes unusable as a result. What did I do incorrectly here? How can I enable multiple displays with this VM software stack? Main spice XML: Both the host and guest are Linux (Pop OS and Debian 10 respectively). I tried upping the video ram from 16MBs to 256MBs, which ends the graphical glitches, but it does not enable interaction with the primary monitor after the second is enabled nor does it allow the second to progress past the above screenshot. I also have spice-vdagent installed in the guest. How can I make this work? |
How to add and change display resolution in (Wayland)Gnome 34? Posted: 17 May 2021 09:51 AM PDT In display settings I am getting any other resolution but 1920 x 1080. I want to change it to 1920 x 1080 resolution mode. How can I add it and change the resolution? I am running Fedora 34 in VMware. |
Cannot connect to serial port after reboot Posted: 17 May 2021 09:35 AM PDT I've a USB to serial converter plugged into my device and it comes up as /dev/ttyUSB0. I run my microservice (through docker container, with privileged true) and my service can connect to the port and read the data that is coming on the port. If I unplug the USB and plug it back in, can connect back to port /dev/ttyUSB0 and read the data. If I unplug the USB and reboot the device and then plug in the USB, my service still cannot connect to the port, "no such file or directory" error. At this point, if I restart just my service, still see same error. However, if I restart my docker container (service also restarts when container restarts), my service can again connect back to port. Following are some outputs when the service says it cannot connect to /dev/ttyUSB0:
dmesg | grep FTDI [ 71.034074] usbserial: USB Serial support registered for FTDI USB Serial Device [ 71.034488] ftdi_sio 1-1.1:1.0: FTDI USB Serial Device converter detected [ 71.035662] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUSB0
ls -l /dev/ttyUSB0 crw-rw---- 1 root dialout 188, 0 May 17 16:14 /dev/ttyUSB0
|
Field extraction in fixed width file and validating format Posted: 17 May 2021 10:03 AM PDT I am writing a poc for a fixed width file to extract a particular field and checking its format . But the both giving me validation failed . can you please help me to point out the issue in code i am trying to substr the email id and trimming for space and validating the format code Input file |
Most popular, trusted rpm dnf repos for CentOS Stream 8 ans RedHat 8 Enterprise Linux Posted: 17 May 2021 09:24 AM PDT Could you please point me to several rpm repositories that hold binary compatible packages for CentOS Stream 8 and / or RHEL 8 so I can use dnf to find newer versions of standard packages or software that is not available from official IBM Red Hat repositories? |
How do I get a list of screen session names for a loop Posted: 17 May 2021 09:11 AM PDT I have used a loop to create a set of screens using Bash that are connected to a set of serial ports: Subsequently, I want to send reset commands to all of these screens repeatedly until they are all closed (some of the devices require several resets in order to reboot). For this I need a list of the active screen session names. Unfortunately, a command like What I'd like is a command like that, which returns: Then I'd be able to run: until there are no more screens left. Can anyone help me with the <<magic stuff here>>? |
dd: writing to Invalid argument with 4k blocksize on iSCSI LUN Posted: 17 May 2021 09:03 AM PDT Why can't use my environment @storage server: VM: all disks formatted with ext4 |
How to build & install Debian package from source on Ubuntu 18.04 Posted: 17 May 2021 11:04 AM PDT What is the most convenient way to build and install packages that are found from Debian Tracker on Ubuntu 18.04 Bionic Beaver? For example I am interested in this unstable version of gdal. So I would need to build the package from source and install it's dependencies. Problem at the moment is that some of the dependencies are not found from Ubuntu repositories. Is it somehow possible to have them installed from the debian source also? |
move all files except one that matches filename Posted: 17 May 2021 10:54 AM PDT I want to move all files in my current directory to a directory named I have found this command that removes all files, but not sure how to move them, not deleting them: |
How to display the content of a file using pipe? Posted: 17 May 2021 09:28 AM PDT I have a text file and I should display its content using pipe in a C program. I have made something like this but isn't exactly what I need. Here I gave the messages that I want to display. I really do not know how to do it for a file. |
Is there a way to disable all write access for a specific user in a directory? Posted: 17 May 2021 10:59 AM PDT I recently learned about ACL and To put it another way, consider a user What I have tried/thought of:
Having skimmed through ACL documentation, I haven't come across anything that points to this direction, so just to be clear, I am not necessarily looking for a way to do this with ACL. (*) or read, or execute access - I guess it shouldn't matter which one it is, but I will stick with write access to keep it simple |
Command works in terminal, but not in crontab Posted: 17 May 2021 10:01 AM PDT I'm testing to set up some backup. I set up my crontab to run every minute. I have a disk that is mounted on machine2 that I will upload the backup to. cron tab entry: This will not run with crontab. I'm running the same command in terminal. Then it works: And file is received on machine2 in the /mnt/backup2 folder. Any suggestions why it doesn't work with crontab? Im running Ubuntu. |
Linux 64-bit SSH port numbers? Posted: 17 May 2021 09:09 AM PDT While there is usually no need for more than the 64k available ports, I am interested in the PoC that having a port number on 64 bits would mitigate the regular attacks on the access ports (ssh, vpn...). Having a 64b port makes it almost impossible to randomly attack a service, targeting either DoS or a login. Like
and practically
|
How to sort files based on barcode and bubble forms? Posted: 17 May 2021 11:11 AM PDT I need to setup a process for easily sorting worksheets completed by students. The basic idea is, I'll collect their work, run it through a feed scanner, which sends me a PDF of all of the pages. Using ImageMagick, I'll split the PDF, during then into JPEGs. All of these steps above I can achieve. The next is where I need help: First, it needs to scan something I placed on EVERY page. The script must check a barcode (or similar marking) at the top of each JPEG, indicating the page number. E.g. if it sees page 1a, it sends that to a directory called "1a". This could be displayed as a barcode, or maybe there is software that can recognize the page number? Next, it would need to scan something students placed on their page, identifying which student filled in the worksheet. The script needs to identify which students completed the worksheet, and sort them. For this, the students will indicate their name or perhaps an assigned number. Since I doubt any software can perform hand-recognition on students with many different hand-writings, this might be some kind of scan-tron like area where students fill in bubbles. E.g. I assigned a student as #130, so they fill in bubbles indicating 130, and then the script sends that JPEG to directory "1a/130/". Does anyone have any ideas what tools I can use for scanning the information off the page? |
No matching VNC server running for this user! Posted: 17 May 2021 10:59 AM PDT I'm using Kali Nethunter, and I need help to fix this. I've been using the command This happened after I gave the command To answer the follow-up questions (in comments):
|
Can't set DisplayPort output to 4k@60hz on the new Huawei Matebook 14 AMD Posted: 17 May 2021 09:40 AM PDT Just this week I got the newest Matebook 14 2020 AMD with the 4800H. On windows I'm using an UtechSmart USB-C hub to output 4K@60Hz to my monitor so physically I know it's possible. Linux, however, is another story. I installed Kubuntu 20.04 LTS, but I could only boot to it (kernel 5.4 I believe) by going into recovery mode, and then selecting continue boot. Otherwise it would just hang on the Huawei logo. I installed the 5.8.15 kernel and everything seems to work fine, except I can't seem to set the display output to 60Hz, even though it's available in the settings, confirmed also by xrandr: However, running I assumed this has something to do with the amdgpu drivers, so I went ahead and downloaded the latest 20.30 version, however, I get the following error: I even tried installing it on the 5.8.1 kernel with no luck. This is where I'm stuck right now, and I'm pretty sure I wrecked the whole installation. Any insight on how to fix my problems? |
How to remove newline character within a column in a tsv file? Posted: 17 May 2021 11:00 AM PDT I need "This contains newline" in one row, newline from the column2 and column4 need to remove. nb: For your understanding the data I upload an image if you want I will upload the text content |
Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) Posted: 17 May 2021 11:06 AM PDT I'm trying to update to Running this command as root doesn't work so I tried to see if apt-get was being used by any other processes. This is all I get. Ultimately, (although it was initially advised not to do so), I tried removing the files and running the command again. Now neither one of these files no longer exists and I still receive the same error when trying to use curl. I also tried to kill that one process and I still get the error. |
Finding and deleting files with a specific date Posted: 17 May 2021 09:33 AM PDT how to delete the files that created on as the following example: |
Logging in with 'su' without entering a password Posted: 17 May 2021 10:01 AM PDT How can I log in with the But when I try to imply it in the I get an error: I don't have access to the I know that the right syntax is basically: What I want to do is to add a |
Posted: 17 May 2021 09:01 AM PDT How can I configure Postfix to silently drop/discard/reject mails that were sent from specific users to an external address? It should work only for specific users E.g:
|
Create a tar archive split into blocks of a maximum size Posted: 17 May 2021 09:15 AM PDT I need to backup a fairly large directory, but I am limited by the size of individual files. I'd like to essentially create a Is there a way I can do this in one command? I understand how to use the |
SSH not landing in the home directory Posted: 17 May 2021 09:29 AM PDT I have recently installed Raspbian into a Raspberry Pi. As part of the installation process I changed the user name and group from the default ( The directory To me everything looks fine, but still when I login from ssh I get a prompt that looks like |
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