Linux

I have a keyboard/mouse/screen switch to connect 2 PCs: one running Linux and one running Windows.

When I connect all the ports, it works, but every time I switch to the Windows laptop, the screen reconfigures, my windows are moved, and it annoys me. The switch behaves as if I had physically unplugged/replugged the screen, and Windows feels compelled to adjust the entire layout!

In my previous post, I used Nebula to setup a secured network between 2 virtual machines.

This time, I’ll try to make a MySQL client and server communicate through a Nebula tunnel. And to make it a little bit more difficult, I’ll use podman to run the client and the server in containers.

Is it possible to use the public network, namely Internet, to make 2 machines communicate securely ? And if possible something easier to install and configure than OpenVpn ?

Udev Webcam 2022.04.01

You can change the device link so your webcam will be always accessible at the same location /dev/video99. You can also persist some settings via the v4l-ctl command.

This days, with 4K monitors, the linux console is unreadable : the font is too small. So how can we scale the font size in the console after boot ?

If you use a tiled window manager like me, Suckless DWM for example, and have Firefox as your browser, you may be interested by not showing the tabs.

How to flash any iso (think about your favorite distro) on an USB key without graphical IHM ?

sudo dd if=/path/to/image.iso of=/dev/sda status=progress
  • “/path/to/image.iso” is the path to the ISO file
  • /dev/sda is your USB key device (see below to get yours) : note that it is the whole device, not a partition (e.g. /dev/sda and not /dev/sda1)
  • status=progress show flashing progression

How to know wich device to use ?

How to configure a Debian based Linux distribution to share a folder with anyone on the network, with read and write access ?

ImageMagick logo

As ‘man convert’ states :

The convert program is a member of the ImageMagick suite of tools. Use it to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

Get rid of graphic boot on Linux with a few modifications in grub configuration :

# edit your grub config
sudo vi /etc/default/grub

# remove splash, quiet, ... from GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="text"

# save the file and update grub
sudo update-grub

For example, to substitute foo with bar

for f in `grep -lR foo`; do
  echo -n ">> $f";
  sed 's/foo/bar/g' $f > $f.2;
  mv $f.2 $f;
  echo " done.";
done
  • for loops on all files containing the text “foo”, grep -l only show the file name with corresponding text inside.
  • sed replace foo with bar in all file
  • mv save the modification (delete if you don’t want to overwrite the original files, the modified files is named with .2 at the end)

The fastest and more efficient way to batch multiple files encoding conversion :

vim +"argdo se fileencoding=utf-8 | w | bnext" +"q" ` find . -type f -name "*.rsp"

+“argdo” : execute the following vim commands for each file (filencode, save and next buffer)

DWM is my tiled window manager. It’s fast, flexible and fun. My linux desktop is up and running after a few seconds… (ok, thanks also to the ssd :-) ).