Amir Pourmand
You can click here to visit my Farsi Blog.
When I was in high school, I remember that I had to memorize all trigonometry formulas. I didn’t have a single way to resort to when I was locked. Fortunately, As I will show here, most trigonometry formulas can be derived via simple algebraic modifications of Euler's Formula. This way, any time we are locked and can’t remember what the formula was, we can simply derive it. I have used some LLM to generate proofs. So, this is the only post ever I’ve used LLMs. But I had to tell. ...
I’ve been using docker for years. And there are multiple commands which have been very useful to me. To me, Docker is one of the most innovative creations of all the time. I see it as basically the best way to release software. The upside is that once you set a Dockerfile and built a package, you don’t have to worry about whether the system dependencies are installed correctly or not. ...
Makefiles are one of the most useful tools I’ve been working with. I can say that it can be useful for lots of projects (with any language). What is Makefile? Makefiles are essentially a place where you can store your most frequently used commands in one place. They make repetitive tasks easier by creating short commands. Let’s take a look at sample file: install_packages: pip install -r requirements.txt generate_deps: pip-compile requirements.in -o requirements.txt docs: pdoc --html --force --output-dir docs common The way to execute this targets would be using make generate_deps or make docs. By default make command will search for a file named Makefile (with no extension) to run your commands. ...
I’ve recently found Caddy as a tool to assign urls to my docker services and I’m quite happy with it. I’ve done other reverse proxies like Nginx and Traefik in the past but they are too complicated for my needs. Let’s start. Let’s say that you want to assign your url like newservice.amirpourmand.ir to a service in a VM with a public IP address. I’ll go you through it. Also, It has multiple benefits. The first one is that you don’t have to do IPs. You don’t have to deal with ugly IPs that may change in the future. You deal with Secure URLs. The second is that the connection is https. ...
Recently, I wanted to have an easy way to send azure Application Insights notifications into Slack. Actually I am writing this tutorial two month after setting up this workflow and I hope I don’t forget anything. This method has been working pretty good in the last couple of months. Note that this is mostly free and I am just using Azure Services (App Logic and Applications Insights) and Slack Incoming Webhook app (which is free). ...
Some days ago, I wanted to record a Google Meet session as a podcast and I didn’t want to pay for just recording the call, neither to google nor third party services. Update 2024-11-02 Previously, I used the browser method to record the screen since I heard my voice twice in the recording. This way, the issue is fixed. But, There are other solutions! The better solution would be to just record the screen normally. These would be the sources. One would capture your audio, and the other would capture your screen and their audio. ...
Here are some most important chrome extensions I use almost on a daily basis. All of them can be installed on chromium browsers. But, they may not be available on Firefox or other browsers. Bitwarden Bitwarden is the first thing I install on every browser. It saves all my passwords on all my devices. I rather not depend on Google to save my passwords since It limits my options to just use same-old Chrome. ...
There are lots of tutorials on the internet on how to install a GPU driver on Linux. However, I end up searching again every time I want to install a GPU drivers and I get frustrated when there are multiple ways of doing the same thing and I don’t know which one is the best. Also, there are some things I’ve learned which I’d like to share it. I’ve tested this on 3090 GPU and Ubuntu 22.04. Yours may vary a little but the procedure it the same. ...
I’ve always wanted a clean local environment to install python packages in it. To me, it should have multiple requirements: 1- Installing packages should be easy enough. I mean I just want to use pip install that and not worry about anything else. 2- Switching between python environments should be easy. If I happen to need multiple environments in my system, I want to be able to easily switch between them. Preferably, even without command line. ...
I’ve been working for some time with Linux and I feel that sharing some scripts and also tools I frequently use can be helpful. Search History history | grep seach_string or Ctrl+R. Search Log files In order to search a folder to see if a string exists in the whole folder: grep -ir "string to search" . Show File and Folder Size To analyze file size, there are several ways. ls -alh -rw-r--r-- 1 amir amir 270K May 20 2023 Arial.ttf -rw-r--r-- 1 root root 72 Sep 20 21:10 Untitled5.ipynb -rw-r--r-- 1 amir amir 1.2M May 26 2023 exp12.mp4 -rw-r--r-- 1 amir amir 4.7M May 26 2023 exp13.mp4 -rw-r--r-- 1 amir amir 654M May 22 2023 exp4.avi -rw-r--r-- 1 amir amir 68 Dec 28 2022 kaggle.json drwxr-xr-x 17 amir amir 4.0K Dec 28 2022 miniconda3 drwxr-xr-x 2 amir amir 4.0K May 26 2023 mp4 You can see from the above output that this only shows file sizes properly. ...