blog.notmyidea.org/code/index.html

143 lines
No EOL
10 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<title>Alexis Métaireau</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://blog.notmyidea.org/theme/css/main.css" type="text/css" />
<link href="https://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
title="Alexis Métaireau ATOM Feed" />
</head>
<body>
<section id="links">
<ul>
<li><a class="main" href="/">Alexis Métaireau</a></li>
<li><a class=""
href="https://blog.notmyidea.org/journal/index.html">Journal</a></li>
<li><a class="selected"
href="https://blog.notmyidea.org/code/">Code, etc.</a></li>
<li><a class=""
href="https://blog.notmyidea.org/weeknotes/">Notes hebdo</a></li>
<li><a class=""
href="https://blog.notmyidea.org/lectures/">Lectures</a></li>
</ul>
</section>
<h1>Code, etc.</h1>
<p>Des bouts de trucs liés au code, que je trouve utiles de stocker quelque part (en anglais)</p>
<section class="section index">
<section class="section index">
<time datetime="2023-09-27T00:00:00+02:00">27 septembre 2023</time>
<h1><a href="https://blog.notmyidea.org/llm-command-line-tips.html" id="page-title">llm command-line&nbsp;tips</a></h1>
<p>I&#8217;m using <a href="https://llm.datasette.io">llm</a> more and more, and today I had to find back prompts I used in the past. Here is a command I&#8217;ve been using, which allows me to filter the results based on what I want. It leverages <a href="https://sqlutils.datasette.io">sql-utils</a>, a cli tool which is able to …</p>
<br />
<a class='tag' href="https://blog.notmyidea.org/tag/python.html">python</a>, <a class='tag' href="https://blog.notmyidea.org/tag/llm.html">llm</a>, <a class='tag' href="https://blog.notmyidea.org/tag/bash.html">bash</a>, <a class='tag' href="https://blog.notmyidea.org/tag/sqlite.html">sqlite</a></section>
<section class="section index">
<time datetime="2023-09-27T00:00:00+02:00">27 septembre 2023</time>
<h1><a href="https://blog.notmyidea.org/setting-up-a-irc-bouncer-with-znc.html" id="page-title">Setting up a <span class="caps">IRC</span> Bouncer with <span class="caps">ZNC</span></a></h1>
<p>It&#8217;s been a while since I&#8217;ve used <span class="caps">IRC</span>, but I needed to connect to it today to discuss around <a href="https://docs.peewee-orm.com">Peewee</a>.</p>
<p>The main issue with <span class="caps">IRC</span> is that you need to be connected to see the answer, and to get the context of the conversation. Unless&#8230; you set up …</p>
<br />
<a class='tag' href="https://blog.notmyidea.org/tag/znc.html">ZNC</a>, <a class='tag' href="https://blog.notmyidea.org/tag/weechat.html">Weechat</a>, <a class='tag' href="https://blog.notmyidea.org/tag/irc.html">IRC</a></section>
<section class="section index">
<time datetime="2023-09-22T00:00:00+02:00">22 septembre 2023</time>
<h1><a href="https://blog.notmyidea.org/how-to-run-the-vigogne-model-locally.html" id="page-title">How to run the vigogne model&nbsp;locally</a></h1>
<p><a href="https://github.com/bofenghuang/vigogne">Vigogne</a> is a <span class="caps">LLM</span> model based on <span class="caps">LLAMA2</span>, but trained with french data. As I&#8217;m working mostly in french, it might be useful. The current models that I can get locally are in&nbsp;english.</p>
<p>The information I&#8217;ve found online are scarse and not so easy to follow, so …</p>
<br />
<a class='tag' href="https://blog.notmyidea.org/tag/llm.html">llm</a></section>
<section class="section index">
<time datetime="2023-09-18T00:00:00+02:00">18 septembre 2023</time>
<h1><a href="https://blog.notmyidea.org/creating-a-simple-command-line-to-post-snippets-on-gitlab.html" id="page-title">Creating a simple command line to post snippets on&nbsp;Gitlab</a></h1>
<p>I&#8217;m trying to get away from Github, and one thing that I find useful is the <a href="https://gist.github.com">gist</a> utility they&#8217;re providing. Seems that gitlab provides a similar&nbsp;tool.</p>
<p>You can use it using <a href="https://python-gitlab.readthedocs.io/">python-gitlab</a>:</p>
<div class="highlight"><pre><span></span><code>pipx<span class="w"> </span>install<span class="w"> </span>python-gitlab
</code></pre></div>
<p>And then&nbsp;:</p>
<div class="highlight"><pre><span></span><code>gitlab<span class="w"> </span>snippet<span class="w"> </span>create<span class="w"> </span>--title<span class="o">=</span><span class="s2">&quot;youpi&quot;</span><span class="w"> </span>--file-name<span class="o">=</span><span class="s2">&quot;snip.py&quot;</span><span class="w"> </span>--content<span class="w"> </span>snip …</code></pre></div>
<br />
</section>
<section class="section index">
<time datetime="2023-09-17T00:00:00+02:00">17 septembre 2023</time>
<h1><a href="https://blog.notmyidea.org/creating-an-online-space-to-share-markdown-files.html" id="page-title">Creating an online space to share markdown&nbsp;files</a></h1>
<p>I wanted to create a space on my server where I can upload markdown files and have them rendered directly, for them to be shared with other&nbsp;people.</p>
<p>I stumbled on <a href="https://github.com/ukarim/ngx_markdown_filter_module">the markdown module for nginx</a> which does exactly what I want, but seemed to ask for compilation of nginx …</p>
<br />
</section>
<section class="section index">
<time datetime="2023-09-13T00:00:00+02:00">13 septembre 2023</time>
<h1><a href="https://blog.notmyidea.org/conversion-dun-fichier-svg-en-faviconico.html" id="page-title">Conversion d&#8217;un fichier svg en&nbsp;favicon.ico</a></h1>
<p>Il y a plusieurs sites qui permettent de faire ça automatiquement, mais j&#8217;aime bien faire les choses depuis mon terminal, voici donc une commande qui permet de faire ça simplement, en utilisant <a href="https://imagemagick.org/">ImageMagick</a>. Merci à <a href="https://gist.github.com/azam/3b6995a29b9f079282f3">ce&nbsp;gist</a></p>
<div class="highlight"><pre><span></span><code>convert<span class="w"> </span>-density<span class="w"> </span>256x256<span class="w"> </span>-background<span class="w"> </span>transparent<span class="w"> </span>favicon.svg<span class="w"> </span>-define<span class="w"> </span>icon:auto-resize<span class="w"> </span>-colors<span class="w"> </span><span class="m">256 …</span></code></pre></div>
<br />
</section>
<section class="section index">
<time datetime="2023-09-12T00:00:00+02:00">12 septembre 2023</time>
<h1><a href="https://blog.notmyidea.org/decouverte-de-nouveaux-outils-pour-le-developpement-llm-helix-et-plus.html" id="page-title">Découverte de nouveaux outils pour le développement: <span class="caps">LLM</span>, Helix et&nbsp;plus</a></h1>
<h2 id="llm"><span class="caps">LLM</span></h2>
<ul>
<li><a href="https://localai.io/model-compatibility/">LocalAI</a> permet de faire tourner des modèles en local avec la même <span class="caps">API</span> <span class="caps">HTTP</span> que celle&nbsp;d&#8217;OpenAI</li>
<li><a href="https://github.com/bofenghuang/vigogne">Le modèle Vigogne</a> est un modèle entrainé (<em>fine-tuned</em>) avec des données en Français. Notamment <a href="https://huggingface.co/bofenghuang/vigogne-2-7b-chat/tree/v1.0">ce modèle</a>qui prends <span class="caps">LLAMA2</span> en&nbsp;entrée.</li>
<li><a href="https://python.langchain.com/docs/get_started/introduction.html">LangChain</a> semble être un framework pour travailler avec les différents …</li></ul>
<br />
</section>
<section class="section index">
<time datetime="2023-08-19T00:00:00+02:00">19 août 2023</time>
<h1><a href="https://blog.notmyidea.org/running-the-gitlab-ci-locally.html" id="page-title">Running the Gitlab <span class="caps">CI</span>&nbsp;locally</a></h1>
<p>Sometimes, I need to change how the continuous integration is setup, and I find
myself pushing to a branch to test if my changes are working. Oftentimes, it
takes me multiple commits to find the correct configuration, which is…&nbsp;suboptimal.</p>
<p>I discovered today <a href="https://github.com/firecow/gitlab-ci-local">Gitlab <span class="caps">CI</span>
local</a> which makes it possible …</p>
<br />
<a class='tag' href="https://blog.notmyidea.org/tag/gitlab.html">gitlab</a>, <a class='tag' href="https://blog.notmyidea.org/tag/docker.html">docker</a></section>
<section class="section index">
<time datetime="2023-08-18T00:00:00+02:00">18 août 2023</time>
<h1><a href="https://blog.notmyidea.org/archlinux-et-mise-a-jour-du-keyring.html" id="page-title">ArchLinux et mise à jour du&nbsp;keyring</a></h1>
<p>Pour les mises à jour Arch, j&#8217;utilise <a href="https://github.com/Jguer/yay">yay</a>. Je
ne fais les mises à jour que de manière semi-régulière, et parfois après une
longue période je me retrouve avec des soucis de clé qui ne sont plus à jour ou&nbsp;manquantes.</p>
<p>Avec une utilisation fréquente du système, aucun problème …</p>
<br />
<a class='tag' href="https://blog.notmyidea.org/tag/arch-linux.html">arch-linux</a></section>
<section class="section index">
<time datetime="2023-08-17T00:00:00+02:00">17 août 2023</time>
<h1><a href="https://blog.notmyidea.org/python-packaging-with-hatch-pipx-and-zsh-environment-variables.html" id="page-title">Python packaging with Hatch, pipx and Zsh environment&nbsp;variables</a></h1>
<p>It&#8217;s been a while I didn&#8217;t packaged something new. I recently remembered an old
package of mine that needed some attention :
<a href="https://gitlab.com/almet/debts">debts</a>. It&#8217;s now time to package it, so I
discovered <a href="https://hatch.pypa.io/">hatch</a></p>
<p>hatch new&nbsp;&#8212;init</p>
<p>This does the heavy-lifting for you, actually porting the <code>setup.py</code> files …</p>
<br />
<a class='tag' href="https://blog.notmyidea.org/tag/python.html">python</a>, <a class='tag' href="https://blog.notmyidea.org/tag/packaging.html">packaging</a>, <a class='tag' href="https://blog.notmyidea.org/tag/zsh.html">zsh</a></section>
<ul>
<li><a href="https://blog.notmyidea.org/profiling-and-speeding-up-django-and-pytest.html" rel="bookmark" title="Permalink to Profiling and speeding up Django and Pytest">Profiling and speeding up Django and&nbsp;Pytest</a></li>
</ul>
</section>
</body>
</html>