Recent Questions - Unix & Linux Stack Exchange |
- systemd says "networking.service failed" but network is up
- Can I ignore certain irrelevant lines when creating/applying a patch with diff/patch?
- bash: export: `172.17.0.1': not a valid identifier
- xargs-like command templating for argv
- UEFI Grub not finding config file
- Linux report that lowmem region is more than physical memory available?
- docker interface tears down wifi internet
- Cannot make persistant Insertion of a kernel object (debian) using Insmod
- linux sort 'field skip' options not documented, but seem to work
- ViM iabbrev to Automatically Replace consecutive blank lines with a character
- How do I find the config files for any application
- Configure split dns resolver to always use vpn-internal nameserver for fixed list of domains
- How to detect EOF on a BASH script's stdin?
- Why do snapshots consume much less space than the data which is changed after they have been taken?
- Read file accessible only from script in Unix
- Mutt: reply in thread and add message from another conversation
- Can't login with normal user with GUI
- rhel + resolve.conf + what is the right resolve.conf settings
- Use sed to insert text before two blank lines
- OPNSense (FreeBSD) doesn't boot from USB: stuck at "UFS found 1 partition"
- Compare row count of a unix file with trailer count for multiple types of record
- Ubuntu stuck at boot
- Debian preseed: How to force prompt for hostname and domain?
- find and replace "tabs" using search and replace in nano
- Open multiple instances of a given application
- Running sshd in cygwin: "/var/empty must be owned by root..."
- Can I connect a Ubuntu Linux laptop to a Windows 10 laptop via ethernet cable
- How to unzip and dd a disk image to an SD Card with a single command?
- find -maxdepth 0 not returning me any output
- How to print certain columns by name?
systemd says "networking.service failed" but network is up Posted: 04 May 2021 09:48 AM PDT Normally, I run Gentoo with openrc init, but am installing a Debian 10 server and having some trouble understanding systems. The server boots via a custom dracut initrd which created a bonded network interface and then boots from an iscsi root. That part all works fine. There are three interfaces which all come up on boot with their respective networks: 192.168.1.0/24, 10.0.0.0/24, and 172.16.0.0/24. My (small) problem is systemd giving the following information: I assume this largely due to one of the networks being active at init time. In Gentoo, I can mark an interface as not providing the network service. Does systemd have a similar concept or is there a setting that I've missed somewhere? Again, all interfaces are actually up and working appropriately (2 bridges, 1 bond) I've snipped local interfaces and the NICS in the bond and bridges. Thanks in advance for any ideas. |
Can I ignore certain irrelevant lines when creating/applying a patch with diff/patch? Posted: 04 May 2021 09:31 AM PDT File A File B I want to diff A and B to generate a patch that when applied to C will change File C (before patch) File C (after patch) How can this be done? |
bash: export: `172.17.0.1': not a valid identifier Posted: 04 May 2021 09:22 AM PDT Why my terminal have this? When I open my terminal then it appear. How to remove it? |
xargs-like command templating for argv Posted: 04 May 2021 09:14 AM PDT Is there a common utility that is sort of like For example, something like: I've considered:
Use case is just when there's very little manipulation of arguments to be done, so it would avoid creating a script for each invocation; or interactive use. |
UEFI Grub not finding config file Posted: 04 May 2021 09:06 AM PDT I need to boot Windows and two other Linux distors using Grub. So, I have installed Grub on UEFI partition with a dedicated partition for storing the files used by Grub using the following command.
However upon booting Grub is seemingly unable to find the grub.cfg file I placed at Here are some of my files I feel like there is some trivial mistake I am making, but I have spent too much time on this. |
Linux report that lowmem region is more than physical memory available? Posted: 04 May 2021 08:53 AM PDT I'm running Ubuntu |
docker interface tears down wifi internet Posted: 04 May 2021 09:01 AM PDT I see this problem on my laptop: when I I don't know how to troubleshoot this, I see I have 2 network interfaces relevant to this issue:
As soon as the network I/O starts on the network interface I see this networking configuration in Docker: When using I don't need to do In In this file If I restart NetworkManager with This issue happens to me with a variety of Linux Ubuntu/Debian versions and Docker versions, anyway my current setup is: I read this page a few times https://docs.docker.com/network/bridge/ and I think my Docker Bridge is working, because when I run these Docker containers on my laptop they are able to reach the Internet. However that documentation on the Docker website is a bit dry and I am not sure how to deeply troubleshoot these networking issues.
|
Cannot make persistant Insertion of a kernel object (debian) using Insmod Posted: 04 May 2021 08:48 AM PDT I'm trying to insert the [.]Ko (Kernel Object) file for the on-board GPIO into my Linux kernel which succeeds using the command insmod < file-name.ko > But when the OS/Device Reboots, the kernel no longer has the mod inserted (checking using lsmod). I have also tried placing it in /lib/modules/4.19.0-14-amd64/kernel/drivers/gpio and running the "sudo update-initramfs -u" to update boot init but didn't work. Is there any way to insert a kernel module permanently (sustains reboot)? P.S. I don't want to use "@reboot insmod" in crontab. Using a Debian GNU/Linux 10 (buster) |
linux sort 'field skip' options not documented, but seem to work Posted: 04 May 2021 08:36 AM PDT I was porting over a script from AIX to linux that had code of the form On AIX, this kind of sort syntax is documented, and basically the +a -b syntax means skip a fields and consider fields between a and b as your sort key. This didn't work on linux, because the linux sort command didn't like including the 'rn' (reverse numeric) flags in the +a 'skip fields' parameter. but this did work: So apparently the 'field skipping logic is supported by linux sort, but not documented in the man page (that I could see, anyway). the -k option works on both systems to specify a key field number. But here's a weird quirk. On AIX produces a list of files sorted on the 5th field (size). But on linux, the same command produces an error: sort: cannot read: +4: No such file or directory does work, though. So, apparently the + skip - skip key-selection syntax sort of works, but only if you specify both the starting and ending column skip parameters. And it's not documented. So, my question - is this column skipping syntax deprecated? Does it just work because the code was just there in the command and nobody knew to take it out? |
ViM iabbrev to Automatically Replace consecutive blank lines with a character Posted: 04 May 2021 08:05 AM PDT I was just wondering if it's possible to create a ViM rule for the following scenario. If I am editing a file is it possible for iabbrev to detect a second blank line and insert some character or string into that lines place? I really hope this makes sense |
How do I find the config files for any application Posted: 04 May 2021 08:19 AM PDT I ran into this problem multiple times now. You have to log into a server you don't know and have to find where an application is installed and where its config files are. I know that most application configs are in /etc/... e.g. /etc/nagios/nrpe.cfg But knowing is not reliable. How can I find them guaranteed? And what is a good way to inspect and study the configs? Most applications allow for other files to be included so the configuration can be split into multiple files which takes ages to write down all the files' locations and look at all of them individually which gets even worse if the structure is cascading. |
Configure split dns resolver to always use vpn-internal nameserver for fixed list of domains Posted: 04 May 2021 07:39 AM PDT What's the most reliable configuration to have a fixed list of internal domains always resolved through an internal nameserver, even if it's unreachable because the vpn is down, while still using the default nameserver for everything else? The connection is established by NetworkManager after selecting the appropriate interface or network in KDE (or another desktop environment). This question is specifically about defining a static list of vpn domains because:
There are similar questions on this site, usually without the requirement of not leaking queries, as well as on other sites. For example, an article on gnome.org seems to address the split dns question under "My Corporate VPN is Missing a Routing Domain, What Should I Do?", but it expects all internal domains to be set by the vpn client and states:
Having to use such a command does not seem like a reliable configuration. And DNS queries shouldn't be leaked if the connection is lost for a moment. The article continues with:
What if you do? The scenario shouldn't be too uncommon, there must be at least one standard solution. For the record, this dnsmasq config was tried but it doesn't fulfill the requirement of defaulting to the standard nameserver provided by DHCP:
In Add a symlink to the config directory used by NetworkManager pointing to the config file that would be used when starting dnsmasq directly using However, as explained above, this configuration is not completely correct. |
How to detect EOF on a BASH script's stdin? Posted: 04 May 2021 09:24 AM PDT I have a bash function inside a script that needs to read data from stdin in fixed size blocks and send those, one at a time, to external programs for further processing. The function itself should run in a loop for as long as there is data (the input is always guaranteed to be a whole number of blocks), but it doesn't otherwise need to interpret the data, so i'd like to have a way to detect EOF on the function's stdin without consuming data in case there is still some to process. The apparently natural way to do this would be to use the
The So, is there a better way, preferably using only bash builtins? |
Why do snapshots consume much less space than the data which is changed after they have been taken? Posted: 04 May 2021 07:51 AM PDT Although I am using ZFS since quite a while, I am still failing to understand some aspects of it from time to time. Currently I am trying to understand how ZFS snapshots take up space on the disk and why that space is much smaller then I would expect. My problem is best explained by an example. I have a VM running from a ZVOL with no compression ( So far, so good. The worrying thing is: For example, after having taken the next-to-last snapshot, I have copied about As a second, more extreme example, that VM ran about seven hours after I had taken snapshot I have found a weird way to see how much data has actually changed after a snapshot has been taken: We can "simulate" sending the snapshot by something like the following command line (command on the first line, output on the following two lines): ( Here we see that incrementally sending the last snapshot based on the next-to-last snapshot would take approximately Could anybody please give an explanation? P.S. I already have read several articles about how to interpret |
Read file accessible only from script in Unix Posted: 04 May 2021 08:52 AM PDT I have written a Base shell script that needs password/key which is retrieved from a file. Base Script---Calls---Key/Password File ---Base Script does further authenticates using the key retrieved Requirements:
Any other suggestions to use password/key not visible to anyone but configurable in script is welcome Note: I tried the sudoers approach but still no success
|
Mutt: reply in thread and add message from another conversation Posted: 04 May 2021 07:25 AM PDT I'm using mutt. There are two different e-mail threads (A and B) and I'd like to forward a single message from thread B to thread A. I could enter thread B and forward said message to the correspondents of A, but that would start a new thread C. How can I reply within conversation A and attach the message from B, so the thread stays intact? |
Can't login with normal user with GUI Posted: 04 May 2021 08:16 AM PDT I tried to log in to my user through my gnome desktop manager with valid credentials. It doesn't tell me "you have bad credentials", it just doesn't let me in. I can log in with the root user and I created another user and I can log in with that too, but not this user. It leads me to a blank screen with a cursor blinking in it and after 5 to 7 seconds I get back to the part where I should enter my username.
my I also set another user home folder to my special users (the one that I can't log in with) home folder, and I can't log in to that user either, so I guess there is a problem with my home folder and configs inside. The other direction doesn't work -- if I set my special user home folder to another user home folder I can't log in. What is wrong here? |
rhel + resolve.conf + what is the right resolve.conf settings Posted: 04 May 2021 09:20 AM PDT we want to know what is the right configuration in in our rhel 7 server we configured the following example of but we can also set the following or to set as the following without so we are little not sure what is the right resolve.conf settings ( option 1 or option 2 or option 3 ) option 1 option 2 option 3 reference https://www.distributednetworks.com/redhat-linux-admin/module4/usingDns-resolve.php |
Use sed to insert text before two blank lines Posted: 04 May 2021 09:23 AM PDT I'm trying to use sed for updating a commented config file. Rather than tacking everything at the EOF, I'm trying to keep things sectioned off. My config looks something like this. I'm trying to insert lines at the end of section one, but I'm having a hard time writing a search pattern since it won't allow "\n" and you can't have multiple "^$" in a pattern. I'd like something like the following: I'm open to other suggestions as well, but I'd like to keep it to a single line if possible. This is part of a much larger script. I know this is pretty easy with Python, Perl, etc., but I'm trying to keep this to a "shell" solution. |
OPNSense (FreeBSD) doesn't boot from USB: stuck at "UFS found 1 partition" Posted: 04 May 2021 09:06 AM PDT I'm trying to boot OPNSense (the amd64 VGA image, 21.1, from https://opnsense.org/download/) from USB. The machine is fairly new (to me), but I've seen
Nevertheless, OPNSense gets stuck right away, right after boot: ... I've also dd'd all of it onto the USB stick another time in case it's a few bits of corruption (no). Any ideas how to start debugging this? Update: it's most likely just a bad UEFI implementation; switching over to MBR boot is a workaround that happened to work well. |
Compare row count of a unix file with trailer count for multiple types of record Posted: 04 May 2021 07:28 AM PDT My file has multiple headers and multiple record types (eg. 0001, 0002, 0003, 0004). Count is given for each record type in the trailer row along with overall detail record count. Sample File: File details: Requirement: Expected output : |
Posted: 04 May 2021 09:45 AM PDT My Ubuntu 20.04 is stuck at the boot. The screen becomes black and the only visible thing is a small underscore on top. I cannot enter the command line. I think I might have screwed something with systemd. Any suggestions? |
Debian preseed: How to force prompt for hostname and domain? Posted: 04 May 2021 07:50 AM PDT I have a preseed file which works perfectly in that the install goes from start to finish fully automated without prompts. However, I want to force a prompt for hostname and domain. I have tried adding: However the installer just ignores this and I end up with a system with the default
If it makes any difference, this question relates to Debian 10. |
find and replace "tabs" using search and replace in nano Posted: 04 May 2021 08:53 AM PDT How can I search and replace horizontal-tabs in nano? I've been trying to use ...just been using |
Open multiple instances of a given application Posted: 04 May 2021 08:57 AM PDT I am using Ubuntu (Ubuntu 16.04.4 LTS 64-bit) with the Gnome desktop environment. My issue is that in the Activities menu, when searching for and selecting certain softwares (like I'm guessing it is a configuration setting in a a file like (Interesting to note that, I am able to open a new window of a given application if that one contains an option to open a new Window itself like Firefox or VS Code) Does anybody know the answer ? |
Running sshd in cygwin: "/var/empty must be owned by root..." Posted: 04 May 2021 09:01 AM PDT I installed OpenSSH on my Windows 7 system so I could tunnel my VNC into it from my Arch machine. However, when I run This is the output of the I've tried a few of the permissions fixes and rebooted and reinstalled OpenSSH (by running How do I fix this error? Thanks! |
Can I connect a Ubuntu Linux laptop to a Windows 10 laptop via ethernet cable Posted: 04 May 2021 08:08 AM PDT I have seen people connect two computers with an Ethernet cable, but the instructions I've seen were for Windows to Windows or Mac to Mac or Windows to Mac. I never came across any for connecting Windows to Linux. Is it possible to connect a Windows system to a Linux system via Ethernet cable? |
How to unzip and dd a disk image to an SD Card with a single command? Posted: 04 May 2021 09:51 AM PDT I am under the following restrictions:
Is it possible for me to write the image to the SD card under these restrictions? I know it's possible to pipe data through |
find -maxdepth 0 not returning me any output Posted: 04 May 2021 08:42 AM PDT I am trying to understand how to use I have the below directory structure. Now, I execute my With none of the above From man page of
I searched for some examples with My Can someone please provide me some pointers on which cases EDIT When I execute the below command, I get the file1 getting listed twice. Is this intended to work this way? |
How to print certain columns by name? Posted: 04 May 2021 07:34 AM PDT I have the following file: I want to print just the However, this requires knowing the column numbers. Is there a way to do it where I can use the name of the column (specified on the first row), instead of the column number? |
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