Makefile bug fixed

This commit is contained in:
Never Gude 2026-01-13 14:54:00 +01:00
parent f7ccf4bb87
commit 9315132636
10 changed files with 542 additions and 6 deletions

View file

@ -27,6 +27,9 @@ clean:
rm index.html about.html $(articles); rm index.html about.html $(articles);
$(articles): %.html: %.md $(articles): %.html: %.md
jq 'del(.articles[] | select(.filename == "$(notdir $@)"))' $(article_list) > articles.json.tmp; \
mv ./articles.json.tmp $(article_list); \
# Build articles using pandoc # Build articles using pandoc
pandoc $< --template $(template) --css $(style) --highlight-style zenburn --mathml --toc --output $@; \ pandoc $< --template $(template) --css $(style) --highlight-style zenburn --mathml --toc --output $@; \

View file

@ -15,6 +15,13 @@
"summary": "Tricks and tools I learned about, while tweaking my Linux sytem or trying to do productive things.", "summary": "Tricks and tools I learned about, while tweaking my Linux sytem or trying to do productive things.",
"title": "Random linux utilities", "title": "Random linux utilities",
"filename": "random-linux-utils.html" "filename": "random-linux-utils.html"
},
{
"author": "Never",
"date": "12.01.2026",
"summary": "As Spotify is getting enshittified by capitalism, keeping a music library is kind of essential. Here I use rsync to syncronise my library with my Android smartphone.",
"title": "Using rsync on Android to syncronise my Music library",
"filename": "rsync-android.html"
} }
] ]
} }

View file

@ -121,8 +121,8 @@ Ghostscript</a></li>
</ul> </ul>
</nav> </nav>
<article> <article>
<h2 id="merge-pdfs">Merge pdfs</h2> <h1 id="merge-pdfs">Merge pdfs</h1>
<h3 id="using-ghostscript">Using Ghostscript</h3> <h2 id="using-ghostscript">Using Ghostscript</h2>
<p>Ghostscript has a feature to merge multiple pdf files into one. <p>Ghostscript has a feature to merge multiple pdf files into one.
Although ImageMagick also has this feature, I prefer this one, as it Although ImageMagick also has this feature, I prefer this one, as it
doesnt rasterize and scales down the pdf files.</p> doesnt rasterize and scales down the pdf files.</p>

View file

@ -6,8 +6,8 @@ date: 25.7.2025
summary: Tricks and tools I learned about, while tweaking my Linux sytem or trying to do productive things. summary: Tricks and tools I learned about, while tweaking my Linux sytem or trying to do productive things.
--- ---
## Merge pdfs # Merge pdfs
### Using Ghostscript ## Using Ghostscript
Ghostscript has a feature to merge multiple pdf files into one. 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 Although ImageMagick also has this feature, I prefer this one, as it doesn't rasterize and scales down
the pdf files. the pdf files.

203
articles/rsync-android.html Normal file
View file

@ -0,0 +1,203 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Never" />
<title>Using rsync on Android to syncronise my Music library</title>
<link rel="icon" type="image/x-icon" href="pandoc/favicon.png">
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
/* The extra [class] is a hack that increases specificity enough to
override a similar rule in reveal.js */
ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
/* CSS for syntax highlighting */
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ color: #cccccc; background-color: #303030; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ffcfaf; } /* Alert */
code span.an { color: #7f9f7f; font-weight: bold; } /* Annotation */
code span.at { } /* Attribute */
code span.bn { color: #dca3a3; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #f0dfaf; } /* ControlFlow */
code span.ch { color: #dca3a3; } /* Char */
code span.cn { color: #dca3a3; font-weight: bold; } /* Constant */
code span.co { color: #7f9f7f; } /* Comment */
code span.cv { color: #7f9f7f; font-weight: bold; } /* CommentVar */
code span.do { color: #7f9f7f; } /* Documentation */
code span.dt { color: #dfdfbf; } /* DataType */
code span.dv { color: #dcdccc; } /* DecVal */
code span.er { color: #c3bf9f; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #c0bed1; } /* Float */
code span.fu { color: #efef8f; } /* Function */
code span.im { } /* Import */
code span.in { color: #7f9f7f; font-weight: bold; } /* Information */
code span.kw { color: #f0dfaf; } /* Keyword */
code span.op { color: #f0efd0; } /* Operator */
code span.ot { color: #efef8f; } /* Other */
code span.pp { color: #ffcfaf; font-weight: bold; } /* Preprocessor */
code span.sc { color: #dca3a3; } /* SpecialChar */
code span.ss { color: #cc9393; } /* SpecialString */
code span.st { color: #cc9393; } /* String */
code span.va { } /* Variable */
code span.vs { color: #cc9393; } /* VerbatimString */
code span.wa { color: #7f9f7f; font-weight: bold; } /* Warning */
</style>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header id="page-header">
<ul>
<li><a href="index.html">Home</a></li><li><a href="about.html">About</a></li>
</ul>
<!--
<ul>
<li>
<span id="dark-mode">
<input id="dark-mode-toggle" type="checkbox"><label for="dark-mode-toggle">Dark mode</label>
</span>
</li>
</ul>
-->
</header>
<header id="title-block-header">
<h1 class="title">Using rsync on Android to syncronise my Music
library</h1>
<p class="author">Never</p>
<p class="date">12.01.2026</p>
</header>
<section id="content">
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#setup-termux" id="toc-setup-termux">Setup Termux</a></li>
<li><a href="#establishing-an-ssh-connection"
id="toc-establishing-an-ssh-connection">Establishing an ssh
connection</a>
<ul>
<li><a href="#configuring-android"
id="toc-configuring-android">Configuring Android</a></li>
<li><a href="#connecting-to-android-via-ssh"
id="toc-connecting-to-android-via-ssh">Connecting to Android via
ssh</a></li>
</ul></li>
<li><a href="#syncronising-files-with-rsync"
id="toc-syncronising-files-with-rsync">Syncronising files with
rsync</a></li>
</ul>
</nav>
<article>
<h1 id="setup-termux">Setup Termux</h1>
<p>Install Termux using F-Droid.</p>
<p>Update software repos.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> update</span></code></pre></div>
<p>Grant file access permissions using.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">termux-setup-storage</span></span></code></pre></div>
<h1 id="establishing-an-ssh-connection">Establishing an ssh
connection</h1>
<p>If network (such as eduroam) is blocking ssh trafic between machines,
open a Wi-Fi Hotspot on your Linux machine and connect the Andoid device
to it before using <code>rsync</code> or <code>ssh</code>.</p>
<h2 id="configuring-android">Configuring Android</h2>
<p>Install the openssh server on Termux.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> install openssh</span></code></pre></div>
<p>Start the ssh server daemon.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">sshd</span></span></code></pre></div>
<p>Get the ip address of the Android machine (in the Hotspot).</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">ifconfig</span></span></code></pre></div>
<pre><code>Warning: cannot open /proc/net/dev (Permission denied). Limited output.
lo: flags=73&lt;UP,LOOPBACK,RUNNING&gt; 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&lt;UP,POINTOPOINT,RUNNING,NOARP,MULTICAST&gt; 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&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; 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)</code></pre>
<p>In this case 10.42.0.200.</p>
<p>The ssh server should now be running and listening on port 8022. You
can check by running</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">nmap</span> <span class="at">-Pn</span> <span class="op">&lt;</span>ip_address<span class="op">&gt;</span></span></code></pre></div>
<p>For me <code>&lt;ip_address&gt;</code> whould be 10.42.0.200.</p>
<p>Get the username.</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">whoami</span></span></code></pre></div>
<pre><code>u0_a700</code></pre>
<p>Set a password for this user.</p>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">passwd</span></span></code></pre></div>
<h2 id="connecting-to-android-via-ssh">Connecting to Android via
ssh</h2>
<p>Make sure you have an ssh key pair on the Linux system. If not
generate one using <code>ssh-keygen</code></p>
<p>Now connect to Android by <code>ssh</code></p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ssh</span> <span class="op">&lt;</span>username<span class="op">&gt;</span>@<span class="op">&lt;</span>ip_address<span class="op">&gt;</span> -p 8022</span></code></pre></div>
<h1 id="syncronising-files-with-rsync">Syncronising files with
rsync</h1>
<p>Install <code>rsync</code> on Termux and Linux. Make sure to keep
your own openssl config.</p>
<div class="sourceCode" id="cb12"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> install rsync</span></code></pre></div>
<p>Now on your Linux machine, syncronise your Music library with
rsync.</p>
<div class="sourceCode" id="cb13"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">rsync</span> <span class="at">-av</span> <span class="at">-e</span> <span class="st">&quot;ssh -p 8022&quot;</span> ~/Music <span class="op">&lt;</span>username<span class="op">&gt;</span>@<span class="op">&lt;</span>ip_address<span class="op">&gt;</span>:/data/data/com.termux/files/home/storage/music</span></code></pre></div>
</article>
</section>
<footer id="page-footer">
<!-- <embed type="text/html" src="https://cups.teabucket.eu/embed?from=never" style="width:320px; height: 120px; scale: 0.66;"> -->
<p class="cups-light">
<a href="https://cups.teabucket.eu/prev?from=never" target="_parent"><img alt="Previous" src="images/cups_left.svg" width="30" height="30/"></a>
<a href="https://cups.teabucket.eu/" target="_parent"><img alt="CUPS" src="images/cups_logo.svg" width="120" height="60/"></a>
<a href="https://cups.teabucket.eu/next?from=never" target="_parent"><img alt="Next" src="images/cups_right.svg" width="30" height="30/"></a>
</p>
</footer>
</body>
</html>

98
articles/rsync-android.md Normal file
View file

@ -0,0 +1,98 @@
---
title: Using rsync on Android to syncronise my Music library
author: Never
date: 12.01.2026
summary: As Spotify is getting enshittified by capitalism, keeping a music library
is kind of essential. Here I use rsync to syncronise my library with my Android smartphone.
---
# Setup Termux
Install Termux using F-Droid.
Update software repos.
```sh
pkg update
```
Grant file access permissions using.
```sh
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 Andoid device to it before using `rsync` or `ssh`.
## Configuring Android
Install the openssh server on Termux.
```sh
pkg install openssh
```
Start the ssh server daemon.
```sh
sshd
```
Get the ip address of the Android machine (in the Hotspot).
```sh
ifconfig
```
```
Warning: cannot open /proc/net/dev (Permission denied). Limited output.
lo: flags=73<UP,LOOPBACK,RUNNING> 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<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> 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<UP,BROADCAST,RUNNING,MULTICAST> 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
```sh
nmap -Pn <ip_address>
```
For me `<ip_address>` whould be 10.42.0.200.
Get the username.
```sh
whoami
```
```
u0_a700
```
Set a password for this user.
```sh
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`
```sh
ssh <username>@<ip_address> -p 8022
```
# Syncronising files with rsync
Install `rsync` on Termux and Linux.
Make sure to keep your own openssl config.
```sh
pkg install rsync
```
Now on your Linux machine, syncronise your Music library with rsync.
```sh
rsync -av -e "ssh -p 8022" ~/Music <username>@<ip_address>:/data/data/com.termux/files/home/storage/music
```

View file

@ -73,6 +73,17 @@ utilities</a>
tweaking my Linux sytem or trying to do productive things.</p> tweaking my Linux sytem or trying to do productive things.</p>
<p class="articles-date">25.7.2025</p> <p class="articles-date">25.7.2025</p>
</li> </li>
<li>
<div class="articles-header">
<a href="rsync-android.html" class="articles-title">Using rsync on
Android to syncronise my Music library</a>
<p class="articles-author"><em>Never</em></p>
</div>
<p class="articles-summary">As Spotify is getting enshittified by
capitalism, keeping a music library is kind of essential. Here I use
rsync to syncronise my library with my Android smartphone.</p>
<p class="articles-date">12.01.2026</p>
</li>
</ul> </ul>
</nav> </nav>

View file

@ -73,6 +73,17 @@ utilities</a>
tweaking my Linux sytem or trying to do productive things.</p> tweaking my Linux sytem or trying to do productive things.</p>
<p class="articles-date">25.7.2025</p> <p class="articles-date">25.7.2025</p>
</li> </li>
<li>
<div class="articles-header">
<a href="rsync-android.html" class="articles-title">Using rsync on
Android to syncronise my Music library</a>
<p class="articles-author"><em>Never</em></p>
</div>
<p class="articles-summary">As Spotify is getting enshittified by
capitalism, keeping a music library is kind of essential. Here I use
rsync to syncronise my library with my Android smartphone.</p>
<p class="articles-date">12.01.2026</p>
</li>
</ul> </ul>
</nav> </nav>

View file

@ -121,8 +121,8 @@ Ghostscript</a></li>
</ul> </ul>
</nav> </nav>
<article> <article>
<h2 id="merge-pdfs">Merge pdfs</h2> <h1 id="merge-pdfs">Merge pdfs</h1>
<h3 id="using-ghostscript">Using Ghostscript</h3> <h2 id="using-ghostscript">Using Ghostscript</h2>
<p>Ghostscript has a feature to merge multiple pdf files into one. <p>Ghostscript has a feature to merge multiple pdf files into one.
Although ImageMagick also has this feature, I prefer this one, as it Although ImageMagick also has this feature, I prefer this one, as it
doesnt rasterize and scales down the pdf files.</p> doesnt rasterize and scales down the pdf files.</p>

View file

@ -0,0 +1,203 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Never" />
<title>Using rsync on Android to syncronise my Music library</title>
<link rel="icon" type="image/x-icon" href="pandoc/favicon.png">
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
/* The extra [class] is a hack that increases specificity enough to
override a similar rule in reveal.js */
ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
/* CSS for syntax highlighting */
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ color: #cccccc; background-color: #303030; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ffcfaf; } /* Alert */
code span.an { color: #7f9f7f; font-weight: bold; } /* Annotation */
code span.at { } /* Attribute */
code span.bn { color: #dca3a3; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #f0dfaf; } /* ControlFlow */
code span.ch { color: #dca3a3; } /* Char */
code span.cn { color: #dca3a3; font-weight: bold; } /* Constant */
code span.co { color: #7f9f7f; } /* Comment */
code span.cv { color: #7f9f7f; font-weight: bold; } /* CommentVar */
code span.do { color: #7f9f7f; } /* Documentation */
code span.dt { color: #dfdfbf; } /* DataType */
code span.dv { color: #dcdccc; } /* DecVal */
code span.er { color: #c3bf9f; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #c0bed1; } /* Float */
code span.fu { color: #efef8f; } /* Function */
code span.im { } /* Import */
code span.in { color: #7f9f7f; font-weight: bold; } /* Information */
code span.kw { color: #f0dfaf; } /* Keyword */
code span.op { color: #f0efd0; } /* Operator */
code span.ot { color: #efef8f; } /* Other */
code span.pp { color: #ffcfaf; font-weight: bold; } /* Preprocessor */
code span.sc { color: #dca3a3; } /* SpecialChar */
code span.ss { color: #cc9393; } /* SpecialString */
code span.st { color: #cc9393; } /* String */
code span.va { } /* Variable */
code span.vs { color: #cc9393; } /* VerbatimString */
code span.wa { color: #7f9f7f; font-weight: bold; } /* Warning */
</style>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header id="page-header">
<ul>
<li><a href="index.html">Home</a></li><li><a href="about.html">About</a></li>
</ul>
<!--
<ul>
<li>
<span id="dark-mode">
<input id="dark-mode-toggle" type="checkbox"><label for="dark-mode-toggle">Dark mode</label>
</span>
</li>
</ul>
-->
</header>
<header id="title-block-header">
<h1 class="title">Using rsync on Android to syncronise my Music
library</h1>
<p class="author">Never</p>
<p class="date">12.01.2026</p>
</header>
<section id="content">
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#setup-termux" id="toc-setup-termux">Setup Termux</a></li>
<li><a href="#establishing-an-ssh-connection"
id="toc-establishing-an-ssh-connection">Establishing an ssh
connection</a>
<ul>
<li><a href="#configuring-android"
id="toc-configuring-android">Configuring Android</a></li>
<li><a href="#connecting-to-android-via-ssh"
id="toc-connecting-to-android-via-ssh">Connecting to Android via
ssh</a></li>
</ul></li>
<li><a href="#syncronising-files-with-rsync"
id="toc-syncronising-files-with-rsync">Syncronising files with
rsync</a></li>
</ul>
</nav>
<article>
<h1 id="setup-termux">Setup Termux</h1>
<p>Install Termux using F-Droid.</p>
<p>Update software repos.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> update</span></code></pre></div>
<p>Grant file access permissions using.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">termux-setup-storage</span></span></code></pre></div>
<h1 id="establishing-an-ssh-connection">Establishing an ssh
connection</h1>
<p>If network (such as eduroam) is blocking ssh trafic between machines,
open a Wi-Fi Hotspot on your Linux machine and connect the Andoid device
to it before using <code>rsync</code> or <code>ssh</code>.</p>
<h2 id="configuring-android">Configuring Android</h2>
<p>Install the openssh server on Termux.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> install openssh</span></code></pre></div>
<p>Start the ssh server daemon.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">sshd</span></span></code></pre></div>
<p>Get the ip address of the Android machine (in the Hotspot).</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">ifconfig</span></span></code></pre></div>
<pre><code>Warning: cannot open /proc/net/dev (Permission denied). Limited output.
lo: flags=73&lt;UP,LOOPBACK,RUNNING&gt; 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&lt;UP,POINTOPOINT,RUNNING,NOARP,MULTICAST&gt; 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&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; 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)</code></pre>
<p>In this case 10.42.0.200.</p>
<p>The ssh server should now be running and listening on port 8022. You
can check by running</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">nmap</span> <span class="at">-Pn</span> <span class="op">&lt;</span>ip_address<span class="op">&gt;</span></span></code></pre></div>
<p>For me <code>&lt;ip_address&gt;</code> whould be 10.42.0.200.</p>
<p>Get the username.</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">whoami</span></span></code></pre></div>
<pre><code>u0_a700</code></pre>
<p>Set a password for this user.</p>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">passwd</span></span></code></pre></div>
<h2 id="connecting-to-android-via-ssh">Connecting to Android via
ssh</h2>
<p>Make sure you have an ssh key pair on the Linux system. If not
generate one using <code>ssh-keygen</code></p>
<p>Now connect to Android by <code>ssh</code></p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ssh</span> <span class="op">&lt;</span>username<span class="op">&gt;</span>@<span class="op">&lt;</span>ip_address<span class="op">&gt;</span> -p 8022</span></code></pre></div>
<h1 id="syncronising-files-with-rsync">Syncronising files with
rsync</h1>
<p>Install <code>rsync</code> on Termux and Linux. Make sure to keep
your own openssl config.</p>
<div class="sourceCode" id="cb12"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> install rsync</span></code></pre></div>
<p>Now on your Linux machine, syncronise your Music library with
rsync.</p>
<div class="sourceCode" id="cb13"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">rsync</span> <span class="at">-av</span> <span class="at">-e</span> <span class="st">&quot;ssh -p 8022&quot;</span> ~/Music <span class="op">&lt;</span>username<span class="op">&gt;</span>@<span class="op">&lt;</span>ip_address<span class="op">&gt;</span>:/data/data/com.termux/files/home/storage/music</span></code></pre></div>
</article>
</section>
<footer id="page-footer">
<!-- <embed type="text/html" src="https://cups.teabucket.eu/embed?from=never" style="width:320px; height: 120px; scale: 0.66;"> -->
<p class="cups-light">
<a href="https://cups.teabucket.eu/prev?from=never" target="_parent"><img alt="Previous" src="images/cups_left.svg" width="30" height="30/"></a>
<a href="https://cups.teabucket.eu/" target="_parent"><img alt="CUPS" src="images/cups_logo.svg" width="120" height="60/"></a>
<a href="https://cups.teabucket.eu/next?from=never" target="_parent"><img alt="Next" src="images/cups_right.svg" width="30" height="30/"></a>
</p>
</footer>
</body>
</html>