Quantcast
Channel: User Kamil Maciorowski - Super User
Browsing latest articles
Browse All 648 View Live

Answer by Kamil Maciorowski for tmux: Can't `bind-key` Ctrl+3 to '#'

AnalysisWhat is the issue?The issue is: for a program reading from a terminal there is no such thing as Ctrl+3.Terminals and terminal emulators do not pass keystrokes that ultimately get to programs...

View Article


Comment by Kamil Maciorowski on Can I login into sddm as some user, not...

@NikitaKipriyanov Implemented in this alternative solution.

View Article


Answer by Kamil Maciorowski for Can I login into sddm as some user, not...

Solution with PAM, policy configured in sudoersCreate /usr/local/bin/use-own-password with the right ownership and permissions. The following shell code will do it:sudo sh -e -c 'cat >...

View Article

Answer by Kamil Maciorowski for Why am I getting a "no such file or...

Shells commonly used in Linux/Unix replace tilde (~) with the value of the HOME shell variable, but only if the tilde is unquoted and unescaped.The whole mechanics is more complicated, with supported...

View Article

Answer by Kamil Maciorowski for SSH upgrade proxy connection to direct...

A pretty standard method of solving this (at least in case of IPv4) is as follows:You ssh into the remote host via a proxy.Once there, you ssh back to your local computer without a proxy. This requires...

View Article


Answer by Kamil Maciorowski for unknown command error when loading .tmux.conf

It appears tmux.conf syntax has changed and these commands no longer generate a syntactically valid file.To convert options shown by tmux show -g to valid tmux commands you need to add set-option -g...

View Article

Answer by Kamil Maciorowski for How do I get Calc `REGEX` to return nothing...

the REGEXExpression argument is long, complex, difficult to read and this method means I have to edit two of them, identically, every time I make a change while I'm working out the REThe Expression...

View Article

Answer by Kamil Maciorowski for What is the effect of Ctrl + Z for a...

A program started directly in a terminal has its stdin, stdout and stderr connected to the special file associated with the terminal, e.g. to /dev/ttyN or /dev/pts/N (where N is a number). Even without...

View Article


Answer by Kamil Maciorowski for Find directories contatining mkv with 1 link

I wish to add an exec command to move directories that have said files somewhere else. Is that at all possible?Yes. I assume by "exec" you mean -exec in find. This is my basic solution. Read the whole...

View Article


Comment by Kamil Maciorowski on How to allow find but forbid find -exec in...

@marcelm You are right. Answer improved.

View Article

Answer by Kamil Maciorowski for How does exec interact with pipes in shells?

It means, if I understand correctly, that all commands trying to read from stdin will actually read from fileA command reading from its stdin will read from a regular file if its stdin happens to be...

View Article

Answer by Kamil Maciorowski for How to print all lines matching the pattern 1...

<data sed -n ' /someheader/ {h;d} /zzz/ { x /./ p s/.*// x p d }'Explanation:If the current line contains someheader, copy it to the hold space for later; delete the pattern space and start a new...

View Article

Answer by Kamil Maciorowski for How do I resize tmux pane by holding down...

By default these bindings (among others) are active:bind-key -r -T prefix M-Up resize-pane -U 5bind-key -r -T prefix M-Down resize-pane -D 5bind-key -r -T prefix M-Left resize-pane -L 5bind-key -r -T...

View Article


Answer by Kamil Maciorowski for Uses of single-partition disk configuration

Is there any reason why a partition would be used in this case rather than a whole disk?Few reasons I can think of:People (read: future admins) expect partition tables. Having them saves WTF moments....

View Article

Answer by Kamil Maciorowski for Beaglebone Black filesystem resize -...

Partitions and filesystems are not the same. At no point the filesystem was destroyed.Partition is just a part of a larger device, identified by some entry in a partition table. fdisk manipulates this...

View Article


Answer by Kamil Maciorowski for How to determine the use of a mystery...

About parted"Partition Table: loop" is parted's way of saying that there is actually no partition table. Misleading, I know.Not having a partition table is totally normal in this case, because your...

View Article

Answer by Kamil Maciorowski for disable terminal bell except when called...

Analysisecho -e "\a" prints the BEL character, 0x07 in ASCII (and a trailing newline which is irrelevant for us). Your terminal (terminal emulator), when it gets this exact character, instead of...

View Article


Answer by Kamil Maciorowski for How to run an infinite loop program on...

Analysis; is a command terminator that makes the shell run the command synchronously.& is a command terminator that makes the shell run the command asynchronously.&; in your augmented code is...

View Article

Answer by Kamil Maciorowski for xterm ignores button remapping command

NumpadSubtract does not work for me in Kubuntu 24.04 LTS. Sole KP_Subtract is also wrong. The right string is <KeyPress>KP_Subtract.string(0x1b) string(0x5b) string(0x41) generates what ↑...

View Article

Answer by Kamil Maciorowski for SSH seems to ignore command line options when...

Without -JWith ssh -o ProxyCommand='ssh -W %h:%p …'… you can do what -J does. In this form you pass options to each ssh separately, so you can use -m exactly where you need it:ssh -o ProxyCommand='ssh...

View Article

Answer by Kamil Maciorowski for How to automatically rename tmux window to an...

Preliminary notesSome parts of the analysis (below) apply mainly to Linux.The solution had been tested in Kubuntu 21.10 and published. Only then the OP revealed they are using macOS; it turned out the...

View Article


Answer by Kamil Maciorowski for Is it possible to combine two USB flash...

If "logical partition that would appear as one larger disk" is not a strict requirement then you can use Btrfs.First decide if you want to commit whole USB sticks to the filesystem you are going to...

View Article


Answer by Kamil Maciorowski for Sudoers NOPASSWD for single executable but...

man 5 sudoers says:When multiple entries match for a user, they are applied in order. Where there are multiple matches, the last match is used (which is not necessarily the most specific match).So you...

View Article

Answer by Kamil Maciorowski for Require bash script to be run with sudo (not...

UID and EUID variables are initialized by Bash at shell startup, but my tests indicate that if they are already in the environment then they will not be changed. The output of id -ru and id -u is...

View Article

Answer by Kamil Maciorowski for Setting up a cron job which runs on the...

The first Thursday of a month is between the 1st and the 7th day of the month (inclusive). The second Thursday is between 8th and 14th, the third Thursday is between 15th and 21st.The Monday in the...

View Article


Answer by Kamil Maciorowski for bash alias or bash function that adds a...

A function like this:# unalias nanotime first, if needednanotime() { nano "$(date +%Y-%m-%d_%H.%M.%S)-$1"}will do what you want, although it's limited.It simply glues the date string to the beginning...

View Article

Answer by Kamil Maciorowski for Why is “less -R” not displaying colors in...

Some programs can detect if they write to a pipe or to a regular file, or to a terminal (tty); they produce colorful output only in this latter case.Example: ls does something like that with ls...

View Article

Answer by Kamil Maciorowski for How are ctags and etags actually defined in...

man ctags states:default is tags, or TAGS when running in etags modeAnd about the etags mode:[…] will create a tag file for use with the Emacs editor. […] if ctags is invoked by a name containing the...

View Article

Comment by Kamil Maciorowski on 'sudo -u' gives error "sorry, try again" for...

Please do not cross-post. For the record, another copy is on Unix & Linux SE.

View Article



Comment by Kamil Maciorowski on MariaDB connection over SSH but using socket...

So... You're telling us you need local sudo mysql ... because the remote MariaDB server can tell what local user opens the local socket; do I get it right? What if you do this locally without sudo (and...

View Article

Comment by Kamil Maciorowski on Why is ADB stopping phone from ejection in...

The solution should be posted as an answer (below). You can answer your own question. There is no need to litter the title with "solved"; accept the best answer to indicate the problem is solved.

View Article

Comment by Kamil Maciorowski on Hide Devices Section from KDE Dolphin

What is the real problem? Does the performance of Dolphin deteriorate because of many mountpoints or what? If you want each user to be unable to access other users' directories then hiding them in...

View Article

Comment by Kamil Maciorowski on How to verify that hard drive is filled with...

As grep 0x00 searches for literal0x00 string, you will probably get binary file matches from your grep -v …. It will only mean there was a "line" not containing literal 0x00. A leading null byte or two...

View Article


Comment by Kamil Maciorowski on Could a change of ISP affect the strength of...

The title (about wifi) and the body (about fibre) seem to be two different questions. Quite confusing. Please [edit] and clarify.

View Article

Comment by Kamil Maciorowski on How to run command recursively on directories...

@jsotola It's probably "on directories only, on Ubuntu".

View Article

Comment by Kamil Maciorowski on Cloning 60GB IDE drive via USB adapter is...

What is the exact command you used? What is the OS? Are you using dd with the default bs=? Are you using some very old hardware? (e.g. with USB 1.1). Please [edit] the question and add information.

View Article


Comment by Kamil Maciorowski on Discord thinks I am living in the future - why?

The question is "why?" and your answer does not answer it at all.

View Article


Answer by Kamil Maciorowski for Is there a safe way to automatically remove a...

Use tmpfs, e.g. create the file inside /dev/shm.It is intended to appear as a mounted file system, but stored in volatile memory instead of a persistent storage device.[emphasis mine]In my Debian /run...

View Article

Comment by Kamil Maciorowski on Can't resize NTFS partition using GParted...

"recreated the NTFS file system with ext4" – NTFS and ext4 are two different types. The sentence makes as much sense as "I painted my shed blue with red paint".

View Article

Comment by Kamil Maciorowski on Why doesn't sort have the option...

The original question is "why is there no option I need?". You added "is it possible to get the result I need with the tool I'm fixated on?" and "if yes, then what is the option I need?". The first...

View Article

Comment by Kamil Maciorowski on How to remove blank lines before line...

@MichaelFirth In both cases we target a multi-line pattern space where there are empty line(s) at the beginning and there is # End of dynamic section at the end, so we anchor accordingly. Anchoring #...

View Article

Browsing latest articles
Browse All 648 View Live