Skip to content

Instantly share code, notes, and snippets.

View MSayib's full-sized avatar
Big dreamer, Long life learner ⭐️

Sayib MSayib

Big dreamer, Long life learner ⭐️
View GitHub Profile
@MSayib
MSayib / gitssh.md
Last active July 2, 2024 17:30
Setup Git over SSH

Linux:

ssh-keygen -t ed25519 && cat /home/YOUR_USERNAME/.ssh/id_ed25519.pub

MacOS:

ssh-keygen -t ed25519 && cat /Users/YOUR_USERNAME/.ssh/id_ed25519.pub

Copy the value from id_ed25519.pub

@MSayib
MSayib / setunsetdns.md
Created July 2, 2024 17:13
Set DNS or Remove DNS on Mac

SET DNS:

  • GoogleDNS:
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4
  • CloudflareDNS:
sudo networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1
@MSayib
MSayib / phpmyadminmac.md
Last active July 2, 2024 17:17
Install phpMyAdmin di MacOS

Install phpmyadmin: composer create-project phpmyadmin/phpmyadmin

Masuk ke folder: cd phpmyadmin

Run: php -S localhost:8000 -t .

@MSayib
MSayib / codesign.md
Created December 12, 2023 02:43
Apple Signature Signing
sudo codesign --force --deep --sign - /Applications/NewApp.app
sudo codesign --force --sign - /Applications/NewApp.app/Contents/MacOS/NewApp

Im storing this because sometimes when i installed new updates on unverified apps i have to resign the code to allow it on any permission with tccp. This will be updated later with description, and with related cases.

@MSayib
MSayib / GitCommitEmoji.md
Created December 7, 2023 03:10 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@MSayib
MSayib / salin.md
Created October 9, 2023 07:45
Copy/Duplicate data between server through SSH
rsync -Prave "ssh -l YOUR_SSH_USER -p YOUR_SSH_PORT" DIR_SOURCE REMOTE_TARGET_SOURCE
@MSayib
MSayib / quickruniterm2.md
Created October 9, 2023 07:31
Quick Start PHP Dev MacOS

This is a tutorial how to create a command that runs/start any app with arguments with iTerm2 on MacOS In my case, i made a local php development server for quick start for working.

  • Install iTerm2 + Py Runtime Enabled
  • Make alias on your zsh/bash -> alias ss1='php -S localhost:8001 -t public'
  • Create new .py script on iTerm2 Script Folder (/Users/YourUser/Library/Application Support/iTerm2/Scripts) (e.g: Launch Service #1)
  • Create your desired script, in my case looks like below script:
import iterm2
async def main(connection):
@MSayib
MSayib / sip.md
Created October 9, 2023 07:12
Enable/Disable SIP MacOS

Enable/Disable SIP

Disable SIP (System Integrity Protection) berfungsi untuk menonaktifkan security dan membuat kita bisa melakukan banyak hal, terutama untuk memodifikasi file sistem.

Cara :

  1. Shutdown Mac
  2. Masuk ke Recovery (Turn on Mac and Hold Power Button for Apple Silicon Chip)
  3. Masuk ke Utilities
  4. Buka terminal
  5. Masukkan csrutil disable
  6. Reboot
@MSayib
MSayib / modifylockedfile.md
Created October 9, 2023 02:44
Cara ubah locked file di MacOS

Cara atasi file locked seperti file hosts di /etc/hosts atau file lainnya adalah dengan cara copy file tersebut ke tempat lain, kemudian replace dengan file yg tidak locked menggunakan Touch ID atau Password (Admin).

FYI:

file yang ada di /etc/ seluruhnya di mirror ke /private/etc

Jadi yg diubah sebaiknya yg di /private/etc saja agar file sistem aman di /etc

Tags:

  • edit hosts file on macOS
@MSayib
MSayib / flushdns.md
Last active July 2, 2024 17:07
Flush DNS MacOS

Run: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Using Alias:

  • For bash :
    echo "alias flushdns='sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder'" >> ~/.bashrc && source ~/.bashrc

or