ArtS - Knowledge Base

Table of Contents

Home Knowledge Base Gaming

ssh

Extending Screens

You can add another computer’s monitor to your host’s screen and control it using your keyboard and mouse as if it was an extra monitor. It can come in handy when working on 2 computers as you can control both with the same of keyboard and mouse.

  • user@host:port specify the host to add to your screen.
  • -east select which direction from your current monitors the new one will be added
ssh -YC user@host:port x2x -east -to :0.0

git

Bare Repositories

Turning off untracked files for git status for bare repositories.

git config status.showUntrackedFiles off

sort

Print out unique lines of the file in descending order.

sort -u file

awk

Print the first column (separated by :) from /etc/passwd.

awk -F: '{print $1}' /etc/passwd

Print the first column (separated by :) from /etc/passwd where the 3rd column is 1000.

awk -F: '$3=="1000" {print $1}' /etc/passwd

date

Convert dates between different formats.

The example converts it to the Unix Epoch format that can be used to compare different dates.

date -d "12:30" +%s

cmatrix

Send any output (like cmatrix) to the TTY screen.

User needs to be logged in on the TTY and not have a Graphical environment running. Best done over SSH on servers.

Might need sudo to be executed.

cmatrix > /dev/tty2

Author: Artem Smaznov

Created: 2022-01-07 Fri 18:08