Jekyll2022-01-07T15:19:54-06:00https://tips.manuel.life/feed.xmlManuel’s TipsRepository of tips and snippets.Manuelmail@manuelfte.comHow to fix Jekyll/Ruby v3 errors on Arch Linux/Manjaro2021-12-27T14:46:00-06:002021-12-27T14:46:00-06:00https://tips.manuel.life/how-to-fix-jekyll-errors-arch-linux-manjaro<p>Today as I was updating my blogs (which run all on <a href="https://jekyllrb.com/">Jekyll</a>) I encountered a series of errors when running <code class="language-plaintext highlighter-rouge">bundle exec jekyll serve</code>; mostly these three:</p>
<p><code class="language-plaintext highlighter-rouge">bundler: failed to load command: jekyll (/media/linux/.gems/bin/jekyll)</code></p>
<p><code class="language-plaintext highlighter-rouge">jekyll 3.9.0 | Error: no implicit conversion of Hash into Integer</code></p>
<p><code class="language-plaintext highlighter-rouge">/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in 'require': cannot load such file -- webrick (LoadError)</code></p>
<p>As it turned out, the cause of this is that I had updated my Ruby version to 3, while neither Jekyll or the <a href="https://github.com/github/pages-gem">GitHub Pages gem</a> (which all my themes use) have been updated to support it, and they require Ruby 2.7. The solution then is to downgrade the Ruby version, or preferably, to use <a href="https://rvm.io/">RVM (Ruby Version Manager)</a> to be able to run several Ruby versions simultaneously on the system.</p>
<p>I’m going to show how to do this on Arch Linux/Manjaro.</p>
<p>Firstly, delete everything in your <code class="language-plaintext highlighter-rouge">.gems</code> folder and also delete the <code class="language-plaintext highlighter-rouge">.Gemlock</code> file in your blog’s folder.</p>
<p>Then we install RVM from the AUR:</p>
<p><code class="language-plaintext highlighter-rouge">yay -S rvm ---noconfirm</code></p>
<p>Now let’s open the <code class="language-plaintext highlighter-rouge">.bashrc</code> file:</p>
<p><code class="language-plaintext highlighter-rouge">nano .bashrc</code></p>
<p>And paste this at the very bottom (the AUR script already adds a similar line there. You can leave it instead of this. I didn’t test if it works the same way):</p>
<p><code class="language-plaintext highlighter-rouge">[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"</code></p>
<p>Now let’s install Ruby 2.7:</p>
<p><code class="language-plaintext highlighter-rouge">rvm install 2.7</code></p>
<p>Then switch to a login shell (reason <a href="https://rvm.io/integration/gnome-terminal">here</a>):</p>
<p><code class="language-plaintext highlighter-rouge">/bin/bash --login</code></p>
<p>And set Ruby 2.7 as the default version:</p>
<p><code class="language-plaintext highlighter-rouge">rvm use 2.7 --default</code></p>
<p>It should all be ready. Now we can reinstall bundler:</p>
<p><code class="language-plaintext highlighter-rouge">gem install bundler</code></p>
<p>Reinstall all of the blog’s dependencies in their appropriate versions by running this <em>inside the blog’s folder</em>:</p>
<p><code class="language-plaintext highlighter-rouge">bundle install</code></p>
<p>And the blog should now be compiling and running in the local server:</p>
<p><code class="language-plaintext highlighter-rouge">bundle exec jekyll serve</code></p>
<p>Not so hard of a solution, but hopefully Jekyll and GitHub Pages are updated soon to support Ruby v3 so all of these steps are no longer necessary.</p>
<p>Source: <a href="https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-arch-linux-with-rvm">DigitalOcean</a></p>Manuelmail@manuelfte.comToday as I was updating my blogs (which run all on Jekyll) I encountered a series of errors when running bundle exec jekyll serve; mostly these three:How to restart KDE Plasma Desktop without rebooting or closing the session2021-08-16T11:46:00-05:002021-08-16T11:46:00-05:00https://tips.manuel.life/restart-kde-plasma-desktop-without-rebooting<p>If your KDE Plasma Desktop has frozen and won’t respond to anything you do, don’t worry, there’s a very easy way to restart it and unfreeze it without having to reboot the computer or closing and re-opening the session.</p>
<p>Simply do <code class="language-plaintext highlighter-rouge">CTLR </code>+ <code class="language-plaintext highlighter-rouge">ALT</code> + <code class="language-plaintext highlighter-rouge">T</code> to open a terminal, and then kill KDE Plasma:</p>
<p><code class="language-plaintext highlighter-rouge">killall plasmashell</code></p>
<p>And restart it:</p>
<p><code class="language-plaintext highlighter-rouge">plasmashell &</code></p>
<p>It couldn’t be any simpler.</p>Manuelmail@manuelfte.comIf your KDE Plasma Desktop has frozen and won’t respond to anything you do, don’t worry, there’s a very easy way to restart it and unfreeze it without having to reboot the computer or closing and re-opening the session.How to convert almost any document from the Linux console2020-10-04T07:29:24-05:002020-10-04T07:29:24-05:00https://tips.manuel.life/how-to-convert-almost-any-document-from-the-linux-console<p>I was looking for an online tool to convert some Markdown (.md) files to Microsoft Word’s format (.docx) and I found something even better. <a href="https://pandoc.org/">Pandoc</a> is an open source application that, as its name suggests (“pan” meaning “all, every”), can convert between almost any document format imaginable. Its usage is very simple. We install it from the repositories of our Linux distribution; example, for Arch Linux it’d be:</p>
<p><code class="language-plaintext highlighter-rouge"># pacman -S pandoc</code></p>
<p>And the syntax to use it is this:</p>
<p><code class="language-plaintext highlighter-rouge">$ pandoc -o <output file> <input file></code></p>
<p>The parameters would make more sense reversed in my opinion, but it does the trick. For my case it was then:</p>
<p><code class="language-plaintext highlighter-rouge">$ pandoc -o my_document.docx my_document.md</code></p>
<p>Pandoc will automatically detect the formats based on the file extensions, but in case we’d need to specify them we can also do it this way:</p>
<p><code class="language-plaintext highlighter-rouge">$ pandoc -t <output format> -f <input format> -o <output file> <input file></code></p>
<p>Once again exemplifying with my case:</p>
<p><code class="language-plaintext highlighter-rouge">$ pandoc -t docx -f markdown -o my_document.docx my_document.md</code></p>
<p>The conversion was almost instantaneous. I was expecting the resulting format to have been all jumbled, but no, it was perfect (though it’s hard to misread Markdown).</p>
<p>Pandoc even does have an <a href="https://pandoc.org/try/">online tool</a> though it’s mostly for testing purposes and it only has a tiny sample of the features available in the installable tool. For instance, the option to convert from Markdown to Microsoft Word is not there, even though the actual tool was perfectly capable of doing so.</p>
<p>This is a list of all the input and output formats supported at the moment of writing this post by version 2.10.1 of Pandoc:</p>
<p><strong>Input formats</strong></p>
<ul>
<li>commonmark (CommonMark Markdown)</li>
<li>commonmark_x (CommonMark Markdown with extensions)</li>
<li>creole (Creole 1.0)</li>
<li>csv (CSV table)</li>
<li>docbook (DocBook)</li>
<li>docx (Word docx)</li>
<li>dokuwiki (DokuWiki markup)</li>
<li>epub (EPUB)</li>
<li>fb2 (FictionBook2 e-book)</li>
<li>gfm (GitHub-Flavored Markdown), or the deprecated and less accurate markdown_github ;use markdown_github only if you need extensions not supported in gfm .</li>
<li>haddock (Haddock markup)</li>
<li>html (HTML)</li>
<li>ipynb (Jupyter notebook)</li>
<li>jats (JATS XML)</li>
<li>jira (Jira / Confluence wiki markup)</li>
<li>json (JSON version of native AST)</li>
<li>latex (LaTeX)</li>
<li>markdown (Pandoc’s Markdown)</li>
<li>markdown_mmd (MultiMarkdown)</li>
<li>markdown_phpextra (PHP Markdown Extra)</li>
<li>markdown_strict (original unextended Markdown)</li>
<li>mediawiki (MediaWiki markup)</li>
<li>man (roff man)</li>
<li>muse (Muse)</li>
<li>native (native Haskell)</li>
<li>odt (ODT)</li>
<li>opml (OPML)</li>
<li>org (Emacs Org mode)</li>
<li>rst (reStructuredText)</li>
<li>t2t (txt2tags)</li>
<li>textile (Textile)</li>
<li>tikiwiki (TikiWiki markup)</li>
<li>twiki (TWiki markup)</li>
<li>vimwiki (Vimwiki)</li>
</ul>
<p><strong>Output formats</strong></p>
<ul>
<li>asciidoc (AsciiDoc) or asciidoctor (AsciiDoctor)</li>
<li>beamer (LaTeX beamer slide show)</li>
<li>commonmark (CommonMark Markdown)</li>
<li>commonmark_x (CommonMark Markdown with extensions)</li>
<li>context (ConTeXt)</li>
<li>docbook or docbook4 (DocBook 4)</li>
<li>docbook5 (DocBook 5)</li>
<li>docx (Word docx)</li>
<li>dokuwiki (DokuWiki markup)</li>
<li>epub or epub3 (EPUB v3 book)</li>
<li>epub2 (EPUB v2)</li>
<li>fb2 (FictionBook2 e-book)</li>
<li>gfm (GitHub-Flavored Markdown), or the deprecated and less accurate markdown_github ;use markdown_github only if you need extensions not supported in gfm .</li>
<li>haddock (Haddock markup)</li>
<li>html or html5 (HTML, ie HTML5 / XHTML polyglot markup)</li>
<li>html4 (XHTML 1.0 Transitional)</li>
<li>icml (InDesign ICML)</li>
<li>ipynb (Jupyter notebook)</li>
<li>jats_archiving (JATS XML, Archiving and Interchange Tag Set)</li>
<li>jats_articleauthoring (JATS XML, Article Authoring Tag Set)</li>
<li>jats_publishing (JATS XML, Journal Publishing Tag Set)</li>
<li>jats (alias for jats_archiving )</li>
<li>jira (Jira / Confluence wiki markup)</li>
<li>json (JSON version of native AST)</li>
<li>latex (LaTeX)</li>
<li>man (roff man)</li>
<li>markdown (Pandoc’s Markdown)</li>
<li>markdown_mmd (MultiMarkdown)</li>
<li>markdown_phpextra (PHP Markdown Extra)</li>
<li>markdown_strict (original unextended Markdown)</li>
<li>mediawiki (MediaWiki markup)</li>
<li>ms (roff ms)</li>
<li>muse (Muse),</li>
<li>native (native Haskell),pandoc 2.10.1July 23, 20204</li>
<li>odt (OpenOffice text document)</li>
<li>opml (OPML)</li>
<li>opendocument (OpenDocument)</li>
<li>org (Emacs Org mode)</li>
<li>pdf (PDF)</li>
<li>plain (plain text),</li>
<li>pptx (PowerPoint slide show)</li>
<li>rst (reStructuredText)</li>
<li>rtf (Rich Text Format)</li>
<li>texinfo (GNU Texinfo)</li>
<li>textile (Textile)</li>
<li>slideous (Slideous HTML and JavaScript slide show)</li>
<li>slidy (Slidy HTML and JavaScript slide show)</li>
<li>dzslides (DZSlides HTML5 + JavaScript slide show),</li>
<li>revealjs (reveal.js HTML5 + JavaScript slide show)</li>
<li>s5 (S5 HTML and JavaScript slide show)</li>
<li>tei (Simple TEI)</li>
<li>xwiki (XWiki markup)</li>
<li>zimwiki (ZimWiki markup)</li>
</ul>
<p>Via: <a href="https://mrjoe.uk/convert-markdown-to-word-document/">Joe Leech</a></p>Manuelmail@manuelfte.comI was looking for an online tool to convert some Markdown (.md) files to Microsoft Word’s format (.docx) and I found something even better. Pandoc is an open source application that, as its name suggests (“pan” meaning “all, every”), can convert between almost any document format imaginable. Its usage is very simple. We install it from the repositories of our Linux distribution; example, for Arch Linux it’d be:How to open Flash files without browser and after the deprecation2020-10-02T19:53:21-05:002020-10-02T19:53:21-05:00https://tips.manuel.life/how-to-open-flash-files-without-browser<p>Adobe Flash has been, fortunately and deservedly, deprecated, and all current browsers have dropped support for it. It was already removed from the repositories of all Linux distributions years ago. But what if for some cursed reason you still need it to open a Flash (SWF) file? Maybe some old game you’re nostalgic about, or… well, I really can’t think on any other reason why you’d want to do that.</p>
<p>Whatever the situation, it’s still possible, by downloading Adobe’s Flash Player Projector, a desktop application that is still available on their website, and that can open Flash files without the need of a browser. Go to the following link and download the version for your system:</p>
<p><a href="https://www.adobe.com/support/flashplayer/debug_downloads.html">Adobe Flash Player - Debug Downloads</a></p>
<p>Here I upload the Linux version as a backup for myself (and for you if you use this system as well):</p>
<p><a href="/uploads/2020/10/flash_player_sa_linux.x86_64.tar.gz">Flash Player Projector (64-bit) for Linux</a></p>
<p>Via: <a href="https://www.howtogeek.com/438141/how-to-play-adobe-flash-swf-files-outside-your-web-browser/">How-To Geek</a></p>Manuelmail@manuelfte.comAdobe Flash has been, fortunately and deservedly, deprecated, and all current browsers have dropped support for it. It was already removed from the repositories of all Linux distributions years ago. But what if for some cursed reason you still need it to open a Flash (SWF) file? Maybe some old game you’re nostalgic about, or… well, I really can’t think on any other reason why you’d want to do that.How to export Linux manpages to PDF2020-09-30T20:03:31-05:002020-09-30T20:03:31-05:00https://tips.manuel.life/how-to-export-manpages-to-pdf<p>All you need is the <code class="language-plaintext highlighter-rouge">groff</code> package. Install it via the repositories of your distribution (on Arch Linux it’s part of the <code class="language-plaintext highlighter-rouge">base-devel</code> pack) and then use this command:</p>
<p><code class="language-plaintext highlighter-rouge">$ man -Tpdf package > output.pdf</code></p>
<p>For example, if I want <code class="language-plaintext highlighter-rouge">rsync</code>’s manpage:</p>
<p><code class="language-plaintext highlighter-rouge">$ man -Tpdf rsync > rsync.pdf</code></p>
<p>In actuality you can export to other formats as well and not only PDF. For example, if I wanted to use ODT instead:</p>
<p><code class="language-plaintext highlighter-rouge">$ man -Tpdf rsync > rsync.odt</code></p>
<p>Via: <a href="https://unix.stackexchange.com/a/444769">Stack Exchange</a></p>Manuelmail@manuelfte.comAll you need is the groff package. Install it via the repositories of your distribution (on Arch Linux it’s part of the base-devel pack) and then use this command:Plasma Desktop fails after updating to KDE 4.11? SOLUTION2013-08-20T08:00:00-05:002013-08-20T08:00:00-05:00https://tips.manuel.life/solution-plasma-desktop-crash-kde<p>Yesterday, <strong>KDE 4.11</strong> arrived to <strong>Arch Linux</strong>’s stable repositories, and as always, I updated and restarted the system. However, when logging in again I encountered something unexpected: <strong>Plasma Desktop died after a few seconds</strong> and left me in a black screen with only the pointer on it.</p>
<p>The worst thing was that, since I had been literally months without having any issue when updating Arch (I seem to recall that the last one had been in April 2021), i lost the habit of keeping the old packages in cache and I had deleted them before restarting, so I couldn’t downgrade. Luckily, I also had LXDE installed just in case and I was able to log in to look for solutions on the Internet. I found Plasma 4.10 in an outdated repo, but despite installing it, it served for nothing. Other ideas didn’t bring any better results. No matter what I did, Plasma kept dying seconds after loading.</p>
<p>I had already resigned myself to spend some time on LXDE, until in the Arch Linux forum, some user who had the same problem gave me the solution. Everything is as simple as editing the <code class="language-plaintext highlighter-rouge">/usr/share/autostart/plasma-desktop.desktop</code> file and replacing this line:</p>
<p><code class="language-plaintext highlighter-rouge">Exec=plasma-desktop</code></p>
<p>With this:</p>
<p><code class="language-plaintext highlighter-rouge">Exec=sleep 10 && plasma-desktop</code></p>
<p>And that’s all. Plasma Desktop will continue working as usual.</p>
<p>Source: <a href="https://bbs.archlinux.org/viewtopic.php?pid=1314424#p1314424" title="Weird at KDE behaviour after upgrade to 4.11">Arch Linux Forum</a></p>
<p>Image: <a href="http://gomezhyuuga.deviantart.com/art/Gaia10-KDE-Plasma-Theme-180131334" title="Gaia10 KDE Plasma Theme">gomezhyuuga at deviantART</a></p>Manuelmail@manuelfte.comYesterday, KDE 4.11 arrived to Arch Linux’s stable repositories, and as always, I updated and restarted the system. However, when logging in again I encountered something unexpected: Plasma Desktop died after a few seconds and left me in a black screen with only the pointer on it.SOLUTION: Stuck documents in the print spooler on Windows2009-06-20T10:36:46-05:002009-06-20T10:36:46-05:00https://tips.manuel.life/solution-stuck-print-job-windows<p>If there’s a document stuck in your printer blocking the print spooler of your Windows and refuses to go away no matter how many times you click “Delete”, there’s a more effective and convenient solution than unplugging the printer or restarting the PC. Just copy and paste the following lines in the notepad and save them with <code class="language-plaintext highlighter-rouge">.bat</code> extension (or you can also <a href="/uploads/2009/06/print-spooler-unlocker.bat">click here</a> to download the file):</p>
<div class="language-bat highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">net</span> <span class="kd">stop</span> <span class="kd">spooler</span>
<span class="nb">del</span> <span class="nv">%systemroot%</span>\system32\spool\printers\<span class="o">*</span>.shd
<span class="nb">del</span> <span class="nv">%systemroot%</span>\system32\spool\printers\<span class="o">*</span>.spl
<span class="nb">net</span> <span class="nb">start</span> <span class="kd">spooler</span>
</code></pre></div></div>
<p>Now double click that file and the stubborn stuck document will go away.</p>
<p>Via: <a href="https://www.ghacks.net/2008/12/11/how-to-deal-with-stuck-print-jobs/">gHacks</a></p>Manuelmail@manuelfte.comIf there’s a document stuck in your printer blocking the print spooler of your Windows and refuses to go away no matter how many times you click “Delete”, there’s a more effective and convenient solution than unplugging the printer or restarting the PC. Just copy and paste the following lines in the notepad and save them with .bat extension (or you can also click here to download the file):