Recent Questions - Unix & Linux Stack Exchange |
- How to disable auto print result in php
- How to get a keycode from my mouse's side button?
- What does "total" mean in the "ls -l" output? [duplicate]
- Concept of "non-portable" in uname command [duplicate]
- Safely configuring `iptables` on a remote system?
- How to block a brute force ssh only using bash?
- How can I generate .out file within a shell script?
- manipulating wayland inside scripts
- Why does variable assignment not work in bash terminal? [closed]
- How to add closing XML tags with sed
- building Debian package fails after even a minor change to code
- detect if DHCPOFFER has been received
- Make nautilus use default kde plasma color scheme
- Connecting to SFTP with PcManFM
- tc traffic shaping with HTB and CQB causes packet transmission gap inconsistencies
- EFI Boot list and EFI Boot Manager timeout setting not working
- Installing PREEMPT_RT kernel on Ubuntu 20.04
- Definition and usage of Kernel/Linux DTS file with more than one MIPI DSI Display panel
- Why can't I see new NIC with nmtui on CentOS 8 and how to resolve?
- error ffmpeg Cannot open display :0.0+0,0, error 1. :0.0+0,0: Input/output error
- Best way to cancel all the SLURM jobs from shell command output
- with yum how can you remove a package but not remove its dependencies at the same time?
- Does pkill kill itself (and its parent processes) last?
- Delete all fail2ban bans in Ubuntu Linux
- How to allow users to mount windows shares
- Linux Mint MATE: Disable encrypted volume password dialog
- How do I loop through only directories in bash?
How to disable auto print result in php Posted: 08 Sep 2021 10:48 AM PDT I'm using a PHP Trader (trader_bbands) library to do some analysis but after execution the result auto printing and not assigning to variable. Result auto printing/echo But i want to assign it to variable and not printing directly. |
How to get a keycode from my mouse's side button? Posted: 08 Sep 2021 10:27 AM PDT In my .bashrc, I would like to add this line : where the keycode number is the one from my mouse's side button. To find a keycode from the keyboard, I use xev, which gives me, for instance: (the line that contains "keycode 135" is the one that matters) However, for a mouse, it doesn't show the keycode: How to get a keycode from my mouse's side button, to use the command xmodmap, to simulate a keyboard's key press from a mouse button? (for instance, pressing the side button would be as if I would press "a" on keyboard - and would show "a" in a text editor) |
What does "total" mean in the "ls -l" output? [duplicate] Posted: 08 Sep 2021 09:45 AM PDT I noticed that when I execute the "ls -l" command, some output entries appear. The first one "total some_number", according to the Linux Bible book, shows the total amount of disk space used by the files in the list; the others show file type, file permissions, hard links, owner, group, file size... I want to understand better the meaning of "total" in this output. I've tried doing some tests and I've searched on the official gnu's project web page about the output of the ls command. According to this source, "total" is followed by the amount of disk space (depending on how many blocks are allocated), measured in KByte, used by the files in the current directory where the command is executed. If let's say I have an empty directory and I do "mkdir newdir newdir1", after I execute "ls -l", I notice that, on my system, "total 8" appears. According to what is said on the gnu's web page, this happens because each of the directories has a size of 4096 byte, in the size column of the ls -l output. Thus, for each directory only one block is allocated, because, on my system, I guess that the block size is 4096 bytes. If I create a new file with the vim command and I insert some text in there so that the file size of the file itself goes to 4096 bytes (ls -l output), now I can see "total 12" in the output of the "ls -l" command. This makes sense. Now, If I insert one more character inside the file just created, I notice that the size goes to 4097. Now "ls -l" shows "total 16". Again, it makes sense, because the system needed another block for the file to store the new character added to it. If we add a symbolic link to the file inside the current directory, the "total" remains the same, anyway. So, can I deduce that symbolic links does not require block allocation? So I think "total", for directories, is calculated by considering 4096 bytes listed in the ls -l output, and not the real size of a directory (4096 refers only to meta-information about the directory). According to this, I also think that "total" doesn't take into account the contents of a directory. I want someone expert to tell me if I am right with what I've written above. |
Concept of "non-portable" in uname command [duplicate] Posted: 08 Sep 2021 10:03 AM PDT What does meaning of |
Safely configuring `iptables` on a remote system? Posted: 08 Sep 2021 09:38 AM PDT I want to configure a complex ip-tables configuration on a system that is only accessible via ethernet. What are the best practices for recovering from the inevitable typos? For example, this question: Configure iptables on remote server without locking me up Ideally:
Are the "INPUT" rules in the above link sufficient to protect against all iptables mess-ups (eg, with NAT) |
How to block a brute force ssh only using bash? Posted: 08 Sep 2021 09:24 AM PDT I currently have to write a script that blocks an IP for x minutes if it failed to log in SSH more than 10 times within 10seconds. So far I have something like this : So this is what I used, but it only blocks the IP after a certain amount of failed attempts, I need to add the unblock part and the failed attempt within a certain period of time. It's something for school they asked us to not use Fail2Ban. Edited to remove the third party thing, thanks for pointing this out, I'm pretty new to all this sorry. Thanks! |
How can I generate .out file within a shell script? Posted: 08 Sep 2021 08:38 AM PDT I wasn't sure how to word this question but basically I have been using a shell script to process sam data. Here's the shell script. And this is the command I run where I get only one .out file for all the sam files processed. Is there a way to generate .out files within my "picard_SortandIndex_from_sam.sh" script so I can have a summary file for each sam file processed? I tried to put > $A".out" in there but it didn't work... Many thanks! |
manipulating wayland inside scripts Posted: 08 Sep 2021 08:05 AM PDT I am running Ubuntu 21.04 on a Lenovo Thinkpad X1 Tablet. On Ubuntu 20.10 I had a series of bash scripts I would run to set up different xorg and xinput configurations depending on what external monitors were attached, rotating the desktop relative to physical device and turning on and off touch. My scripts would use How do I script wayland to do similar things? I would like the following functionality:
Most of the wayland manipulation instructions I have found seem to involve changing grub and then rebooting. I created these scripts so I could change things on the fly: like when I undock from my desk monitor and go to a meeting, I want to turn touch off, rotate the desktop so I am in portrait mode not landscape, etc. I do not want to have reboot to make these changes. |
Why does variable assignment not work in bash terminal? [closed] Posted: 08 Sep 2021 10:35 AM PDT I'm new to bash environment and I try to understand the difference between a bash terminal and a bash script file. As far as I see, your terminal is running on bash just like executing a bash file. Hence there shouldn't be any difference between what you can do in a bash file and a bash terminal. But then how come simple statement like: does not work in the terminal. |
How to add closing XML tags with sed Posted: 08 Sep 2021 08:46 AM PDT I have the following example in the XML doc: While running the following sed command: I'm obtaining the following result: Where the closing slash is missing for the first example due to the slash between text and html. If however I modify my sed command to: Then I have double slash on the third example: Any idea on how to cover both of those cases? |
building Debian package fails after even a minor change to code Posted: 08 Sep 2021 09:45 AM PDT I am able to build Debian package But as soon as I make any change to the code, even changing one character in a string, then the build fails during the tests: I have pasted the full output here How can I build the package with custom changes ? |
detect if DHCPOFFER has been received Posted: 08 Sep 2021 10:34 AM PDT The Linux box with
This assumes that there should be a process running in parallel with the
I'm not sure if Am I over complicating the problem, and there is easier solution? |
Make nautilus use default kde plasma color scheme Posted: 08 Sep 2021 09:20 AM PDT I am currently working with the KDE Plasma window manager and switched my default file manager to nautilus. Functionally everything works, but aesthetically it looks not very pleasing. Is it possible to make nautilus use KDE Plasma's default color scheme? |
Connecting to SFTP with PcManFM Posted: 08 Sep 2021 09:22 AM PDT When I run I'm fairly certain that this is possible since when I was searching for an answer to this problem, I found some people asking about this, however I didn't find any actual solutions to this problem. Any idea how to resolve it? |
tc traffic shaping with HTB and CQB causes packet transmission gap inconsistencies Posted: 08 Sep 2021 08:56 AM PDT I am sorry if this is duplicate of https://serverfault.com/q/1076769/822163. I created that first and then realized the Linux and Unix stack exchange is the right place. Problem: When the tc HTB or CQB is used to do traffic shaping, first two packet that are sent after some time gap are sent back to back as recorded in the pcap log. I have a intermediate computer with ubuntu 18.4 with network forwarding enabled. I run the tc with HTB to shape the traffic to have constant bitrate output on egress port. Client requests the chunks with variable sizes from the sever. Server sends the chunk transfer encoded data with gap of 200ms between each chunk to client. With my setup having the intermediate computer, These packets are passed through the traffic shaper on intermediate computer to obtain fixed bitrate of 500kbps. As I disable offload (TSO and GRO) each n bytes are split into frames by pcap. Most of 1448B packets have time gap close to 24.224ms which is expected at 500kbps Issue: Although the frames arrive in the sequence, their time gap of arrival is not consistent. Second large packet (1448B) after gap of 200ms always comes almost back to back with first packet. Last packet in chunk ( 654B) arrives with delay (24.224ms instead of 10.464ms in example in the picture attached) Screen shot of the timings Timing gaps between the packets. TC command with HTB: If I am not doing any mistake in calculation I think the issue could be due to the token handling in tc that I am using for trafic shaping. I think the tokens are accumulated in the idle time and when the next packet is received it sends the two packets back to back. from third packet token consumtion rate settles down. If this is what is happenning, I would like to know if there is a way to avoid using the accumulated tokens for second packet in the chunk. I tried various options in tc command I also tried using CQB - command below Reference : https://lartc.org/lartc.html#AEN2233 Observation: reducing the burst = 10 slightly increases the gap between first and second packet. tc With CQB: Further: As per suggestion from http://linux-ip.net/articles/hfsc.en/ I tried HFSC (referred ). I need help with HFSC here. Here is the script that I used output of my Output: I am not sure what does it mean by
where as In my tc command I have
After running this script I try to ping 192.168.1.102. I get few ping responses and then the ARP
kicks in where 192.168.2.100 is ip address of ip forwarding port where I am running tc. The command is mostly copied from http://linux-ip.net/articles/hfsc.en/ I have just added route
It would be great if someone could help to fix the umax and dmax issue. |
EFI Boot list and EFI Boot Manager timeout setting not working Posted: 08 Sep 2021 09:45 AM PDT How can I change the 'timeout' setting of the EFI boot manager? I am trying to dual-boot Windows 8 and Ubuntu and I would like to be able to choose one or the other OS at my machine boot time. I already tried to use Here are more details: Is it because of the UPDATE: Here is my status after carrying out the tasks in Peter's answer. So Peter,
|
Installing PREEMPT_RT kernel on Ubuntu 20.04 Posted: 08 Sep 2021 08:06 AM PDT I am trying to install a PREEMPT_RT kernel for my ubuntu distribution as this is a requirement for a robot I am working on. But no matter what I do I get errors when compiling the kernel. I've included the error messages in the question, and I have provided links for full terminal outputs. I am not very expreienced with linux, so I have been following setup-guides from the manufacturer with the following steps: In the configuration I simply select Fully Preemptible Kernel (RT) (PREEMPT_RT_FULL) for the preemption model, and leave all the other settings at their default.
All terminal output here If I instead try to use
All termial output here When that didn't work I tried following the steps given in the answer to this question
When I use the make modules command it compiles for a long time and it terminates successfully, but once again when I run modules_install I get an error message:
I am at a loss for what to try next. I have tried different kernel versions and different operating systems (Ubuntu 18.04 and 20.04), and I get the same error in all of them. The instructions I have been given seems so clear and direct, so I'm wondering if I'm doing something wrong, or if there is some hardware incompatibilites or something of that nature? For reference I am currently running Ubuntu 20.04.02, kernel 5.8.0-53-generic, hardware. Does anyone have any Idea what may cause this issue? PS: this is my first question on this site, feedback on question format is appreciated (too much/to little/ relevance of information etc.) I just added all the information the terminal gave me, not sure what is or isn't useful |
Definition and usage of Kernel/Linux DTS file with more than one MIPI DSI Display panel Posted: 08 Sep 2021 09:33 AM PDT I actually need some help of defining the kernel/linux DTS file and use it together with the uboot videoargs. In use is the 5.4.47 uboot and kernel/linux from a NXP imx8m YOCTO project. In uboot I already can use 5 different MIPI DSI display panels and a HDMI adapter from nxp. To configure the displays type in uboot, I use the video_link environment variable. This works fine for me and can easily be extended and configured. To get this work my uboot DTS looks like this: Now I want to use the same displays in kernel/linux, of course. I first tried the same DTS structure like above from uboot DTS file. I also used the following configuration of the kernel/linux DTS: The second variant ends in the usage of the panel 0, while the kernel boots. But in both variants I was not able to tell the kernel/linux, from the uboot side, which display I want to use. As boot- or videoargs from uboot side I tested many variants without any success. A short example list you can see here: In my opinion the first configuration, like I use in uboot, is the correct one, but I end in the questions:
|
Why can't I see new NIC with nmtui on CentOS 8 and how to resolve? Posted: 08 Sep 2021 08:09 AM PDT In a nuthsell: I cannot see my newly added NIC with nmtui on CentOS 8. How to resolve it? Detail: I've installed a CentOS 8 VM on VirtualBox. Usually I configure two NICs during the installation:
I didn't use Bridged network for I don't want to expose those VMs to the outside world. It works well for all my VMs. But when installing a new server I forgot to set a second NIC on VirtualBox during the OS installation, so I added a new NIC in VirtualBox after the installation. Now I'm able to see the the newly added NIC with both "ip addr" : and "nmcli device": Note that enp0s3 is the NIC which I've configured during the installation, while enp0s8 is the one that I added after the installation. But when I use nmtui to configure the IP address of the newly added NIC, I just can't see it in "Edit a connection" screen: Neither can I see it in "Activate a connection" screen: So how can I make nmtui recognize this new NIC? Some articles say that I have to use "auto enp0s8" to initialize the NIC, but it seems that CentOS 8 doesn't have that tool: |
error ffmpeg Cannot open display :0.0+0,0, error 1. :0.0+0,0: Input/output error Posted: 08 Sep 2021 09:01 AM PDT Hello I get this error when i want to capture my screen on linux with ffmpeg ubuntu 16:04 : the command i'am using : |
Best way to cancel all the SLURM jobs from shell command output Posted: 08 Sep 2021 10:47 AM PDT I submitted lots of SLURM job script with debug time limit (I forgot to change the time for actual run). Now they are all submitted at the same time, so they all start with job ID 197xxxxx. Now, I can do to print the job ID's I want to delete. But how do I use scancel command on all these ID's. The output from the above shell command would look like |
with yum how can you remove a package but not remove its dependencies at the same time? Posted: 08 Sep 2021 08:40 AM PDT Today if I do I would like to remove packageA without removing packageB (etc) is this possible? |
Does pkill kill itself (and its parent processes) last? Posted: 08 Sep 2021 08:48 AM PDT I'm writing a bash script that kills a bunch of processes selected by certain criteria and then quits. The only problem is that those criteria apply to the script and its parent processes ( Now I'm wondering whether I could simplify this to a single Is there such a guarantee implemented into |
Delete all fail2ban bans in Ubuntu Linux Posted: 08 Sep 2021 09:45 AM PDT How can I delete all fail2ban bans in Ubuntu? I tried everything but I don't get it. I just want to delete all bans - but I don't know any IP adresses. |
How to allow users to mount windows shares Posted: 08 Sep 2021 08:07 AM PDT Our company uses both Windows and Linux. Each user has access to many Windows Shares, e.g. In Ubuntu, how to allow non-root users accessing those shares? Is there a way to access those without mounting? If mounting is required, how to allow non-root users to mount network shares to their home folders? They should be able to mount |
Linux Mint MATE: Disable encrypted volume password dialog Posted: 08 Sep 2021 10:02 AM PDT I'm running the MATE edition of Linux Mint on my laptop. I have an external USB disk with a LUKS container on it. The USB disk is connected to the laptop's docking station. Whenever I connect the laptop to the docking station, MATE pops up a window which says, "Enter a password to unlock the volume" along with a text field and options to forget the password immediately, remember until logout, or remember forever. (Not "don't show me this popup again," which is what I would prefer.) Under normal use, I want to have this external USB disk unmounted and idle. I have a cron job which unlocks the disk via a key file, mounts the partition, and runs an automated backup. I don't want this partition to be mounted all the time, nor do I want it to be accessible to my ordinary (non-privileged) user account. Is there any way to tell gvfs (or whatever is doing this) to please stop showing me the "enter password" dialog every time I dock my laptop to the docking station? |
How do I loop through only directories in bash? Posted: 08 Sep 2021 10:33 AM PDT I have a folder with some directories and some files (some are hidden, beginning with dot). will loop through all files and directories, but I want to loop only through directories. How do I do that? |
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