Recent Questions - Unix & Linux Stack Exchange |
- Why F5 Big IP CLI self created file script doesn't work, although command works from terminal?
- How to prevent destructive side effects from running exported bash functions?
- badblocks and mkfs.ext4
- Mac clients cannot set permissions on Samba share
- How to use `curl` to see the top of a very long output?
- Help required in setting up a CLI environment on my chromebook
- In fixed width file new line char in data
- Close recently opened process in .sh
- v4l2 loopback working fine with openCV but weird output on OBS
- Can't set static IP on systemd-networkd
- format data into table
- Retry command on failure but with different flags
- Linux 64-bit SSH port numbers?
- using awk to print if any three variables are true
- degraded iops and throughput on a linux machine in a cluster
- Kali installation failing at "Select and Install software"
- Enabling core files on CentOS 8.1
- Unable to use mouse and keyboard in Lightdm test mode
- warning /dev/centos/root swap centos-root does not exist -- after configuring DRBD
- Delete all directory that begin with a particular string
- slow download link with hostapd and ath9k_htc driver
- "netstat -p"/"ss -p" not showing the process of a listening port
- How to use Ctrl+mouse click in tmux?
- How to add an attribute in a tag in XML file by command-line?
- convert xml to csv
- What is $PWD? (vs current working directory)
- Why are my virtual consoles completely blank?
- port being in use not displayed in netstat output
- How can I find a memory leak of a running process?
Why F5 Big IP CLI self created file script doesn't work, although command works from terminal? Posted: 15 May 2021 09:48 AM PDT Here's my script which is saved as f5cli and chmod +x f5cli for executable. I'm using F5FPC_HOST environment variable to pick the value for host url Replacement of variable values is not a problem, i have verified by printing the data in echo/notify-send. I have tried changing bin/sh to bin/zsh or bin/bash. Command which works in terminal |
How to prevent destructive side effects from running exported bash functions? Posted: 15 May 2021 09:38 AM PDT With some versions of Here's a toy example. It is based on the short script The shell interaction below shows the issue: The first 4 lines of the output shows the definition that As the last line shows, I don't understand what is going on. I suppose it is a bug in Is there anything that a script can do to protect itself against such potential side effects? (I happen to know about the problem with 1 The details of the function does not matter, AFAICT. The same behavior occurs with every other function I have tested. 2 To be clear, if I comment out the invocation of |
Posted: 15 May 2021 09:38 AM PDT I've ran Block size used in both commands are the same. But I'm formating a partition which is not the first one of the disk. Should block numbers be recalculated and if yes, how to do it? I do not want to run |
Mac clients cannot set permissions on Samba share Posted: 15 May 2021 09:31 AM PDT I'm running Samba on a Debian server in my local home network. The Samba version is However, I noticed that permissions on the data share do not work properly. If I try to change permissions of a file or folder, e.g., with I already tried various Samba settings based on information I found on the Internet, as well as reading I added these parameters to the global section of my smb.conf file: And the data share is configured like this: I'm new to Samba and am a bit confused by all the different parameters. Right now I don't have any idea why my Mac client cannot set file permissions for files on the share. For simply storing files this might even be OK, but it causes problems with applications. As an example, I wanted to put my large picture library on to the share. I copied it there and wanted to open it with Apple's Photos app - but Photos fails to do so, says permissions are broken, and also fails to repair permissions. I'd really appreciate some help, because I'd love to get this setup working. |
How to use `curl` to see the top of a very long output? Posted: 15 May 2021 09:43 AM PDT I use There is an analogous question about the |
Help required in setting up a CLI environment on my chromebook Posted: 15 May 2021 09:13 AM PDT I have an acer chromebook, I wish to set up a fully-fledged linux command-line environment on it. I mostly use the terminal on my other linux machine, I don't really care much for GUI evnironments. I need a setup on my chromebook that allows me to run all the commandline utilities of a typical linux distro. How do I begin? What I've done so far: I've tried using crouton to install chroot but chroot's installation gave me this error in the end: "W: Failure trying to run: dpkg --force-depends --install /var/cache/apt/archives/libc6_2.23-0ubuntu3_amd64.deb" I tried installing costini but that requires you to set "Enable linux beta" option, and I do not have that option. I tried looking for an 'kernel-next' in chrome://flags and that wasn't there either. I just need a typical linux terminal environment. |
In fixed width file new line char in data Posted: 15 May 2021 08:36 AM PDT Fixed width file has 15 fields,in 5th field-address it starts from 19 th char and ends at 58th char (its length is 40) getting \n char(new line char in data). How to replace it with double space without any impact actual line separator. Input: Output: |
Close recently opened process in .sh Posted: 15 May 2021 08:10 AM PDT I am new to Linux and trying to learn how to launch and close processes automatically. Eventually I would like to run this/a similar process with cron. Here, just testing "checking in" to google.
I have added execute permissions to Thank you in advance! |
v4l2 loopback working fine with openCV but weird output on OBS Posted: 15 May 2021 07:59 AM PDT I'm as CS student and i'm trying to make a project where I output my webcam video flow but as an ascii art. In order to do so, I get the image from v4l2. then i use OpenCV to decode the image (i wasn't able to find an easier way to do so) Then i get the data from my openCV mat and, in a new buffer, create an ascii art from my image. after that i send data from my buffer in v4l2 but when i use the v4l2 loopback input on obs the output is realy weird (see image) I've tried to output the image in a new mat using opencv and the image output correctly. i really don't understand what happen neither why. Also i've tried to use discord instead of OBS the output is completely black ... Any help would be appreciate. Thanks by advance. (all my code is available through github, i'm not sure if i should post it since this is not stack overflow. if ever you need it just let me know i'll add a link) |
Can't set static IP on systemd-networkd Posted: 15 May 2021 08:13 AM PDT I can't set static IP on a wired interface using but I give below log from you can find my hardware and software specification in below: |
Posted: 15 May 2021 09:32 AM PDT How to get the details and transpose it to horizontal form Every record ends after Note : This four header will be their for below data : Name , City , Age , Couse if you see the second record their is no "Name" : "" -> missing so it should be null in place of that and remaining will be appended after that with pipe separated like this : I have a data like below in demo.txt file Expected Output : I tried below code : but not working my logic |
Retry command on failure but with different flags Posted: 15 May 2021 08:55 AM PDT So, I'm trying to retry failing or command-line with errors, BUT with different flags each time it retry... I already know how to retry command on failure: As an example, I'll use the function above on a failing command on purpose to illustrate: I'm aware this:
And all of the above is the wanted/expected effect. Only thing I'm trying to add to that is support for additional flag when "retrying" N command (which I'll need to either supply as argument to the function or hardcode in the function depending on cases...) Here what I tried: Usage: Where the new command will become 2nd Method: Same usage as above... Here it will give the same result as above. Now this seems to work on first glance, but if the supplied/failing command contain any kind of quotes, which usually come unquoted, the output/retried command will then have the quotes removed/ignored... So following above two method/example, a command such as To fix this I tried this answer's I don't want to have to use a |
Linux 64-bit SSH port numbers? Posted: 15 May 2021 09:38 AM PDT While there is usually no need for more than the 64k available ports, I am interested in the PoC that having a port number on 64 bits would mitigate the regular attacks on the access ports (ssh, vpn...). Having a 64b port makes it almost impossible to randomly attack a service, targeting either DoS or a login. Like
and practically
|
using awk to print if any three variables are true Posted: 15 May 2021 09:38 AM PDT i want the code print if any of these variables are true. this is not my real code, it's just an example and so on i will write it here by another way for more clarification i need any three of these variables matching with user inputs, print the line |
degraded iops and throughput on a linux machine in a cluster Posted: 15 May 2021 10:02 AM PDT we have a linux-based cluster on AWS with 8 workers. OS version (taken from /proc/version) is: Linux version 5.4.0-1029-aws (buildd@lcy01-amd64-021) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #30~18.04.1-Ubuntu SMP Tue Oct 20 11:09:25 UTC 2020 worker id 5 was added recently, and the problem that we see is that during times of high disk util% due to a burst of writes into the workers, the disk mounted to that worker's data dir (/dev/nvme1n1p1) shows a degraded performance in terms of w/sec and wMB/sec, which are much lower on that worker compared to the other 7 workers (~40% less iops and throughput on that broker). the data in this table was taken from running iostat -x on all the brokers, starting at the same time and ending after 3 hours during peak time. the cluster handles ~2M messages/sec. another strange behavior is that broker id 7 has ~40% more iops and throughput during bursts of writes compared to the other brokers. worker type is i3en.3xlarge with one nvme ssd 7.5TB. any idea as to what can cause such degraded performance in worker id 5 (or such a good performance on broker id 7)? this issue is causing the consumers from this cluster to lag during high writes because worker id 5 gets into high iowait, and in case some consumer reads gets into lag and performs reads from the disk then the iowait on worker id 5 climbs into ~70% and all consumers start to lag and also the producers get OOM due buffered messages that the broker doesn't accept. |
Kali installation failing at "Select and Install software" Posted: 15 May 2021 09:43 AM PDT I am trying to install Kali Linux onto VirtualBox virtual machine, but for some reason, I always get this error every time I try: It can't be anything wrong with my computer, as I recently needed to reset my PC and it's still not working. I saw somewhere it might be something wrong with the network settings but am really confused as to what to do. I'd greatly appreciate any help, thanks! |
Enabling core files on CentOS 8.1 Posted: 15 May 2021 08:23 AM PDT I am trying to debug a broken application that renders X11 windows. I am running CentOS 8.1. I have followed the instructions per Redhat on enabling core dumps.
When I try to run my application : I don't see the core file generated either in the current working directory or in my home directory. I also tried uncommenting the Question
|
Unable to use mouse and keyboard in Lightdm test mode Posted: 15 May 2021 08:04 AM PDT I have a Debian Buster as a VirtualBox guest, and when I run
I am unable to use both mouse and keyboard. (Ctrl+Shift does not help) it outputs: Any ideas? |
warning /dev/centos/root swap centos-root does not exist -- after configuring DRBD Posted: 15 May 2021 10:04 AM PDT I configured DRBD on default CentOS 7.3 Installation like following:
DRBD resource device is Now everytime I reboot the system I get the errors: From dracut shell I run : and system boots fine. But It fails again at Any solution? UPDATE: Found the cause, drbd device was causing the issue. I removed it from both servers and it fixed the 2nd server but not the 1st one. |
Delete all directory that begin with a particular string Posted: 15 May 2021 09:36 AM PDT What command do I have to use to delete all directories that begin with What can I add to the |
slow download link with hostapd and ath9k_htc driver Posted: 15 May 2021 08:04 AM PDT Brief Intro: Raspberry Pi 3 acting as a WiFi AP hosting 2.4Ghz and 5Ghz Wifi AP's. The AP of concern is the 2.4Ghz network. The NIC is a TP-Link WN722N adapter using driver Tests: A speedtest done from the Raspberry Pi 3 results in:
which is expected and correct. Clients connecting to the 2.4Ghz hosted network doing a speedtest results in:
note: Changing router channels does not have any effect on the download speed of hosted wifi network. A shared ethernet connection, hosted by the Raspberry Pi, to which clients connect do not experience this issue. These achieve expected download speeds. Question: Since all NIC's report correct download and upload speed except the hosted wifi network (2.4Ghz adapter) using the Some HW Info: note: The hosted 5Ghz network does not have this download issue, speeds are correct and as expected NIC Info and hostapd config |
"netstat -p"/"ss -p" not showing the process of a listening port Posted: 15 May 2021 08:51 AM PDT On my CentOS 7, at one point, I haven't been able to reproduce this, and I struggle to think of a situation a "non-process" might be listening on a port (as I'm quite sure Linux does the intended cleanup work when a tcp-listening process dies). As it happens with multiple programs too, the only explanation I can think of is that this is an "intended but very rootkit-y" behaviour of CentOS, but I'm most surely missing something. What might possibly have caused this? |
How to use Ctrl+mouse click in tmux? Posted: 15 May 2021 09:06 AM PDT Due to the change in Tmux2.1, I need to remap my mouse's middle click to tmux's paste: However, I also would like to enable using Ctrl (or Alt, Cmd) + middle click to paste the system's clipboard. This is what I have tried (failed) so far: |
How to add an attribute in a tag in XML file by command-line? Posted: 15 May 2021 09:12 AM PDT I am trying to add field at the end of tag using sed script. Suppose I have a tag in XML file: Now I want to add field as I tried with but it gives: |
Posted: 15 May 2021 09:23 AM PDT i need to convert a xml to csv using script. I found a solution with xmlstarlet but it is not available so i am returning to point 0. Here is my xml. And the csv i need, note that the headers are output I can't install any library but i can use awk, perl, bash so i'am open on solution. |
What is $PWD? (vs current working directory) Posted: 15 May 2021 08:26 AM PDT So Wikipedia (link) tells me that the command But for the environment variable, the "P" has to be an acronym for something else than print. I hear people talking about "current working directory", which sounds better and is more intuitive, but still the environment variable seems to be called $PWD, and not $CWD. Nobody ever says "Did you check the print working directory variable?". I am currently playing around with the web application server uWSGI, and when running it tells me (on the uWSGI stats page): so they obviously like the (more intuitive acronym) I guess I am trying to figure out if I misunderstood something, or if it is just a matter of having given the environment variable an unintuitive name? |
Why are my virtual consoles completely blank? Posted: 15 May 2021 08:37 AM PDT When I go from my graphical session to a virtual console by Ctrl + Alt + F i (with i in 1 - 7 and 9-12) I see a completely black screen. Only on F8 I see the GUI. Not even a blinking coursor on the others. When I enter anything, I can't see anything. What is the problem and how do I fix it? My system edit: I tried the first steps suggested on http://forums.linuxmint.com/viewtopic.php?f=42&t=168108 and the problem seems to be the framebuffer. I did this:
Now I have (a low resultion) tty working again :-) |
port being in use not displayed in netstat output Posted: 15 May 2021 08:53 AM PDT In what scenarios port being used by a process don't show up in I'm running Now when I do I'm running CentOS. |
How can I find a memory leak of a running process? Posted: 15 May 2021 08:25 AM PDT Is there a way, I can find the memory leak of a running process? I can use Valgrind for finding memory leaks before the start of a process. I can use GDB to attach it to a running process. How could I debug a memory leaks of a running process? |
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