Recent Questions - Unix & Linux Stack Exchange |
- Comparing two directories based on inodes
- Debian Buster Freezing when Compiling Large Project
- How to migrate an existing Btrfs subvolume to *systemd-homed*
- How to extract columns by names from CSV file
- GPG key generation
- Is there any good documentation on sysfs?
- How to show the output for the execution for any command and/or script in stdout and file but keeping the color in the stdout?
- Different desktops (Gnome Classic vs. Gnome Shell) depending on local vs. remote login
- How to prevent rsyslog from logging cron tasks to /var/log/syslog using additional config
- Manjaro: Steam controllers are not detected wirelessly making them not able toconnect
- Can't connect to postgres using a URI, but can connect with psql -U
- What are difference between -bash and bash?
- How to explain all details with 'ls' command on freebsd and what color means?
- apt errors not installing
- I can run only commands which produces output less than 25 line in centos
- Why does the command echo `echo \\\\\\\z` in bash script print \\z instead of \\\z?
- Installing Sublime Text with apt fails due to missing public key
- Conditional dependencies in `debian/control` file
- How do I add a different prefix to each line?
- How to add ip rule after dockerd is up?
- Get an accellerated X11 driver for "XGI Z7" GPU under Alpine Linux v3.14?
- Tarring files with mtime after a date and with grep
- Writing the data to CSV file
- Add JSON objects to array using jq
- zsh testing existence of a key in an associative array via indirect expansion
- can't change value in smp_affinity
- The "proper" way to test if a service is running in a script
- Issue in running sudo visudo command?
- Location of Wifi SSID configs and how to make a hotspot in Ubuntu 14.04
Comparing two directories based on inodes Posted: 07 Aug 2021 09:56 AM PDT A bit of context that I think is relevant for the appropriate solution: I have a server that has two folders; one is ingest, the other is sorted. The source of the sorted folder is the ingest folder, all directories are unique, all files are hard links. The result of this is that when the ingest folder has a file deleted, it stays in the sorted folder, and vice versa. This makes cleanup almost impossible, as there are hundreds of thousands of files totaling about 40 terabytes. I have a script to add all links to a database, with their inode and path name. I can then use some SQL to find the inodes that only appear once, and decide whether or not I want to delete them. This solution is very slow (need to refresh the entire database every time I want to manage it) and quite clunky (need to run the query, then manually delete files over CLI). Is there a solution like ncdu or any dual-pane file browser that can show inodes, and filter specifically on number of links for the inode (as shown by |
Debian Buster Freezing when Compiling Large Project Posted: 07 Aug 2021 09:48 AM PDT I've recently begun encountering an issue when attempting to compile a moderately large software project where my entire computer freezes. I can't get to another tty, I can't move the mouse. After some experimentation, I was able to replicate this freezing with other compilers and large projects so I don't suspect this issue is particular to my code or compiler. From what I can tell, the issue does appear to occur primarily when some other software (either a IDE linter, browser, etc.) is also taking up a fair amount of CPU. I've run Having looked into various potential fixes online related to memory, but none of the below seemed to work:
At present, I'm simply at a loss for what to do. I'm not even sure of what logs I can check or ways I can know the true cause of the unresponsiveness. Any and all assistance would be much appreciated. |
How to migrate an existing Btrfs subvolume to *systemd-homed* Posted: 07 Aug 2021 09:42 AM PDT Correct me if I'm wrong, but it appears to me that Linux is migrating to systemd-homed to manage home directories. My home directory is on a Btrfs subvolume. I see that homectl mentions that Btrfs subvolumes are supported. Is there any method to migrate an existing Btrfs subvolume to systemd-homed? On Converting Existing Users to systemd-homed I only see a method to copy paste the entire home directory. This isn't quite ideal, since:
So I'm wondering if there's a more direct way to migrate, without copying any files. |
How to extract columns by names from CSV file Posted: 07 Aug 2021 09:53 AM PDT I Have over 150 CSV files with inconsistent columns on Linux. I need to extract specific columns by names ( in case they exist) from each file e.g.,: name, mobile, email into a new file. So, the goal is to have one CSV file out of these 150 files with the following order: name, mobile, email |
Posted: 07 Aug 2021 09:22 AM PDT I'm following a tutorial about gpg key creation in order to build a signed Ubuntu repo: does not generate a Then those keys are put in their perspective keyrings and I can export them. However, from what I've seen those keys are ASCII-encrypted and in the *.pgp format. I would like to know what's going wrong with the first command (why does it not generate a key file) and what's the difference to the second command and exporting them later. |
Is there any good documentation on sysfs? Posted: 07 Aug 2021 09:49 AM PDT I'm looking for good documentation for sysfs; the man page is incomplete and even has one sentence that just stops half way through. I've found the Linux kernel documentation but that's a little bit too geared towards programmers as opposed to administration. If anyone can suggest a good source I'd be grateful. |
Posted: 07 Aug 2021 08:17 AM PDT For some commands, in the terminal they print with some colors in the stdout, for example: Note: it applies for scripts that contain:
Therefore the following is possible: Until nothing is new and all work how is expected, therefore:
So if any of them print in the terminal (stdout) some colors, it is the default behavior according each command/tool Now if I want see the output in the terminal (as above) and write it to some file, according with: Therefore is possible do in general And it works how is expected, but the output in the terminal (stdout) does not include the colors anymore. Question:
Same behaviour when the pipe and Note I did do a research about the but it overrides the I need a general approach, it for any command and/or |
Different desktops (Gnome Classic vs. Gnome Shell) depending on local vs. remote login Posted: 07 Aug 2021 08:19 AM PDT If I log in to RHEL 8.4 on my office PC locally the following setting in i.e. I have the Gnome Classic desktop there. If I log on from remote via RDP/Xvnc from a Win 10 PC I still get the Gnome Shell desktop. How can this be if it is the same user in both cases? How to activate Classic Shell at remote logon, as well? |
How to prevent rsyslog from logging cron tasks to /var/log/syslog using additional config Posted: 07 Aug 2021 08:17 AM PDT I have a Docker image for cron tasks. Here is the Dockerfile: By default rsyslog logs cron to /var/log/syslog. I want to log cron to a separate file /var/log/cron.log. rsyslog's master config /etc/rsyslog.conf has the following lines: I want to disable logging cron to /var/log/syslog and enable logging it to /var/log/cron.log by adding one more config /etc/rsyslog.d/02-cron.conf: But the result is that cron logs to both /var/log/syslog and /var/log/cron.log. |
Manjaro: Steam controllers are not detected wirelessly making them not able toconnect Posted: 07 Aug 2021 07:58 AM PDT I have fresh install of Manjaro linux and installed steam client. I have stem controller dongle plugged in the PC. When I turn on the steam controller it blinks as it is unconnected. After something like minute it turns it self off. When I open big picture mode and go to settings > controller and turn the controller on, it will not show in controller list. The steam is totally unable to detect it. I tried making it did not work. So I made when I run When I connect controller via USB it works but only inside steam client in big picture mode. I remember I could control cursor outside of big picture mode few years ago using steam controller. Maybe this is some lead. How can I fix this so I would be able to connect steam controller wirelessly and outside of steam client ? Thank you for help |
Can't connect to postgres using a URI, but can connect with psql -U Posted: 07 Aug 2021 07:48 AM PDT I'm trying to set up a simple web server on digital ocean and I'm having trouble connecting to the database with sqlalchemy using a URI. Running fails but running passes. As far as I can tell my pg_hba.conf file allows local ip connections: Doesn't the line mean accept ipv4 connections on local host with password using md5? I imagine I could add the machine's ip to the top list of external ips and route my connections through that but that seams like a Bad Idea™ Does anyone have any debug tips or suggestions? |
What are difference between -bash and bash? Posted: 07 Aug 2021 07:18 AM PDT When I log in as But when I do the same thing as user Now what are difference between -bash and bash? |
How to explain all details with 'ls' command on freebsd and what color means? Posted: 07 Aug 2021 07:21 AM PDT I am trying to clone directory with This is what I am abserving with I.e. copied file is indicated with different color. But the textual representations of both files are identical. What is the difference and how to show it with |
Posted: 07 Aug 2021 09:11 AM PDT I am currently trying to install This output also appears when running other |
I can run only commands which produces output less than 25 line in centos Posted: 07 Aug 2021 07:11 AM PDT I am connecting to a centos server with ssh and try to execute some commands. But if this commands output is bigger than 25 line, it fails and I can't do anything else in this ssh session. Is there any limit for terminal output? For example ifconfig>>output.txt -> There is no error in this command ifconfig-> This command fails and ssh session drop after some time. I can establish another ssh session and run executable commands during ssh drop time. If there is a limit for terminal output, how can I change this? Thanks in advance. |
Why does the command echo `echo \\\\\\\z` in bash script print \\z instead of \\\z? Posted: 07 Aug 2021 08:16 AM PDT The command is from this book , I don't understand why it prints when it get executed via the bash script. I think it should print |
Installing Sublime Text with apt fails due to missing public key Posted: 07 Aug 2021 07:29 AM PDT I am using these instructions to setup apt to install sublime-text: https://www.sublimetext.com/docs/linux_repositories.html https://wiki.debian.org/DebianRepository/UseThirdParty How to add a third-party repo. and key in Debian? However, when running This is what I am doing: Download key, convert key from ascii to binary, and move key to shared location: Create source list: Set pinning rules to restrict repo usage: Then I run When I run with debug for gpg, I read this to mean that apt is correctly passing on the location of the key I have downloaded. This could mean that gpg can not read the contents of the key. Or maybe the key was somehow mangled in the dearmoring process and no longer has the contents expected. This is pure guessing on my part. When I inspect the dearmored key, The key is readable, although it does not mention So what went wrong? How can I get this to function correctly? |
Conditional dependencies in `debian/control` file Posted: 07 Aug 2021 09:34 AM PDT I'm packaging the software, which depends on a particular version of a library shipped in the official Debian distribution. The software also has a bundled sources of the library. Is there any way to describe this in the Also, for the older versions (how to detect it in the |
How do I add a different prefix to each line? Posted: 07 Aug 2021 09:13 AM PDT I have a list of names in a list/text file (file test.txt). For example: How would I add every letter as a prefix for each line, and output it as a new text file? Desired output: |
How to add ip rule after dockerd is up? Posted: 07 Aug 2021 07:28 AM PDT I want to add an ip rule that involves the docker0 interface. But docker0 does not exist until docker is up. ip rule will fail if docker0 does not exists. I could use a script that repeats until docker0 is added but is there a more elegant way? Like a hook / script triggered after docker is up? |
Get an accellerated X11 driver for "XGI Z7" GPU under Alpine Linux v3.14? Posted: 07 Aug 2021 09:21 AM PDT I am trying to get a modern Linux up and running on an elderly PC with a Vortex86DX CPU (i586) and a built-in GPU which is reported in dmesg as To my understanding this GPU was supported by the SIS module, but when trying to run The fbdev driver does its job but is rather slow. The VideoDriverFaq at https://wiki.freedesktop.org/xorg/VideoDriverFAQ/ mentions that the sis driver should be used but it is clearly not properly autodetected. The sis module is available in a package and installed on the system How should I approach this? |
Tarring files with mtime after a date and with grep Posted: 07 Aug 2021 08:36 AM PDT Tons of threads out there, but nothing with that includes the entire hat trick. I'm trying to This one does the proper filtering (date and ignore) but doesn't tar anything ( Can't figure out to get the What am I missing? Thanks. UPDATE: This came from my system admin (who wishes to remain anonymous): This command line will run the tar command for every file it finds, create (-c) a new tar archive (always called newestfiles.tar.gz) for it and then tar and compress the file into that tar archive. So at the end you're left with one tar archive that contains the last file the "find" command found, all previous tar archives were overwritten (since it's always the same name). To prevent this from happening you need to use the add (-r) instead of the create (-c) tar option. Unfortunately this doesn't work with compression in one command, so that has to happen in a separate step. And if you don't need compression, you can do it with just the one. So, |
Posted: 07 Aug 2021 09:16 AM PDT I have a file generated everyday which have number of webservices request and response and i wanted to write the contents of the request and response to the CSV file. Something in the below format (Contents of both request and response together) Please note that only Phonenumber,RefID,DateTime to be extracted in the Input Request and SOATransactionID,phonenumber,RefID to be extracted in the Output response. Sample request & Reponse Thanks |
Add JSON objects to array using jq Posted: 07 Aug 2021 09:30 AM PDT My goal is to output a JSON object using I have this command which creates JSON objects from each line of output: The output looks like this: But I need these objects to be in an array, and I need the array to be the value of a a parent object's single key called I tried adding the square brackets to the I found possible solutions here but I could not figure out how to use them while looping through each line. |
zsh testing existence of a key in an associative array via indirect expansion Posted: 07 Aug 2021 09:41 AM PDT So I know that you can test for the existence of a regular parameter via indirect expansion by doing something like: And I know you can test for the existence of a key inside an associative array by doing something like: However I can't figure out how to combine the two and test for the existence of a key inside an associative array via indirect expansion. Is this possible without using eval? I tried several combinations including the following, and none of them worked: |
can't change value in smp_affinity Posted: 07 Aug 2021 08:05 AM PDT I am trying to set irq affinity on linux by changing the value in smp_affinity. When I echo the new value into the file, I don't get any error but when I read it back, the value remains unchanged. I don't have irqbalance enabled, so I am not sure what else could be preventing me from changing it. For example: |
The "proper" way to test if a service is running in a script Posted: 07 Aug 2021 08:50 AM PDT My problem: I'm writing a bash script and in it I'd like to check if a given service is running. I know how to do this manually, with But (especially since the move to systemd) that prints a whole bunch of text that's a little messy to parse. I assumed there's a command made for scripts with simple output or a return value I can check. But Googling around only yields a ton of "Oh, just Or should I just shut up and get my hands dirty with a little pgrep? |
Issue in running sudo visudo command? Posted: 07 Aug 2021 07:27 AM PDT I get the following error when running |
Location of Wifi SSID configs and how to make a hotspot in Ubuntu 14.04 Posted: 07 Aug 2021 09:01 AM PDT What is the location of wifi ssid config in Ubuntu 14.04. Also, making a wifi connection as Hotspot does not work. I am unable to make a hotspot in Ubuntu 14.04 via UI. One of the reasons that I found was that mode is set to infrastructure in the hotspot config and I need to change it. I tried locating the file in /etc/network/interfaces from online search but that configuration is not something that I am looking for. |
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