This is the first balenaOS masterclass.
There are no prerequisites apart from basic linux knowledge and terminal access to a device running balenaOS.
Masterclass Type: Core Maximum Expected Time To Complete: 60 minutes
root@5689936:~# chronyc sources -v | |
210 Number of sources = 4 | |
.-- Source mode '^' = server, '=' = peer, '#' = local clock. | |
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined, | |
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable. | |
|| .- xxxx [ yyyy ] +/- zzzz | |
|| Reachability register (octal) -. | xxxx = adjusted offset, | |
|| Log2(Polling interval) --. | | yyyy = measured offset, | |
|| \ | | zzzz = estimated error. |
Notes on making rachel pi work with a read-only filesystem.
A good reference this is based on. https://hallard.me/raspberry-pi-read-only/
List of actions:
Ideally, go through https://docs.docker.com/engine/userguide/intro/ | |
Its pretty good and steps through many various features. | |
Ubuntu repositories usually have an old version. | |
Install latest from https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
To make it easy to run docker without sudo. Add current user to sudo. | |
https://docs.docker.com/engine/installation/linux/ubuntulinux/#create-a-docker-group | |
Run hello-world container. |
# sabaq.pk has a site-map page which has links to all videos. | |
# Extracting titles of all videos using the following bash for example punjab biology 9th class | |
# need a few variables | |
subject=punjab-biology-9th | |
board="punjab board" | |
# grep subject, then video. then replace bad characters in the line with nothing using sed to generate right urls of each video | |
cat sabaq.xml | grep $subject | grep video | sed s/vsg/sid/ | sed 's/amp;//' | sed 's/<loc>//' | sed 's/<\/loc>//' > $subject.txt |
sabaq.pk has lectures in urdu for high school. | |
They are hosted on daily motion. | |
The easiest way would be to download them all using youtube-dl and the sabaq user. | |
However they are not sorted as playlists, and the video titles are not numbered. | |
And daily motion has an issue. It only shows 1800 videos on a 100 user pages. | |
Any more video pages get redirected to the 100th page. |
youtube-dl is a nifty utility that can parse and download all user videos. Recently added a feature on downloading all playlists. | |
Here is a command that downloads all playlists of user KhanAcademyUrdu and puts all videos of each playlist in separate folders. | |
youtube-dl -ciw -f '(webm)[height<480]' -o '/media/zubairlk/part1/khanurdu/%(playlist)s/%(playlist_index)s_%(title)s_%(id)s.%(ext)s' --yes-playlist -R 10000 https://www.youtube.com/user/KhanAcademyUrdu/playlists | |
some explanation for later. see https://github.com/rg3/youtube-dl for full details. | |
-i is to ignore interrupts. timeouts/private videos etc block otherwise. |
this is me typing in the main window |