<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Scientific logbook (Posts about code/shell)</title><link>https://laurentperrinet.github.io/sciblog/</link><description></description><atom:link href="https://laurentperrinet.github.io/sciblog/categories/code/shell.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:laurent.perrinet@univ-amu.fr"&gt;Laurent Perrinet&lt;/a&gt; 
&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ar/"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-bottom:12px;"
src="http://i.creativecommons.org/l/by-nc-sa/2.5/ar/88x31.png"&gt;&lt;/a&gt;</copyright><lastBuildDate>Wed, 02 Dec 2026 21:21:33 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Using singularity on slurm</title><link>https://laurentperrinet.github.io/sciblog/posts/2024-01-12-singularity-on-slurm.html</link><dc:creator>Laurent Perrinet</dc:creator><description>&lt;div&gt;&lt;p&gt;In this post, I will disp)lay my configuration that I use to run &lt;a href="https://sylabs.io/singularity/"&gt;Singularity&lt;/a&gt; on a &lt;a href="https://slurm.schedmd.com/"&gt;SLURM&lt;/a&gt; cluster. &lt;/p&gt;
&lt;p&gt;My use case is mostly using a recent version of pyTorch on GPUs.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://laurentperrinet.github.io/sciblog/posts/2024-01-12-singularity-on-slurm.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>code</category><category>code/shell</category><category>ipython</category><category>numpy</category><category>open-science</category><category>outreach/blog</category><category>shell</category><guid>https://laurentperrinet.github.io/sciblog/posts/2024-01-12-singularity-on-slurm.html</guid><pubDate>Fri, 12 Jan 2024 13:40:39 GMT</pubDate></item><item><title>Converting a bunch of files in a few lines</title><link>https://laurentperrinet.github.io/sciblog/posts/2019-11-19-converting-a-bunch-of-files-in-a-few-lines.html</link><dc:creator>Laurent Perrinet</dc:creator><description>&lt;div&gt;&lt;p&gt;You may have a bunch of files that you want to convert from one format to another: images, videos, music, text, ... How do you convert them &lt;em&gt;while using ZSH as your shell language&lt;/em&gt; in a single line?&lt;/p&gt;
&lt;p&gt;I will take the example of music files which I wish totransform from FLAC to &lt;a href="https://mf4.xiph.org/jenkins/view/opus/job/opus-tools/ws/man/opusenc.html"&gt;OPUS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://laurentperrinet.github.io/sciblog/posts/2019-11-19-converting-a-bunch-of-files-in-a-few-lines.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>code</category><category>code/shell</category><category>ipython</category><category>numpy</category><category>open-science</category><category>outreach/blog</category><category>shell</category><guid>https://laurentperrinet.github.io/sciblog/posts/2019-11-19-converting-a-bunch-of-files-in-a-few-lines.html</guid><pubDate>Tue, 19 Nov 2019 13:40:39 GMT</pubDate></item><item><title>Resizing a bunch of files using the command-line interface</title><link>https://laurentperrinet.github.io/sciblog/posts/2016-11-29-resizing-a-bunch-of-files-using-the-command-line-interface.html</link><dc:creator>Laurent Perrinet</dc:creator><description>&lt;div class="cell border-box-sizing text_cell rendered"&gt;&lt;div class="prompt input_prompt"&gt;
&lt;/div&gt;&lt;div class="inner_cell"&gt;
&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;h2 id="generating-databases"&gt;generating databases&lt;a class="anchor-link" href="https://laurentperrinet.github.io/sciblog/posts/2016-11-29-resizing-a-bunch-of-files-using-the-command-line-interface.html#generating-databases"&gt;¶&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A set of bash code to resize images to a fixed size.&lt;/p&gt;
&lt;p&gt;Problem statement: we have a set of images with heterogeneous sizes and we want to homogenize the database to avoid problems when classifying them.
Solution: ImageMagick.&lt;/p&gt;
&lt;p&gt;We first identify the size and type of images in the database. The database is a collection of folders containing each a collection of files. We thus do a nested recursive loop:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://laurentperrinet.github.io/sciblog/posts/2016-11-29-resizing-a-bunch-of-files-using-the-command-line-interface.html"&gt;Read more…&lt;/a&gt; (98 min remaining to read)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><category>code</category><category>code/shell</category><category>ipython</category><category>numpy</category><category>open-science</category><category>python</category><category>shell</category><guid>https://laurentperrinet.github.io/sciblog/posts/2016-11-29-resizing-a-bunch-of-files-using-the-command-line-interface.html</guid><pubDate>Tue, 29 Nov 2016 08:08:52 GMT</pubDate></item><item><title>transferring (lots of) files to a remote server + saving space</title><link>https://laurentperrinet.github.io/sciblog/posts/2014-07-07-transferring-lots-of-files-to-a-remote-server-s.html</link><dc:creator>Laurent Perrinet</dc:creator><description>&lt;div class="cell border-box-sizing text_cell rendered" id="cell-id=f0bf97b9"&gt;&lt;div class="prompt input_prompt"&gt;
&lt;/div&gt;&lt;div class="inner_cell"&gt;
&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;I have recently been asked how to transfer lots of file from a backup server to a local disk. The context is that&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;the backup is an archive to be put on an external hard drive and then in a closet for future use,&lt;/li&gt;
&lt;li&gt;the transfer line is not quite reliable and transfers may stop (for instance if it is mounted as a samba / windows / applefile share)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://laurentperrinet.github.io/sciblog/posts/2014-07-07-transferring-lots-of-files-to-a-remote-server-s.html"&gt;Read more…&lt;/a&gt; (14 min remaining to read)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><category>code</category><category>code/shell</category><category>ipython</category><category>numpy</category><category>open-science</category><category>outreach/blog</category><category>shell</category><guid>https://laurentperrinet.github.io/sciblog/posts/2014-07-07-transferring-lots-of-files-to-a-remote-server-s.html</guid><pubDate>Mon, 07 Jul 2014 08:31:28 GMT</pubDate></item><item><title>Batch removing files on a FTP server</title><link>https://laurentperrinet.github.io/sciblog/posts/2014-02-28-batch-removing-files-on-a-ftp-server.html</link><dc:creator>Laurent Perrinet</dc:creator><description>&lt;div class="cell border-box-sizing text_cell rendered"&gt;&lt;div class="prompt input_prompt"&gt;
&lt;/div&gt;&lt;div class="inner_cell"&gt;
&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;In a previous post, I have shown how to convert MoinMoin pages to this blog (Nikola angine). Let's now tidy up the place and remove obsolete pages.&lt;/p&gt;
&lt;p&gt;Pages that were succesfully converted:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://laurentperrinet.github.io/sciblog/posts/2014-02-28-batch-removing-files-on-a-ftp-server.html"&gt;Read more…&lt;/a&gt; (5 min remaining to read)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><category>code</category><category>code/shell</category><category>ipython</category><category>numpy</category><category>open-science</category><category>outreach/blog</category><category>shell</category><guid>https://laurentperrinet.github.io/sciblog/posts/2014-02-28-batch-removing-files-on-a-ftp-server.html</guid><pubDate>Fri, 28 Feb 2014 07:33:36 GMT</pubDate></item><item><title>Converting moinmoin pages to nikola</title><link>https://laurentperrinet.github.io/sciblog/posts/2014-02-15-converting-moinmoin-pages-to-nikola.html</link><dc:creator>Laurent Perrinet</dc:creator><description>&lt;div class="cell border-box-sizing text_cell rendered"&gt;&lt;div class="prompt input_prompt"&gt;
&lt;/div&gt;&lt;div class="inner_cell"&gt;
&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;nikolFrom a previous post, we have this function to import a page from moinmoin, convert it and publish:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://laurentperrinet.github.io/sciblog/posts/2014-02-15-converting-moinmoin-pages-to-nikola.html"&gt;Read more…&lt;/a&gt; (23 min remaining to read)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><category>code</category><category>code/shell</category><category>ipython</category><category>numpy</category><category>open-science</category><category>outreach/blog</category><category>python</category><guid>https://laurentperrinet.github.io/sciblog/posts/2014-02-15-converting-moinmoin-pages-to-nikola.html</guid><pubDate>Sat, 15 Feb 2014 13:09:31 GMT</pubDate></item><item><title>Converting MoinMoin pages to Nikola</title><link>https://laurentperrinet.github.io/sciblog/posts/2014-02-11%20Converting%20MoinMoin%20pages%20to%20Nikola.html</link><dc:creator>Laurent Perrinet</dc:creator><description>&lt;div&gt;&lt;div class="cell border-box-sizing text_cell rendered" id="cell-id=6b6f4d52"&gt;&lt;div class="prompt input_prompt"&gt;
&lt;/div&gt;&lt;div class="inner_cell"&gt;
&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;I have another wiki to take notes. These are written using the MoinMoin syntax, which is nice, but I found no converter from MoinMoin to anything compatible with Nikola.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="cell border-box-sizing text_cell rendered" id="cell-id=bfb8891e"&gt;&lt;div class="prompt input_prompt"&gt;
&lt;/div&gt;&lt;div class="inner_cell"&gt;
&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;Following this post &lt;a href="http://carreau.github.io/posts/06-NBconvert-Doc-Draft.html"&gt;http://carreau.github.io/posts/06-NBconvert-Doc-Draft.html&lt;/a&gt; , I thought I might give it a try using ipython within nikola:&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="cell border-box-sizing code_cell rendered" id="cell-id=b76e0863"&gt;
&lt;div class="input"&gt;
&lt;div class="prompt input_prompt"&gt;In [1]:&lt;/div&gt;
&lt;div class="inner_cell"&gt;
&lt;div class="input_area"&gt;
&lt;div class="highlight hl-ipython3"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'https://URL/cgi-bin/index.cgi/SciBlog/2005-10-29?action=print'&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="cell border-box-sizing text_cell rendered" id="cell-id=08728ecb"&gt;&lt;div class="prompt input_prompt"&gt;
&lt;/div&gt;&lt;div class="inner_cell"&gt;
&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;NOTE: this should not be tried with these URLS as they do not exist anymore...&lt;/p&gt;
&lt;p&gt;&lt;a href="https://laurentperrinet.github.io/sciblog/posts/2014-02-11%20Converting%20MoinMoin%20pages%20to%20Nikola.html"&gt;Read more…&lt;/a&gt; (7 min remaining to read)&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><category>code</category><category>code/shell</category><category>ipython</category><category>numpy</category><category>open-science</category><category>outreach/blog</category><category>python</category><guid>https://laurentperrinet.github.io/sciblog/posts/2014-02-11%20Converting%20MoinMoin%20pages%20to%20Nikola.html</guid><pubDate>Tue, 11 Feb 2014 15:07:59 GMT</pubDate></item></channel></rss>