Articles

Registering WinRAR on a Linux machine in 2020

Image
The recent LGR video prompted me to write about my experience on how I got an official WinRAR installation to run on Ubuntu. Back in August, I decided to treat myself to something nice to celebrate my thirtieth birthday. After a session of deep introspection, I concluded that it was time to purchase a WinRAR licence. Registering WinRAR was supposedly considered to be a rite of passage in ancient cultures, the turning point where boys became men. I felt that I had finally reached a level of maturity that would permit me to embark in this life changing journey. The process itself was relatively straightforward. I went over to the official website and placed an order, and they sent me an invoice and a link from which to download the licence key, itself compressed in a RAR archive. I couldn't help but marvel at the website, it aged like fine wine. It is reminiscent of an earlier internet, and I look back fondly to a time where websites used to be much simpler. You'll notic

Cloning an infrared remote controller

Image
Context : One of my earliest paychecks went into a cheap 22" TV. It's not fancy at all, but it was a nice upgrade from the old Sony Trinitron TV that was starting to show its age. The new TV has a brand name of "Vision", which is less glamorous than "Sony", but it has been working well so far, so I can't really complain. Just the other day, I found out that it is possible to get it to record something while it's on standby. It's a feature I never knew I needed until I discovered it. A couple of months after I got it, I ran into a problem with the remote controller. Luckily it turned out to be caused by a dead battery. Even though it was trivial to fix, this minor incident planted the seed of fear in me. Since the TV doesn't have physical buttons, I concluded that it would become useless should the remote stop working for some reason or another. Because of this, I decided to make a backup of the remote in case something happens to it. To d

Porting a Golang and Rust CLI tool to D

Image
A few days ago, in the programming subreddit, Paulo Henrique Cuchi shared his experience writing a command line tool in both Rust and Go . The tool in question is a client for his side project, Hashtrack. Hashtrack exposes a GraphQL API with which the clients can track certain twitter hashtags and get a real time list of relevant tweets. Prompted by this comment , I decided to write a D port to demonstrate how D can be used to achieve a similar goal. I'll try to keep the same structure as the one he used in his blog post. Source code on Github How did I end up using D? The main reason is that the original blog post compared statically typed languages like Go and Rust, and made honorable mentions to Nim and Crystal, but didn't mention D. D falls under this category, so I think this will make for an interesting comparison I also like D as a language and I have mentioned it in various other blog posts. Local environment The manual has a lengthy page on how to downlo

My experience with Win by Inwi

Image
In my previous post, I mentioned how I was using a data plan that amounts to 10 DH per gigabyte. Being a relatively light streamer, I can usually get by with 10 gigabytes per month. These days however, I often find myself abusing my data plan for calls and screen sharing and whatnot. This month for example, I spent 250 DH on internet alone. With a monthly spending like that, I realized that I might as well get ADSL or a cheap optical fiber subscription. So why didn't I ? Well, for one, I don't want to get tied down by a monthly subscription. Secondly, I don't want something that requires a heavy installation with all the fees and the time that it implies. And finally, I want to have the option of carrying it with me wherever I want. When I was searching for alternatives, a friend of mine suggested Win by Inwi . I looked into it and it seemed to satisfy my needs of portability and ease of use. In short, you can customize your plan as you wish , handle the paperwork onlin

Life during the COVID-19 lockdown

Image
Given the state that the world is in right now, many companies, mine included , offered their employees the option of working from home. I decided to jump on the "working from home" bandwagon and write an entry describing how I personally managed it. Hardware A few days before the state of emergency took effect, I bought an HP monitor, a Logitech keyboard and the cheapest mouse I could find. With this, I set up an impromptu workstation for the days to come. I chose this monitor because it supports both HDMI and Display Port. I use the former with my work issued laptop and the latter with my own Thinkpad. The choice of keyboard was driven by the lack of an alternative. Most of the keyboards I was shown looked like cheap knockoffs of popular brands. As for the mouse, I picked the cheapest one because I'm not a heavy mouse user, and I figured any mouse would do the trick. I regretted this decision when I found out that the mouse sometimes releases mid-click, which resul

Decoding JWTs in the terminal

Image
These past few days, I have been working on integrating IBM App ID into our Java backend and Android frontend codebases. Because of this, I would find myself going back and forth between the terminal and JWT.io whenever I need to inspect a JWT's payload. I don't want to call it a "JWT token" because that would be a bad case of RAS and I'm pedantic like that, but I digress. Instead of relying on a website to do that for me, I figured why not just do it from the terminal. I did some reading and it turns out that JWTs are relatively easy to parse : Split the token using the dot character as a delimiter Base 64 decode the first portion to get the header Base 64 decode the second portion to get the payload The third portion serves as a signing mechanism for the token. I chose to ignore the signing logic for the script I intended to write because it was irrelevant for my use case. I ended up writing a command line tool in D to help me inspect JWTs. The ma

Quickly sharing files over wifi

Image
I sometimes find myself needing to transfer a file to someone at the office. It's a common scenario. To solve this problem, a few options present themselves. The easiest one, in my opinion, is to just serve the file in question through HTTP from my own machine on the local network. I then send the link to whoever needs it. If you think about it, you will realize that it has many advantages : It's easy to setup Everyone these days has an HTTP client on their computer Files can be protected from prying eyes thanks to HTTP authorization You can resume downloads You can serve entire directories It has, however, a few downsides : The file is no longer available if the server is turned off The client has to be on the same network It's probably not the most secure solution out there To use this method, I usually resort to python's built in HTTP server. It's only a matter of navigating to the directory you want to serve and running the python3 -m http.serv