diff --git a/Makefile b/Makefile index ef7b8b7..452d2db 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ SHELL = /bin/sh -INSTALLDIR := ./public_html/eh/eh/eh/eh-eh/ +INSTALLDIR_HTML := ./public_html/eh/eh/eh/eh-eh/ +INSTALLDIR_ANSI := ./public_ansi/ # The name of the stylesheet. This needs to be copied to any directory containing html files that use it. style := style.css @@ -15,18 +16,20 @@ list_template := pandoc/meta-json-template.txt article_list := articles.json # article targets -articles := $(patsubst %.md,%.html,$(wildcard articles/*.md)) +articles_html := $(patsubst %.md,%.html,$(wildcard articles/*.md)) +articles_ansi := $(patsubst %.md,%,$(wildcard articles/*.md)) -all: index.html about.html +all: index.html index about.html about install: - cp -r index.html about.html shark.js shark.png dvd-logo.png $(articles) $(style) $(images) $(INSTALLDIR); \ + cp -r index.html about.html shark.js shark.png $(articles_html) $(style) $(images) $(INSTALLDIR_HTML); \ + cp -r index about $(articles_ansi) $(INSTALLDIR_ANSI); clean: echo '{"articles": []}' > $(article_list); \ - rm index.html about.html $(articles); + rm index.html about.html $(articles_html); -$(articles): %.html: %.md +$(articles_html): %.html: %.md jq 'del(.articles[] | select(.filename == "$(notdir $@)"))' $(article_list) > articles.json.tmp; \ mv ./articles.json.tmp $(article_list); \ @@ -38,9 +41,18 @@ $(articles): %.html: %.md jq '.articles += [$(shell pandoc $< --template $(list_template) | jq '. += {"filename": "$(notdir $@)"}' )]' $(article_list) > articles.json.tmp; \ mv ./articles.json.tmp $(article_list); \ -index.html: index.md $(articles) +$(articles_ansi): %: %.md + pandoc $< --to ansi --output $@ + +index.html: index.md $(articles_html) # Build index.html with metadata injected from articles_list pandoc $< --template $(template) --include-after-body shark.js --css $(style) --metadata-file $(article_list) --highlight-style zenburn --mathml --toc --output $@; \ +index: index.md $(articles_ansi) + pandoc $< --to ansi --output $@ + about.html: about.md pandoc $< --template $(template) --css $(style) --highlight-style zenburn --mathml --toc --output $@ + +about: about.md + pandoc $< --to ansi --output $@ diff --git a/about b/about new file mode 100644 index 0000000..084b746 --- /dev/null +++ b/about @@ -0,0 +1,5 @@ +]8;;https://nevereverever.de/eh/eh/eh/eh-eh/rsync-android.html\Rsync Android]8;;\ + +Stuff + +$$ \sum_{i=1}^k i = \frac{k(k+1)}{2} $$]8;;\ diff --git a/about.html b/about.html index ca1d4ba..204c245 100644 --- a/about.html +++ b/about.html @@ -50,6 +50,9 @@
+

Rsync +Android

Stuff

i=1ki=k(k+1)2 \sum_{i=1}^k i = \frac{k(k+1)}{2}

diff --git a/about.md b/about.md index 1942365..73adbf2 100644 --- a/about.md +++ b/about.md @@ -2,6 +2,8 @@ title: About --- +[Rsync Android](https://nevereverever.de/eh/eh/eh/eh-eh/rsync-android.html) + ## Stuff $$ \sum_{i=1}^k i = \frac{k(k+1)}{2} $$ diff --git a/articles/latex-endeavors b/articles/latex-endeavors new file mode 100644 index 0000000..c0c53f2 --- /dev/null +++ b/articles/latex-endeavors @@ -0,0 +1,8 @@ +BIBLATEX AND BIBER + +Biber doesn’t run + +Biber doens’t run if the (fedora) package  libxcrypt-compat  is missing. +It will fail with the error message + + biber: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory]8;;\ diff --git a/articles/random-linux-utils b/articles/random-linux-utils new file mode 100644 index 0000000..258bec6 --- /dev/null +++ b/articles/random-linux-utils @@ -0,0 +1,11 @@ +MERGE PDFS + +Using Ghostscript + +Ghostscript has a feature to merge multiple pdf files into one. Although +ImageMagick also has this feature, I prefer this one, as it doesn’t +rasterize and scales down the pdf files. + + gs -dNOPAUSE -sDEVICE=pdfwrite \ +  -sOUTPUTFILE=output.pdf \ +  -dBATCH 1.pdf 2.pdf]8;;\ diff --git a/articles/rsync-android b/articles/rsync-android new file mode 100644 index 0000000..4faedb8 --- /dev/null +++ b/articles/rsync-android @@ -0,0 +1,107 @@ +SETUP TERMUX + +Install Termux using F-Droid. + +Update software repos. + + pkg update + +Grant file access permissions using. + + termux-setup-storage + +ESTABLISHING AN SSH CONNECTION + +If network (such as eduroam) is blocking ssh trafic between machines, +open a Wi-Fi Hotspot on your Linux machine and connect the Android +device to it before using  rsync  or  ssh . + +Configuring Android + +Install the openssh server on Termux. + + pkg install openssh + +Start the ssh server daemon. + + sshd + +Get the ip address of the Android machine (in the Hotspot). + + ifconfig + + Warning: cannot open /proc/net/dev (Permission denied). Limited output. + lo: flags=73 mtu 65536 +  inet 127.0.0.1 netmask 255.0.0.0 +  unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) + + rmnet0: flags=4305 mtu 1280 +  inet 10.200.157.166 netmask 255.255.255.0 destination 10.200.157.166 +  unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) + + wlan0: flags=4163 mtu 1500 +  inet 10.42.0.200 netmask 255.255.255.0 broadcast 10.42.0.210 +  unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) + +In this case 10.42.0.200. + +The ssh server should now be running and listening on port 8022. You can +check by running + + nmap -Pn <ip_address> + +For me   whould be 10.42.0.200. + +Get the username. + + whoami + + u0_a700 + +Set a password for this user. + + passwd + +Connecting to Android via ssh + +Make sure you have an ssh key pair on the Linux system. If not generate +one using  ssh-keygen . + +Now connect to Android by  ssh . + + ssh <username>@<ip_address> -p 8022 + +SYNCRONISING FILES WITH RSYNC + +Install  rsync  on Termux and Linux. Make sure to keep your own openssl +config. + + pkg install rsync + +Now on your Linux machine, syncronise your Music library with rsync. + + rsync -av -e "ssh -p 8022" ~/Music <username>@<ip_address>:/data/data/com.termux/files/home/storage/music + +Refreshing the Android MediaStore + +Android uses a Database to store files. In order to play your music, +this database needs to be refreshed. This can be achieved by a reboot or +by using adb to manually refresh it. + + sudo dnf install adb + +Connect the Android device via USB and see if it is listed. + + adb devices + +If it is, restart adb in TCP mode with port 5555 + + adb tcpip 5555 + +Connect to the device using its . + + adb connect <ip_address> + +Refresh MediaStore. + + adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN -d file:///data/data/com.termux/files/home/storage/music/]8;;\ diff --git a/index b/index new file mode 100644 index 0000000..8d210ed --- /dev/null +++ b/index @@ -0,0 +1 @@ +]8;;\ diff --git a/public_ansi/about b/public_ansi/about new file mode 100644 index 0000000..084b746 --- /dev/null +++ b/public_ansi/about @@ -0,0 +1,5 @@ +]8;;https://nevereverever.de/eh/eh/eh/eh-eh/rsync-android.html\Rsync Android]8;;\ + +Stuff + +$$ \sum_{i=1}^k i = \frac{k(k+1)}{2} $$]8;;\ diff --git a/public_ansi/index b/public_ansi/index new file mode 100644 index 0000000..8d210ed --- /dev/null +++ b/public_ansi/index @@ -0,0 +1 @@ +]8;;\ diff --git a/public_ansi/latex-endeavors b/public_ansi/latex-endeavors new file mode 100644 index 0000000..c0c53f2 --- /dev/null +++ b/public_ansi/latex-endeavors @@ -0,0 +1,8 @@ +BIBLATEX AND BIBER + +Biber doesn’t run + +Biber doens’t run if the (fedora) package  libxcrypt-compat  is missing. +It will fail with the error message + + biber: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory]8;;\ diff --git a/public_ansi/random-linux-utils b/public_ansi/random-linux-utils new file mode 100644 index 0000000..258bec6 --- /dev/null +++ b/public_ansi/random-linux-utils @@ -0,0 +1,11 @@ +MERGE PDFS + +Using Ghostscript + +Ghostscript has a feature to merge multiple pdf files into one. Although +ImageMagick also has this feature, I prefer this one, as it doesn’t +rasterize and scales down the pdf files. + + gs -dNOPAUSE -sDEVICE=pdfwrite \ +  -sOUTPUTFILE=output.pdf \ +  -dBATCH 1.pdf 2.pdf]8;;\ diff --git a/public_ansi/rsync-android b/public_ansi/rsync-android new file mode 100644 index 0000000..4faedb8 --- /dev/null +++ b/public_ansi/rsync-android @@ -0,0 +1,107 @@ +SETUP TERMUX + +Install Termux using F-Droid. + +Update software repos. + + pkg update + +Grant file access permissions using. + + termux-setup-storage + +ESTABLISHING AN SSH CONNECTION + +If network (such as eduroam) is blocking ssh trafic between machines, +open a Wi-Fi Hotspot on your Linux machine and connect the Android +device to it before using  rsync  or  ssh . + +Configuring Android + +Install the openssh server on Termux. + + pkg install openssh + +Start the ssh server daemon. + + sshd + +Get the ip address of the Android machine (in the Hotspot). + + ifconfig + + Warning: cannot open /proc/net/dev (Permission denied). Limited output. + lo: flags=73 mtu 65536 +  inet 127.0.0.1 netmask 255.0.0.0 +  unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) + + rmnet0: flags=4305 mtu 1280 +  inet 10.200.157.166 netmask 255.255.255.0 destination 10.200.157.166 +  unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) + + wlan0: flags=4163 mtu 1500 +  inet 10.42.0.200 netmask 255.255.255.0 broadcast 10.42.0.210 +  unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) + +In this case 10.42.0.200. + +The ssh server should now be running and listening on port 8022. You can +check by running + + nmap -Pn <ip_address> + +For me   whould be 10.42.0.200. + +Get the username. + + whoami + + u0_a700 + +Set a password for this user. + + passwd + +Connecting to Android via ssh + +Make sure you have an ssh key pair on the Linux system. If not generate +one using  ssh-keygen . + +Now connect to Android by  ssh . + + ssh <username>@<ip_address> -p 8022 + +SYNCRONISING FILES WITH RSYNC + +Install  rsync  on Termux and Linux. Make sure to keep your own openssl +config. + + pkg install rsync + +Now on your Linux machine, syncronise your Music library with rsync. + + rsync -av -e "ssh -p 8022" ~/Music <username>@<ip_address>:/data/data/com.termux/files/home/storage/music + +Refreshing the Android MediaStore + +Android uses a Database to store files. In order to play your music, +this database needs to be refreshed. This can be achieved by a reboot or +by using adb to manually refresh it. + + sudo dnf install adb + +Connect the Android device via USB and see if it is listed. + + adb devices + +If it is, restart adb in TCP mode with port 5555 + + adb tcpip 5555 + +Connect to the device using its . + + adb connect <ip_address> + +Refresh MediaStore. + + adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN -d file:///data/data/com.termux/files/home/storage/music/]8;;\ diff --git a/public_html/eh/eh/eh/eh-eh/about.html b/public_html/eh/eh/eh/eh-eh/about.html index ca1d4ba..204c245 100644 --- a/public_html/eh/eh/eh/eh-eh/about.html +++ b/public_html/eh/eh/eh/eh-eh/about.html @@ -50,6 +50,9 @@
+

Rsync +Android

Stuff

i=1ki=k(k+1)2 \sum_{i=1}^k i = \frac{k(k+1)}{2}

diff --git a/public_html/eh/eh/eh/eh-eh/images/shark-top-small.xcf b/public_html/eh/eh/eh/eh-eh/images/shark-top-small.xcf new file mode 100644 index 0000000..bd0e140 Binary files /dev/null and b/public_html/eh/eh/eh/eh-eh/images/shark-top-small.xcf differ diff --git a/public_html/eh/eh/eh/eh-eh/images/shark_top.xcf b/public_html/eh/eh/eh/eh-eh/images/shark_top.xcf new file mode 100644 index 0000000..cbf6098 Binary files /dev/null and b/public_html/eh/eh/eh/eh-eh/images/shark_top.xcf differ