Skip to content

Instantly share code, notes, and snippets.

Avatar

Francesco Frassinelli frafra

View GitHub Profile
@frafra
frafra / .gitlab-ci.yml
Created Nov 6, 2020
Build containers with GitLab CI without root nor daemons by using buildkit
View .gitlab-ci.yml
build-container:
stage: build
image:
name: moby/buildkit:rootless
entrypoint: [ "sh", "-c" ]
variables:
BUILDKITD_FLAGS: --oci-worker-no-process-sandbox
before_script:
- |
mkdir ~/.docker
@frafra
frafra / fix.md
Created Jun 14, 2020
USB C headphones sound distorsion fix for Linux
View fix.md

Affected devices

  • Bowers & Wilkins PX7 19b5:0025 B & W Group
  • Dali IO-6 0a12:0001 Cambridge Silicon Radio

Fix

Sample rate should be set to 96 kHz.

PulseAudio

@frafra
frafra / pyproject.toml
Created May 11, 2020
poetry-cookiecutter-bug
View pyproject.toml
[tool.poetry]
name = "{{ cookiecutter.project_name }}"
version = "0.1.0"
description = ""
authors = ["Francesco Frassinelli <francesco.frassinelli@nina.no>"]
[tool.poetry.dependencies]
python = "^3.7"
[tool.poetry.dev-dependencies]
@frafra
frafra / consigli-per-animali.md
Created Apr 20, 2020
Divertirsi con le parole
View consigli-per-animali.md

Testo rilasciato sotto licenza Creative Commons Attribution 4.0, scritto da Francesco Frassinelli fraph24@gmail.com.

Consigli per animali a cui manca solo la parola

È di vitale importanza che le capre amanti del canto restino sopra le panche, anche se hanno una fame da lupi, per non finire a far compagnia alle gatte morte. I cani che abbaiano non facciano troppo i galli ed abbassino la cresta: se si scoprisse che non mordete finireste per fare la figura dei polli. Per le signore di una certa età è meglio fare le galline che le oche: almeno il brodo sarà buono. Se si è pesci meglio stare stretti come sardine che passare per dei tonni. È auspicabile che i molluschi non facciano gli asini con le volpi, evitando di dare le perle ai porci. I vermi lenti come lumache cerchino riparo sotto terra: una gallina potrebbe metterci il becco. I lupi solitari che non sono delle aquile potranno comuque fare la parte del leone se saranno testardi come dei muli, ma attenzione ai gufi porta sfortuna e alle sanguisughe opp

@frafra
frafra / example-extract-table-from-wikipedia.sh
Created Feb 26, 2020
Extract a table from Wikipedia (example)
View example-extract-table-from-wikipedia.sh
#!/bin/bash -x
set -e
title="List_of_most-viewed_YouTube_channels"
host="en.wikipedia.org"
tmp="$title.$(date +'%Y%m%d').html"
cleanup() { rm -f "$tmp"; }
trap cleanup 0
curl -L "$host/api/rest_v1/page/mobile-sections/$title" |
@frafra
frafra / restore-mediawiki-dump.sh
Last active Nov 10, 2019
Restore MediaWiki dump (example)
View restore-mediawiki-dump.sh
#!/bin/bash -ex
# https://dumps.wikimedia.org/backup-index.html
dump="https://dumps.wikimedia.org/nowiktionary/20191101/nowiktionary-20191101-pages-articles-multistream.xml.bz2"
# https://www.mediawiki.org/wiki/Extension:Scribunto
scribunto="https://extdist.wmflabs.org/dist/extensions/Scribunto-REL1_33-8328acb.tar.gz"
pod="wiktionary"
mysql=$(podman volume create)
@frafra
frafra / stubby-onoff.sh
Last active Oct 22, 2019
Enable/Disable DNS-over-TLS on Fedora
View stubby-onoff.sh
#!/bin/bash
# mkdir -p $HOME/bin && cd $_ && wget https://gist.githubusercontent.com/frafra/a1ca3d5eff81e6c6aebd8fab12b00695/raw/stubby-onoff.sh -O stubby-onoff && chmod +x $_ && cd -
set -ex
[ $USER == "root" ] || exec sudo $0
pkgs="getdns-stubby crudini"
rpm -q $pkgs || dnf install -y $pkgs
conf=/etc/NetworkManager/NetworkManager.conf
@frafra
frafra / chromecast-and-linux.md
Last active Sep 22, 2019
Tricks to use Chromecast on GNU/Linux systems
View chromecast-and-linux.md

No weird or unmaintained softwares or libraries are involved in this guide, just VLC, Avahi and youtube-dl.

VLC + Chromecast

VLC supports Chromecast since version 3.0.0 (2018-02-09). Just go to Playback -> Renderer.

vlc --sout "#chromecast" --sout-chromecast-ip=$IP --demux-filter=demux_chromecast "$input"
@frafra
frafra / ls-contributed-to.sh
Created Jan 21, 2019
Like `ls -1` but marks path modified by a specific author or a company
View ls-contributed-to.sh
#!/bin/bash
#regex="@nina.no$"
regex="$1"
function check {
git log --format="%ae" "$1" | grep -q "$regex"
}
check '.' && echo " * ." || echo " ."
View cheap-vps.md

VPS cheaper than 5 €/month

Famous/big companies

Linode

Current status (October 2020): better avoid

Starting from 5 $/month.

You can’t perform that action at this time.