IT notes

mojave Iso

Create 12 GB tmp disk: hdiutil create -o /tmp/Mojave.cdr -size 12000m -layout SPUD -fs HFS+J Attach the disk: hdiutil attach /tmp/Mojave.cdr.dmg -noverify -mountpoint /Volumes/install_build Extract the installer: sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build Create the iso mv /tmp/Mojave.cdr.dmg ~/Desktop/InstallSystem.dmg hdiutil detach /Volumes/Install\ macOS\ Mojave hdiutil convert ~/Desktop/InstallSystem.dmg -format UDTO -o ~/Desktop/Mojave.iso Rename Mojave.iso.cdr to Mojave.iso

Block SSH on MacOS

To block incoming ssh connections, edit the /etc/pf.conf and add the following line at the bottom: block in log quick proto tcp from any to any port 22 You can use vim or use something like this: sudo sh -c "echo 'block in log quick proto tcp from any to any port 22' >> /etc/pf.conf" Then reload the pfrules: sudo pfctl -Fa -f /etc/pf.conf For this to work the firewall must be enabled.

macOs sparseimage

To create an install disk using an spare disk: $ hdiutil create -size 6GB -fs JHFS+ -volname "macOS_installmedia" -type SPARSE ~/Desktop/macOS_installmedia Mount it (or double-click in Finder to mount): $ hdiutil mount ~/Desktop/macOS_installmedia.sparseimage Use the createinstallmedia: $ sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS_installmedia --applicationpath /Applications/Install\ macOS\ High\ Sierra.app

MTU 1453

If after upgrading macOS to 10.13.4 wifi stop working give a try to change the MTU:

Delete Guest

To delete macOS Guest user: sudo dscl . -delete /Users/Guest This will avoid showing the Guest user on the login screen

ansible ImportError: No module named boto3

When using ansible 2.4.0.0 (macOS) to fix this problem update your library: pip install --upgrade --user boto3 notice the –user it will update, your local $HOME/Library/Python/2.7/lib/python/site-packages By using --upgrade it will recreate the site-packages. Or create PYTHONPATH system variable: export PYTHONPATH=/usr/local/lib/python2.7/site-packages paramiko In case you get this error: Unicode-objects must be encoded before hashing", "unreachable": true Try: pip install --upgrade --user paramiko==2.0.6 To upgrade,reinstall ansible just in case:

brew update formula

Example: brew bump-formula-pr --strict --url=https://github.com/immortal/immortal/archive/0.18.0.tar.gz immortal To keep in sync forked repo: git fetch upstream git co upstream/master git push -f origin master