Recent Questions - Unix & Linux Stack Exchange |
- Parsing for specific information
- Cannot login to running libvirt virtual machine from qcow2 cloud-init image
- Is it possible that BalancerMember retries connection?
- quickly tar/zip/group 15mil files into one for archival purposes
- Copying file between machines without uploading my private key
- Managing ssl ciphersuites in Linux
- sudo apt-get update Error writing to output file - write (28: No space left on device) [IP:]
- Fetch partial data from JSON Format data by jq
- Is there any reason why /proc/*/cmdline is world-readable?
- Change restart settings based on ExecCondition
- Systemd service echo and ping does not work on startup
- Unable to change mouse sensitivity
- Connecting Linux to Yaesu FT3D via bluetooth for audio
- VNC too many authentication failures error - Fail2ban
- How to set NoAccel to disable i915 GPU from Xorg.conf (to avoid GPU hang)
- tar fails on symlinks when called as python subprocess
- GNU tar's "transform" option behaves inconsistently when pattern ends in "/"
- Stream video with ffmpeg to icecast?
- iptables-block-all-inbound-and-outbound except dns(port 53), teamviewer port(5938) and my server ip (port 80)
- Bash: How can I replace a string in a previous command?
- How to make grub-mkconfig work on a usb device?
- Test integrity of ZIP file?
- Give server access to Internet, via client connecting by SSH
- Is it safe to add . to my PATH? How come?
- Bash script that reads filenames from a pipe or from command line args?
- How can I detect when a monitor is plugged in or unplugged?
- How do I change folder timestamps recursively to the newest file?
Parsing for specific information Posted: 18 Oct 2021 11:06 AM PDT I run a command on my linux system and redirect the output into a file. Here is what my file looks like: I want to extract the client hostnames that show only a connection to Purple and clients with no connections into a new file. I have had some success getting all of the non-relevant information out using the following: I have not been able extract just those clients with a connection to purple or no connection. I want to omit everything that has a connection to Green only. |
Cannot login to running libvirt virtual machine from qcow2 cloud-init image Posted: 18 Oct 2021 10:48 AM PDT I'm running Arch Linux and I would like to install a qcow2 cloud image of Arch in a vm using libvirt similar to the method described here: How to create VM using the qcow2 image file in KVM - nixCraft. I have never used cloud-init images or libvirt before. The problem I'm having is that I cannot ssh into the domain (vm). Also, I cannot login via the console. Here are my full steps. I started by checking my hardware: It seems to meet the requirements, so I proceeded with the installation as follows: And I did the initial basic setup: I downloaded a cloud-init image from: https://mirror.pkgbuild.com/images/latest/ Specifically, I downloaded Arch-Linux-x86_64-cloudimg-20211001.0.qcow2 I checked the basic libvirt functionality: I made my user-data and meta-data text files following the outline given at the link above. meta-data contents (changed to reflect that I'm installing Arch, not rhel8): cloud-config contents: I made those two files into an iso image: I created a base image and an image to hold the changes: Then I ran this command (and I guessed at some of the parameters, like the network and graphics): As stated, the problem I'm having now is that I cannot ssh into the domain (vm). Also, I cannot login via the console. Here are a few things I checked: SSH is asking for a password when I try to ssh into it. This made me wonder if the customizations in my cidata.is (user-data) were applied, but it seems maybe they were from this domstats output: If that info was applied, I should be able to ssh into the domain without a password, but I can't. Checked a few more things: And I don't see any log messages here: |
Is it possible that BalancerMember retries connection? Posted: 18 Oct 2021 11:33 AM PDT We are using apache2 Proxy balancer and we have setup like this: Is it possible to setup this balancer to retry connection to http://127.0.0.1:5033 and does sleep for 10 seconds or so each time it fails to connect. Sometime like try sleep for 10 seconds after each attempt to connect? |
quickly tar/zip/group 15mil files into one for archival purposes Posted: 18 Oct 2021 09:11 AM PDT i have a backup directory on a corp nas that contains something like 15million + files - large corporation 365 back up i need to migrate all this into s3 then glacier - going by individual files the transfer would have taken something like 81 days - so i figured i'd batch all the files into a tar and the split the tar in 500mb chunks - since its deep storage it won't need to be access - and it will only have to move larger files instead of each transaction for a 30kb file currently i'm just straight - is there a quicker way to batch all these up - i don't care about compression - just want it done quickly - presently its been going for three days and i'm only at 600gb i'm doing this on a synology nas - so its not a powerhouse of a machine |
Copying file between machines without uploading my private key Posted: 18 Oct 2021 09:41 AM PDT I have SSH access to two machines which I want to copy a big file between them. I also have |
Managing ssl ciphersuites in Linux Posted: 18 Oct 2021 09:18 AM PDT Are the ciphersuites and encryption protocols allowed by an application managed only at the application, or can they be managed at the OS level? Note: My experience with ssl is at the application level, not the os. I have a vulnerability report stating that a particular app supports insecure cipher suites and deprecated protocols. I spoke with the application owner and he states that we should be able to disable all of this at the OS level. So, I'd like to confirm: Can these be managed at the OS level, or are they managed at the application level? I have my thoughts, but I'd like to hear from those who know more about this than I do and get an idea of best practices. Thank you! |
sudo apt-get update Error writing to output file - write (28: No space left on device) [IP:] Posted: 18 Oct 2021 10:14 AM PDT I am not a linux admin by no means and I cant seem to figure this one out. So I am ultimately trying to perform an update but running into a
NOTE: This is a new install of linux and the I have performed Although I do not fully comprehend what these files are I have used disk analyzer and have found that the following file paths are full or nearing at capacity for memory: Here is the lnode output for reference: Is there something I am not seeing? I am unable to update or install anything currently because of this issue. What can I do to fix these space issues? UPDATE: So this just happened when I tried to reboot my machine let me know if this is clear. I am unable to get to terminal. It does not respond to my key commands. |
Fetch partial data from JSON Format data by jq Posted: 18 Oct 2021 10:38 AM PDT I have a sample JSON format data I want to get partial data and construct another json FORMAT Like I have tried this command (I have saved sample data to json.data) It didn't work I wonder to know the correct cli command to get what I want Thanks very much |
Is there any reason why /proc/*/cmdline is world-readable? Posted: 18 Oct 2021 10:37 AM PDT Maybe I haven't had enough coffee yet today, but I can't remember or think of any reason why Making it readable only by the user (and maybe the group. and root, of course) would prevent casual exposure of passwords entered as command-line arguments. Sure, it would affect other users running |
Change restart settings based on ExecCondition Posted: 18 Oct 2021 08:48 AM PDT I have a bunch of services that have the same service file that changes based on the parameter. Something like this: The application ran in Is there any way not to restart if systemd 245 (245.4-4ubuntu3.2) |
Systemd service echo and ping does not work on startup Posted: 18 Oct 2021 10:48 AM PDT I created a simple oneshoot systemd service file on a Raspberry Pi which starts up on boot and logs a specific journal namespace and some dmesg locally to a file. Executing the script locally as a test seems to work, but the automatic start has issues and does not work at all. test.service The system is rather simple, there is not much going on. Only root user is there. One temperature logger, which logs to journal and has a LogNamespace=temp_logger also starts with the system. I did not put it in the dependencies or somewhere else. Now when I execute the file test.sh with this content: It seems to work fine. No errors, nothing. Looks good. If I enable the service with The directory didnt get created and the log files are not there. (I deleted the ones from the test) When checking with When I modify all calls from However, the journal log seems not to work. The files are there but have no content (size 0) What exactly goes wrong there? Why do I need to give the absolute path to binaries ? Why does the journalctl not work? |
Unable to change mouse sensitivity Posted: 18 Oct 2021 09:16 AM PDT System: Debian 11 Bullseye There is only an acceleration slider in the mouse settings (acceleration only). And no acceleration profile or mode flags in xinput. Acceleration flags i have: If I disable acceleration with xinput, I can't be able to change the sensitivity at all. Changing the DPI is not an option. I have several different mouses - same result. xset output: |
Connecting Linux to Yaesu FT3D via bluetooth for audio Posted: 18 Oct 2021 09:40 AM PDT I'm looking to connect my Yaesu FT3D ham radio to a Linux laptop via bluetooth. I understand it only does audio over bluetooth, but for my use case that's acceptable. My end goal is to run With no PTT control I'll be limited to either RX only, or using VOX. So how do I do this? I assume there's a series of commands that will make it show up like a sound device on Linux? |
VNC too many authentication failures error - Fail2ban Posted: 18 Oct 2021 10:48 AM PDT On a Debian 11 server with Xtightvnc, I am getting a lot of "too many authentication failures" messages. I would like to put fail2ban to block unauthorized users who try to login into my server via VNC. But I can't find a rule that works. The rules I find are old and don't work with the log. I'm using iptables to release only my access ip, but I don't want this solution. |
How to set NoAccel to disable i915 GPU from Xorg.conf (to avoid GPU hang) Posted: 18 Oct 2021 09:14 AM PDT I'm running Ubuntu on a new system with a GPU that uses the i915 kernel module. Unfortunately several times a week the gui crashes and dumps me to a terminal. I'm working on diagnosing the problem, but that's not my question today. Today I simply want to disable Xorg from using the GPU at all, so I can use Xorg without crashing. (I tried kernel parameter I read from the ArchLinux wiki that sometimes GPU hanging can be solved by setting There's some missing explanation, however. I think I should add this by creating a file under |
tar fails on symlinks when called as python subprocess Posted: 18 Oct 2021 09:08 AM PDT After upgrading my debian from buster to bullseye, my yocto build process fails in ( Unfortunally, I can't reproduce the error executing directly. This does not give any error. Just when executed as a |
GNU tar's "transform" option behaves inconsistently when pattern ends in "/" Posted: 18 Oct 2021 09:46 AM PDT I have come across the following strange behavior of GNU To reproduce:
As you can see, the directory itself is not renamed correctly, although the renaming works for all files within the directory.
Now, the directory itself is correctly renamed. The behavior doesn't change when the
So it really seems that the trailing |
Stream video with ffmpeg to icecast? Posted: 18 Oct 2021 10:04 AM PDT Is there a simple way to stream video with ffmpeg into icesast? Source video is in But stream is not playable and connections cause ffmpeg to terminate with following error: Involving anything besides ffmpeg is fine, I just want it to work. |
Posted: 18 Oct 2021 11:09 AM PDT I´m trying to block all traffic using
At the moment I have these lines of code, but it is not working as I need: Teamviewer won't connect, nor the name resolution works, adb doesn't connect either. There is something wrong there, don't really know what. Only thing working is the connection to my own server if I hardcode the domain at Can one of the |
Bash: How can I replace a string in a previous command? Posted: 18 Oct 2021 10:19 AM PDT I need to replace a word in line or URL but I need to do it from command line/terminal. I mean Now from there, without going back, I need to replace |
How to make grub-mkconfig work on a usb device? Posted: 18 Oct 2021 09:04 AM PDT AFAIK I want to run the commands on a usb drive, but
How can I do either of them? BTW I am using manjaro KDE |
Posted: 18 Oct 2021 08:58 AM PDT Near as I can tell the zip -T option only determines if files can be extracted -- it doesn't really test the archive for internal integrity. For example, I deliberately corrupted the local (not central directory) CRC for a file, and zip didn't care at all, reporting the archive as OK. Is there some other utility to do this? There's a lot of internal redundancy in ZIP files, and it would be nice to have a way of checking it all. Of course, normally the central directory is all you need, but when repairing a corrupted archive often all you have is a fragment, with the central directory clobbered or missing. I'd like to know if archives I create are as recoverable as possible. |
Give server access to Internet, via client connecting by SSH Posted: 18 Oct 2021 09:05 AM PDT I can use my home computer A to connect by SSH to a server B where access to the external network is blocked. In other words, all requests to Internet from B throw an error: Network is unreachable. Can I redirect all these requests to pass through the computer A which has an unrestricted access to Internet? Server B is a server which hosts one of my website. I want to download files in order to install some software. But the connection is blocked. I was able to transfer files but it was complicated because the software versions are different on A and B, so the dependencies where different and it required different files on A and B. I searched on Internet and it seems that I need a reverse tunnel. But I only found solutions where a port is redirected. But it's not what I need since I don't want B to access to A but to Internet. |
Is it safe to add . to my PATH? How come? Posted: 18 Oct 2021 09:07 AM PDT I've seen people mention in other answers that it's a bad idea to include the current working directory (' So, why shouldn't I add |
Bash script that reads filenames from a pipe or from command line args? Posted: 18 Oct 2021 10:44 AM PDT I want my script to read a bunch of filenames (which may have spaces) given either as a glob or from STDIN and do stuff with them. I've been able to read either way separately, but not combine them. This reads globs from the command line: And this reads from STDIN: What I really want is to read from either one into an array so I don't have to duplicate my entire EDIT: I think the best thing would be to read from args if they're given, and otherwise wait for EDIT: OK, the problem isn't what I thought it was. The problem is that process_file also asks for user input. Is there are way to read from |
How can I detect when a monitor is plugged in or unplugged? Posted: 18 Oct 2021 09:26 AM PDT Is there any event that is triggered when I plug in or out an external monitor into the DisplayPort of my laptop? ACPID and UDEV don't react at all. I'm using onboard graphics on an intel chip. Here is a similar discussion which is already a couple of years old. I don't want to use polling but I need to have some configuration that set's the display settings automatically depending on if the display is connected. |
How do I change folder timestamps recursively to the newest file? Posted: 18 Oct 2021 09:05 AM PDT I was wondering if anyone knows how to change the timestamps of folders recursively based on the latest timestamp found of the files in that folder. So for example: jon@UbuntuPanther:/media/media/MP3s/Foo Fighters/(1997-05-20) The Colour and The Shape$ ls -alF total 55220 drwxr-xr-x 2 jon jon 4096 2010-08-30 12:34 ./ drwxr-xr-x 11 jon jon 4096 2010-08-30 12:34 ../ -rw-r--r-- 1 jon jon 1694044 2010-04-18 00:51 Foo Fighters - Doll.mp3 -rw-r--r-- 1 jon jon 3151170 2010-04-18 00:51 Foo Fighters - Enough Space.mp3 -rw-r--r-- 1 jon jon 5004289 2010-04-18 00:52 Foo Fighters - Everlong.mp3 -rw-r--r-- 1 jon jon 5803125 2010-04-18 00:51 Foo Fighters - February Stars.mp3 -rw-r--r-- 1 jon jon 4994903 2010-04-18 00:51 Foo Fighters - Hey, Johnny Park!.mp3 -rw-r--r-- 1 jon jon 4649556 2010-04-18 00:52 Foo Fighters - Monkey Wrench.mp3 -rw-r--r-- 1 jon jon 5216923 2010-04-18 00:51 Foo Fighters - My Hero.mp3 -rw-r--r-- 1 jon jon 4294291 2010-04-18 00:52 Foo Fighters - My Poor Brain.mp3 -rw-r--r-- 1 jon jon 6778011 2010-04-18 00:52 Foo Fighters - New Way Home.mp3 -rw-r--r-- 1 jon jon 2956287 2010-04-18 00:51 Foo Fighters - See You.mp3 -rw-r--r-- 1 jon jon 2730072 2010-04-18 00:51 Foo Fighters - Up in Arms.mp3 -rw-r--r-- 1 jon jon 6086821 2010-04-18 00:51 Foo Fighters - Walking After You.mp3 -rw-r--r-- 1 jon jon 3033660 2010-04-18 00:52 Foo Fighters - Wind Up.mp3 The folder "(1997-05-20) The Colour and The Shape" would have its timestamp set to 2010-04-18 00:52. |
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