Last active
August 21, 2020 23:02
-
-
Save hoggren/c7a9ebc2e7d02a8a35ae0adc48261cd6 to your computer and use it in GitHub Desktop.
Revisions
-
hoggren revised this gist
Aug 21, 2020 . 2 changed files with 25 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/bin/bash # Usage: ./bootable_usb4mac.sh /dev/rdiskX isofile.iso # Writing to /dev/rdiskX requires root privilegies, and rdisk is FASTER # https://superuser.com/questions/631592/why-is-dev-rdisk-about-20-times-faster-than-dev-disk-in-mac-os-x/631601 USBDISK=$1 ISOFILE=$2 TMPFILE="tempoutput" if [ "$(whoami)" != "root" ]; then echo "no root, qutting" exit 0 fi echo "Write image $ISOFILE to $USBDISK, type YES to confirm:" read INPUT if [ "$INPUT" != "YES" ]; then echo "quitting" exit 0 fi diskutil unmountDisk $USBDISK hdiutil convert -format UDRW -o $TMPFILE $ISOFILE dd if=$TMPFILE.dmg of=$USBDISK bs=1m rm $TMPFILE.dmg -
hoggren revised this gist
Jul 22, 2020 . No changes.There are no files selected for viewing
-
hoggren revised this gist
Jul 22, 2020 . 2 changed files with 0 additions and 20 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +0,0 @@ -
hoggren revised this gist
Dec 22, 2019 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
hoggren revised this gist
Dec 22, 2019 . 3 changed files with 43 additions and 51 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/bash # Usage: ./bootableusb_for_mac.sh /dev/diskX isofile.iso USBDISK=$1 ISOFILE=$2 TMPFILE="tempoutput" if [ "$(whoami)" != "root" ]; then echo "no root, qutting" exit 0 fi echo "Write image $ISOFILE to $USBDISK, type yes to confirm:" read INPUT if [ "$INPUT" != "yes" ]; then echo "quitting" exit 0 fi diskutil unmountDisk $USBDISK hdiutil convert -format UDRW -o $TMPFILE $ISOFILE dd if=$TMPFILE.dmg of=$USBDISK bs=1m rm $TMPFILE.dmg This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,51 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #!/bin/zsh # Get version number and name of therunning on a MacOS. # # Last update: 2019-12-21 # Author: Patrik Hoggren <[email protected]> # MAJOR=`sw_vers -productVersion | awk -F '[.]' '{print $1}'`; MINOR=`sw_vers -productVersion | awk -F '[.]' '{print $2}'`; # PATCH=`sw_vers -productVersion | awk -F '[.]' '{print $3}'`; typeset -A hash hash[10]="Yosemite" hash[11]="El Capitan" hash[12]="Sierra" hash[13]="High Sierra" hash[14]="Mojave" hash[15]="Catalina" hash[16]="<Time for some maintenance for this script...>" macos_name=${hash[$MINOR]}; -
hoggren created this gist
Jul 25, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ #!/bin/bash # Shell script for bash running on # Get version numbers ond the OS name running on a MacOS. # # Last update: 2019-03-15 # Author: Patrik Hoggren <[email protected]> # MIT License is supplied with this file. # If not, you should find it at: # http://www.github.com/phoggren/get-macos-name if [ "$BASH_ARGV" == "-h" ]; then echo ""; echo " get-macos-name 0.1.0"; echo ""; echo "Usage: [-h]"; echo " -h: Show this message."; echo ""; echo "Outputs the OS version name"; echo ""; exit 1; fi # could be nice to have for some other script :) # MAJOR="sw_vers -productVersion | awk -F '[.]' '{print \$1}'"; MINOR="sw_vers -productVersion | awk -F '[.]' '{print \$2}'"; # PATCH="sw_vers -productVersion | awk -F '[.]' '{print \$3}'"; # ANS1=`eval $MAJOR`; ANS2=`eval $MINOR`; # ANS3=`eval $PATCH`; NICEMAP=( [10] = "Yosemite" [11] = "El Capitan" [12] = "Sierra" [13] = "High Sierra" [14] = "Mojave" [15] = "NextV" [16] = "<Time for some maintenance for this script...>" ); # maps the OS minor version number (10.x.5) with table above MACOS_NAME="${NICEMAP[$ANS2]}"; if [ -n "$MACOS_NAME" ]; then echo $MACOS_NAME; exit 0; fi exit 1;