Sony Arouje

a programmer's log

Posts Tagged ‘macbookpro

Configure MS Sql Server in Mac M1 via docker

leave a comment »

In this post, I will walk you through how to run MS Sql Server on Mac M1. Make sure docker desktop is installed on your machine.

I prefer using a Docker Compose file to run containers because it helps me avoid remembering all the environment variables, ports, and configurations.
To run SQL Server, I’ve created the following Docker Compose file:

version: '3.8'

services:
  sqldata:
    image: mcr.microsoft.com/mssql/server:2022-latest
    environment:
        - SA_PASSWORD=Pass@word
        - ACCEPT_EULA=Y
    container_name: sqlserver-tracer
    ports:
        - "1433:1433"
    volumes:
        - './data:/var/opt/mssql/data'
        - './log:/var/opt/mssql/log'
        - './secrets:/var/opt/mssql/secrets'

Now, run the following command to start the SQL Server container:

docker-compose up

The container will exit with following error code

This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
/opt/mssql/bin/sqlservr: Invalid mapping of address 0x400976b000 in reserved address space below 0x400000000000. Possible causes:
1) the process (itself, or via a wrapper) starts-up its own running environment sets the stack size limit to unlimited via syscall setrlimit(2);
2) the process (itself, or via a wrapper) adjusts its own execution domain and flag the system its legacy personality via syscall personality(2);
3) sysadmin deliberately sets the system to run on legacy VA layout mode by adjusting a sysctl knob vm.legacy_va_layout.

To fix the above error, follow these steps in Docker settings:

General -> check Use Virtualization framework
Features in development -> Use Rosetta for x86/amd64 emulation on Apple Silicon

Now, run the Docker Compose command again, and this time SQL Server should be up and running.

DB Management tool

Download Azure Data Studio

Create a new connection, keeping in mind that the server parameter should be set to something like localhost,1433, where 1433 is the port mentioned in the Docker Compose file.

  • User Name: sa
  • Password: specify the password configured in docker compose environment variable SA_PASSWORD
  • Leave the database as default.

Note: This tutorial assumes that you have Docker Desktop installed on your Mac. If you haven’t already, you can download it here. Additionally, make sure you have a basic understanding of Docker and its concepts, as we’ll be using Docker Compose to manage our SQL Server container.

Written by Sony Arouje

September 21, 2023 at 4:56 pm

Posted in Misc, Programming

Tagged with , ,

Switching from Windows to MacBook

leave a comment »

I was an avid user of Windows for over 20+ years. My windows machine is old and may give up on me any time soon, so I started looking for a powerful machine for my development needs. I almost fixed on a dell laptop but I also started looking at MacBook as well. At the end decided to shift to Mac after seeing the reviews about the performance of M1 chip. Another reason is, I can run Visual studio in mac and thats one of the important requirement for me, VS 2022 is still a preview release for mac but it will stable soon. I am using iPhone for so many years and I know the basics of how apple’s system works.

Ordered a MacBook Pro M1 Max with 64gb, as its a custom made waited for almost a month and the seller told me that the delivery will take more time than they expected, they offered me a 32gb version instead. I did some research to see any performance impact if I downgrade to 32gb. Come across some youtube videos where people are stress testing both 32 and 64gb version and I could see not much difference between both configuration. So decided to go ahead with 32gb.

Getting started with mac

Initially it was difficult. I didn’t had any clue how to access the windows explorer equivalent in mac. Next hurdle was with the keyboard shortcuts. I started googling to understand the mac os and the shortcuts, at the end, got a fair idea of how the system works.

Got to know about finder, launchpad, spotlight etc works, these are some of the basics applications of mac os I experimented first. Next learning was how to access applications that are running. I had to learn more about using trackpad, those three finger and two finger gestures. I was so amazed how the trackpad works, its very convenient and so very responsive. I never experienced such a trackpad in any windows based laptops.

Setting up the system

I am able to setup my development system without much of a hurdle, I mostly use VS Code, Visual studio, docker, nodejs, golang etc. I didn’t had any trouble setting up any of the application I use on a daily basis.

Performance of the system

There are so many benchmarks available in internet and I am not going repeat it but MacBook pro is blazingly fast. I haven’t experienced any kind of performance delay even when the memory utilisation has reached close to 28gb. Its one of the fastest laptop I ever used so far. System startup is quick just like a smart phone. Battery life is very impressive, I haven’t tested the full duration but I could easily work for 6-7 hrs without plugging. I have been using this mac for couple of days and never heard the sound of the cooling fan.

The retina display is one of the best, its so crisp and clear. I can read even if I am a little away from the display.

Conclusion

I thoroughly enjoy the experience of using MacBook. Its build quality is superior. Initially started with my logitech wireless mouse but soon realised, its easy to use built in trackpad than mouse. I don’t know yet how to quickly access running programs and other options trackpad provides via mouse, switched off the mouse and started using trackpad. So far I am really satisfied with my MacBook.

I would like to say, I love the keyboard short cuts in windows than mac. For e.g. press End or Home button to move to the end of line or go back to the start of line and other shortcuts. Hope by practice I will be more comfortable with Mac keyboard.

I have been using Mac for less than a week, I will update this blog post once I use Mac for some more time.

Written by Sony Arouje

June 15, 2022 at 1:52 pm

Posted in .NET

Tagged with , ,