Posts

Converting media formats on the command line

1. Install Homebrew 2. Install ImageMagic and FFMpeg:      brew install ImageMagick      brew install ffmpeg 3.  Where  $i  is the original name and  $nn  is the new name: Animated gif to mp4: ffmpeg -i $i -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $nn.mp4 WAV to mp3: In case you have to deal with windows 3.11 users. Just kidding, any windows users. ffmpeg -i $i -vn -ar 44100 -ac 2 -b:a 192k $nn.mp3 Any video to mp4: This is useful if you get MOV files from your phone as they are 3x bigger than mp4: ffmpeg -i $i $-vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 $nn.mp4 PNG to jpg: This is useful if you get lots of screenshots on your phone as the screenshots are 10x bigger than jpg:     convert $i $nn.jpg

Mark an app as secure to run on Mac on command line

 sudo xattr -r -d com.apple.quarantine /Applications/Theapp.app 

How to format/partition a disk from the command line

 diskutil partitionDisk /dev/disk3 GPT jhfs+ foo 10g jhfs+ bar 10g

Boot MacOS under VirtualBox

  Introduction The following steps are needed to boot Mac OS under VirtualBox. I tested it using Mac OS X 10.13. I can't guarantee this works. You'll need a source/original mac to copy the OS install. Probably Apple won't approve of this because they want you to buy their original hardware, but sometimes you need hosted VMs in the cloud or similar, and they don't really offer that. You can see this page for more:  https://johnsmactips.blogspot.com/2021/02/managing-virtualbox-on-command-line.html Steps Commands below are typed in a command line like the Terminal. 1. On a Mac, do this to download an installer disk: softwareupdate --fetch-full-installer --full-installer-version  ... OR download from the app store. If the operating system you want to install is out of date, ie if the Mac tells you the installer is damaged, set your Mac date and time to however many years ago that operating system came out, and turn of automatic date and time in the date and time system pref

Getting 10.11 to work on older macs

I had an older mac and needed to have a Mac OS X 10.11 installed on it, it would not run anything newer. For the purposes of this explanation I am assuming you have access to a slightly newer Mac as well, e.g. 2-5 years newer than the target machine. Step 1.   get the installer DMG.   Open it when it is finished downloading. Step 2 . Install on your own  internal hard drive (run the installer and choose your own machine as the target). This creates the installer application in / Applications (even if your OS is newer). This part is not obvious, and surprisingly it doesn't tell you that your machine is too new. Step 3 . Get Etcher from  https://etcher.io Step 4 . Attach an external hard drive. Make sure it's empty and formatted HFS+ (use Disk Utility  which is in the Utilities folder in your Applications folder ) . You click on the hardware drive shown on the left panel, NOT the partition. Important: tell it to use a GUID partition scheme  (popup menu in the centre of the

iPhone jiggling camera / unstable camera

Image
On some (older) models of iPhone I have noticed that sometimes the camera goes haywire and jiggles. Apparently this is a result of the gyroscope going haywire. This then affects things like StarWalk and anything else that needs the gyro. The fix is relatively simple: glue a tiny strong magnet to the case where the gyro is. Experiment with a magnet to see where the gyro is. On an iPhone 6 it is the top right corner.

Making an iPhone record video WHILE playing music

I've found it annoying that I can't record video AND play music as a backing track on my iphone. The default behaviour is to halt music as soon as you hit the video recording button. This is how you get past it. 1. Go into the camera, choose PHOTO 2. Go to Music, play the music 3. Go back to the camera and hold down the white photo-taking button... and drag it towards the circular arrows on the right. Release. 4. You are now recording a video with music in the background.