All Questions

Filter by
Sorted by
Tagged with
7 votes
2 answers
2k views

Shell one-liner for adding a line in the middle of a pipe

I write a script which sends the input file to CPP, then to grep, then to a certain program: cpp $1 | grep -v "#" | theprogram But, "theprogram" requires the input to start with a certain constant ...
1 vote
0 answers
23 views

Check if it's safe to move a directory and replace it with a symlink

Say the directory you want to move has absolute path DIR. A case where it is NOT safe: that directory has either absolute path symlinks to within DIR itself. relative path symlinks to outside DIR Is ...
6 votes
8 answers
5k views

How to count total number of lines of all .txt files?

I'm trying to figure out how to get total number of lines from all .txt files. I think the problem is on the line 6 -> let $((total = total + count )). Anybody knows what's to correct form of this? ...
1 vote
3 answers
45 views

Create MD5 within a pipe without changing the data stream

I was asked to create a mechanism to dump a (data on rest) encrypted mysql into an encrypted file. That mechanism must meet certain criteria, like: Shall run under Linux No write of unencrypted sql ...
4 votes
1 answer
3k views

ALSA doesn't play on HDMI

I have Ubuntu 14.04.3 with kernel 3.16.0-48 installed on mini-PC Gigabyte GB-BXBT-2807. The chipset also integrates audio controller Realtek ALC283. I've been struggling to have my audio play over ...
0 votes
0 answers
4 views

Second external monitor does not turn on but is connected

I'm running debian 12 on a thinkpad T14s and have an issue with a second external monitor. I have both monitors connected to the thinkpad universal usb-c docking station and my laptop plugged into ...
0 votes
0 answers
2 views

How to tell whether a given packet is subject to IPsec's SPD?

My IPsec configuration via strongSwan is non-device and uses XFRM policies / states. On the VPN gateway I'm trying to test whether a given IP packet (described as src IP, src dev, dst IP) will be ...
7 votes
3 answers
8k views

Remove "No LSB modules are available." message from 'lsb_release -a'

I try to write a script to get the version of my distro so that I can pass it to a variable. The following command is what I wrote to achieve the result. lsb_release -ar | grep -i release | cut -s -f2 ...
3 votes
1 answer
3k views

Set up nftables to only allow connections through a vpn and block all ipv6 traffic

I am trying to set up a nftables firewall on my archlinux distribution that only allows traffic through a vpn (and blocks all ipv6 traffic in order to prevent any ipv6 leaks) I have been playing ...
1 vote
0 answers
7 views

How to login to systemd-based Linux if there are no /dev/tty[0-9]* devices?

I am forced to use a kernel without virtual console support. There is only a /dev/tty device. As a userspace, I use the Debian testing distribution. In rescue mode, I checked that it is possible to ...
0 votes
0 answers
5 views

QEMU: Why does kernel panic while debugger attached and KVM enabled?

maybe someone has encountered a similar issue and may point me into the right direction. I compiled a fairly recent linux kernel with a standard COS config. I can run it with qemu without problems ...
0 votes
1 answer
272 views

objtool won't build on RHEL 9.1, I'm getting make warnings and objtool compile error, Why?

I'm having the same issue with RHEL 9.1. Does anyone know what might be causing this? I try to run a make and continue to get the following error: make[1]: Entering directory '/usr/src/kernels/5.14.0-...
1 vote
4 answers
79 views

Find text files where the content is duplicated?

By mistake I appended (>>) rather than overwrote (>) the output from a script that processed thousands of files, but I only did it for about 20 % of the files (I ran 5 parallel instances of ...
1 vote
1 answer
165 views

No applications found in non-root user account

I'm currently running OpenSuse Tumbleweed and after I uninstalling snapd package I reboot my PC and I found my plasma desktop without any applications available. I can see some files that I got in my ...
1 vote
1 answer
64 views

sed performance using pattern space and hold space

Given a 425M sized text file with the following content: --START-- Data=asdfasdf Device=B Lorem=Ipsum --END-- --START-- Data=asdfasdf Lorem=Ipsum Device=A --END-- --START-- Device=B Data=asdfasdf --...
0 votes
1 answer
2k views

How to mount an LVM from Read-only to Read and Write

I have a VM with an LVM. Occasionally when updates are performed, and the system has restarted it will go into a read-only state. This is an issue because I perform daily backups. Unfortunately, for ...
2 votes
0 answers
806 views

Why is unistd.h named the way it is?

Similar in spirit to this question about the etymology of linux commands, I'm curious about the origin of the name of unistd.h. Does anyone know for certain what unistd.h stands for? If unistd.h was ...
1 vote
2 answers
41 views

UEFI HTTP boot only: GRUB2 used a mysterious HTTP agent "UefiHttpBoot/1.0" to load initrd and failed to completely read large initrd

I was using GRUB for UEFI PXE boot or UEFI HTTP boot of a Linux Live OS (made by Ubuntu Focal or Bionic or Jammy). I used the same grub.cfg for both methods. It worked well under UEFI PXE boot, but ...
1 vote
1 answer
9 views

Raspberry Pi timedatectl fails with "Transport endpoint is not connected" and ".service files" errors

I am encountering an issue on my Raspberry Pi when trying to use the timedatectl command. When I execute timedatectl status I get the following error message: spaikon@raspberrypi:~ $ timedatectl ...
1 vote
1 answer
3k views

Turn off Suspend, Sleep, Hibernate for user (xfce4)

as the title is says, I want to disable all methods (buttons, commands, etc.) an unprivileged user have to turn a system into any standby-mode (sleep|hibernate|hybrid) under xfce4. I found out that ...
2 votes
2 answers
316 views

How to enable HugeTLB controller in cgroup v2 on Ubuntu

I am trying to enable HugeTLB Controller on cgroup v2 on my system but can't figure out how. This is the list of controllers on my system: cat /sys/fs/cgroup/cgroup.controllers cpuset cpu io memory ...
0 votes
1 answer
47 views

How to make a script to forward commands to an SSH server?

I have a remote SSH server with several custom utilities for my work. However, there are times when I feel lazy and don't want to start a full SSH session just to execute a single command. This ...
0 votes
2 answers
40 views

Can I let users create an account on their own?

I teach a programming course with over 40 students. I want them to upload their projects to a Linux web server that I rent. So I want each student to create a user account on the server. I do not want ...
-2 votes
3 answers
45 views

How to convert multiple columns from file to single string

I would like to edit something like this; ABC abc 123 Into something like this; Aa1Bb2Cc3
1 vote
1 answer
2k views

ssh stuck at expecting SSH2_MSG_KEX_ECDH_REPLY

I faced this issue on a server in another country. I changed mtu to values between 1200 and 1500 but nothing changed. I reinstall openssh but nothing happened. please help. tnx.Also forcing ...
9 votes
6 answers
6k views

Where can I find all tmux options?

Where can I find a list of all tmux options? I know of tmux list-keys -t <table> which shows you various keybindings and their commands, but I'm looking for a comprehensive list of all possible ...
3 votes
1 answer
155 views

Can't write to Live CD system

I am not new to Linux, but am new to creating my own virtual machine environment. I am using Linux to learn how to do penetration testing, and have been required to download lots of different software ...
-1 votes
1 answer
51 views

Command ssh ask for a passphrase, but there is no passphrase set. In fact, works like a charm on another machine?

I have an SSH key pair (codebot and codebot.pub) used to fetch code from GitHub. Generation was without any passphrase. On server A, it works without any trouble. SeLinux disabled: bash-4.2$ ssh -T -i ...
2 votes
1 answer
2k views

Two vsftpd instances - check passive port on FTPS

I have configured VSFTPD in a CentOS machine to run on two instances, with vsftpd.conf and vsftpd2.conf. Here is the content of the second conf file: anonymous_enable=NO chroot_list_enable=YES ...
0 votes
0 answers
9 views

Where does `logger` save messages to on macOS?

I'm writing a shell script that utilizes the Linux logger to log output. Based on that documentation, I believe that the logging is sent to /var/log/syslog on Linux which would be var/logs/system.log ...
0 votes
2 answers
24 views

No wifi adapter found ubuntu 22.04

I had to reinstall Ubuntu 22.04 due to problems with an nvidia graphics driver, and now its not detecting the wifi adapter. I'm using an Asus ROG Strix G15 AMD Ryzen 7 6800H, nvidia geforce RTX 3050 ...
0 votes
0 answers
20 views

Confusing behavior when using IFS and read [duplicate]

line="touch : touch : test.txt" IFS=':' read scr cmd <<< "$line" echo $scr echo $cmd output: touch touch : test.txt line="touch : touch : test.txt" IFS=':' ...
0 votes
1 answer
26 views

Not enough space to install apt packages/how do I resize /var/?

Clearing the apt packages cache does not help, neither do I have any extra update packages. Whenever I try to apt install something, it tells me I have no space left. df -h says my /var/ is full, so I'...
1 vote
3 answers
10k views

Matrix Structure for screen rotation

I can set my screen rotation to inverted with: xrandr -o inverted xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1 and back to normal with: xrandr -o normal ...
26 votes
4 answers
34k views

Ephemeral port : What is it and what does it do?

I suddenly came across the term "ephemeral port" in a Linux article that I was reading, but the author did not mention what it is. What is an ephemeral port in UNIX?
0 votes
2 answers
2k views

How to subscribe to public YUM repository in Oracle Linux

I would like to subscribe to the following Oracle yum repository so I can install virtual box guest additions packages. https://yum.oracle.com/repo/OracleLinux/OL7/developer/x86_64/index.html Where ...
1 vote
1 answer
7k views

error: need to load kernel first

I tried to download Tails on my computer, however, I couldn't do it because in grub there were 2 errors: error:/live/vmlinuz has invalid signature error: you need to load the kernel first Can anyone ...
0 votes
1 answer
34 views

Why all Xorg log messages are written to journal at level 4 (warning)?

All the content of Xorg.n.log can be viewed with journalctl. As Xorg is launched by GDM (if I understand it correctly), it always has the --identifier=/usr/libexec/gdm-x-session. But despite this hint ...
0 votes
0 answers
40 views

Where are firefox cookies in Linux?

I want to find out where are firefox cookies getting stored in Linux. there is a similar old question here which says that the cookies are stored at ~.mozilla/firefox/<profile name>/cookies....
-2 votes
2 answers
43 views

Count lines in a file if EITHER of 2 conditions is true

The file is ASCII with 1K lines made up of strings of 1's and 0's of various lengths and randomly mixed (no spaces between numbers): if you'd like to see actual file please go here: https://mega.nz/#!...
1 vote
3 answers
3k views

how to create a new file in an immutable directory

I have changed the directory attribute immutable by chattr +i /testdir; but I need to create files in that directory. Or is there any way that nobody can delete the directory but the owner can still ...
0 votes
3 answers
3k views

How to get the json data used in each curl statement while using xargs and maps it to its corresponding result?

I have text file that has arguments of curl command. This is how the file looks 'https://example.com/tl/' -X POST -H 'Content-Type: application/json' --data-raw '{"email":"username2&...
0 votes
0 answers
15 views

.xinitrc, .xsession don't work (commands not run)

A quick summary: I installed Ubuntu (Current LTS - 22.04) I wanted to change the window manager from the default one to "dwm" I installed dwm via apt, it works correctly, The problem is - ...
0 votes
1 answer
24 views

Force open deprecated Chrome app

I used to be able to "open anyways" a deprecated Chrome app (Authy in my case), but now it doesn't give me that option. All it says is that I can remove it: Is there a way (e.g., in the ...
0 votes
1 answer
2k views

Combine sound for Display port and HDMI

I have an nvidia gtx 1050 running on debian 9. I have 2 external monitors, one through Display port and one through HDMI. Both monitors output the sound just fine, but only one at a time. Is there any ...
0 votes
0 answers
32 views

Problem with permissions - propably after using "sudo chown -R me ./"

I am preety new to Linux. Recently, I used the command "sudo chown -R me ./" to grant myself permission to a certain folder. If it matters at all, I ran this command in the '/var/www' folder....
0 votes
2 answers
45 views

Is there a difference between file permissions and mode?

The terms "file permission" and "file mode" are often used interchangeably. However, some tools exclusively use one term or the other. Interestingly, the venerable chmod tool ...
0 votes
0 answers
20 views

Raspbian static IP on Wifi without DCHP service

I've tried to set up a static IP on a RPi4 running the latest Raspbian Lite (Bullseye), so I can remove DHCP entirely. My /etc/network/interfaces file looks like: # Include files from /etc/network/...
1 vote
1 answer
27 views

Why isn’t wpa_supplicant working on Void Linux?

I installed a glibc Void Linux partition on my 2019 Macbook Air. I can’t get wpa_supplicant working. I enabled wpa_supplicant and dhcpcd. Then I used wpa_passphrase with my Wi-fi network’s SSID and ...
0 votes
1 answer
2k views

Bluetooth does not work on Debian 11 Bullseye LXQt

I have Debian 11 operating system LXQt version, and my computer is HP 15-n220ca I'm trying to install Bluetooth on my computer but it doesn't work. I don't know what USB Bluetooth dongle to buy here ...

15 30 50 per page
1
2 3 4 5
4629