Recent Questions - Unix & Linux Stack Exchange |
- bashrc + why source not refresh the .bashrc file
- How to configure similar to do-ip6 setting (unbound) in coredns of kubernetes
- Why does my sytem have muptiple addresses on interface wlo1?
- Why is the bash completion setting in root's .bashrc is commented out in Ubuntu?
- rsync / mv how to skip empty files
- How to stream the linux framebuffer as video over http
- Why do package managers require root priveleges?
- systemd debug (embedded case)
- Gnome 3 finger gestures not working well when tap to click is enabled
- How to prevent child process to interfere with bash prompt?
- cant create a choice selector in bash
- String searching with grep
- How can I remove the portion between the ">" and the word "Bacteria" for each occurrence in a file?
- Forcing the failover to a hot spare in a degraded ZFS pool
- Unmount /boot after booting
- Use umask to set permission
- Giving files in batches to a script
- Remove the matching pattern from grep's output?
- Sorting lines based on certain digit pattern
- Automatically source a file when `cd` into a specific directory
- Is it possible to have systemd open a program running in a clean terminal automatically after startup?
- Why root user is not getting "Device or resource busy" response?
- How to enable an Ethernet interface at boot on CentOS 8?
- TFTP: cannot send/recive file, showing Error: TFTP, Opcode: Error Code(5)
- How to change default text editor for virsh edit?
- How to is the system proxy configured in Tails OS?
- what is the function of "ip link" command?
- Swap: Better to create a dedicated swap partition or to create a swap file?
- Cron job to run every minute from 11PM to 6AM
- What is the meaning of ls -d?
bashrc + why source not refresh the .bashrc file Posted: 06 Apr 2022 01:58 AM PDT we add the following line to so we get then we did and indeed when we do we got but when we want to back to real reboot , we removed the line --> as the following: and we refresh the bashrc but we still get the old alias when we try to reboot: what we are missing here? another example with function with example above we cant to do |
How to configure similar to do-ip6 setting (unbound) in coredns of kubernetes Posted: 06 Apr 2022 12:50 AM PDT do-ip6 is an option in unbound dns where we can enable or disable whether ip6 queries are answered or issued.
How this is by default in coredns of kubernetes? Is the queries are answered on Ipv6 or Ipv4 by default in coredns? Incase the queries are answered on Ipv6 by default, can we able to configure this to answer queries on Ipv4 via Corefile of coredns in kubernetes? It would be really grateful if someone helps me to clear out this. Thanks in advance!!! |
Why does my sytem have muptiple addresses on interface wlo1? Posted: 06 Apr 2022 12:15 AM PDT I tried to init docker swarm Ok,I will advertis address. shows Can someone explain muliple interafaces? |
Why is the bash completion setting in root's .bashrc is commented out in Ubuntu? Posted: 06 Apr 2022 01:32 AM PDT I'm on Ubuntu 20.04 and I found that in root's .bashrc file, the bash completion setting is commented out by default: When I uncomment it, the completion works again. Why it was commented by default? Is this related to any security considerations? |
rsync / mv how to skip empty files Posted: 06 Apr 2022 12:03 AM PDT I am new to linux. I have a requirement to copy files from source1 directory to destination1 directory and move from source1 directory to destination2 directory. It is working fine. But script is copying even empty files also. rsync / mv should not pick empty files. How can i do that.Currenlty I am using below script. |
How to stream the linux framebuffer as video over http Posted: 05 Apr 2022 11:05 PM PDT I have an embedded linux system (yocto based) with a framebuffer UI (no X11) and a running web server. Now I'm asking how to "mirror" the screen contents to a web page. Think of it like a web cam, except the stream is not coming from a camera, but from Sounds like a quite obvious thing to do, but my web search didn't throw any matches. Do you have an idea on how to proceed? |
Why do package managers require root priveleges? Posted: 06 Apr 2022 02:02 AM PDT The default package manager for mainstream Linux distros (deb/apt, yum/dnf, pacman, etc) do global-installation by default and require root. I am curious about in the rationale for this design choice. It seems better to install as user or group and not need root, because one would run less untrusted code as root (as Nix, Guix, Cargo, Pip, Gem, Cabal, Stack, CPAN). On shared systems, one could install packages to directory which is readable by users but writable by admins, but this doesn't have to be root, and it should still permit users to install their own packages. Package that modify protected files like Grub or provide services would need to modify the root system, but everything else should be doable from user-side. This question says that packages may assume they are installed to specific locations in the Filesystem Hierarchy, but I thought this could be fixed by setting |
Posted: 05 Apr 2022 11:36 PM PDT How to trace systemd unit files, to be specific, device unit files? I use 3.18 version of linux kernel. On my board after systemd has started, (mypartition).device runs and, I suppose, remounts the rootfs and it takes about 2 seconds to complete as systemd-analyze plot shows. I want to know what it does during those 2 seconds, because remounting of rootfs takes not so much time (usually few milliseconds). How I can understand systemd-analyze plot, there are so many unit files, is it possible to know which unit causes running of the others? I tried to find .device unit file in my system, but I could not find anything. |
Gnome 3 finger gestures not working well when tap to click is enabled Posted: 05 Apr 2022 11:48 PM PDT I've just switched to fedora (fedora 35) and i noticed that when i enable the tap to click, three finger gestures not working well. If i disable it the gestures work just fine but if i enable it the sensitivity is not as good, i have to do the gestures very slowly for gnome to pick up. So what is the reason for this and is there a solution? PS. My pc is Lenovo Thikpad E495 and i have windows 10 installed on my computer besides fedora. |
How to prevent child process to interfere with bash prompt? Posted: 06 Apr 2022 01:52 AM PDT The application in question is DaVinci Resolve. I start it from terminal. And when I close it, the message "Socket Disconnected" from the app is written to the terminal output. Then the bash prompt appears as normal. I start typing the new command, and suddenly another message appears in terminal "Socket Disconnected". And this interferes with the input I made. It looks like this: Video demo: https://youtu.be/arcCOjrN7kw Why this is happening and is there a way to prevent this? My guess is that there is subprocess of the main process, which still is alive even after main process dies. I have found this answer. Is that the developer's fault? Can I workaround this somehow (maybe nohup for child process)? |
cant create a choice selector in bash Posted: 06 Apr 2022 01:18 AM PDT I am trying to make a bash choice selector from https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script but it doesn't work I also installed Dialog but it still don't work. help me debug it. thank you Here's what it shows |
Posted: 06 Apr 2022 01:07 AM PDT I'm just searching in emacs some strings with following pattern: So i've used grep: but got no match, instead there's a lot of them for example: What's wrong? |
How can I remove the portion between the ">" and the word "Bacteria" for each occurrence in a file? Posted: 05 Apr 2022 10:13 PM PDT I want to remove the portion between the
This is a FASTA file (a common file format in bioniformatics), so the I was thinking about using |
Forcing the failover to a hot spare in a degraded ZFS pool Posted: 06 Apr 2022 01:55 AM PDT I have a simple 5x1TB RAIDz1 configuration (tank? pool? vdev?), with a global spare assigned to it. One of the 5 drives in the array is listed in a I have read many forum posts from many locations, discussing The The There is no indication that the spare is being used to rebuild the array. I am not keen to start physically moving drives around, neither the current array member nor the functioning hot spare - I'd prefer not to interrupt anything. I'd also prefer to not bring the array down, restratt he server etc. The system is designed to transparently recover without this, I want to learn how. The data is backed up so I have free reign. Linux Kernel: 3.10.0-1160 ZFS Version: 5 Update: Output from Output from ZFS version: zpool status: |
Posted: 05 Apr 2022 10:57 PM PDT For some highly secure bastion VMs I'll implement soon, I am considering to unmount
|
Posted: 06 Apr 2022 01:21 AM PDT The task: use umask to define the permisson Create a directory (say
Thank you. That's is what I did already, I'm not sure about the permission for delete files/dir. |
Giving files in batches to a script Posted: 06 Apr 2022 01:44 AM PDT I have many files, and the naming convention is as follows:
I want to provide the first |
Remove the matching pattern from grep's output? Posted: 06 Apr 2022 12:07 AM PDT With bash, I'm running this: My command outputs this: But I want to output this: Normally, I would just pipe this to Return only the portion of a line after a matching pattern is a very similar question. Perhaps it's even a duplicate. One could argue mine is a little bit more narrow: it's guaranteed that the pattern I'm grepping and the pattern I'm removing will be the same. I want to remove |
Sorting lines based on certain digit pattern Posted: 05 Apr 2022 11:33 PM PDT Assume I have a text file with the following lines: as you can see above, each line will have the following pattern (I couldn't write all possible variations since there are 9.9599603594104e+16 possible lines) I want a grep/sort statement that counts the lines where the first four numbers matched and print that count. The expected output for the example above is: Side notes:
one of the commenters on this post suggested to use: which seems to work well. |
Automatically source a file when `cd` into a specific directory Posted: 06 Apr 2022 01:19 AM PDT I have couple of utility commands-and-aliases that are generic enough in any directory for my own requirement. But there are certain directory e.g. 'build', where I need a custom behaviour. To do this, I have created a different file in those directories, that contain the modifications with same name of functions and aliases (so that I don't need to remember, new names). Currently I manually source the files, after cd'ing into the specific directory This is working well, but I'm looking to automate this sourcing of file. Is there a way to source a file on cd'ing into specific directory? Note: I went with this approach, as I don't want to change the system wide user-aliases. |
Posted: 06 Apr 2022 01:02 AM PDT First off apologies for the simple question- there is more to it that I will explain below. I am new to Linux style systems and evidently I have A LOT to learn. With that said... My System I am running a program on a Raspberry Pi 4 Model B. My operating system is Raspbian GNU/Linux 10 (buster). What I Have I have produced a working program in C++ that is stored in When launching the program through Geany (an editor on the pi), I can make and run the program which opens a new terminal window and prints the output there. When clicking on the executable file in the folder I'm asked to choose between 'Execute' and 'Execute in terminal'.
When using the terminal and running What I Want I would like the program to run automatically on startup. The Pi will be used 'headless' but with the graphical interface enabled so I can see the desktop using VNC; when I open the VNC connection I would like a terminal to be running and displaying the program output. What I Have Tried I have been attempting to use systemd to launch the program. At first I tried launching the program directly but got absolutely nowhere; I couldn't find any good info or examples online and most examples were using bash or Python scripts... If you can't beat them join them... So next I created (copied) a simple bash script in usr/local/bin/ called and when running this script using Next I created a I chose I chose I set execute permissions for both script and service folders using:
I next told systemd to reload the files:
and then enabled the script to be ran at boot:
after that I ran Continued So.. before sending this post I followed my own instruction and at the end ran:
Which reported the service was successfully running and printing the program output into a log. This is semi-ok: I can use the Pi as intended as the program is running- just with no output showing by default. So to redo my question: Is it possible to have systemd open a program running in a clean terminal automatically after startup? I also think I need to change the service file; since its running a script that runs the program I might be launching several instances of the same program? Thank you for reading. Continued continued I have now installed I have changed my script to the following: When running this script through the Pi GUI terminal, I get exactly what I want: a new window outputting correctly. When running this from startup or through SSH I get the following errors:
I'm currently looking into resolving this. |
Why root user is not getting "Device or resource busy" response? Posted: 06 Apr 2022 01:26 AM PDT I am working with GSM modem and using Device is having proper rights: I am in OK, so for some reason ModemManager is holding this file busy, but when this happens I can still send commands the same way, but from I've got two questions:
|
How to enable an Ethernet interface at boot on CentOS 8? Posted: 06 Apr 2022 02:00 AM PDT I have a VM which is connected to a network with DHCP etc. Whenever I boot the VM the virtual Ethernet connection is DOWN. I need to log in by console and run This is I thought that The I set
|
TFTP: cannot send/recive file, showing Error: TFTP, Opcode: Error Code(5) Posted: 05 Apr 2022 11:01 PM PDT I am trying to send/receive a file using TFTP from the network switch to ubuntu(VirtualBox on Windows 10 Pro), but getting an error code 5 By following the steps mentioned below it seems like my localhost is working with TFTP server, I can send and receive the file using localhost: When I used the command in the switch to send/receive the file then I get the error message: Trivial File Transfer Protocol Opcode: Error Code (5) [Destination File: test] Error code: Access violation (2) Error message: Access violation [Expert Info (Warning/Response): TFTP ERROR packet] [TFTP ERROR packet] [Severity level: Warning] [Group: Response] Would you please guide me on how to fix this issue? https://icesquare.com/wordpress/how-to-setup-tftp-on-ubuntu/ First, let's install all the necessary packages: Next, we need to create a configuration file: Put the following content into the file. In the server_args, I have var/lib/tftpboot, which represents the location of the tftp root, i.e., /var/lib/tftpboot. Notice that I skip the root /. Now let's change the ownership of the directory: and start the TFTP service: Verify the TFTP is running correctly or not: Test: Upload a file to TFTP Server Now let's test the TFTP server by logging into the server first: tftp localhost and upload a file: Make sure that file has been uploaded: Test: Download a file from TFTP Server Now, let's go to a different directory and download the file we just upload. and log in to the tftp server again: and get the file: |
How to change default text editor for virsh edit? Posted: 05 Apr 2022 10:37 PM PDT I recently installed virt-manager on Arch Linux, and unlike under Ubuntu, I was not prompted to choose a text editor on the first launch of virsh-edit. Instead, the XML file was opened in vi (or vim, not sure). From this thread in the RedHat archives, I thought that if I just added to that would solve the problem. But setting EDITOR environment variable didn't work. Also, launching it with and I see that the variable has in fact been set: However Is there something different I need to do in Arch? Has the method of changing this setting been changed in recent updates of virsh? |
How to is the system proxy configured in Tails OS? Posted: 06 Apr 2022 12:02 AM PDT How is tails system wide proxy configured in tails? Tails have non-null variables |
what is the function of "ip link" command? Posted: 06 Apr 2022 01:45 AM PDT I've installed putty, and I'm trying to write For what is it used?? |
Swap: Better to create a dedicated swap partition or to create a swap file? Posted: 06 Apr 2022 01:18 AM PDT Is there a rationale when to create a dedicated swap partition vs. creating a swap file, for example like In my certain case, memory is kind of low (1GB), disk space on a SSD is pretty huge (256GB). Thus, swapping will happen pretty regularly. Any comments appreciated! Carsten |
Cron job to run every minute from 11PM to 6AM Posted: 05 Apr 2022 10:40 PM PDT I have a python program which I need to run every minute from 11PM (EDT) to 06AM (EDT). How can I schedule a cron job to do this? will this work? or do I have to write 2 separate cron jobs for this? |
Posted: 06 Apr 2022 01:57 AM PDT I entered the man page of
So, I thought ls -d will display all directories within a given directory. However I entered one directory and tried two different commands:
I do not understand if I am using the option wrongly or if I am misunderstanding its meaning, what is the actual meaning and usage for the |
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