Transition from linux to mac, a programmer's perscpective

· ismailefetop's blog


I recently bought a macbook air m2, this is my first time using a mac. So I have to transfer and change my code from my linux machine. I am going to record my journey here for future uses and for people that are going through the same thing as me.


1. Change hostname: #

I like to change my macbook's hostname, for this we can follow apple's guide.  

2. Package Manager(brew): #

I like to use package manager, so I am going install one. The most popular and most reliable one seems to be Homebrew. Let's install it!

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After following the installer and pasting the commands, we are ready! I am now going to install my necessary programs. There are two types of programs in homebrew, GUI and CLI. We can install GUI programs with adding --cask at the end. For example:

brew install firefox --cask

Here are some of the programs I daily use: #

  1. kitty

  2. firefox

  3. qbittorrent

  4. visual studio code

  5. krita

For CLI programs we don't need to add anything. For example:

brew install neovim

After we installed all our favourite programs, let's set up fish!



3. Fish(friendly interactive shell) #

First of all what is fish, fish is an interactive shell like bash or zsh. It is my favourite shell because of it's simple use. You can install fish with brew:

brew install fish

After you install fish you can make it your default shell with this command:

sudo sh -c 'echo /opt/homebrew/bin/fish >> /etc/shells'
chsh -s /opt/homebrew/bin/fish

Now you can configure fish to your liking with web interface.

fish_config

Lastly we need to add the homebrew binary's to our path, we can do this with:

fish_add_path /opt/homebrew/bin

I am going to add couple more path's.

fish_add_path /opt/local/bin
fish_add_path /Users/myusername/.local/bin
fish_add_path /opt/homebrew/sbin
fish_add_path /Users/myusername/Library/Python/3.8/bin/

Now that we configured our shell, we can configure git.



4. Git #

First we need to install git, we can do this with our package manager.

brew install git

After that we need to give it some information, we can do this with:

git config --global user.name "Your Name"
git config --global user.email yourname@example.com



5.Rust #

I am trying to learn rust, when using rust cargo is an essential. Let's install it with the official script.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After our rust install we are going to need to add the binary's to our path, we can do this with:

fish_add_path /Users/ismailefetop/.cargo/env/
fish_add_path /Users/ismailefetop/.cargo/bin/