Posts

Showing posts with the label Mac

How to set up Ubuntu in Apple Macos m1/m2

Ubuntu SSH Server for The Stupid Apple Macos M1 System https://github.com/yingshaoxo/ubuntu_ssh_server_for_the_stupid_apple_macos_m1_system Build  Edit ssh_root_password environment variable in docker-compose.yaml file first. docker-compose.yaml: version: "3.9" services: 2_ssh_ubuntu: platform: linux/amd64 image: yingshaoxo/ubuntu_ssh_server_for_the_stupid_apple_macos_m1_system:v1 ports: - "2222:22" environment: - ssh_root_password=yingshaoxo volumes: - "~/ubuntu_docker:/root" restart: unless-stopped Run docker-compose up -d ssh root@ 127.0 . 0.1 -p 2222 The default password is yingshaoxo ​

How to lock and unlock a folder/file in MacOS from terminal (so that general program can't modify it

Launch Terminal.  sudo chflags uchg [file path] Press Enter. Unlock: chflags nouchg [file path] ​

A simple way to check if you got the Root Permission in your MacOS or not

Run: cp /bin/zsh /bin/zsh_backup cp /bin/bash /bin/zsh /bin/zsh --version If you see: cp: /bin/zsh_backup: Operation not permitted , then you don’t have the root permission at all. I would suggest you return that Mac Machine, because it doesn’t belong to you, you don’t have full control over it. Some of you may think you could go to the recovery terminal to do a remount to change the file system, but as far as I know, you can’t. Here is the command line, try it yourself: mount -uw '/Volumes/Macintosh HD' cd '/Volumes/Macintosh HD' cp ./bin/zsh ./bin/zsh_backup cp ./bin/bash ./bin/zsh I think I won’t buy apple products anymore. (except airpods pro, the version that have noise cancel function ​

How to hide all windows at once in MacOS

  Just click: ⌥  +  ⌘ +  H  +  M

Mac Tips 2021.12

Today, for somehow, I have re-catched two tips for MAC for efficiency: 1. full screen a window, then create a new window. in this way you got a horizontal split double window 2. ctrl+t to call shell everywhere, ctrl+w to close it, ctrl+d to split the shell into two panels Usage for this setting: 1. one screen: UI graph + real-time webview/phone hotreload view 2. one screen: VS code + browser (I'm such a genius

How to let the VSCode(Or any Mac IDE) to help you do the comment/uncomment job

control + /  https://yingshaoxo.blogspot.com/2019/06/repeat-boring-work-with-vim.html ​

One key to be polite on MacOS

on run {input, parameters} set _clipboard to get the clipboard set the clipboard to "谢谢 (thanks)" tell application "System Events" to keystroke "v" using command down delay 0.2 set the clipboard to _clipboard delay 0.1 tell application "System Events" to keystroke return using command down return input end run https://superuser.com/a/543660   ​

Essential Mac Terminal shortcuts

Command + T: create a new tab Shift + Command + { or }: switch between tabs Command + W: close a tab  https://support.apple.com/guide/terminal/keyboard-shortcuts-trmlshtcts/mac ​

How to run MacOS within VirtualBox under Linux

https://www.wikigain.com/install-macos-catalina-on-virtualbox-on-windows/ VBoxManage modifyvm "macOS" --cpuidset 00000001 000106 e5 00100800 0098 e3fd bfebfbff VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac19,1" VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-AA95B1DDAB278B95" VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 VBoxManage setextradata "macOS" VBoxInternal/CPUM/IsaExts/AVX 0 VBoxManage setextradata "macOS" VBoxInternal/CPUM/IsaExt...