Listing posts

Displaying posts 11 - 15 of 356 in total
Midnight Commander shortcuts
Last update
2025-09-08
2025
09-08
«MC: the "Midnight Commander".
Norton Commander clone/powerup»

Panel Functions

Keys Function
TAB switch focus between panels
Alt ? open search (find) dialog
Alt s incremental search (press again for the next match)
Alt i sync panels directories on current one
Alt t switch among panel layouts in loop
Ctrl r refresh active panel
Ctrl u swap panels

Common Functions

Keys Function
Insert toggle mark on selected file
* toggle marked files
+ marks files based on a pattern
- unmarks files based on a pattern
Shift Down mark file and move to the next entry
Shift Up mark file and move to the previous entry
Shift F5 copy single file
Shift F6 move single file
Ctrl x c open chmod dialog for marked file
Ctrl x o open chown dialog for marked file
Ctrl x s make a symbolic link of the current file

Shell functions

Keys Function
Alt Enter copy selected filename in command line
Ctrl Shft Enter copy full path of selected file in the command line
Alt H shows command line history

Useful settings

Here is my configuration (press F9 to navigate the menu):

Option menu Option
Configuration check_box Verbose operation
check_box Compute totals
check_box Auto save setup
Layout check_box_outline_blank Hintbar visible
Panel options check_box_outline_blank Show hidden files
check_box Auto save panels setup
check_box File highlight > File types
Appearance darkfar theme


Left/Right menu Option
Listing mode check_box User defined > half type name | size:4 | perm

File actions

  • Menu > Command > Edit extension file
  • set mpv for video files
  • set geeqie for images
  • set mcomix for cbz/cbr

Source: Klimer, MC HP, Kayxl, ArchLinux forum


~~~ * ~~~

Linux terminal window manager
Last update
2025-09-08
2025
09-08
«text mode, cli, gui, mouse»

Window managers

Other mentions


Source: r/linux


~~~ * ~~~

fish | friendly interactive shell attachment
person cloud · link
Last update
2025-09-07
2025
09-07
« — »

Resources

Extensions

Prompt power-up

  • decompress fish_config.7z attachment in ~/.config/fish/
  • curl -L https://get.oh-my.fish | fish
  • omf install bobthefish
  • download and install Meslo font from nerd-fonts
  • set MesloLGMDZ Nerd Font Mono font for your terminal
  • put set -g theme_nerd_fonts yes in your ~/.config/fish/config.fish
  • customize fish_greeting.fish and fish_right_prompt.fish in ~/.config/fish/functions/

On cygwin under windows you can install DejaVu Sans Mono ttf powerline font, and set fish as the default shell.

In the attached file there is a simple prompt with git support.

Commands

  • fish_update_completions -- scan man pages for completion tips
  • env VAR1=xxx VAR2=yyy command arg1 arg2 ... -- run command with env vars

~~~ * ~~~

SSH tunnel howto and hints attachment
Last update
2025-09-05
2025
09-05
«relevant things about ssh tunnels, netcat port knocking»

A general tunnel command:

1
2
3
4
5
6
7
8
9
10
11
12
13
ssh myuser@mysrv
  -L   8080:localhost:80  # tunnel local_port:target:target_port
  -L *:8080:localhost:80  # tunnel open to everyone who can connect to this machine
  -R   3380:localhost:80  # reverse tunnel port_on_mysrv:target:target_port
  -R *:3322:localhost:22  # reverse tunnel open to everyone who can connect to mysrv
  -q # quiet mode
  -f # go to background
  -n # redirects stdin from /dev/null
  -N # do not execute a remote command
  -T # disable pseudo-terminal allocation
  -M -S /path/to/socket # enable master mode via a shared socket
  -o UserKnownHostsFile=/dev/null # do not update known_hosts file
  -o StrictHostKeyChecking=no     # do no check the empty known_hosts file

Note: to allow the creation of reverse tunnels opened to everyone (0.0.0.0) you have to set this option:

1
2
# server configuration: /etc/ssh/sshd_config
GatewayPorts clientspecified

Scriptable tunnels

You can look for process IDs via pgrep/pkill:

1
2
ssh -fnNT ... mysrv          # start
pkill -f -QUIT 'ssh.*mysrv'  # stop

or better use master mode to avoid both grepping and any timing issues:

1
2
3
ssh -fNM -S /path/to/socket ... mysrv  # start
ssh -S /path/to/socket -O check        # check
ssh -S /path/to/socket -O exit mysrv   # stop

Auto-closing tunnels

SSH runs the specified command and then exits only if no one is using the tunnel:

1
2
ssh -f myusr@mysrv sleep 10  # start auto-closing tunnel
vncviewer 127.0.0.1::25901   # use the tunnel

Keep alive your connection

Keep alive the connection for 60 seconds, 1440 times (= 24 hours):

1
2
3
4
# client configuration: /etc/ssh/ssh_config | ~/.ssh/config
Host *
  ServerAliveInterval 60
  ServerAliveCountMax 1440
1
2
3
# server configuration: /etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 1440

Test connectivity

1
ssh -o BatchMode=yes -o ConnectTimeout=3 myusr@mysrv exit && echo ok || echo ko

List active tunnels and ports

1
sudo lsof -i -n | egrep sshd

Port knocking

1
2
3
4
5
6
7
# -4=ip4, -z=scan, -n=no_dns_lookup, -u=UDP, -v=verbose, -w=timeout_seconds
nc -4znuv hostname_or_ip port1 port2 ...

# example using TCP and wait interval 
nc -4zw myhost port1; sleep 1
nc -4zw myhost port2; sleep 1
...

Source: Stackexchange - master mode, Patrickmn - keep alive, Stackoverflow - test, Superuser - list active tunnels


~~~ * ~~~

Linux Run Command As Another User
person cloud · link
Last update
2025-09-05
2025
09-05
«runuser, su, sudo»

runuser

Only root can use it, no password asked, less overhead than others.

1
2
3
4
5
runuser -u username -- command args

# -l = login shell, -P = allocate a pty
runuser -l  userNameHere -c 'command args'
runuser -P -l  userNameHere -c '/user/bin/bash -ilc "command args"'

Note: You can also use #!/usr/bin/env -S bash -il shebang in a command script to get the real final user environment.

sudo

Asking user password

1
2
3
# -i = login shell, -u = username
sudo -iu username # open default shell for `username`
sudo -iu username command args

Without asking user password

1
echo "username ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/local

su

Asks target password.

1
2
3
# - or --login = login shell
su - # open root shell
su - username -c "command args"

Source: nixCraft