Recent Questions - Unix & Linux Stack Exchange |
- How to set up a variable in .env file and using it in a .conf file
- Fix/Repair Can't find a SQUASHFS superblock
- Extract lines into separate files between two non-empty fields in the same column
- Shared library fetching fails if LD_LIBRARY_PATH isn't exported
- summarize consecutive lines containing identical values in a specific field using sed (or awk)?
- Unix command to cut between strings
- How can sudo be hidden in a command?
- Should nameservers be separated by comma, or semicolon in .config connman files
- wlan0 not showing up on virtualbox in Kali Linux
- Wifi slow when directly connected to router but fast through mobile hotspot
- Mounting anything during gentoo installation breaks everything using official live cd
- Replace var placeholder results in an unwanted new line
- dd command ruining files
- How to escape ANSI format on remote SSH command?
- sed regex fails to capture the entire paragraph containing the pattern
- Fail2ban Regex help for banning sshd connection attempts
- Scripting with find and awk
- How to match pattern in line and insert it after another pattern
- How to enable auto logout in fish shell?
- New command shortcut setting doesn't work
- Is it with GNU parallel possible to split on character count, but provide full lines only?
- I get "Forbidden You don't have permission to access / on this server" every time I log in
- How to filter ARP-Requests with Nftables using a Raspberry Pi as AP (using hostapd)
- What is the command in Awesome Window manager to let go of a key that has not been let go of?
- gpg: keyserver receive failed: No data
- 'inf' in awk not working the way '-inf' does
- Yum does not seem to recognize the $releasever variable in the Centos repos file
- Match touchpad properly in xorg.conf on Dell XPS 15
- How to find the process with maximum file descriptors?
- Find where inodes are being used
How to set up a variable in .env file and using it in a .conf file Posted: 02 Aug 2021 10:32 AM PDT I have a .conf file that has a label and variable that I'm trying to move to a .env file. How can I accomplish this? This is what I have in my .conf file I'm trying to have something like this in the .env file I was hoping I could use but I keep getting this error Am I doing it incorrectly (or is it even possible to do what I'm trying to accomplish)? (Note: I'm trying to accomplish this so I can simply use |
Fix/Repair Can't find a SQUASHFS superblock Posted: 02 Aug 2021 09:56 AM PDT I have an old filesystem backup that I made and compressed into a squashfs. It was stored on an ext4 filesystem, and I suspect it suffered from some bitrot. I don't have a backup of the file. Is there any way I might be able to rescue this filesystem? |
Extract lines into separate files between two non-empty fields in the same column Posted: 02 Aug 2021 10:39 AM PDT I've got a csv Output files based on I'm able to use awk to print lines that have a non-empty first field, but can't figure out how to expand and print subsequent records up to the next non-empty first field: The other aspect of this problem is separating out the results into separate files. One thing I could do is use the matching record numbers to print out lines between the two. Something kind of like this: |
Shared library fetching fails if LD_LIBRARY_PATH isn't exported Posted: 02 Aug 2021 10:36 AM PDT By looking at What's the correct way to set that variable permanently and why it is failing to pick the library even though a EDIT:
|
summarize consecutive lines containing identical values in a specific field using sed (or awk)? Posted: 02 Aug 2021 10:34 AM PDT So far I've been able to get around sed's more advanced features like look-ahead/look-behind across multiple lines but I'd like to understand how tasks like the following can be achieved with sed as I have the feeling that my approach of doing this e.g. within python is not necessary and can also be done within a filter pipeline on cmd. a stripped example of the data coming in is like this: the first columns width is always identical (contains a shortened hash-value) and the second columns content is completely odered, numerical and without gaps (and therefore potentionally unnecessary besides providing orientation on lenghtier lists). the desired output would be either like this (putting the index of the last consecutive occurance into an additional column): or even better with aggregated numbers of repeating values (math expressions (adding) seem to be more easily done with awk but my skills with that are even worse, so this is just to illustrate what other outcomes would be desireable): I tried to follow several similar but yet different questions found across the SO-space but could not wrap my head around possibly simpler parts possibly leading to a solution like why My system has GNU sed version 4.8 and awk version 5.1.0 installed and I'd love to learn how I could use one of them to get this done. And no, this is not homework but lengthy lists of hashes with plenty of redundancy that need to be compacted and compared. ;) |
Unix command to cut between strings Posted: 02 Aug 2021 10:44 AM PDT my file: Output I need is Output I am getting is Command used: |
How can sudo be hidden in a command? Posted: 02 Aug 2021 09:01 AM PDT On linux mint 20+, I don't have to type "sudo apt upgrade". I only type "apt upgrade", the prompt asks for sudo password and the command is executed with elevated privileges. How is that achieved? |
Should nameservers be separated by comma, or semicolon in .config connman files Posted: 02 Aug 2021 08:31 AM PDT I want to create interface-specific config for my Ethernet connection by editing: The docs say that:
but when I manually enter new list of nameservers with: they appear in: as semicolon separated list: Do these two files use different syntax? |
wlan0 not showing up on virtualbox in Kali Linux Posted: 02 Aug 2021 09:02 AM PDT Hello I just installed Kali Linux on a virtual box on a Mackbook pro, and when I try ifconfig it just shows me eth0, eth1, lo, as well when I try iwconfig it tells me no wireless extension. I have internet on the virtual box, but how can I make it to it can shows me the wifi connection. As well on the top right network button it doesn't show me the possibility of wifi connection. |
Wifi slow when directly connected to router but fast through mobile hotspot Posted: 02 Aug 2021 09:36 AM PDT I have had this problem with Mint 18.0 and I installed Mint 20.2 on my laptop hoping the issue would go away. But it hasnt. My mint wifi speed when connected to Home router is around 2mbps where the plan is of 20mbps and I get that 20mbps speed on all the mobile and another windows laptop connected to it. interestingly if I connect my mint laptop to my phone(through hotspot) which is connected to this router I get 20mbps speed on my laptop. I have no idea whats happening or how to debug the issue. Any advice on how to figure out the issue or solutions would be appreciated. If you need any more information, please ask. $ iwconfig $ lspci |
Mounting anything during gentoo installation breaks everything using official live cd Posted: 02 Aug 2021 08:29 AM PDT It doesn't matter what I mount. Even mounting tmpfs (with I'm trying to install Gentoo in a VirtualBox VM, but everything stops working after mounting the the root partition (using
After mounting, even running I tried the ISO from 25.07.2021 and 01.08.2021. I use a GPT partition table and have enabled EFI in the VirtualBox settings. Disabling EFI doesn't help. |
Replace var placeholder results in an unwanted new line Posted: 02 Aug 2021 08:09 AM PDT I wish to replace
Doing
It doesn't even matter what follows the I used I tried a variety of escape slashes, single quotes and double quotes with no result. What's going on here? |
Posted: 02 Aug 2021 07:12 AM PDT I recently was trying to flash from an IMG file with I don't know if I'm being stupid, or if it's a drive error. This is the code I used: |
How to escape ANSI format on remote SSH command? Posted: 02 Aug 2021 08:59 AM PDT I wanted to change the title of the window using the command as described here over SSH, however I kept get getting the error: with the command: No matter how I try to escape them, it seems to somehow return error. Tried: Any idea how to fix this? |
sed regex fails to capture the entire paragraph containing the pattern Posted: 02 Aug 2021 08:13 AM PDT I have this XML file (example) Using the However, it captures only this string: But I try to capture the entire first paragraph between What am I doing wrong here? |
Fail2ban Regex help for banning sshd connection attempts Posted: 02 Aug 2021 08:45 AM PDT This is a tricky questions (for me) I'm trying to setup fail2ban to BAN all connection attempts to my ssh server that don't login. Now, my issue is.. everything, in the file filter.d/sshd.conf. for me it's incomprehensible, jibbrish, I simply can't understand the regex (I can't understand regex at all, and believe me, I've tried) in that configuration file. I want to scan and ban on this line of the log: (since it shows a connection that only connected) Connection closed by 192.168.0.2 port 12210 [preauth] now, as I wrote earlier, I have NO idea how or where to write/put it in the configuration file (didn't want to clog the forum with an standard file) This one so if someone would be so kind of help me what I should write, and where I should put it in the configuration file. And, if possible, explain (or at least try to) what you're doing? |
Posted: 02 Aug 2021 07:18 AM PDT I would like to find the port that a process (for example apache2) is listening on and print only this (tcp) port number to a file, file1.txt.
How can I ensure that only the port number (80), NOT the '*', is my output? Edit by Ed Morton to add the important information the OP provided in a comment: Please note that this sequence from my system: Output is: |
How to match pattern in line and insert it after another pattern Posted: 02 Aug 2021 07:20 AM PDT I have a file with 2 lines I want to transform it like this: so that the string before the How can I do this with |
How to enable auto logout in fish shell? Posted: 02 Aug 2021 09:14 AM PDT A quick google search says I could enable auto logout (for text consoles) by setting a TMOUT parameter. However, I discovered later that this would only work with the bash shell. Is there a way I could set a timer for auto logout if my default shell was fish? What is the purpose? Security, of course. I want it to lock when it's idle for 1 minute. |
New command shortcut setting doesn't work Posted: 02 Aug 2021 09:13 AM PDT I want to modify the command of PrintScreen key to one that takes the screenshoot and ask me the name of the file through a pop up window. From terminal below line did the job: But when I put that command in the keyboard shortcuts, it doesn't work, nothing happens: Note 1: How could I define in the command that saves the screenshot renamed in the Pictures folder?, I couldn't do it. I tried: Note 2: I also notice that using the command I mentioned at the beginning, when I write the name it also takes the first string and the rest is ignored. Let's say I call the pic taken as "Screenshot taken" then the pic is saved only as "Screenshot" Thanks for your help. |
Is it with GNU parallel possible to split on character count, but provide full lines only? Posted: 02 Aug 2021 09:43 AM PDT I would like to split an input file on character count (ASCII is fine), combined with new lines as well. That is, every group of 10000 character should be seen as one record to be piped into the child process, but if that 10000th character does not happen to be at the end of line, the whole line should be included (and thus more that 10000 characters are provided). Each line should be considered as a single entity, which cannot be split. Is that possible with GNU parallel (or possibly with a chain of other tools which might be useful)? |
I get "Forbidden You don't have permission to access / on this server" every time I log in Posted: 02 Aug 2021 10:48 AM PDT I use Arch Linux. Every time I logged on, a browser window popped up on its own showing an error message. I did not open the browser, and I didn't go to the website by clicking a link. The message says
The message looks like this: I don't know what kind of permission I am lacking here (I am new to Linux). |
How to filter ARP-Requests with Nftables using a Raspberry Pi as AP (using hostapd) Posted: 02 Aug 2021 07:40 AM PDT I´m trying to filter ARP-requests coming from certain IP-addresses in my network. I tried : It should drop all ARP-requests not coming from either the router or the laptop. But requests send by my smartphone are still recieved by my laptop. (My Pi acts as routed access point, it is connected to the ISP-Router via ethernet and uses interface wlan for AP function.) Then I tried to use table netdev with ingress hook because (at least in theory) it should resolve first: I also tried to use the hostapd function I use Raspberry Pi OS with kernel version 5.10.17-v7+, hostapd version 2.8-devel, nft version 0.9.6, dnsmasq version 2.80. Could it be, that Hostapd forwards packets to the local network before packetfilter like Nftables are enforced? Or is there something wrong with my ruleset? Or is it something else altogether? |
What is the command in Awesome Window manager to let go of a key that has not been let go of? Posted: 02 Aug 2021 10:17 AM PDT My v key is locked up after I use the below snippet in my BackgroundHotkey combinations are usually all pressed together at the same time. I am using the function key Fn which works as a key chain only because of the way it works with the firmware on my ThinkPad. Key chain means you press the Fn key, release it, then press another key. In other words, key chain keys are not pressed together but sequentially, one after the other. SetupMy Fn key is The following below is part of my This snippet works just fine; I press Fn, release it, then press v and vim opens. Just as intended. ProblemAfter I have used this keychain, Awesome will not let go of the v key and every time after that when I press the v key, for whatever reason, vim opens. This is less than ideal. How to stop this behavior in Awesome? |
gpg: keyserver receive failed: No data Posted: 02 Aug 2021 09:07 AM PDT I am getting this error when I am trying to install gauge framework. Ubuntu: 18.04.3 |
'inf' in awk not working the way '-inf' does Posted: 02 Aug 2021 07:23 AM PDT Given a single column file of numbers, call it The same approach to get the minimum doesn't produce anything But if instead of using Why doesn't |
Yum does not seem to recognize the $releasever variable in the Centos repos file Posted: 02 Aug 2021 08:03 AM PDT I was trying to use yum on a Centos 7 cluster to install a package, and I was getting the following error: I tried several suggested solutions online ( After hours of troubleshooting, I managed to find a workaround. On the So instead of: I have: after which both yum update and yum install seem to work fine. However, I don't know if this is a permanent solution to the issue. Can someone tell me what's going on and if there's a more proper way to fix this problem? Thanks. |
Match touchpad properly in xorg.conf on Dell XPS 15 Posted: 02 Aug 2021 10:08 AM PDT I'm trying to set nice options like tap and natural scroll to my Dell's touchpad. Booting X will detect 2 touchpads, one SynPS/2 Synaptics and one DLL touchpad. The SynPS/2 won't get any xevents, they all go to the DLL touchpad, so I disabled the SynPS/2 one and get the following device list: My `/etc/X11/xorg.conf.d/50-touchpad.conf: When I matched the I also switched the driver from synaptic to the newer libinput - could that cause any problems? |
How to find the process with maximum file descriptors? Posted: 02 Aug 2021 07:11 AM PDT What is wrong with this Why is it executing the output of Or is there another way I can find the process with maximum file descriptors? |
Find where inodes are being used Posted: 02 Aug 2021 09:50 AM PDT So I received a warning from our monitoring system on one of our boxes that the number of free inodes on a filesystem was getting low.
As you can see, the root partition has 81% of its inodes used. |
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