Recent Questions - Unix & Linux Stack Exchange |
- Passing arguments into a glob pattern within a script
- Is it safe to login to my account and do work thorough root prompt instead of desktop? [closed]
- Adding a command to break long lines into shorter ones to an ed script
- How to stop a process permanently for every session?
- Search File A with Terms from File B and save output to individual TXT files based off search term from File B
- Disable passwords when using ssh
- ubuntu multiple monitor issues
- Lap top get off when I separate charger
- if using while loops in bash is bad...what should I do, then?
- Why does a command called by its name behave differently when it is called by full path?
- Adding second IP to RHEL 8 virtual machine
- Linux 4.19: apply devicetree overlay on live system
- jq merge values of same key into an array?
- Setting variables using getopts [duplicate]
- How to evalute multiple arguments in a alias?
- Is there any way to prevent someone from running a shell as root?
- Awk: isolate a block of code, then iterate through multiple blocks (if they exist)
- How VirtualBox NAT network is one-direction only?
- how to start openvpn client in Fedora 34 via systemd?
- Cannot scroll terminal on Ubuntu Server 20.04.2
- On GNOME, make the current window take the whole screen
- Getting IPv4/IPv6 dual stack servers to bind to 0.0.0.0 instead of :: on machines where ipv6 is disabled?
- Can't boot without a liveUSB
- /etc/network/interfaces - difference between auto and allow-hotplug
- Linux Mint - Frontend process, what is it?
- Why do the command cvt and gtf give different frequency values
- Password: chsh: PAM: Authentication failure
- Incorrect automatic time zone
- How do you binarize a colored image?
Passing arguments into a glob pattern within a script Posted: 09 Aug 2021 09:34 AM PDT I have a script called Let me simplify my problem to what I believe are its essentials: The I can enter a shell command like and I get exactly what I want, the appropriate text from each file for the dates 07-01 to 07-12. I want to make a script for this, where all I have to do is enter the start and end dates as well as the month. This was my first go: But doing
Looking around, I've realized that you have to be careful when doing this, because the script will interpret |
Is it safe to login to my account and do work thorough root prompt instead of desktop? [closed] Posted: 09 Aug 2021 09:40 AM PDT I power on and go to maintenance(ctrl+D). Is it safe(security wise)?Would it negatively affect my hardware in someway(battery etc.)? Reason-My laptop is very slow to boot up.
Ubuntu ServerI also wanna look into Ubuntu server. Does it consume less RAM than Desktop one and does it provides faster login? I am able to do my work by logging in my user account from root prompt(no more su after login) happily. Thank you |
Adding a command to break long lines into shorter ones to an ed script Posted: 09 Aug 2021 09:24 AM PDT I frequently have long lines in my I can apply this command also from within ed as follows: However, when I add this command to my ed script, which comprises the following lines, I get an error. I would like to know the reason for the error and a way if circumventing it. |
How to stop a process permanently for every session? Posted: 09 Aug 2021 08:49 AM PDT I have a laptop with minimal resources and this process, "gnome-software", takes up huge space in RAM. I have to kill it every time. Is there permanent way to stop this process? |
Posted: 09 Aug 2021 09:49 AM PDT FILE-A has 100,000 lines. FILE-B is 50 search terms. I'm looking to complete the search of FILE-A (CSV or TXT) with the various terms from FILE-B (CSV or TXT) .... AND (here is the kicker) Save the results in individual TXT files based off the search terms in FILE-B. Example: FILE-A FILE-B Results = "1.txt" with all matching lines from FILE-A, "2.txt" with all lines matching from FILE-A. "23.txt", "78.txt" and so on. So if FILE-B has 50 search terms, I would end up with 50 TXT files, named with the search term, assuming at least one hit with said term from FILE-A. I have searched using "fgrep -f FILE-B.txt FILE-A.csv >> output.txt" This puts all of the search terms from FILE-B found in FILE-A into one "output.txt". Looking to seperate them into individual txt files. |
Disable passwords when using ssh Posted: 09 Aug 2021 08:12 AM PDT I have found lots of answered questions on this subject, both here on SE, and elsewhere. But I'm still stuck. We use mercurial at work, and we have a script (which is outside my control) to clone a repo on my local machine to another location on this same machine. The script does something like this: It requests a password, which breaks the script. I have created rsa keypair, and copied the public-key to ~/.ssh/id_rsa.pub and ~/.ssh/authorized_keys, and also to ~/.ssh/authorized_keys2 (after reading a post elsewhere). I have set the permissions for these three files to 640. Even connecting to my local machine using ssh also requests the password: I'm trying to configure my local machine such that no password is requested, for both the ssh and repo clone operations. I have asked a colleague to do the same and in his case, no password is requested. Is this a local configuration problem? |
ubuntu multiple monitor issues Posted: 09 Aug 2021 09:32 AM PDT This issue has only happened recently. Before, my setup was great. I was able to have 2 external monitors and have my laptop's lid closed. But now, when I have the monitors connected and working with my docking station, if I close the laptop (because I just want to use the 2 external monitors) everything freezes. I see the mouse on the monitor sometimes but that is it, everything else is black and not responsive. I am running Ubuntu 20.04. I have uninstalled and reinstalled Displaylink (I am using a pluggable docking station). I deleted the monitor.xml files (this helped a little so that both monitors would connect properly). From what I have seen, my Nvidia card is "prime". I have tried installing the right drivers but that hasn't made a difference. (NVIDIA GeForce RTX 2070) Here is what the logs look like, but I have not been able to make progress with it: |
Lap top get off when I separate charger Posted: 09 Aug 2021 08:34 AM PDT I brought my lenovo-ideapad-320 to repair shop and changed my keyboard. now when I separate my charger ,the lap top get off and doesn't get on without charger. may is it related to long time being off? |
if using while loops in bash is bad...what should I do, then? Posted: 09 Aug 2021 09:38 AM PDT I guess this may be a naive question but I can't get my head around so I felt like asking... I was searching for some solution to a problem, when I found this very interesting post about why is using I searched extensively: I googled (or duckduckgo-ed) and this: that are indicated as very bad examples of shell scripting. At this point I am wondering, and this is the actual question: if the posted while loops should be avoided because they are bad practice and whatever...what am I supposed to do, instead? EDIT: I see that I am already having comments/questions addressing the exact issue with the |
Why does a command called by its name behave differently when it is called by full path? Posted: 09 Aug 2021 07:36 AM PDT I wanted to use What is going on? Why does |
Adding second IP to RHEL 8 virtual machine Posted: 09 Aug 2021 08:09 AM PDT I have an existing RHEL8 virtual machine used for running httpd and a single virtualhost. I need to add a second IP/virtual host and am running into an issue. My understanding is that NetworkManager still parses network-scripts. The existing IP is configured as: I created a second script set up with the new IP: I then restarted NetworkManager with But I'm not seeing the new device named ens4 listed, just the existing IP (ens3) Device ens3 works fine. The existing bridge from the host machine works since device ens3 works fine (I can view site content, ssh to machine, ect). So I'm not super sure this is a VM host setup issue. What step(s) am I missing to add a second IP to RHEL8? Is the process different when the server is virtual? |
Linux 4.19: apply devicetree overlay on live system Posted: 09 Aug 2021 06:58 AM PDT Is it possible to apply a devictree overlay on a live system? We have an embedded system that has some optional hardware. We would like to load the devicetree information after Linux booted. Reqaon for this: our additional hardware uses a I2C bus to configure itself created by another component on an SPI bus. Unfortunate, the communication between our cpu and optional hardware is going over SPI. Since a devicetree is "worked off" in chronological order, we cannot "go back" to the SPI bus after initializing our I2C bus. I already tried to mount configfs, did not work and is not recommended in prouction environments. Thanks in advance |
jq merge values of same key into an array? Posted: 09 Aug 2021 09:45 AM PDT I have a SQL resultset exported as JSON, in the form of 1:1 mappings in an array. e.g. I would like to coalesce the levels into a single subject key like so: Note: no anonymous objects How can I achieve this with jq? |
Setting variables using getopts [duplicate] Posted: 09 Aug 2021 09:47 AM PDT I would like to use getopts for parsing arguments to bash functions. But am encountering problems in setting variable values. Calling But running the command again with Here is what I have done to handle the options |
How to evalute multiple arguments in a alias? Posted: 09 Aug 2021 09:51 AM PDT I am trying to create a simple alias that uses the argument with the full path On the command line, I can type This alias didn't work though. The CLI interprets as if However, it keeps waiting for an input argument instead of taking my initial argument... If you wanna try out what I mean, substitute In my case, Thank you in advance. PS: My problem is not "how to give the full path to a command", my problem is "how to handle inputs argument in an alias in order to solve this kind of situation". So don't wanna alternatives to give the full path, I wanna know why my alias is not working. |
Is there any way to prevent someone from running a shell as root? Posted: 09 Aug 2021 08:59 AM PDT This is a question I've pondered for a long time and thought was impossible. Is it possible to prevent administrators of a machine from bypassing the audit capabilities of I suppose the real question is, is there a way to audit root's activity on a machine? |
Awk: isolate a block of code, then iterate through multiple blocks (if they exist) Posted: 09 Aug 2021 09:50 AM PDT Can awk † find the nth iteration of a " † I've been assuming awk is the correct tool for this job. Other ideas are welcome. I need to isolate blocks of text in hundreds of files. Some files have only one block, but others contain dozens. sample: It may be best to I suspect awk can be given an index to find the nth match. The bash script can manage the loop and iteration. I've gotten close However, since the above operates on the entire file it doesn't work for files containing more than one block (e.g. below). Irrespective of how many blocks in any file, I need every block separated to be processed individually. Some files contain comments, but many do not--with no standard. I discard them, but the inconsistency means comments can't be relied upon for tracking where we are. The only given is the curly braces (and the line separation). The text is always newline-separated, but not always a blank line between blocks. The data pairs vary, so this can't be a simple My above awk statement runs through all groups, mashing them all into one large paragraph. I need to tell awk to look for the nth " The intent is similar to a non-greedy regex match of the nth " TIA. EDITS: I apologize for what must feel like shifting goalposts; I really botched this at first. Everyone's input has helped me isolate my question to what I really need. Thank you for that. I've found a few SE questions that seem similar, but if these contain my solution I'm not well-versed enough in awk to see the connection. |
How VirtualBox NAT network is one-direction only? Posted: 09 Aug 2021 08:41 AM PDT When a VM in VirtualBox uses NAT networking, it is able to communicate with the host, but the host is not able to communicate with (e.g., ping) the VM. How is it possible? Is it some iptables setup? Looking at Another question, I think it's related (if not, let me know, I'll create another post): On the host I have a docker container running, connected to the default docker0 bridge. Its IP is |
how to start openvpn client in Fedora 34 via systemd? Posted: 09 Aug 2021 08:41 AM PDT So I'm having issues starting openvpn client in Fedora 34. This is what I'm getting on the terminal my config files are located in These are the contents of default.conf This is the systemd service. I added " --verbose 9 --log /var/log/openvpn.log" in the hope I will be getting something in the log. BUT /var/log/openvpn.log doesn't exists even after running "systemctl start". I also run "systemctl daemon-reload" after editing the service file. If I were to manually start openvpn using the value in "ExecStart", I do not get any error. Any ideas what can be wrong? Thanks! UPDATE1:
|
Cannot scroll terminal on Ubuntu Server 20.04.2 Posted: 09 Aug 2021 08:10 AM PDT I've installed Ubuntu Server 20.04 in a Samsung PC (NOT VM), but i cannot scroll up and down, and without a mouse i do not know how to do. I've already tested Shit+PageUp, Ctrl+Shift+PageUp or ArrowUp, Shift+Fn+PageUp or arrowup but nothing. I cannot find anything around Than you |
On GNOME, make the current window take the whole screen Posted: 09 Aug 2021 07:13 AM PDT I am looking for a way to cause the current window on GNOME 3 to take the whole screen. It should be in a form of a script, not a Qt or Python application. I have installed and tried |
Posted: 09 Aug 2021 08:01 AM PDT I have a Linux (Ubuntu Groovy) server that is booted with kernel option I also have some braindead dual stack software that I cannot change that wants to bind to |
Posted: 09 Aug 2021 08:53 AM PDT I'm coming from Ubuntu, and am somewhat new to Arch-based Linux. I installed an Arch-based Linux yesterday. Everything went smooth until when I wanted to boot. First, my PC didn't recognize the EFI bootloader. And then I had to boot to a LiveUSB. On the LiveUSB screen when I chose When I click on either of them it tells me When I press the E button on that screen I see that the root and chain loader is not correct. It's something like this: When I change these to System boots successfully. I checked with Gparted and my EFI partition is flagged as boot. I don't know what is it that I'm missing. Now my question is, how can I make this change permanent and boot without the liveUSB? I appreciate any help, thanks ahead |
/etc/network/interfaces - difference between auto and allow-hotplug Posted: 09 Aug 2021 09:26 AM PDT I am running Debian 9.13. I tried to check what is the difference between Is it correct? Is there any other difference? |
Linux Mint - Frontend process, what is it? Posted: 09 Aug 2021 08:54 AM PDT |
Why do the command cvt and gtf give different frequency values Posted: 09 Aug 2021 08:01 AM PDT I am trying to setup a xrandr mode line for a X display but in attempting to find the appropriate parameters, I note there are two different calculation programs (see below). Why the difference in values? Which set should I use for a NON-CRT display? |
Password: chsh: PAM: Authentication failure Posted: 09 Aug 2021 09:07 AM PDT Trying to run (dockerfile) i tried to change it to /bin/zsh but still doesn't work. Docker file is too long, there is the offical repository with the file https://hub.docker.com/r/alexcheng/magento2/~/dockerfile/ Result : /etc/passwd /etc/passwd /etc/pam.d/chsh Any ideas how to fix it? |
Posted: 09 Aug 2021 07:04 AM PDT I've noticed that the automatic time zone detection functionality of my GNOME 3 (Arch Linux) is not working correctly. My actual time zone is PST (UTC-08), but if I toggle on the "Automatic Time Zone" option in "All Settings -> Date & Time", it would detect me to be in EST (UTC-05). Kernel: GNOME: Output of Output of Output of I suspected it was something wrong about my IP address, but all online IP location finder websites I've tried tell me I'm in San Francisco (which is correct). Also, I'm running dual systems (Windows 10 & Arch), and one OS writing the hardware clock always results in the other OS having an incorrect time on the next boot; I just ignore it and let the OSes' internet time services correct it. Wrong time zone detection only began today. I'm not sure how to approach this issue. Can anyone shed some light on what might be the cause? |
How do you binarize a colored image? Posted: 09 Aug 2021 06:34 AM PDT My friend has an colored image with Chinese handwriting (basically by taking photo of or scanning what he wrote on a piece of white paper), and he would like me to convert it into a black and white binary image. Are there applications under Ubuntu that can accomplish that? Here is an example image: |
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