Jekyll2023-08-01T00:55:45+00:00https://rmpr.github.io/feed.xmlPaul MairoThe faster you fail, the faster you learnIt seems like Stevey was right2023-08-01T00:00:00+00:002023-08-01T00:00:00+00:00https://rmpr.github.io/it-seems-like-stevey-was-right<p>TL;DR This is a blog entry about me using
<a href="https://github.com/sourcegraph/cody">cody</a> to write code with a python library
I wasn’t familiar with.</p>
<p>All of this started with me wanting to send a bunch of audio files to Anchor,
and I discovering that it was not only bought by Spotify, but also it didn’t
offer any API endpoint to send the audio files. I instinctively reached out to
Selenium, that I had never used before, and I (more importantly) didn’t feel
like reading the documentation. This happened to be the day after I read <a href="https://about.sourcegraph.com/blog/all-you-need-is-cody">All
you need is Cody</a> by
Steve Yegge. I think you see where this is going. I went ahead and fired up VS
Code (Cody’s not yet fully available for Neovim 😢).</p>
<p>This was my first query:</p>
<blockquote>
<p>Create a python script using selenium to login to
<a href="https://podcasters.spotify.com/">https://podcasters.spotify.com/</a> with Firefox with the username “admin” and the
password “admin” and upload a mp3 located on the harddrive</p>
</blockquote>
<p>And it came up with the following code:</p>
<p><img src="../images/first_iteration_mp3_to_anchor_cody.jpg" alt="img" /></p>
<p>If for some reason you can’t see that image correctly, here’s the text:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.common.keys import Keys
browser = webdriver.Firefox()
browser.get('https://podcasters.spotify.com/')
assert 'Spotify for Podcasters' in browser.title
username = browser.find_element(By.ID, 'username')
username.send_keys('admin')
password = browser.find_element(By.ID, 'password')
password.send_keys('admin')
browser.find_element(By.ID, 'loginButton').click()
# Find upload button and click
upload_button = browser.find_element(By.ID, 'uploadButton')
upload_button.click()
# Enter file path and upload
file_path = '/path/to/mp3/file.mp3'
browser.find_element(By.ID, 'fileInput').send_keys(file_path)
# Click upload
browser.find_element(By.ID, 'uploadFileButton').click()
# Assert file was uploaded
assert 'File uploaded successfully!' in browser.page_source
browser.quit()
</code></pre></div></div>
<p>I felt a bit adventurous so I decided to run this after replacing the values of
the secrets with the correct ones. And unsurprisingly:</p>
<p><img src="../images/selenium_exception.jpg" alt="img" /></p>
<p>I had to play the game of prompting. Fast-forward a little bit, because I don’t
want this to be too long, it took me 1 hour-ish to get a minimal working
version I could iterate on, which means, in practice the script could login and
start clicking around. If you look closely at the first version of the code,
you will notice that Cody got most of the steps right, and it was a matter of
actually providing a useful implementation, not a dummy thing that will throw
exceptions all over the place.</p>
<h1 id="the-bad">The bad</h1>
<p>At times, it’s funky at best, just like when it tried to sell me that you could
upload files with the system dialog using selenium only. Full disclosure, it
was probably mislead by the
<a href="https://www.selenium.dev/documentation/webdriver/elements/file_upload/">documentation</a>,
so I don’t know if I can hold that against Cody. Or when it hallucinates with
imports. Even if I was that familiar with the library, I’m pretty sure it would
have taken me quite some time to figure out the best way to go about it.</p>
<h1 id="the-less-bad">The less bad</h1>
<p>It will make you discover many things that might be some advanced features of
the library, that if you went the traditional way, would have only discovered
after becoming more familiar with the library.</p>
<h1 id="the-good">The good</h1>
<p>Sometimes, the completion is so spot on, it almost feels like magic:</p>
<p><img src="../images/cody_autocompletion_cheating_mp3.jpg" alt="img" /></p>
<p>It’s also quite good at writing XPath queries!</p>
<h1 id="the-summary-after-a-first-exposure">The summary after a first exposure</h1>
<p>You need practice with prompting, and that mastery only comes with experience.
All in all, it feels quite in line with how I think we should approach writing
software, or at least some of it. After all, I created <a href="https://atbswp.com">atbswp</a> for exactly that
reason. One notable aspect of this is, the only thing I needed to motivate
myself to start that boring task is telling myself that the AI will write all of
the code for me.</p>
<p>Some people see it as the end for software engineers, I’d argue that with such a
system you need to know even more what you’re doing. Or at least have pretty
good fundamentals. Overall, I find it to be an okay tradeoff. Reading the
documentation and figuring out the details by yourself is not obsolete yet, it’s
just not the first thing you want to do (nor should do, to be fair). Maybe code
assistants were the solution we were waiting for to starve the spam clones of
Stackoverflow? We’ll see. This is definitely a game changer, and it wouldn’t be
wise to ignore it. To sum it up, we are not doomed quite yet, at best, in its
current stage, I would see this technology to be a sort of funky
pair-programming, or in the words of JHH in Software Defined Talk, it’s a more
efficient Stackoverflow. Definitely excited to see what the future holds, and
the Neovim extension.</p>
<p>The final version of the code, that you can also find <a href="https://github.com/RMPR/send-audio-to-anchor">here</a></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import os
from time import sleep
import pyperclip
from pynput.keyboard import Key, Controller
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
browser = webdriver.Chrome()
browser.get('https://podcasters.spotify.com/pod/login')
username = browser.find_element(By.ID, 'email')
username.send_keys('email')
password = browser.find_element(By.ID, 'password')
password.send_keys('password')
cookie_button = browser.find_element(By.ID, "onetrust-accept-btn-handler")
cookie_button.click()
# Find submit button with text "Login"
submit_button = browser.find_element(By.XPATH, "//button[@type='submit']")
sleep(5)
submit_button.click()
sleep(5)
# Once logged in go to the upload page
sleep(7)
keyboard = Controller()
for file_path in [mp3_file for mp3_file in os.listdir() if mp3_file.endswith('.mp3')]:
browser.get('https://podcasters.spotify.com/pod/dashboard/episode/wizard')
sleep(5)
file_input = browser.find_element(By.XPATH, "//button[@data-encore-id='buttonPrimary']")
file_input.click()
sleep(2)
# Needs to copy-paste here because of some limitations of pyautogui/pynput
pyperclip.copy(f"{file_path}")
with keyboard.pressed(Key.ctrl):
keyboard.press('v')
keyboard.release('v')
keyboard.press(Key.enter)
keyboard.release(Key.enter)
sleep(5)
file_path_without_extension = file_path.replace(".mp3", "")
title_input = browser.find_element(By.XPATH, "//input[@name='title']")
title_input.send_keys(file_path_without_extension)
episode_description = browser.find_element(By.XPATH, "//div[@role='textbox']")
episode_description.send_keys(file_path_without_extension)
publication_time = browser.find_element(By.XPATH, "//label[@for='publish-date-now']")
publication_time.click()
explicit_content = browser.find_element(By.XPATH, "//label[@for='no-explicit-content']")
explicit_content.click()
# Create a WebDriverWait to wait for the dialog
wait = WebDriverWait(browser, 420)
wait.until(EC.presence_of_element_located((By.XPATH, "//button[@data-encore-id='buttonSecondary' and text()='Replace']")))
submit_button = browser.find_element(By.XPATH, "//button[@data-encore-id='buttonPrimary']")
submit_button.click()
sleep(2)
submit_button = browser.find_element(By.XPATH, "//button[@data-encore-id='buttonPrimary']")
submit_button.click()
sleep(2)
submit_button = browser.find_element(By.XPATH, "//button[@data-encore-id='buttonPrimary']")
submit_button.click()
os.remove(file_path)
print(file_path, "deleted")
sleep(8)
</code></pre></div></div>TL;DR This is a blog entry about me using cody to write code with a python library I wasn’t familiar with.Connect to a server behind a NAT using mosh2023-02-21T00:00:00+00:002023-02-21T00:00:00+00:00https://rmpr.github.io/mosh-behind-nat<p>If you’re not familiar with <a href="https://mosh.org/">mosh</a> it’s essentially SSH but
with support for roaming and it works like a charm on slow connections. I
wanted to access my server which is behind a NAT, but with the default config
it was not straightforward to do so. When you first launch mosh, sshd is launched
in the background then kills the connection, in order to circumvent that, edit the ssh
daemon config file: <code class="language-plaintext highlighter-rouge">/etc/ssh/sshd/config</code> to add the port you want to connect to:</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Port <span class="c">#PORTNUMBER</span>
</code></pre></div></div>
<p>If you have SELinux enabled, you have to tell SELinux about this change.</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>semanage port <span class="nt">-a</span> <span class="nt">-t</span> ssh_port_t <span class="nt">-p</span> tcp <span class="c">#PORTNUMBER</span>
</code></pre></div></div>
<p>After that, you need to forward the same port you’ll be listening to, to your router.
Otherwise you won’t get any data back. You can now access your server with:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mosh --ssh="ssh -p #PORTNUMBER" -p #PORTNUMBER username@serveradress
</code></pre></div></div>If you’re not familiar with mosh it’s essentially SSH but with support for roaming and it works like a charm on slow connections. I wanted to access my server which is behind a NAT, but with the default config it was not straightforward to do so. When you first launch mosh, sshd is launched in the background then kills the connection, in order to circumvent that, edit the ssh daemon config file: /etc/ssh/sshd/config to add the port you want to connect to:Preview Images Using Neovim in Fedora2022-01-12T00:00:00+00:002022-01-12T00:00:00+00:00https://rmpr.github.io/Telescope-media<p>To preview images with neovim you can use the plugin <a href="https://github.com/nvim-telescope/telescope-media-files.nvim"><code class="language-plaintext highlighter-rouge">telescope-media-files.nvim</code></a>
which is a <a href="https://github.com/nvim-telescope/telescope.nvim">Telescope</a> extension.</p>
<p>To install with vim-plug, add the following lines to your config:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-media-files.nvim'
</code></pre></div></div>
<p>This extension uses <a href="https://github.com/seebye/ueberzug">Überzug</a> in the background, to install it on Fedora:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># dnf copr enable tokariew/ueberzug
</code></pre></div></div>
<p>Note that this is a fork of the original COPR by frostyx because it has issues on Fedora 35. You can then install it:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># dnf install -y ueberzug
</code></pre></div></div>
<p>To set up the plugin, all you need to do is to add</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>require('telescope').load_extension('media_files')
</code></pre></div></div>
<p>In a lua file in your config. If you want to put it into a vimscript source file, you can write instead:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lua << EOF
require('telescope').load_extension('media_files')
EOF
</code></pre></div></div>
<p>That’s it, now you can preview images by running:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>:Telescope media_files
</code></pre></div></div>
<p>And voilà!</p>
<p><img src="../images/telescope_media_ueberzug.gif" alt="Telescope media demo" /></p>To preview images with neovim you can use the plugin telescope-media-files.nvim which is a Telescope extension.The fish shell is amazing2021-11-08T00:00:00+00:002021-11-08T00:00:00+00:00https://rmpr.github.io/the-fish-shell-is-amazing<p>I’ve been lurking the <a href="https://fishshell.com/">fish shell</a> for a couple of years now (and the
<a href="https://github.com/nushell/nushell">nushell</a> but it is another story for
another time). Not so long ago, I decided to try it, and it’s simply… amazing. If I had to state one feature that makes me like to use it, it’ll be the
autocompletion, hands down. It’s the first time I just take a shell and without customization it’s pleasing to use.</p>
<h2 id="features">Features</h2>
<p>Some notable features I want to mention:</p>
<ul>
<li>
<p><strong>The default colorscheme</strong>: when you type something invalid it’s red, blue when not</p>
</li>
<li>
<p><strong>Smart tab completion</strong> not only for the commands but for the arguments as well, and it apparently does that by parsing man pages. The autocompletion is also
contextual, depending on where you are, it suggests different things.</p>
</li>
<li>
<p>Floating point calculation directly inside the shell, not super important, but I used to use a REPL or bc for that</p>
</li>
<li>
<p>You can configure your shell using a web interface! Just run <code class="language-plaintext highlighter-rouge">fish_config</code></p>
</li>
</ul>
<h2 id="what-about-plugins">What about Plugins?</h2>
<p>On my previous shells I used <a href="https://github.com/bash-it/bash-it/">bash-it</a>
and <a href="https://github.com/ohmyzsh/ohmyzsh">oh-my-zsh</a>. While those are amazing
projects, they still need configuration to get things to work really well. And
if you want to match fish’s level, you will need to install a lot of plugin and/or
write quite a few lines of code. With fish you get that for free.
Nevertheless, there are some plugins manager,
<a href="https://github.com/oh-my-fish">oh-my-fish</a>,
<a href="https://github.com/jorgebucaran/fisher">fisher</a> and
<a href="https://github.com/danhper/fundle">Fundle</a>. To be honest, I didn’t
find them super useful because the only plugin I use is the
<a href="https://github.com/starship/starship">starship</a> prompt and it’s
available in the Fedora repo anyway. For those interested, <a href="https://github.com/jorgebucaran/fisher/issues/481">here is a
comparison between fisher, omf and
fundle</a>
it might be a bit biased since it’s by fisher’s author. But those seemed to me like valid points.</p>
<p><a href="https://asciinema.org/a/447626"><img src="https://asciinema.org/a/447626.svg" alt="asciicast" /></a></p>
<p>I used oh-my-zsh with powerlevel10k because it’s very fast. When switching to fish, I felt I had to choose between
<a href="https://github.com/starship/starship">starship</a> and <a href="https://github.com/IlanCosman/tide">tide</a>. I wish I could say more things on that, but I chose starship solely because it is on the Fedora repo :p
but it’s crazy fast though.</p>
<h2 id="some-quirks-that-might-actually-not-be-quirks">Some quirks (that might actually not be quirks)</h2>
<p>The first thing you need to know, fish is <strong>not</strong> POSIX compliant, don’t expect your
previous scripts to work at all. The syntax is different, and arguably better.
For example the for loop:</p>
<p>with fish:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">for </span>i <span class="k">in</span> <span class="k">*</span>.pdf
<span class="nb">echo</span> <span class="nv">$i</span>
end
</code></pre></div></div>
<p>With bash/zsh:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">for </span>i <span class="k">in</span> <span class="k">*</span>.pdf<span class="p">;</span>
<span class="k">do
</span><span class="nb">echo</span> <span class="nv">$i</span><span class="p">;</span>
<span class="k">done</span>
</code></pre></div></div>
<p>No more <code class="language-plaintext highlighter-rouge">fi</code>, <code class="language-plaintext highlighter-rouge">esac</code> or <code class="language-plaintext highlighter-rouge">done</code>.</p>
<p>Although I didn’t face anything (<code class="language-plaintext highlighter-rouge">source bin/activate.fish</code> works like a charm),
if you have issues activating Python virtual environments, you can have a look at
<a href="https://github.com/justinmayer/virtualfish">virtualfish</a></p>
<h2 id="closing-thoughts">Closing thoughts</h2>
<p>In my opinion, fish is not geared towards shell scripting, it’s interactivity
is simply unmatched in any current shells that I know of. If you are more interested in a better shell scripting
experience, you might want to have a look at the <a href="https://www.oilshell.org/">oil shell</a> instead.
Don’t get me wrong, you still need to learn bash at a decent level as it is
what you’ll probably stumble upon the most (in containers, virtual environments,
vanilla servers, …), but this shouldn’t prevent you from stepping up your game.
If you liked this post, check out this <a href="https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/">awesome piece</a> by Julia Evans.
This is the first article of the serie about mouseless computing, I felt like it’s kinda useful to have this as an entry point. Stay tuned for the next one.</p>I’ve been lurking the fish shell for a couple of years now (and the nushell but it is another story for another time). Not so long ago, I decided to try it, and it’s simply… amazing. If I had to state one feature that makes me like to use it, it’ll be the autocompletion, hands down. It’s the first time I just take a shell and without customization it’s pleasing to use.Thoughts on how to find remote work in Cameroon2021-09-04T00:00:00+00:002021-09-04T00:00:00+00:00https://rmpr.github.io/remote-work-cameroon<p><a href="https://www.economist.com/graphic-detail/2021/08/11/for-programmers-remote-working-is-becoming-the-norm">Remote work is the new norm</a>
there has never been a time like this, where as a SE you can make more than a
decent living. This isn’t a know-it-all kind of post, I just wanted to write a
bit about my experience, but it’s way too long (6 months+) so I will just share
what worked and not for me. Before I forget, this is mainly for people like me doing
computer science for the sake of doing it. Not because someone forced us or
whatever. In short, geeks I guess. If you’re like me the perspective of spam
applying and writing corresponding CVs is not very appealing. So, if CS is just
a means to an end - not that there’s something wrong with that - but this might
rub you off the wrong way (and you guessed right, no, I don’t look forward to
enter management to “escape” coding). The job landscape in Cameroon is…
saddening. While everywhere else the supply exceeds the demand, here it’s the
exact opposite, which inevitably leads to abuse. Also, if you are still a student, this might
not be for you directly, you can still read it to be prepared but <a href="https://github.com/deepanshu1422/List-Of-Open-Source-Internships-Programs">there are
many opportunities for students</a> and I talk
a bit about GSoC <a href="../Guerilla-Gsoc/">here</a>. That being said, let’s get started.</p>
<p><a id="orgdc3fe01"></a></p>
<h2 id="where-to-get-jobs">Where to get jobs?</h2>
<p>Most of the time looking for someone to fill a position is an algorithm like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>for candidate in talent_pool:
if company.interviews(candidate):
# Passed all the interviews
break
else:
company.reject(candidate)
</code></pre></div></div>
<p>For those who hate Python, well I guess my post isn’t for you either :p</p>
<p>What I try to convey here is that there is an obvious advantage of applying early. Of course, the most efficient
way is to know someone at the company who can share your CV before the job is
even out or in short <a href="#org595a31d">make jobs come to you</a>, but hey, if you can do that, you don’t need this post anyway.
The key here is to iterate quickly, so staying on top of information is crucial.
There are many platforms online to find jobs:</p>
<ul>
<li><a href="https://weworkremotely.com/">weworkremotely</a></li>
<li><a href="https://hiddengurus.com/">Hidden Gurus</a></li>
<li>Pretty much everything with remote in the domain name.</li>
</ul>
<p>Just to name a few, you can find more <a href="https://docs.google.com/spreadsheets/d/1JfNAbUX_lN9K3MCNHO15GJtJ5qpk7H9Cl3xTBwv2FR8/htmlview">here</a>,
thanks <a href="https://news.ycombinator.com/item?id=25312556">Doreen Michele</a>.
As far as I am concerned, after using Linkedin (didn’t get much responses from here), AngelList and a bunch of stuff.
I settled on using the RSS feeds of <a href="https://stackoverflow.com/jobs/feed">Stackoverflow Jobs</a> and the monthly <a href="https://hnrss.org/whoishiring/jobs">“Who is hiring”</a> thread on Hackernews</p>
<p><a id="org5063d35"></a></p>
<h2 id="-make-jobs-come-to-you"><a id="org595a31d"></a> Make jobs come to you</h2>
<p>If I had to sum up this one, I would say: <strong>Make yourself known and heard</strong>. I
always like to take the example of fasterthanlime <a href="https://twitter.com/fasterthanlime/status/1292239088704258049">when he quitted his job</a> I want to
note two things: first, He is in control, not only choosing the type of work (remote) but
also the location (France) and people already share some jobs with him in the comments.
To finally <a href="https://twitter.com/fasterthanlime/status/1301237794828963841">get a job less than a month later</a>. This
was so inspirational. Usually, I am not a social networks type of guy, but I’ve come to tolerate some of them
with time. By the way, you can find me on <a href="https://twitter.com/_paulmairo">Twitter</a> and <a href="https://www.linkedin.com/in/mpr/">Linkedin</a> mostly.
Now if you are not famous (whatever that means) here are a couple of things you can try to “fake” it:</p>
<ul>
<li>Share your profile on the monthly “Who wants to be hired” thread on Hackernews</li>
<li>Take Linkedin assessment tests and keep your profile up to date</li>
<li>Get some reputation on Stackoverflow (might be a bit controversial but I like to think it helped me)</li>
<li>Well, actually grow your Twitter/Blog/Whatever audience</li>
<li>I recently discovered that you can mark yourself available for hire on <a href="https://github.com/settings/profile">github</a> but I didn’t use that feature</li>
</ul>
<p><a id="org7d7f1dd"></a></p>
<h2 id="my-strategy">My strategy</h2>
<p>Sorry web designers, I don’t mean to shit on your work. But have a look at
What I see when I browse the Stackoverflow jobs RSS feed
<img src="../images/newsboat_stackoverflow_jobs.jpg" alt="newsboat stackoverflow jobs" />
Versus the Web interface.
<img src="../images/stackoverflow_jobs_web.jpg" alt="stackoverflow jobs web interface" /></p>
<p>Using the RSS feed, at first glance I can see 35 jobs and I already know those
that aren’t a good fit while on the web interface I barely see 3, and if I exclude the featured job, it’s just two. Not good at all. There’s also the
online vs offline considerations, and I can talk about the advantages a whole
day but I think you get the picture (pun intended).</p>
<p><a id="orgdc32eae"></a></p>
<h2 id="a-note-about-job-interviews">A note about job interviews</h2>
<p>If a company insist that I go to hackerrank or whatever before an interview
with a real person. It is probably not a company I really want to work for anyway.
Before throwing stones at me, let me explain. If you could just share your screen,
show what you’ve got and call it a day, that would probably be good enough.
Live coding is way better not only because the person is in a familiar
environment and in an ideal world you don’t get to be judged if you forget
how to iterate over a dictionary and you have to go to the documentation (true
story). While with Hackerrank the process is totally dehumanized. As a rule of thumb
for me, the faster you talk to an actual person, the better. I will take the time to say
that I really appreciated companies using <a href="https://www.beapplied.com/">beapplied</a>. Their
process was really transparent and well-rounded, I wish them success, they sure
deserve it.</p>
<p><a id="orge881430"></a></p>
<h2 id="rejections">Rejections</h2>
<p>They will unavoidably happen, I mean, even the <a href="https://web.eecs.utk.edu/~azh/blog/allmyrejections.html">best of us get rejected</a>
sometimes. But a rejection can be useful in your journey. Don’t forget to <strong>always ask for
feedback</strong>. After your hundredth feedbackless rejection or so, you can seriously doubt your skills.
Not only that, if there’s something wrong you’ve been doing, a good feedback
will point it out and you’ll correct it the next time. Too bad another
company will profit from your upgrade.</p>
<p><a id="org861dd5d"></a></p>
<h2 id="compensation">Compensation</h2>
<p>Compensation is one of the most important aspects and there are simply too many things to cover.
A rough summary of my experience is that I have been ghosted many times when I asked for money first. So
I double down on the “let them give you a number first”. If they refuse, it’s probably not
a company you want to work for anyway. I leave you this awesome resource <a href="https://www.kalzumeus.com/2012/01/23/salary-negotiation/">salary negociation, make more money, be more valued</a></p>
<p><a id="orgfb63a65"></a></p>
<h2 id="miscellaneous">Miscellaneous</h2>
<p>Here are some stuff that came to my mind in no particular order:</p>
<ul>
<li>
<p><strong>Ask for someone to have a look at your resume.</strong>
For this part, you can shoot me an email: blog(at)rmpr.xyz or join our <a href="https://t.me/joinchat/8VX3yG6k7GI0NjY0">telegram community</a> (more on that later)
people will be more than happy to help you.</p>
</li>
<li>
<p><strong>Get a good Internet with good backup plans (in case of Eneo you know)</strong>
This one is pretty obvious, but I just wanted to say that <del>Camtel</del> Blue is the
best consumer ISP.</p>
</li>
<li>
<p><strong>If you absolutely have to write a cover letter write your own instead of copy-pasting a template</strong>
Here’s a <a href="https://paste.centos.org/view/7791344b">link</a> to one of my cover letters. This is just
temporary, will get deleted very soon.</p>
</li>
</ul>
<p>Stuff I didn’t try but they sure look good on paper:</p>
<ul>
<li>
<p><strong>Master a niche language</strong>
Real expertise is very time-consuming and difficult to get, so, what you can
do is learn a “niche” language: Clojure, Elixir, Scala come to my mind. Don’t get
me wrong, I don’t ask you to fall for the hype, C is totally fine, and if you
develop your skills enough you’re a rare breed. Python, JS, … all valid choices. You should just keep in mind that they (should) hire someone they feel can get the job done. It’s
just that it might be easier with a language not everyone has a grasp on, because it
reduce extensively the talent pool from which the company can choose from</p>
</li>
<li>
<p><strong>Contribute to popular open source projects backed financially</strong>
Off the top of my head: <a href="https://github.com/supabase/supabase">supabase</a>,
<a href="https://github.com/aquasecurity/tracee">tracee</a>,
<a href="https://github.com/commaai/openpilot">openpilot</a>,
<a href="https://github.com/ziglang/zig">zig</a>,
<a href="https://github.com/ValveSoftware/Proton">proton</a>,
<a href="https://wiki.winehq.org/Submitting_Patches">wine</a>,
<a href="https://github.com/httpie/httpie">httpie</a>,
<a href="https://github.com/rotki/rotki">rotki</a>,
<a href="https://github.com/mattermost">Mattermost</a>.
For more insight about making money with open source, you can have a look
<a href="https://twitter.com/VittoStack/status/1433324585659871237?s=19">here</a> and
<a href="https://drewdevault.com/2020/11/20/A-few-ways-to-make-money-in-FOSS.html">there</a>.</p>
</li>
</ul>
<p><a id="org631fcf6"></a></p>
<h2 id="closing-thoughts">Closing thoughts</h2>
<p>The key is information and speed. Follow the good persons, maybe build an audience.
I leave you with something I found to be true every single damn time:
Finding a job is more a social activity than a technical one.</p>
<p>Edit (Wed Jul 12 11:27:51 PM CEST 2023):</p>
<p>With stackoverflow <a href="https://meta.stackoverflow.com/questions/415293/sunsetting-jobs-developer-story">sunsetting jobs and developer
story</a>,
my new recommendation is <a href="https://www.levels.fyi/jobs">levels.fyi’s job board</a>. Add your
compensation there too, they are great.</p>Remote work is the new norm there has never been a time like this, where as a SE you can make more than a decent living. This isn’t a know-it-all kind of post, I just wanted to write a bit about my experience, but it’s way too long (6 months+) so I will just share what worked and not for me. Before I forget, this is mainly for people like me doing computer science for the sake of doing it. Not because someone forced us or whatever. In short, geeks I guess. If you’re like me the perspective of spam applying and writing corresponding CVs is not very appealing. So, if CS is just a means to an end - not that there’s something wrong with that - but this might rub you off the wrong way (and you guessed right, no, I don’t look forward to enter management to “escape” coding). The job landscape in Cameroon is… saddening. While everywhere else the supply exceeds the demand, here it’s the exact opposite, which inevitably leads to abuse. Also, if you are still a student, this might not be for you directly, you can still read it to be prepared but there are many opportunities for students and I talk a bit about GSoC here. That being said, let’s get started.Comment être plus productif sans se forcer ?2021-08-11T00:00:00+00:002021-08-11T00:00:00+00:00https://rmpr.github.io/How-to-be-productive-without-forcing<p>Ceci est une traduction de l’article <a href="https://www.deprocrastination.co/blog/how-to-be-productive-without-forcing-yourself">How to be productive without forcing yourself</a>
donc (il y’a certainement) des choses qui ont été perdues lors de la traduction.</p>
<p>Imaginez que vous pouviez travailler et être beaucoup plus productif. Et le meilleur dans tout ça ? Vous
n’auriez pas besoin de vous forcer à travailler.</p>
<p>Il existe des personnes exactement comme ça, qui sont capables de travailler de manière totalement naturelle
sans se forcer. Ils attendent même le travail avec impatience. Et la bonne nouvelle c’est que vous pouvez
apprendre à le faire aussi.</p>
<p>La plupart des gens ont une conception négative du travail. Ils pensent que comparé à l’amusement <a href="https://www.deprocrastination.co/blog/today-shouldnt-suck">le travail est nul</a>. Ils perçoivent le travail comme
une gêne qui les empêche de faire ce dont ils ont réellement envie. Ils pensent aussi que la
farniente c’est un état idéal dans lequel ils aimeraient toujours rester. Ceci pousse à penser que c’est nécessaire de s’efforcer pour travailler. Que c’est nécessaire d’user de volonté pour s’efforcer à
travailler.</p>
<p>Cette façon de penser a 3 principales causes :</p>
<ol>
<li>Les gens veulent généralement ce qu’ils n’ont pas et pensent que l’herbe est plus verte de l’autre côté</li>
<li>Tout le monde dit que le travail est difficile</li>
<li>Par rapport aux emplois sans-issues ou dans des entreprises sans impact et liberté, vivre de loisirs sans fin ressemble au paradis</li>
</ol>
<p>En réalité, la plupart des gens qui essaient de vivre sans rien faire pendant une longue période
deviennent malheureux, dépressifs et las. Les personnes riches qui ont “réussi” redeviennent rapidement
agitées. <a href="https://www.reddit.com/r/StopGaming/">Ceux qui jouent tout le temps</a> se rendent compte d’à quel
point ils sont vides. Sur le long terme, trop de loisirs ne satisfont pas.</p>
<p>D’un autre côté, il y’a certaines personnes qui travaillent et qui aiment ça. Appelons ce groupe
les producteurs.
Il n’est pas question ici des bourreaux du travail qui fuient leur vie en travaillant tout le temps. Les
producteurs. Les producteurs ont un équilibre sain entre leur vie professionnelle et leur vie privée.
Qu’est-ce qu’ils donc que ceux qui n’aiment pas le travail ne font pas ?</p>
<p>Premièrement, ils ont tendance à penser au travail différemment.</p>
<p>Pour eux, le travail est
<a href="https://www.deprocrastination.co/blog/what-is-a-positive-feedback-loop-and-why-it-matters">une source constante de feedback positif</a>. Les
producteurs voient le <strong>travail comme étant satisfaisant et donnant un sens à leur vie</strong>. Le travail est une
activité qui leur permet de savourer des loisirs bien mérités. Le repos est une disposition qui accroît
leur bonheur et qui alimente leur motivation pour le travail.</p>
<p>Deuxièmement, leur travail est généralement :</p>
<ul>
<li>
<p>Intéressant</p>
</li>
<li>
<p>Utile</p>
</li>
<li>
<p>Bien-défini</p>
</li>
</ul>
<p>Si vous remplissez au moins un ou deux critères ci-dessus, quelque chose de magique se produit :</p>
<p><strong>Vous n’avez plus besoin de vous forcer à travailler</strong></p>
<p>C’est facile d’avoir envie de faire un travail bien-défini, utile et particulièrement intéressant.</p>
<p>Les non-producteurs pensent toujours que les producteurs sont chanceux de tomber sur un tel travail. En
réalité, les producteurs parcourent souvent un long chemin pour <a href="https://www.deprocrastination.co/blog/how-to-make-work-less-boring">rendre leur travail plaisant</a></p>
<h2 id="comment-rendre-le-travail-plus-intéressant">Comment rendre le travail plus intéressant</h2>
<p>C’est un facteur crucial dans le fait que le travail soit fait.</p>
<p>Vous n’avez pas besoin de donner un sens à votre travail pour qu’il soit intéressant. Même si la tâche est
complètement indéfinie, complexe et difficile, la curiosité peut vous amener à la terminer.</p>
<p>Comment donc développer de la curiosité envers le travail ?</p>
<p>Vous devez donner la chance au travail de devenir intéressant. Comment? En combinant les trois étapes
suivantes :</p>
<h3 id="être-moins-exposé-aux-choses-trop-plaisantes">Être moins exposé aux choses trop plaisantes</h3>
<p>Les jeux vidéos, surfer sur internet NDT les réseaux sociaux, la pornographie, l’alcool et la drogue,
etc. rendent le travail considérablement plus difficile, pourquoi ?</p>
<p>Ils établissent un certain standard de stimulation mentale. Tout ce qui n’est pas aussi plaisant
va sembler ennuyeux.</p>
<p><img src="https://www.deprocrastination.co/assets/illustrations/stimulation_standard.png" alt="Stimulation Standard" /></p>
<p>Malheureusement le travail se retrouve toujours dans la catégorie “feels bad”. Comparé aux jeux ou aux
réseaux sociaux, le travail peut sembler inintéressant ou ennuyeux.</p>
<p><img src="https://www.deprocrastination.co/assets/illustrations/stimulation_work_distractions.png" alt="stimulation work distractions" /></p>
<p>Vous pouvez argumenter que certaines personnes travaillent sans problèmes même en buvant de l’alcool,
jouant aux jeux vidéos, etc.</p>
<p>Mais il faut considérer qu’il existe deux types de personnes : ceux qui peuvent modérer leur
consommation et ceux qui ne le peuvent pas. Ces derniers sont souvent décrits par la société comme des
addicts. Si vous êtes addict à n’importe laquelle des activités fournissant beaucoup de dopamine sans
faire beaucoup d’effort, il faudrait l’arrêter. Au moins temporairement pour rétablir une relation saine
avec le travail. Plus nous gagnons de l’expérience avec ce sujet, plus cela nous semble évident. Il
n’existe aucun autre moyen que d’arrêter l’activité addictive au moins temporairement. Si vous péchez
par les jeux, nous avons couvert <a href="https://www.deprocrastination.co/blog/should-i-quit-video-games">l’addiction aux jeux vidéos ici</a>.</p>
<p>Certaines personnes peuvent avoir un rapport sain avec, par exemple, les jeux vidéos.</p>
<p>Pourtant, pour certaines personnes c’est leur kryptonite. Voici quelques indices qui prouvent que les
activités trop plaisantes ont un effet néfaste sur votre travail :</p>
<ol>
<li>Vous vous précipitez et bâclez toutes les autres choses pour pouvoir vous lancer dans votre activité
trop plaisante. Quand j’étais (Mat) addict aux jeux vidéos, je baclais tout ce que j’avais à faire
pendant la journéee pour pouvoir commencer à jouer.</li>
<li>Vous passez le temps à reporter ou oublier tout ce qui n’est pas urgent pour pouvoir faire votre
activité super plaisante. Vous avez ce livre que vous avez envie de lire mais vous n’y arrivez
jamais.</li>
<li>Une fois que vous commencez votre activité, il n’y a plus d’ordre. La plupart des gens qui
recommencent les jeux vidéos disent que leur sens de l’ordre commence à se désagréger rapidement.
Leur chambre devient désordonnée, ils commencent à sauter des séance d’exercise physique, à arrêter
de préparer des repas, à consommer plus de malbouffe, à arrêter d’organiser leurs journées.</li>
</ol>
<p>Si les points précédents vous concernent, il est peut-être temps d’arrêter votre activité addictive, au
moins pour un temps.</p>
<p>Une fois que votre cerveau n’est plus constamment surstimulé, il est plus facile de trouver les
activités communes comme le travail ou faire l’ordre plus intéressantes.</p>
<h3 id="sennuyer-plus-souvent">S’ennuyer plus souvent</h3>
<p>Lorsque vous vous ennuyez, toutes les autres activités deviennent plus intéressantes.</p>
<p>Vous ne nous croyez pas ? Faites l’expérience de tout arrêter. Mettez un compte à rebours de 15 minutes.
Asseyez-vous sur une chaise et regardez le mur. Ne bougez pas, ne consommez aucune information, ne
parlez pas, n’écrivez rien. Regardez juste le mur.</p>
<p>À l’exception des zen masters, la plupart d’entre nous vont commencer à s’agiter après quelques minutes.
Très souvent, notre cerveau commence à rêver et à imaginer des trucs. Pour les premières minutes, tout
peut sembler bien aller, en pensant à sa journée. Cependant, après 5 ou 10 minutes, l’envie de faire
quelque chose, n’importe quoi, va commencer à vous démanger. Soudainement, faire un site web, écrire un
artile ou dessiner semblent plus intéressants, plus plaisants.</p>
<p><img src="https://www.deprocrastination.co/assets/illustrations/stimulation_work_boredom.png" alt="Switching from boredom to work is easier" /></p>
<p>Si vous sentez que vous ne pouvez pas vous empêcher de scroller et de consommer du contenu tout le
temps, programmez une séance de 15 min d’ennui pour demain juste avant de commencer le travail.
<a href="https://www.deprocrastination.co/blog/how-to-use-boredom-to-procrastinate-less">Utilisez l’ennui de manière stratégique</a></p>
<h3 id="aller-profondément-dans-un-sujet">Aller profondément dans un sujet</h3>
<p>C’est amusant quand nous pouvons connecter les idées, créer de nouvelles relations entre elles.
<em>Oh, je vois comment cet évènement historique a contribué à une révolte…</em></p>
<p>Plus on est capables de créer des connexions dans un sujet, plus on s’y intéresse. C’est là tout
l’intérêt de la curiosité.</p>
<p>Si vous prenez le temps de regarder un documentaire, lire un livre ou parcourir un ensemble d’articles
relatifs à votre travail. Vous allez glaner plus d’éléments pour établir des relations. Vous allez voir
comment les choses vont ensemble.</p>
<p>Si vous avez envie de regarder quelque chose ou vous avez une soirée libre, au lieu de regarder des
vidéos au hasard ou des rediffusions des anciennes séries télévisées, dirigez plutôt votre attention
sur des choses relatives à ce que vous devez faire.</p>
<p><a href="https://www.deprocrastination.co/blog/block-out-input-free-time">Donnez vous du temps</a> pour développer
de l’intérêt.</p>
<h2 id="comment-rendre-le-travail-plus-utile">Comment rendre le travail plus utile</h2>
<p>C’est difficile de se sentir motivé lorsque vous n’avez pas une raison personnelle de faire le travail.</p>
<p>Cependant, “travail utile” est devenu un mot à la mode.</p>
<p>Tout le monde essaie de trouver de la signifiance dans son travail. Ceci peut être une perte d’énergie,
surtout si vous travaillez dans un environnement corporate ou alors quelque part sans perspective
d’évolution. Nous vous disons ceci pour ne pas vous appesantir sur votre sort ou alors que soyez frustrés
parce que vous n’arrivez pas à trouver un moyen de sauver le monde par ce que vous faites.</p>
<p>Dans tous les cas, peu importe votre travail, vous pouvez le rendre assez utile pour commencer.</p>
<p>Par exemple si vous devez étudier pour un examen et que cette matière n’est pas
particulièrement agréable. Si vous vous rappelez à vous-même pourquoi vous avez
choisi cette matière et pourquoi l’étudier est important pour vous, ce sera plus
facile de surmonter la difficulté.</p>
<p>Le fait est que certaines choses ont besoin d’être faites. Il est mieux de trouver une raison personnelle
qui vous motive à les faire et en finir au plus vite au lieu de les ajourner indéfiniment.</p>
<p>Lorsqu’une tâche est ennuyante, posez-vous la question : pourquoi ai-je besoin de faire ça ? Trouvez
et consolidez le pourquoi derrière le travail à faire.</p>
<h2 id="comment-bien-définir-le-travail">Comment bien-définir le travail</h2>
<p>Si vous avez une recette qui explique étape par étape comment préparer un repas, c’est en général facile
à suivre. Vous savez exactement où commencer et comment.</p>
<p>De nos jours, le travail créatif n’est pas nécessairemment aussi structuré. Il n’y a pas de recettes pour
le travail que nous avons à faire, ou alors elles ne le rendent pas plus facile à faire parce
qu’une recette serait trop compliquée à comprendre.</p>
<p>De plus, nous entravons notre envie de travailler nous-mêmes. Combien de fois créez vous des éléments
vagues sur votre todo list comme : “rédiger l’article” ou “faire une vidéo” ?</p>
<p>Il y’a tellement d’étapes dans “faire une vidéo” que cette vague définition de la tâche à faire cause
juste de l’anxiété et de la procrastination.</p>
<p>On dit souvent qu’il est plus facile de commencer à travailler que de continuer à travailler une fois
qu’on a commencé. De ce fait, nous devrions rendre le commencement plus facile en définissant <strong>comment</strong>
commencer et <strong>ce par quoi</strong> on commence.</p>
<p>La manière dont vous définissez comment commencer le travail influe donc sur la facilité à le faire.</p>
<p>Fondamentalement, ceci peut être fait en 3 étapes :</p>
<h3 id="toujours-définir-où-vous-allez-commencer">Toujours définir où vous allez commencer</h3>
<p>Cela signifie qu’il faut toujours écrire la prochaine action à faire.</p>
<p>Vous avez besoin d’écrire un essai ?</p>
<p>La prochaine action à faire c’est : ouvrir une étude scientifque et commencer à la lire. Ou alors créer un document → créer un brouillon dans les 15 prochaines minutes.</p>
<p>Vous voulez apprendre à coder ?</p>
<p>La prochaine action devrait être : Ouvrir freecodecamp.org → commencer à résoudre le premier challenge.</p>
<p>Ça peut sembler stupide de définir la prochaine action à faire, mais ce n’est pas le cas. La trouver
est facile, et vous pouvez le faire tout de suite.</p>
<p>Quelle est la prochaine action que vous avons besoin de faire ?</p>
<h3 id="commencez-par-travailler-515-minutes">Commencez par travailler 5/15 minutes</h3>
<p>Vous n’avez probablement pas envie de créer une présentation de 20 diapositives maintenant et la présenter dans 2 heures.</p>
<p>Vous n’avez probablement pas envie de rédiger tout un mémoire sur un sujet que vous connaissez à peine.</p>
<p>Vous n’avez probablement pas envie de courir un marathon.</p>
<p>Mais vous pourriez avoir envie de regarder quelques photos ou des articles pour faire la présentation.</p>
<p>Ou écrire un ou deux paragraphes avant le prochain repas.</p>
<p>Ou faire 1km de marche.</p>
<p>Ce sont juste des petites étapes qui font partie d’un plus grand voyage.</p>
<p>Nous sous-estimons souvent la puissance des petits accomplissements, mais ils sont essentiels parce
qu’ils nous aident à déveloper la bonne habitude.</p>
<p>Si vous commencez à courir quelques mètres chaque jour, vous vous habituerez et aurez naturellement
envie d’augmenter la distance. Et éventuellement, vous arriverez à courir un marathon complet.</p>
<p>Les petits accomplissements, même s’ils peuvent sembler petits pour le moment, sont ce qui permet
d’arriver un jour à atteindre l’objectif.</p>
<p>Si vous avez une tâche intimidante, commencez par y consacrer 5 ou 15 minutes. Tout le monde peut
survivre à ça.</p>
<h3 id="le-premier-essai-peut-être-bâclé---pas-dattentes-élevées">Le premier essai peut être bâclé - pas d’attentes élevées</h3>
<p>Vous pouvez avoir de grandes attentes pour le travail final.</p>
<p>Vous voulez écrire un excellent livre, pas juste un bon. Ou créer une excellente pièce artistique, ou commencer une affaire très florissante.</p>
<p>Toutes ces attentes peuvent vous mettre plus de pression que vous ne pouvez supporter. Plus de pression
conduit toujours à plus de procrastination.</p>
<p>Au lieu de ça, vous pouvez commencer de manière délibérée à faire quelque chose de pas bien.</p>
<p>Commencez à écrire un chapitre à la main, sans éditer quoi que ce soit - vous savez que ce ne sera pas
publié.</p>
<p>Commencez à réaliser votre affiche avec un marqueur au lieu du programme d’infographie le plus
sophistiqué.</p>
<p>Créez un prototype d’un produit que vous n’enverrez jamais à personne.</p>
<p>Quand vous savez que vous n’avez pas à faire le meilleur truc possible dès le début, c’est plus facile
de commencer ensuite c’est d’autant plus facile de continuer.</p>
<h2 id="en-résumé">En résumé</h2>
<p>Si vous combinez toutes ces astuces, travailler deviendra plus facile. vous pourriez même commencer à
apprécier ça.</p>
<ol>
<li>Si vous voulez trouver le travail plus intéressant, arrêtez avec les distractions trop plaisantes,
essayez de vous ennuyer plus souvent, et donnez vous le temps de développer de l’intérêt.</li>
<li>Si possible, cherchez à rendre votre travail utile. Vous n’avez pas besoin de sauver le monde, pensez
juste à quelques raisons personnelles pour faire ce que vous devez faire.</li>
<li>Définissez exactement comment vous allez commencer. Quelle est la prochaine action à faire ?</li>
</ol>
<p>Mettez cela en pratique dès maintenant.</p>Ceci est une traduction de l’article How to be productive without forcing yourself donc (il y’a certainement) des choses qui ont été perdues lors de la traduction.Display Driver on RedHat-based Linux distributions (tested on Asus MB169B+)2021-05-01T00:00:00+00:002021-05-01T00:00:00+00:00https://rmpr.github.io/display-link<p>I got myself a Asus MB169B+ to use with my Thinkpad X1 Yoga, and what leads me to write this is because when
you try to install the displaylink driver you are instantly redirected to Ubuntu’s, even very active members
in the community <a href="https://www.winglemeyer.org/ramblings/2018/11/19/displaylink.html">suggest you to do so</a>.
Well, let me tell you something: you don’t need to, <a href="https://github.com/displaylink-rpm/displaylink-rpm">display-rpm</a> is what you have been
looking for. And the thing is actually up to date: I am currently running with the 5.11.16 kernel on
Fedora 33. Granted <a href="https://fedoramagazine.org/announcing-fedora-34/">Fedora 34 is already out</a> but
it still got you covered, you can build it yourself. with everything that bleeding-edginess implies.
The only downside is that it only works on Xorg for now.
One more reason to <a href="../Frankentile/">stay away from Sway for now</a>.</p>I got myself a Asus MB169B+ to use with my Thinkpad X1 Yoga, and what leads me to write this is because when you try to install the displaylink driver you are instantly redirected to Ubuntu’s, even very active members in the community suggest you to do so. Well, let me tell you something: you don’t need to, display-rpm is what you have been looking for. And the thing is actually up to date: I am currently running with the 5.11.16 kernel on Fedora 33. Granted Fedora 34 is already out but it still got you covered, you can build it yourself. with everything that bleeding-edginess implies. The only downside is that it only works on Xorg for now. One more reason to stay away from Sway for now.Frankentile (KDE + i3)2021-04-22T00:00:00+00:002021-04-22T00:00:00+00:00https://rmpr.github.io/Frankentile<p>I used i3 for 2 years (2017-2019), then Sway to get a taste of Wayland
for almost the same amount of time. Although I was quite satisfied with my
setup, I discovered something even better for me: <code class="language-plaintext highlighter-rouge">KDE + i3</code>. Or more exactly
<code class="language-plaintext highlighter-rouge">KDE - KWin + i3</code>.</p>
<p>For some reasons, I had to go back to Xorg in order to get screen sharing working
with Teams (thanks M$).
I must admit, after 4 years away from DEs, Gnome became even less usable
for me on Xorg (on Wayland it seems fine though). I don’t know why the
Gnome Shell kept crashing. That lead me to use KDE (which I was kind of already
using in a virtual machine to test atbswp) and I must say, it’s been a great experience
(although it feels sluggish compared to a WM).
I especially like the start menu. It’s like Windows’ but without all the
bullshit. By the way, somebody tells Microsoft that nobody wants neither candy crush
auto-installing, nor royal Revolt - what is that even -, nor ads all over the place,
nor Cortana, etc. I don’t know why, but I missed the tiling, and it’s not like
I knew tiling all along. I discovered it 4 years ago and fell in love,
or maybe I am just becoming old and I don’t want things to change anymore.</p>
<p>Enters i3. I discovered that it’s not only possible to integrate i3 with KDE, but
it’s also done with a minimal effort: just write a two lines script and create a
symlink in the startup folder of Plasma. The good news is, I don’t even have to
give up on Sway, I launch it on a different VT (Ctrl+Alt+F3 usually) and I can
switch environments with minimal or no hassle at all. This time I got to read
the whole i3 documentation, there are some hidden gems in there
like making a window sticky (how did I even manage to live without that feature?).
My config file is <a href="https://github.com/rmpr/dotfiles">here</a>. And if you are
interested in the guides I used, <a href="https://userbase.kde.org/Tutorials/Using_Other_Window_Managers_with_Plasma#Introduction">here</a>
<a href="https://github.com/heckelson/i3-and-kde-plasma">you</a> <a href="https://laptrinhx.com/i3-plasma-using-the-i3-window-manager-on-the-top-of-kde-plasma-and-other-dotfiles-configurations-scripts-workarounds-and-practises-from-my-debian-machines-236106475/#desktop">go</a>.
I feel like I should mention this <a href="https://cravencode.com/post/essentials/enable-tap-to-click-in-i3wm/">non-hacky awesome guide</a>
to make the mouse gestures work. While going through all this, I stumbled upon
<a href="https://github.com/esjeon/krohnkite">krohnkite</a>. It seemed interesting but I never
got to actually test it. I guess it might be useful to DWM users.</p>I used i3 for 2 years (2017-2019), then Sway to get a taste of Wayland for almost the same amount of time. Although I was quite satisfied with my setup, I discovered something even better for me: KDE + i3. Or more exactly KDE - KWin + i3.Approche guerilla au Google Summer of Code2021-04-09T00:00:00+00:002021-04-09T00:00:00+00:00https://rmpr.github.io/Guerilla-Gsoc<p>Note préliminaire, si tu n’as aucune idée de ce qu’est le GSoC je te renvoie vers l’excellente
<a href="https://fr.wikipedia.org/wiki/Google_Summer_of_Code">page Wikipedia</a> à ce sujet.
J’ai été contacté par un étudiant de mon ancienne école à propos de cette opportunité, somme toute assez
unique à laquelle j’ai participé il y’a quelques années déjà. J’aurais pu répondre directement, mais ce
serait hautement spécifique et je n’aurais pas vraiment eu le temps de rassembler toutes mes pensées à ce
sujet. Et étant donné qu’il n y’a pas beaucoup de documentation relative à ça en français, il m’a semblé qu’une
pièce de ce style serait assez utile. Il s’agit plus un mélimélo de choses que je pense plutôt que
quelque chose de vraiment structuré, un ensemble d’heuristiques pour permettre de
réduire drastiquement le nombre d’organisation/projets que tu auras à considérer pour ton choix (parce
que le choix t’appartient après tout).</p>
<h2 id="avant-de-commencer">Avant de commencer</h2>
<p>Il existe déjà de nombreux guides (en anglais pour la plupart sorry) qui parlent de comment aborder le
GSoC, ce qu’il faut faire, etc. Celui-ci est plus axé sur une approche guerilla où il faut faire les choses
bien et surtout faire les choses vite. Avant tout, si tu ne l’as pas déjà fait : installe une
distribution Linux… ne pose pas de questions fais le
juste. J’insiste, fais-le avant de continuer à lire cet article. Tu me remercieras plus tard. Je te conseillerais
Fedora juste comme ça, mais te sens pas obligé :p. Plus sérieusement, tu peux consulter
<a href="https://distrochooser.de/fr/">distrochooser</a> pour t’aider et l’excellent cours d’openclassrooms
<a href="https://openclassrooms.com/fr/courses/43538-reprenez-le-controle-a-laide-de-linux">reprendre le contrôle à l’aide de Linux</a>.</p>
<h2 id="choisir-une-organisation">Choisir une organisation</h2>
<p>Il faut noter le singulier: “une” organisation. L’erreur qui est facile à commettre c’est de se dire que
soumettre le maximum de proposals augmente la probabilité d’être sélectionné. Ce n’est pas nécessairement
vrai, et qui plus est, étant déjà en retard donc il faut être concentré. Quelques critères pour t’aider à te
décider plus vite:</p>
<h3 id="technologie">Technologie</h3>
<p>Je mets cet aspect en premier parce que même étant enthousiaste à l’idée de travailler pour une
organisation, à la fin, la seule chose qui compte c’est être capable de pouvoir faire le travail
demandé. Le GSoC est certes une occasion d’apprentissage, mais on arrose pas une terre stérile, donc
mon conseil ici c’est de chercher des organisations qui manipulent des technologies avec lesquelles tu
as déjà une certaine expérience. Et pour être tout à fait précis, puisqu’il s’agit d’une situation de
crise, je dirais même qu’il faut choisir le langage avec lequel tu es le plus à l’aise et éliminer de
manière inconditionnelle
toutes les entreprises qui ne l’ont pas dans leur liste. Cet outil pourrait être utile dans cette
perspective: <a href="https://github.com/rohithasrk/GSoC-Organisation-Scraper">Gsoc Organisation Scraper</a></p>
<h3 id="moyen-de-communication">Moyen de communication</h3>
<p>Chaque organisation pour se coordonner a besoin d’un medium de communication, mon conseil ici est simple. Il faut
privilégier les compagnies qui ont les moyens de communication les moins accessibles, ou alors qui
requièrent un certain effort de configuration, IRC me vient directement à l’esprit. Non seulement il
y’aura forcément moins de populace, mais plus le medium est ancien plus l’entreprise est susceptible
d’être bien établie dans le monde de l’OSS ce qui m’amène au point suivant.</p>
<h3 id="nombre-de-slots">Nombre de slots</h3>
<p>Chaque organisation a un nombre maximal de participants qui lui est accordé par Google. Généralement cela
dépend de sa taille (et donc de son statut dans l’écosystème). Les plus anciens sont susceptibles d’avoir
le plus grand nombre de slots quoique pas toujours.</p>
<h3 id="concurrence">Concurrence</h3>
<p>Toujours regarder le nombre de participants déjà actifs dans l’organisation qu’on veut choisir. Moins il y’en
a, mieux c’est, évidemment. Mais attention, il faut regarder aux projets individuels parce que certaines
organisations ont une grande variété de projets, certains faciles (où beaucoup de gens vont s’agglutiner),
d’autres un peu moins évidents. Dans ce cas bien précis s’investir dans un projet certes plus difficile mais
avec peu ou pas d’affluence a un meilleur retour sur investissement.</p>
<h2 id="choisir-un-projet">Choisir un projet</h2>
<p>Une fois que le nombre d’organisations a été drastiquement réduit il est temps de passer au filtrage par
projet.</p>
<h3 id="quel-projet-pour-la-proposal">Quel projet pour la proposal?</h3>
<p>Il est possible de soumettre son propre projet sur lequel on va travailler durant le GSoC, encore faudrait-il
qu’il soit accepté. Mon conseil ici c’est, autant que possible, essaie de prendre un projet déjà existant. La
plupart des entreprises ont des wikis où ils ont une liste de projets qu’ils proposent. Déjà ça évite d’avoir
à débattre sur la pertinence du projet pour l’organisation, ensuite de débattre sur qui va te
mentorer (chaque projet a généralement un ou plusieurs mentors déjà arrêtés), et la formulation de ce
problème bien défini va t’aider dans la rédaction de ta proposal (sur laquelle tu dois travailler aussitôt
que tu as sélectionné un projet).</p>
<h3 id="the-lower-the-better">The lower the better</h3>
<p>Plus le projet est difficile et fait appel à des compétences rares ou des technologies pas sexy, moins il y’a
de personnes, et plus il y’a de chances d’être sélectionné. Par exemple l’IA c’est sexy, la programmation
système… un peu moins. Dans le même sens, tout ce qui a Javascript est très susceptible d’être déjà
surchargé, alors que C ou même Haskell… un peu moins. D’un autre côté il peut arriver que pour des projets nécessitant des skills non triviaux
il y’ait déjà quelqu’un travaillant dessus. Dans ce cas, il faut auditer. S’il est déjà avancé et fait
du bon travail, il faut laisser tomber et passer à autre chose. Sinon, dans l’éventualité où tu peux avoir
un meilleur rendement que lui, vas-y. Fun fact, sur smbcmp nous étions quelques 5 personnes, donc la
concurrence à un moment est peut-être inévitable.</p>
<h2 id="prise-finale">Prise finale</h2>
<p>Voilà j’espère que ce sera utile, si d’autres choses me reviennent je ferais des addendum donc il faudra
consulter l’article de temps en temps. En ce qui concerne mon expérience, je l’ai plus ou moins relatée
<a href="https://rmpr.xyz/gsoc_2019/">ici</a> et les liens vers ma proposal et le code sont
<a href="https://summerofcode.withgoogle.com/archive/2019/organizations/4908878360215552/">ici</a>. Il faut se rappeler
que ne pas être pris ce n’est pas la fin du monde, il faudra juste en tirer des leçons, et il existe d’autres
programmes de ce type auquel il est possible de postuler <a href="https://github.com/deepanshu1422/List-Of-Open-Source-Internships-Programs">Open Source Internships</a></p>
<p>Ressources supplémentaires:</p>
<ul>
<li><a href="https://cyprientankeu.com/2019/03/18/google-summer-of-code-2019-les-6-conseils-disaac-kamga-pour-etre-selectionne/">Les 6 conseils d’Isaac Kamga pour être sélectionné au GSoC</a></li>
</ul>Note préliminaire, si tu n’as aucune idée de ce qu’est le GSoC je te renvoie vers l’excellente page Wikipedia à ce sujet. J’ai été contacté par un étudiant de mon ancienne école à propos de cette opportunité, somme toute assez unique à laquelle j’ai participé il y’a quelques années déjà. J’aurais pu répondre directement, mais ce serait hautement spécifique et je n’aurais pas vraiment eu le temps de rassembler toutes mes pensées à ce sujet. Et étant donné qu’il n y’a pas beaucoup de documentation relative à ça en français, il m’a semblé qu’une pièce de ce style serait assez utile. Il s’agit plus un mélimélo de choses que je pense plutôt que quelque chose de vraiment structuré, un ensemble d’heuristiques pour permettre de réduire drastiquement le nombre d’organisation/projets que tu auras à considérer pour ton choix (parce que le choix t’appartient après tout).Synchronous Async2021-04-07T00:00:00+00:002021-04-07T00:00:00+00:00https://rmpr.github.io/Sync-async<p>This piece might need to dive a bit in the source code of <a href="https://git.sr.ht/~rmpr/atbswp">atbswp</a>.
I was working on atbswp trying to solve a problem I spotted since the beginning of the project: How to
stop the infinite playback. It doesn’t seem like it, but it was very challenging for me.
I even asked it <a href="https://stackoverflow.com/questions/60296543/how-to-update-the-state-of-a-toggle-button-after-process-completion">on stackoverflow</a></p>
<h2 id="the-problem">The problem</h2>
<p>Usually threading (and multiprocessing for that matter) are used for concurrent
execution. That is, you leave the right to the interpreter/OS to execute
the tasks in whatever order it find suitable, as long as everything executes
concurrently. For my use case, I had to keep track of the execution of a thread in the background to launch another
one (or not) just after it finishes executing. My problem was thus to try to bend the library
to my will for a thing it wasn’t really designed to do in the first place.</p>
<h2 id="how-did-it-work-all-this-time">How did it work all this time?</h2>
<p>Since I couldn’t really keep track of what was happening, I decided to join the
threads upon completion. That is, wait for the infinite playback to complete
before giving back the control to the main event loop. On Linux, for some reason
everything worked fine, but on Windows… the program will just become unresponsive
until the user finally kills it or the infinite playback finishes. Which in
retrospective was the right thing to do from the OS. As any guy working for free
on a project alone, the solution was simple: ditch Windows support like I did with
macOS just before that. That’s when I realized most of the users (reporting issues)
are on Windows. That wasn’t really feasible then.</p>
<h2 id="the-solution">The solution</h2>
<h3 id="realisation-why-are-you-trying-to-solve-the-same-problem-3-different-ways">Realisation: Why are you trying to solve the same problem 3 different ways?</h3>
<p>I came to the conclusion (in my sleep mind you) that the infinite playback,
the finite playback and the single playback were just 3 instances of the same
problem (before everything was implemented kinda independently). And just like the
linked list implementation Torvalds always presents as good taste in code,
I was able to produce something I found very clever. Yeah I know about the Kernighan’s
law, but I know I will never have to debug this code.</p>
<h3 id="first-thing-first-split-the-exec">First thing first split the exec</h3>
<p>This is probably what unlocked everything. How to interact with the script
in exec? Turns out since the macro is (hopefully) always linear, I can just
execute the thing line by line instead of as a big string and it works!</p>
<h3 id="second-notify-the-main-event-loop-that-the-work-is-over">Second notify the main event loop that the work is over</h3>
<p>For this part, I simply used the built-in mechanism of wx: events. When a thread
finishes executing, it manually fires an event which will then be caught by the
event loop which is in charge of everything, keeping track of a counter holding
the number of executions left to satisfy the current settings it can then decide
to launch another thread (if the counter is non-zero) or not.</p>
<h3 id="finally-extend-the-base-thread-class-to-add-a-completion-flag">Finally extend the base Thread class to add a completion flag</h3>
<p>The only kinda reliable way to interrupt a thread is to return from inside, I just
added a flag that the thread will check periodically (before executing the
current line of the capture) and return if it’s set.</p>
<h2 id="final-thoughts">Final thoughts</h2>
<p>In retrospective, it seems that I rolled out my own mini-scheduler (kind of) and
experimenting with async code was challenging because the debugger wasn’t as
useful as usual. That made me rethink about the whole fearless concurrency
thing of Rust. That might be a thing.</p>This piece might need to dive a bit in the source code of atbswp. I was working on atbswp trying to solve a problem I spotted since the beginning of the project: How to stop the infinite playback. It doesn’t seem like it, but it was very challenging for me. I even asked it on stackoverflow