linux-settings

Nastavitve za linux programe.

Installation

wget https://raw.githubusercontent.com/kb2623/linux-settings/master/configure
bash configure
make

Git navodila

Git global setup

git config --global user.name "user"
git config --global user.email "user@mail.com"

Git user home dir

git init
git remote add origin https://github.com/kb2623/linux-settings.git 
git fetch
git submodule update --init --recursive

Git ukaz za podmodule

Inicializacija in prenos

git submodule update --init --recursive

Prenos inicializiranih

git submodule update --recursive --remote

Prenos master brancha

git submodule foreach git merge origin master

Dodatne nastavitve

Firefox

How to disable WebRTC in Firefox?

In short: Set media.peerconnection.enabled to false in about:config.

Now you can be 100% sure WebRTC is disabled.

userChrome.css

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

#TabsToolbar { height:25px!important; margin-top:-1px!important; margin-bottom:1px!important; }
#tabbrowser-tabs { height:25px!important; min-height:25px!important; }

.tab-background-start[selected=true]::after,
.tab-background-start[selected=true]::before,
.tab-background-start,
.tab-background-end,
.tab-background-end[selected=true]::after,
.tab-background-end[selected=true]::before {
  min-height:25px!important;
}

#VimFxMarkersContainer .marker {
  font-size: 15px !important; /* Specific font size. */
  text-transform: uppercase !important; 
}

Accessing vncserver via SSH tunnels

For servers offering SSH connection, an advantage of this method is that it is not necessary to open any other port than the already opened SSH port to the outside, since the VNC traffic is tunneled through the SSH port.

On the server

On the server side, vncserver or x0vncserver must be run.

When running either one of these, it is recommended to use the -localhost switch way since it allows connections from the localhost only and by analogy, only from users ssh’ed and authenticated on the box. For example run a command such as:

$ vncserver -localhost

or for x0vncserver:

$ x0vncserver -localhost -SecurityTypes none

On the client

The VNC server has been setup on the remote machine to only accept local connections. Now, the client must open a secure shell with the remote machine (10.1.10.2 in this example) and create a tunnel from the client port, for instance 9901, to the remote server 5901 port.

$ ssh 10.1.10.2 -L 9901:localhost:5901

Once connected via SSH, leave this shell window open since it is acting as the secured tunnel with the server. Alternatively, directly run SSH in the background using the -f option. On the client side, to connect via this encrypted tunnel, point the vncviewer to the forwarded client port on the localhost.

$ vncviewer localhost:9901

What happens in practice is that the vncviewer connects locally to port 9901 which is tunneled to the server’s localhost port 5901. The connection is established to the right port within the secure shell.

Tip

It is possible, with a one-liner, to keep the port forwarding active during the connection and close it right after:

$ ssh -fL 9901:localhost:5901 10.1.10.2 sleep 10; vncviewer localhost:9901

What it does is that the -f switch will make ssh go in the background, it will still be alive executing sleep 10. vncviewer is then executed and ssh remains open in the background as long as vncviewer makes use of the tunnel. ssh will close once the tunnel is dropped which is the wanted behavior.

Connecting to a vncserver from Android devices over SSH

To connect to a VNC server over SSH using an Android device as a client, consider having the following setup:

In ConnectBot, connect to the desired machine. Tap the options key, select Port Forwards and add a port:

Type: Local
Source port: 5901
Destination: 127.0.0.1:5901

In androidVNC connect to the VNC port, this is the local address following the SSH connection:

Password: the vncserver password
Address: 127.0.0.1
Port: 5901

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

tmux new -s myname

attach:

tmux a  #  (or at, or attach)

attach to named:

tmux a -t myname

list sessions:

tmux ls

kill session:

tmux kill-session -t myname

In tmux, hit the prefix ctrl+b and then:

Sessions

:new<CR>  new session
s  list sessions
$  name session

Windows (tabs)

c           new window
,           name window
w           list windows
f           find window
&           kill window
.           move window - prompted for a new number
:movew<CR>  move window to the next unused number

Panes (splits)

|  horizontal split
-  vertical split

o  swap panes
q  show pane numbers
x  kill pane
⍽  space - toggle between layouts

Window/pane surgery

:joinp -s :2<CR>  move window 2 into a new pane in the current window
:joinp -t :1<CR>  move the current pane into a new pane in window 1

Misc

d  detach
t  big clock
?  list shortcuts
:  prompt

Resources:

Notes:

TODO:

SSL

Create key

openssl genrsa -des3 -out [file.key] 2048

Decript key

openssl rsa -in [file1.key] -out [file2.key]

Create certificat

openssl req -x509 -new -nodes -key [file.key] -sha256 -days 1024  -out [file.pem]

Kitty

xterm-kitty: unknown terminal type

n order to copy over a terminfo file to your remote host’s ~/.terminfo folder, run the following:

kitty +kitten ssh "your.remote.server"