New answers tagged

0 votes

How to make Linux stop sending IPv6 ICMP redirects?

Block the redirect packets in ip6tables sudo ip6tables -I OUTPUT -p icmpv6 --icmpv6-type redirect -j DROP
  • 101
0 votes

Building .deb package for Linux perf?

You can use these patches and apply them to the vanilla linux kernel. These patches are more recent than what was posted above. This will build linux-tools-*.deb packages. I've recently tested on the ...
  • 101
2 votes
Accepted

After SSH login linux output a kernel version

Option 1: Add the following in /etc/ssh/sshd_config Banner /etc/banner or Banner /folder/mybannerfile Write the message you want in the file and restart sshd Option 2: It seems it is possible to ...
0 votes

How to identify one of several Firefox installations (location) by id from `~/.mozilla/firefox/installs.ini`?

To get the current firefox profile folder, just type this: awk -F= '{if(NF){if($1=="Path")path=$2;if($1=="Default")def=$2}else{if(def==1){print "~/.mozilla/firefox/"path;...
0 votes

Any foss apps on Linux that contain the print booklet feature of Adobe Acrobat Reader?

You can run pdfbook2 (package texlive-extra-utils) on the PDF file. pdfbook2 - Create print-ready PDF files from some INPUT PDF files for booklet printing. The resulting files need to be printed in ...
0 votes

Remove internet access without losing LAN

If all of the nodes, including the master, are on the the same subnet 192.168.1.x/24 then they can communicate directly without any need for a gateway. Only nodes that need Internet access need a ...
  • 101k
1 vote

Umask set weird result for files when apply value 0666

umask created some confusion, so after reading some documentation I got a clear idea. umask: [ u => User ] When we create files or directories, those files got some default permission. mask work ...
0 votes

Get user's login duration time without time of locked screen

It's not exactly what you're asking for, but you might find the GNU accounting utilities (acct) useful. GNU Accounting Utilities is a set of utilities which reports and summarizes data about user ...
  • 73.7k
0 votes

Get user's login duration time without time of locked screen

As far as I knows, the idle time displayed by who command differs from the time with unlocked screen. No. who is a program that predates graphical sessions. It has no notion at all what a "...
1 vote

Extracting columns with similar name from two different csv files

Assuming the header in both files is a simple list of comma-delimited field names, without any special CSV quoting, we may extract the field names on separate lines from a file using head -n 1 file | ...
  • 311k
0 votes

Extracting columns with similar name from two different csv files

Using Raku (formerly known as Perl_6) raku -MText::CSV -e ' \ #read headers of each csv, match column names on first word; my $csvA = Text::CSV.new; my $csvB = Text::CSV.new; my $fhA =...
  • 1,953
2 votes

"hostname: Name or service not known" when hostname is written in /etc/hosts and /etc/hostname

grep: /etc/nsswitch.conf: Structure needs cleaning This indicates your root filesystem probably needs a filesystem check: it might be corrupted. And because it's your root filesystem, it is likely ...
  • 80k
1 vote

Umask set weird result for files when apply value 0666

umask is a mask, applied to file permissions. touch creates files with permission 666 by default; with a mask of 0666, all those permission bits are masked, so you end up with files with no permission ...
0 votes

Primary vs secondary groups in Linux

Primary Group: Used to decide which files are created by which users. One user must belong to only one group. Supplementary Group: Specifies one or more groups for users to share files between them. ...
1 vote
Accepted

Using IPC_CREAT with an already created shared memory segment

Yes, that's the idea. You use IPC_CREAT to allow the creation, not to force it. To force creation (and failure if the key already exists), IPC_CREAT | IPC_EXCL.
0 votes

i3 status bar with ANSI *input*

Here is an answer using the third method. It transform a terminal window in a dock by setting the X11 properties understood by i3. It does only work with terminal emulator that does NOT fork their ...
  • 111
0 votes

No linux will boot after BIOS update

It works now! I updated my Gigabyte Z590 Vision D to firmware F8f, running Ubuntu 22.04.2 with Linux 5.19; all good now!
  • 101
0 votes

HTML symbols using shell

The ⇨ character (U+21E8, RIGHTWARDS WHITE ARROW, ⇨) looks closer to what you want. 🢧 (U+1F8A7, RIGHTWARDS LEFT-SHADED WHITE ARROW, 🢧) even closer. Your ➡ is the U+...
0 votes

Debian one interfaces gets two ip addresses

I just figured out a solution and will share a theory about what I think was happening. On my system, at least, it looks like the interface is assigned connections from NetworkManager and /etc/network/...
  • 1
1 vote

Why cannot I set the date of my GNU/Linux machines to the Epoch?

I would like to elaborate a bit the cases of which this question apply to. It is not only that you cant date -s '@0', but in fact, you can't do date -s '@X' where X satisfies X<...
  • 121
0 votes

How can I join mp4 files in Linux without transcoding the files?

Write mp4 videos paths into file input.txt: file '/path/to/video1.mp4' file '/path/to/video2.mp4' and then run this: ffmpeg -f concat -safe 0 -i ./input.txt -c:v copy output.mp4 Just this!
1 vote

How to set a label and UUID for the entire drive?

Only if you format the entire drive as a filesystem as opposed to creating a partition table such as MS-DOS or GPT, you'll get a UUID. The UUID lsblk reads is from partitions/filesystems.
1 vote

How to disable root permission on terminal (manjaro)

While it would be possible for an outsider or malware to cause your mouse to move randomly, unless someone is hacking your system just to get your attention, or you have enabled screen sharing (such ...
  • 5,081
2 votes

Does running exec command preserves environment variables of the calling shell? If so, why?

Unix doesn't use spawn, it uses fork. Fork clones a process (with a very short list of differences in the child), typically immediately before an exec. (As said in comment..) The exec system call is ...
  • 5,081
0 votes

How to disable root permission on terminal (manjaro)

If you feel someone takes control from outside, the best thing is to install ufw and type: sudo ufw default deny incoming sudo ufw enable Sudo will permit a logged user which is in your sudoers group ...
0 votes

Allow all users full read/write access to CIFS share with automount/autofs

Change your /etc/auto.htpc to: htpc -fstype=cifs,rw,file_mode=0777,dir_mode=0777,username=content,password=content ://192.168.0.2/Content That will allow any user to write and read from the ...
  • 181
0 votes

How to remove all default gateways

It solves https://github.com/hub4ops/vagrant/blob/main/Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" config.vm.network "...
0 votes

Free Up Port 53 on Ubuntu so costom DNS server can use it

As was given in another answer, you can mostly follow the tutorial here: https://www.linuxuprising.com/2020/07/ubuntu-how-to-free-up-port-53-used-by.html. I won't rehash those specifics, but if that ...
1 vote

Error occurred in mounting file system during Linux bootup with busybox

With the testing suggested by Artem, I found out the root cause of the error and how to fix it. When busybox is started as init process in the system, it first checks /etc/fstab and tries to mount ...
  • 161
6 votes
Accepted

User friendly way to apply BadRAM patterns

Something like memmap=1M!2399M will reserve a slice of memory from 0x95f00000 to 0x95ffffff and should do the job. We can surely be finer with the K unit : memmap=32K!2457344K (from 0x95fc0000 to ...
1 vote
Accepted

Direct output from gnome-terminal to text file

Correct Answer It's very likely you don't need to use gnome-terminal to achieve whatever you're doing. There most likely is a better way to capture the output of ./program than running it in gnome-...
  • 19.3k
-1 votes

Zsh script to recursively unrar into a folder with the same name

Did you try the unrar itself? unrar x archive.rar If the archive has directories and subdirectories - they would be recreated.
  • 4,010
2 votes

Trying to sed a file

Using sed: $ sed -E 's/.*/Echo &;ssh & date/' file Echo Computer1;ssh Computer1 date Echo Computer2;ssh Computer2 date Echo Computer3;ssh Computer3 date or $ sed 's/.*/Echo &;ssh & ...
0 votes

how to restrict SSH for specific user from specific subnet

Yes - it's in the manual: AllowUsers This keyword can be followed by a list of user name patterns, separated by spaces. If specified, login is allowed only for ...
  • 4,683
0 votes
Accepted

Using awk to pull multiple rows from a txt file and put it a single cell in html

This might be what you're trying to do, using any awk: $ cat tst.sh #!/usr/bin/env bash tmpfile='test.html' input='test.txt' awk ' BEGIN { print "<table border=1 cellspacing=0 ...
  • 27.2k
0 votes

Renaming: Remove last X characters from files in directory

Thunar bulk rename tool (thunar -B). KRename cannot do this. There is a sort of incomplete fork of Thunar's renamer, made for KDE, but which can be used separately, called "Bionic Batch Renamer&...
  • 1,224
1 vote

Cron Job to execute every 14 days (or every other Tuesday)

The cron schedule for running a job at 05:15 on Tuesdays is 15 5 * * 2 or use the day name (this may not be supported everywhere), 15 5 * * tue The easiest way to get your command to run every ...
  • 311k
0 votes

How to print full path of a folder which is not current directory?

You can also use find to achieve that. realpath may not exist on all the systems. find $(pwd) -name "FILE_or_DIR_NAME" Example: $ cd ~ $ find $(pwd) -name "reports" /home/tommy/...
  • 272
1 vote
Accepted

packets are filtered via bridge using namespaced network card

I'll limit my references to IPv4 (IPv6 or ARP are also affected, but IPv6 isn't used by OP and no default firewall for ARP exists). Docker relies on and loads the kernel module br_netfilter for proper ...
  • 28.4k
2 votes
Accepted

How to print full path of a folder which is not current directory?

I found the command. It can be done using realpath. >/media/hardDrive/Music/ $ realpath Album_1 /media/hardDrive/Music/Album_1
18 votes
Accepted

Does Bourne Shell have a regex validator?

No, but with some tools it's not hard to test whether a regex compiles or not. For example, with grep: echo | grep -P '[' - the exit code, $?, will be 2, indicating an error occurred (and for this ...
  • 73.7k
0 votes

'Secure Boot dbx Configuration Update' prompt on gui but terminal says everything is up to date. What is it? Is it safe to install?

Leave it to microsoft to screw up my Dell Ubuntu system. I presume this is only for dual boot windows machines? Why would a Microsoft boot loader be on my Ubuntu machine (it is a dell factory-...
  • 1
0 votes

Command line to return to the GUI after Ctrl-Alt-F1?

Here's the English version of what the other answers said: First, log in if it asks you to do so. Then, run the w command. It will give you a tty# for your desktop GUI. Then, either press F# or run ...
  • 111
-1 votes

Using awk to pull multiple rows from a txt file and put it a single cell in html

The awk ORS (output record separator) variable can be used to combine the output of numerous rows into a single cell. You can modify it to any other string or character; by default, it is set to the ...
0 votes

How to convert APE files to FLAC in Linux?

In the directory with .ape/Monkey Audio files: dir/with/ape$ for i in *ape; do ffmpeg -i "$i" -compression_level 12 "${i%.ape}.flac"; done The compression level may be set to ...
  • 103
1 vote
Accepted

Shared /opt between distros

Just one: The /opt is currently used by many commercial (and free) products, which do not like to spread its files over /usr tree. So majority of system administrators would expect to see /opt/oracle, ...
  • 4,010
0 votes

How do I jump to the next or previous word with CTRL + arrow keys in a console?

I use zsh, therefore I can enable this behaviour by editing the .zshrc file The following lines have to be added: # Enable Ctrl+arrow key bindings for word jumping bindkey '^[[1;5C' forward-word # ...
0 votes

Automounting LUKS encrypted external usb when device inserted without error or hanging on boot if not present

Just a quick idea... Maybe use udev to launch script/app which make dir for your mount point and then do all cryptsetup stuff. This script may use key from usb drive. Try do everything without using ...
0 votes

How to bind mount from a symlink

With Linux v5.12+ kernels it is possible to create bindmount from symlinks with new mount API. Here is an example: $ unshare --mount $ mount --types tmpfs tmpfs /tmp $ cd /tmp $ echo TEST1 > test1 $...
  • 21
0 votes

How can I configure shutdown, reboot etc. to display a message on an old (2.6) Linux?

Shutdown and so on usually progress through telinit setting the runlevel to 6 or 0, and this calls the kill scripts in /etc/rc6.d/K* so you could add a wall command to one of those scripts in the stop ...
  • 47.9k

Top 50 recent answers are included