What are Makefiles and Why should anyone use them?

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....

July 19, 2024 · 5 min · 907 words · Amir

Setting Up Caddy for Reverse Proxy is dead simple

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....

July 3, 2024 · 3 min · 533 words · Amir

How to Install GPU Driver on Ubuntu

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....

March 2, 2024 · 6 min · 1105 words · Amir

A Great Combination of Jupyter + Conda + Docker

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....

December 8, 2023 · 3 min · 588 words · Amir

Useful Linux Commands and Scripts

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....

December 5, 2023 · 4 min · 739 words · Amir

Guide for using remote server (linux) for a data scientist!

Well, you have got a server (most probably linux) which you want to run your tasks on it. How should you do that and What technologies you should adopt? Windows Users This tutorial is written with bash (or zsh) in mind. So, If you are a mac or linux user, your default shell would be enough and you can go ahead with the rest of tutorial. However, Windows users need to follow this tutorial to install WSL and then Ubuntu to get a good bash....

May 20, 2022 · 6 min · 1243 words · Amir