- Arch Linux iso
- Virtualbox
- Two virtual HDDs - 8G (main) & 1G (detached header & boot) respectively
| device=sdb | |
| serial="$(ls -la /dev/disk/by-id | grep "/$device\$" | sed 's/ /\n/g' | grep ata | sed 's/_/\n/g' | tail -n1)" | |
| read -r -s password | |
| hashed=$(SERIAL="$serial" PASSWORD="$password" python3 -c 'import hashlib, base64, os; print(base64.b64encode(hashlib.pbkdf2_hmac("sha1", os.environ["PASSWORD"].encode(), os.environ["SERIAL"].ljust(20, " ").encode(), 75000, 32)).decode())' | base64 -d) | |
| sudo sedutil-cli -n --listLockingRanges "$hashed" /dev/$device |
| #!/bin/bash | |
| if [ "$#" -lt 4 ]; then | |
| echo "`basename $0` <mysql-root-passwd> <db user> <ip> <db password>"; | |
| exit 1; | |
| fi | |
| mysql --user=root --password=$1 <<EOF | |
| CREATE DATABASE wordpress; | |
| CREATE USER '$2'@'$3' IDENTIFIED BY '$4'; |
Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.
- this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
- if something is not clear, you need more information, etc. check the sources below
With that out the way, let's begin.
| location = /404.html { | |
| root /usr/share/nginx/error; | |
| } | |
| error_page 404 /404.html; | |
| location = /50x.html { | |
| root /usr/share/nginx/error; | |
| } | |
| error_page 500 502 503 504 /50x.html; |
This gist will explain how to create a DNS-over-TLS bridge for the local network.
The server part will be based on: https://dfarq.homeip.net/dns-over-tls-protect-your-network-with-ubuntu/.
Install required packaages:
This FFmpeg command reads images named frame_[4 char digit].png and converts it to an mp4 using the h264 encoding which Twitter accepts. The bitrate is set to 5M to reduce blocking as much as possible while keeping the size small.
ffmpeg -framerate 10 -i frame_%04d.png -c:v h264_qsv -b:v 5M video.mp4
ffmpeg -i input.mp4 -c:v h264_qsv -vf: scale=1080:-1 -b:v 5M output.mp4
| # find merge-request which contains commit in GitLab | |
| # https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28037 | |
| # https://stackoverflow.com/a/17819027/7277090 | |
| git config --add remote.origin.fetch '+refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*' | |
| git fetch origin | |
| git for-each-ref --contains <hash> | grep merge-requests | head -n 10 |