<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Linux on nxadm</title>
    <link>https://nxadm.apt-get.be/tags/linux/</link>
    <description>Recent content in Linux on nxadm</description>
    <generator>Hugo -- 0.135.0</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 05 Oct 2024 15:45:00 +0100</lastBuildDate>
    <atom:link href="https://nxadm.apt-get.be/tags/linux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fix for Proton/Linux slow loadtime for some games</title>
      <link>https://nxadm.apt-get.be/posts/proton-linux-open-files/</link>
      <pubDate>Sat, 05 Oct 2024 15:45:00 +0100</pubDate>
      <guid>https://nxadm.apt-get.be/posts/proton-linux-open-files/</guid>
      <description>&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;cover.jpg&#34; alt=&#34;Cover Ember Knights&#34;  title=&#34;Cover Ember Knights&#34;  /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Proton_(software)&#34;&gt;Proton&lt;/a&gt; is a compatibility
layer for Windows games to run on Linux. Running a Windows games is mostly
just hitting the Play button within Steam. It&amp;rsquo;s that good that many games now
run faster on Linux than on native Windows. That&amp;rsquo;s what makes the
&lt;a href=&#34;&#34;&gt;Steam Deck&lt;/a&gt; the best gaming handheld of the moment.&lt;/p&gt;
&lt;p&gt;But a compatibility layer is still a layer, so you may encounter
&amp;hellip;  incompatibilities.
&lt;a href=&#34;https://store.steampowered.com/app/1135230/Ember_Knights/&#34;&gt;Ember Knights&lt;/a&gt;
is a lovely game with fun co-op multiplayer support. It runs perfectly on the
(Linux-based) Steam Deck, but on my Ubuntu laptop I encountered long loading
times (startup was 5 minutes and loading between worlds was slow).  But once
the game was loaded it ran fine.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img loading="lazy" src="cover.jpg" alt="Cover Ember Knights"  title="Cover Ember Knights"  />
</p>
<p><a href="https://en.wikipedia.org/wiki/Proton_(software)">Proton</a> is a compatibility
layer for Windows games to run on Linux. Running a Windows games is mostly
just hitting the Play button within Steam. It&rsquo;s that good that many games now
run faster on Linux than on native Windows. That&rsquo;s what makes the
<a href="">Steam Deck</a> the best gaming handheld of the moment.</p>
<p>But a compatibility layer is still a layer, so you may encounter
&hellip;  incompatibilities.
<a href="https://store.steampowered.com/app/1135230/Ember_Knights/">Ember Knights</a>
is a lovely game with fun co-op multiplayer support. It runs perfectly on the
(Linux-based) Steam Deck, but on my Ubuntu laptop I encountered long loading
times (startup was 5 minutes and loading between worlds was slow).  But once
the game was loaded it ran fine.</p>
<p>Debugging the game reveled that there were lost of <code>EAGAIN</code> errors while the
game was trying to access the system clock. Changing the numer of allowed open
files fixed the problem for me.</p>
<p>Add this to end end of the following files:</p>
<ul>
<li>in <code>/etc/security/limits.conf</code>:</li>
</ul>
<pre tabindex="0"><code>* hard nofile 1048576
</code></pre><ul>
<li>in /etc/systemd/system.conf <strong>and</strong> /etc/systemd/user.conf:</li>
</ul>
<pre tabindex="0"><code>DefaultLimitNOFILE=1048576 
</code></pre><p>Reboot.</p>
]]></content:encoded>
    </item>
    <item>
      <title>rakudo-pkg v2: Github Actions/CloudSmith, devbuilds, Alpine repos, nfpm</title>
      <link>https://nxadm.apt-get.be/posts/rakudo-pkg-v2/</link>
      <pubDate>Thu, 11 Feb 2021 12:24:01 +0100</pubDate>
      <guid>https://nxadm.apt-get.be/posts/rakudo-pkg-v2/</guid>
      <description>&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://nxadm.apt-get.be/images/butterfly_sanctuary.jpg&#34; alt=&#34;Butterfly Sanctuary&#34;  title=&#34;Butterfly sanctuary t-shirt&#34;  /&gt;
&lt;/p&gt;
&lt;p&gt;(In case you don&amp;rsquo;t know &lt;a href=&#34;https://github.com/nxadm/rakudo-pkg&#34;&gt;rakudo-pkg&lt;/a&gt;:
it&amp;rsquo;s a project to provide native packages and relocatable builds of Rakudo for
Linux distributions.)&lt;/p&gt;
&lt;p&gt;The &lt;a href=&#34;https://www.jeffgeerling.com/blog/2020/travis-cis-new-pricing-plan-threw-wrench-my-open-source-works&#34;&gt;downward spiral of Travis&lt;/a&gt;
since it was taken over by a Private Equity firm (there is a pattern here),
triggered a long coming refactoring of the rakudo-pkg workflow. Until now the
packages were created on Travis because it supported running Linux containers
so we could tailor the build for each distribution/release. Almost at the same
time
&lt;a href=&#34;https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/&#34;&gt;JFrog announced it was sunsetting Bintray and other services popular with
FOSS projects&lt;/a&gt;.
The deb and rpm repos needed a new home.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img loading="lazy" src="/images/butterfly_sanctuary.jpg" alt="Butterfly Sanctuary"  title="Butterfly sanctuary t-shirt"  />
</p>
<p>(In case you don&rsquo;t know <a href="https://github.com/nxadm/rakudo-pkg">rakudo-pkg</a>:
it&rsquo;s a project to provide native packages and relocatable builds of Rakudo for
Linux distributions.)</p>
<p>The <a href="https://www.jeffgeerling.com/blog/2020/travis-cis-new-pricing-plan-threw-wrench-my-open-source-works">downward spiral of Travis</a>
since it was taken over by a Private Equity firm (there is a pattern here),
triggered a long coming refactoring of the rakudo-pkg workflow. Until now the
packages were created on Travis because it supported running Linux containers
so we could tailor the build for each distribution/release. Almost at the same
time
<a href="https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/">JFrog announced it was sunsetting Bintray and other services popular with
FOSS projects</a>.
The deb and rpm repos needed a new home.</p>
<p>Oh well, Travis and Bintray will be missed and certainly deserve our thanks for
their service during years. It was difficult to imagine a better time to
implement a few ideas from the good old TODO list.</p>
<h3 id="from-travis-to-github-actions">From Travis to Github Actions</h3>
<p>Github Actions is <strong>way</strong> faster than the post-P.E. Travis. Builds that took a
few hours (we build around 25 distro/version combinations) now are done between
10 and 20 minutes. Not surprisingly this not only meant learning a complete
new tool, but also a <strong>complete</strong> rewrite of the rakudo-pkg workflow.</p>
<p>Running on Github also means that every Github user can fork the repo
<strong>including</strong> the rakudo-pkg Github workflows. One of the advantages of a
rewrite is implementing new functionalities, like the new feature of rakudo-pkg
to allow everyone to test the upstream MoarVM/NQP/Rakudo and zef
commits/releases:</p>
<p><img loading="lazy" src="/images/rakudo-pkg-devbuild.png" alt="Github Actions UI for rakudo-pkg devbuild"  title="Github Actions UI for rakudo-pkg devbuild"  />
</p>
<h3 id="from-bintray-to-cloudsmith-with-alpine-repositories">From Bintray to CloudSmith with Alpine repositories</h3>
<p><a href="https://cloudsmith.io/">Cloudsmith</a> has a huge advantage over Bintray: it
supports Alpine Linux repositories, making it a great addition to the rpm and
deb repositories we already offer. The packages in the old repositories were
GPG signed by BinTray. From now onwards, rakudo-pkg will be signed with his
own key on Cloudsmith. Check the project&rsquo;s
<a href="https://github.com/nxadm/rakudo-pkg/blob/master/README.md">README</a>
for instructions how to change your configuration. So far the experience with
CloudSmith has been stellar. Their support is impressively responsive and they
solve issues immediately, sometime while we were chatting about it.</p>
<h3 id="from-fpm-to-nfpm">From fpm to nfpm</h3>
<p>rakudo-pkg created packages with the venerable
<a href="https://github.com/jordansissel/fpm">fpm</a>, written in Ruby. While the tool is
extremely capable, I spent most of the time of a release getting fpm to build
on new versions of distributions. The Ruby Gems ecosystem looks like a moving
target. Enter <a href="https://github.com/goreleaser/nfpm">nfpm</a>, inspired with fpm
but with the promise of a single binary. Written it Go, it&rsquo;s more accessible
to me to understand how it works and send fixes upstream if needed. The devs
are also very responsive and fixed one issue I encountered extremely fast.</p>
<hr>
<p>Feel free to open issues of send PRs if I missed something or if you have ideas to improve rakudo-pkg</p>
<p><em>(Post moved from nxadm.wordpress.com.)</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>rakudo-pkg: Create OS packages for Rakudo Perl 6 using Docker</title>
      <link>https://nxadm.apt-get.be/posts/rakudo-pkg-announce/</link>
      <pubDate>Mon, 05 Sep 2016 12:41:01 +0100</pubDate>
      <guid>https://nxadm.apt-get.be/posts/rakudo-pkg-announce/</guid>
      <description>&lt;p&gt;There was an interesting discussion on #perl6 (irc.freenode.net) about the use
of rakudobrew as a way for end-users to install Rakudo Perl 6
(see how-to-get-rakudo [dead link to page on Rakudo&amp;rsquo;s website]).&lt;/p&gt;
&lt;p&gt;rakudobrew, inspired by perlbrew, is a way to manage (and compile) different
versions of rakudo. nine argued that it&amp;rsquo;s primarily meant as a tool for rakudo
developers. Because of the increased complexity (e.g. when dealing with
modules), it&amp;rsquo;s not targeted at end-users. While being a big fan of rakudobrew,
I agree with nine.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>There was an interesting discussion on #perl6 (irc.freenode.net) about the use
of rakudobrew as a way for end-users to install Rakudo Perl 6
(see how-to-get-rakudo [dead link to page on Rakudo&rsquo;s website]).</p>
<p>rakudobrew, inspired by perlbrew, is a way to manage (and compile) different
versions of rakudo. nine argued that it&rsquo;s primarily meant as a tool for rakudo
developers. Because of the increased complexity (e.g. when dealing with
modules), it&rsquo;s not targeted at end-users. While being a big fan of rakudobrew,
I agree with nine.</p>
<p>The problem is that there are no Linux binaries on the download page (there are
for MacOS and Windows), so users are stuck with building from source (it can be
fun, but after a while it isn&rsquo;t).</p>
<p><code>rakudo-pkg</code> is a <a href="https://github.com/nxadm/rakudo-pkg">github project</a> to
help system administrators (and hopefully Rakudo release managers) to easily
provide native Linux packages for end users. So far, I added support for
creating Ubuntu 16.04 LTS amd64 and i386 packages and Centos 7 amd64. These
are the systems I use the most. Feel free to add support for more
distributions.</p>
<p>rakudo-pkg uses Docker. The use of containers means that there is no longer
need for chasing dependencies and no risks of installing files all over your
system. It also means that as long the building machine is a Linux 64-bit OS,
you can build packages for <em>all</em> supported distributions.</p>
<p>Within the containers, rakudo-pkg uses
<a href="https://github.com/goreleaser/nfpm">fpm</a>. The created packages are
minimalistic by design: they don&rsquo;t run any pre/post scripts and all the files
are installed in /opt/rakudo. You&rsquo;ll have to add /opt/rakudo/bin to your PATH.
I also added two additional scripts to install Perl 6 module managers (both
have similar functionalities):</p>
<pre><code>install_panda_as_user.sh
install_zef_as_user.sh
</code></pre>
<p>If you just want to create native packages, just go to the bin directory and
execute the run_pkgrakudo.pl command. In this case there is no need to
locally build the Docker images: you&rsquo;ll automatically retrieve the image from
the rakudo namespace on Docker Hub. Of course, if you want to create the
container images locally, you can use the supplied dockerfiles in the docker
directory. Have a look at the
<a href="https://github.com/nxadm/rakudo-pkg/blob/master/README.md">README.md</a>
for more information.</p>
<p>You can find examples of packages created with rakudo-pkg here (they need to
be moved to a more definitive URL)[dead link, the packages reside now at
CloudSmith).</p>
<p>Have fun.</p>
<p><a href="https://github.com/nxadm/rakudo-pkg">rakudo-pkg repo</a></p>
<p><em>(Post moved from nxadm.wordpress.com.)</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>Encrypted USB Disks</title>
      <link>https://nxadm.apt-get.be/posts/encrypted-usb-disks/</link>
      <pubDate>Wed, 02 Dec 2009 11:37:01 +0100</pubDate>
      <guid>https://nxadm.apt-get.be/posts/encrypted-usb-disks/</guid>
      <description>&lt;p&gt;On most Linux distributions, you can use the graphical &amp;ldquo;disks&amp;rdquo; application
to create Luks+ext4 partitons. The defaults are sane. However, it&amp;rsquo;s still advisable to put random data on the new disk before encryption.&lt;/p&gt;
&lt;p&gt;If you use USB disks for off-site backups, it&amp;rsquo;s a good idea to encrypt them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install the cryptography software:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo apt-get install cryptsetup
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Write some random data to your disk (we will assume it&amp;rsquo;s called /dev/sdx,
type &amp;ldquo;dmesg&amp;rdquo; after inserting the disk to figure out the device, or if it&amp;rsquo;s
windows formatted and automounted have a look at the output of &amp;ldquo;mount&amp;rdquo;):&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo dd &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/dev/random of&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/dev/sdx bs&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;4K
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will taken a long time, maybe a few days (create some IO). A good
-shorter- compromise (a day) is:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>On most Linux distributions, you can use the graphical &ldquo;disks&rdquo; application
to create Luks+ext4 partitons. The defaults are sane. However, it&rsquo;s still advisable to put random data on the new disk before encryption.</p>
<p>If you use USB disks for off-site backups, it&rsquo;s a good idea to encrypt them:</p>
<ul>
<li>Install the cryptography software:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo apt-get install cryptsetup
</span></span></code></pre></div><ul>
<li>Write some random data to your disk (we will assume it&rsquo;s called /dev/sdx,
type &ldquo;dmesg&rdquo; after inserting the disk to figure out the device, or if it&rsquo;s
windows formatted and automounted have a look at the output of &ldquo;mount&rdquo;):</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo dd <span style="color:#66d9ef">if</span><span style="color:#f92672">=</span>/dev/random of<span style="color:#f92672">=</span>/dev/sdx bs<span style="color:#f92672">=</span>4K
</span></span></code></pre></div><p>This will taken a long time, maybe a few days (create some IO). A good
-shorter- compromise (a day) is:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo badblocks -c <span style="color:#ae81ff">10240</span> -s -w -t random -v /dev/sdx
</span></span></code></pre></div><ul>
<li>Create a new Linux partition table with cfdisk (create new partition table
if asked, chose New and assign all the disk, use a primary partition).</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo cfdisk /dev/sdx
</span></span></code></pre></div><ul>
<li>Setup a partition using fdisk (compatible with the new 4KB block size
drives):</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo fdisk -uc /dev/sdx
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>Command (m for help): d
</span></span><span style="display:flex;"><span>Selected partition 1
</span></span><span style="display:flex;"><span>Command (m for help): n
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Command action
</span></span><span style="display:flex;"><span>e   extended
</span></span><span style="display:flex;"><span>p   primary partition (1-4)
</span></span><span style="display:flex;"><span>p
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Partition number (1-4): 1
</span></span><span style="display:flex;"><span>First sector (2048-2930277167, default 2048):
</span></span><span style="display:flex;"><span>Using default value 2048
</span></span><span style="display:flex;"><span>Last sector, +sectors or +size{K,M,G} (2048-2930277167, default 2930277167):
</span></span><span style="display:flex;"><span>Using default value 2930277167
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Command (m for help): t
</span></span><span style="display:flex;"><span>Selected partition 1
</span></span><span style="display:flex;"><span>Hex code (type L to list codes): 83
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Command (m for help): p
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Disk /dev/sdx: 1500.3 GB, 1500301910016 bytes
</span></span><span style="display:flex;"><span>81 heads, 63 sectors/track, 574226 cylinders, total 2930277168 sectors
</span></span><span style="display:flex;"><span>Units = sectors of 1 * 512 = 512 bytes
</span></span><span style="display:flex;"><span>Sector size (logical/physical): 512 bytes / 512 bytes
</span></span><span style="display:flex;"><span>I/O size (minimum/optimal): 512 bytes / 512 bytes
</span></span><span style="display:flex;"><span>Disk identifier: 0x4fabbfc4
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Device Boot      Start         End      Blocks   Id  System
</span></span><span style="display:flex;"><span>/dev/sdx1         2048  2930277167  1465137560   83  Linux
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Command (m for help): w
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>The partition table has been altered!
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Calling ioctl() to re-read partition table.
</span></span><span style="display:flex;"><span>Syncing disks.
</span></span></code></pre></div><ul>
<li>Create the encrypted partition. Make the passdphase long and difficult to
guess:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo cryptsetup --verbose --verify-passphrase luksFormat /dev/sdx1
</span></span></code></pre></div><ul>
<li>Create a filesystem (I am using ext4, the chose device and label name is
&ldquo;disk5&rdquo;, change it to your taste):</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo cryptsetup luksOpen /dev/sdx1 disk5
</span></span><span style="display:flex;"><span>sudo mkfs.ext4 /dev/mapper/disk5 -L disk5
</span></span><span style="display:flex;"><span>sudo cryptsetup luksClose disk5
</span></span></code></pre></div><ul>
<li>Mount and umount it:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo /dev/mapper/disk5 /mnt
</span></span><span style="display:flex;"><span>sudo umount /mnt
</span></span><span style="display:flex;"><span>sudo cryptsetup luksClose disk5
</span></span></code></pre></div><p>That&rsquo;s it!</p>
<p><em>(Post moved from nxadm.wordpress.com.)</em></p>
]]></content:encoded>
    </item>
    <item>
      <title>Split one flac/ape (&#43; cue) file into separate tracks</title>
      <link>https://nxadm.apt-get.be/posts/split-flac/</link>
      <pubDate>Mon, 09 Feb 2009 13:00:01 +0100</pubDate>
      <guid>https://nxadm.apt-get.be/posts/split-flac/</guid>
      <description>&lt;p&gt;You may have backupped your music CDs using a single flac file instead of
a file for each track. In case you need to split the cd-flac, do this
(instruction for Debian/Ubuntu):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install the needed software.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo apt-get install cuetools ffmpeg flac shntool
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;In case the source file is one unsplitted ape file, you can convert it to flac first.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ffmpeg -i sample.ape sample.flac
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;In case the cue file is not a separate file, but included in the flac
file itself, split them.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;metaflac --show-tag&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;CUESHEET sample.flac | grep -v ^CUESHEET &amp;gt; sample.cue
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(NB: The regular syntax is &lt;code&gt;metaflac --export-cuesheet-to=sample.cue sample.flac&lt;/code&gt;, however often the cue file in embedded in a tag instead of the
cuesheet block).&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>You may have backupped your music CDs using a single flac file instead of
a file for each track. In case you need to split the cd-flac, do this
(instruction for Debian/Ubuntu):</p>
<ul>
<li>Install the needed software.</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo apt-get install cuetools ffmpeg flac shntool
</span></span></code></pre></div><ul>
<li>In case the source file is one unsplitted ape file, you can convert it to flac first.</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>ffmpeg -i sample.ape sample.flac
</span></span></code></pre></div><ul>
<li>In case the cue file is not a separate file, but included in the flac
file itself, split them.</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>metaflac --show-tag<span style="color:#f92672">=</span>CUESHEET sample.flac | grep -v ^CUESHEET &gt; sample.cue
</span></span></code></pre></div><p>(NB: The regular syntax is <code>metaflac --export-cuesheet-to=sample.cue sample.flac</code>, however often the cue file in embedded in a tag instead of the
cuesheet block).</p>
<ul>
<li>Split the album flac file into separate tracks:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>cuebreakpoints sample.cue | shnsplit -o flac sample.flac
</span></span></code></pre></div><ul>
<li>Copy the flac tags (if present):</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>cuetag sample.cue split-track*.flac
</span></span></code></pre></div><p>That&rsquo;s it.</p>
<p><em>(Post moved from nxadm.wordpress.com.)</em></p>
]]></content:encoded>
    </item>
  </channel>
</rss>
