# MacOS

# Aliases on shell

Since .bashrc is not working, i managed to do some tricks

Edit /etc/profile and add the following lines.......

# Dealing with ISO Files with hdiutil

**Creating an iso file from a directory**

```shell
hdiutil makehybrid -iso -joliet -o output_image.iso input_directory/
```

**Mounting an iso file into /Volumes/**

```shell
hdiutil mount source_image.iso
```

# Writing image to SD card

#### **These are the steps to write an raspberry pi OS image to an SD card on MacOS**

**1. Insert card on reader**

**Identify the disk number**

```shell
diskutil list
```

**2. Unmount the disk**

```shell
unmountDisk /dev/disk2
```

**3. Write the image**

```shell
sudo dd bs=1m if=hassos_rpi3-2.12.img of=/dev/rdisk2 conv=sync
```

**4. Eject card**

```shell
sudo diskutil eject /dev/rdisk2
```

**Done!**

[https://www.raspberrypi.org/documentation/installation/installing-images/mac.md](https://www.raspberrypi.org/documentation/installation/installing-images/mac.md)

# DNS Cache clear

<span class="crayon-v">dscacheutil</span> <span class="crayon-o">-</span><span class="crayon-v">flushcache</span>

<span class="crayon-v"><span class="crayon-e">sudo </span>killall <span class="crayon-o">-</span><span class="crayon-e">HUP </span>mDNSResponder</span>

[https://www.siteground.com/kb/how\_to\_clear\_the\_local\_dns\_cache\_in\_mac\_os/](https://www.siteground.com/kb/how_to_clear_the_local_dns_cache_in_mac_os/)