Applicazioni da remoto

Oh, dimenticavo di aver già scritto di waypipe, a proposito dei giochi 3d. Quasi 5 anni fa!

Ora la parte noiosa. Spesso mi collego (con ssh, ça va san dire) alle mie macchine di casa da remoto dove è già attiva una sessione “desktop” che oggigiorno è Wayland. Così qualsiasi programma Gnome o che usa le librerie Gtk – cioè moltissimi – verrà visualizzato sul desktop Wayland e non sul dektop remoto.

waypipe ssh $HOST” funziona a meraviglia, ma l’aggiunta di queste righe al vostro .bashrc è utile quando non state usando una sessione Wayland (cioè Windows):

if [ -n "$SSH_CLIENT" ]; then
  if [ -n "$WAYLAND_DISPLAY" ]; then
    echo "Remote session with waypipe, everything will be OK" 
  else 
    echo "Remote session, forcing GTK to X11"
    export GDK_BACKEND=x11
  fi
fi

Network transparency with Wayland (bis)

Oh, I forgot I already wrote about waypipe, regarding 3d games. Almost 5 years ago!

Now the boring part. If you log into a machine where a Wayland session is already active – I often log into my home machines remotely – any Gtk program will show on the Wayland desktop. So you use “waypipe ssh $HOST” which is cool and works like a breeze but adding those lines to your .bashrc helps when you are not using a wayland session (i.e. Windows):

if [ -n "$SSH_CLIENT" ]; then
  if [ -n "$WAYLAND_DISPLAY" ]; then
    echo "Remote session with waypipe, everything will be OK" 
  else 
    echo "Remote session, forcing GTK to X11"
    export GDK_BACKEND=x11
  fi
fi

How to download all PDF files linked from a single page using wget

You can use wget to download all PDFs from a webpage by using:

wget -r -l1 -H -t1 -nd -N -np -A.pdf -erobots=off --wait=2 --random-wait --limit-rate=20k [URL]
  • -r: Recursive download.
  • -l1: Only one level deep (i.e., only files directly linked from this page).
  • -H: Span hosts (follow links to other hosts).
  • -t1: Number of retries is 1.
  • -nd: Don’t create a directory structure, just download all the files into the current directory.
  • -N: Turn on timestamping.
  • -np: Do not follow links to parent directories.
  • -A.pdf: Accept only files that end with .pdf.
  • -erobots=off: Ignore the robots.txt file (use carefully, respecting site’s terms and conditions).
  • –wait=2: Wait 2 seconds between each retrieval.
  • –random-wait: Wait from 0.5 to 1.5 * –wait seconds between retrievals.
  • –limit-rate=20k: Limit the download rate to 20 kilobytes per second.

This parameters will avoid the “429: Too Many Requests” error.

Source: How to download all PDF files linked from a single page using wget

Guida ad Internet per tiranni

Cassandra Crossing 256/ Guida ad Internet per tiranni riporta un collegamento a http://assets.pwd.io/pwd/media/Guida_per_dittatori.pdf e http://assets.pwd.io/pwd/media/Guida_per_dittatori.txt conservato su archive.org. Ora siccome archive.org è sempre fin troppo oberato mi sembra opportuno copiare qui

Continue reading

How to copy a file or directory from another GIT repository while preserving its history?

Internet is full of magic formulas each one more complex.

Here I’m proposing a much simpler and faster one that is to make a git format-patch for the entire history of the file or subdirectory that we want and then import it into the destination repository.

mkdir /tmp/mergepatchs
cd ~/repo/org
export reposrc=myfile.c #or mydir
git format-patch -o /tmp/mergepatchs $(git log $reposrc|grep ^commit|tail -1|awk '{print $2}')^..HEAD $reposrc
cd ~/repo/dest
git am /tmp/mergepatchs/*.patch

Simple and fast :)

Source synaptic fault http://blog.neutrino.es/2012/git-copy-a-file-or-directory-from-another-repository-preserving-history/

Audio oh, audio

As I tend to meddle a lot more than necessary with my strange machine which is stable/testing/unstable and somehow experimental I tend to mess it up. So today I had to issue

systemctl --user restart pipewire.service

to get audio back on my Gnome desktop