Posts

Apple Power Supply fraying

Image
It's well-known that all apple power supplies and cables for the last 10 or more years fray and break after a few years of folding. This post shows you a simple way to fix them rather than buy a new power supply. 1. Trim off the excess plastic around the frayed cable 2. Join the frayed wires again with either new wire or tin foil 3. Take a straw; cut off a piece about 5cm, and cut it lengthwise. 4. Fill it with silicone sealant. 5. Open it and clip it around the frayed section. 6. Let it set before using it, e.g. for a day.

script to copy a folder structure and omit files

 The following script will copy a directory structure from a source to a target and omit files, copying only folders (directories) #!/bin/sh if [ -z "$1" ] ; then echo "Please give a source dir" echo "otherwise I will assume that the source is ".`pwd` echo "Synax: cp-dirsonly.sh sourcedir/ targetdir/" sourcedir="./" fi if [ ! -z "$1" ] ; then sourcedir=$1 fi if [ -z "$2" ] ; then echo "Please give give a target dir" exit fi find $sourcedir -type d -links 2 -exec mkdir -p "$2/{}" \;

recoving files from a mac disk and w o n d e r s h a r e is unethical

Image
If you search for cgsecurity.org testdisk, which is a free opensource utility to recover data from a disk, you get SEO'ed to w o n d e r s h a r e 's website. Whilst w o n d e r s h a r e  does make good software, I think this is entirely unethical. Hence I decided to make this blogpost to help others avoid paying them when free software exists and they are being predators trying to hide this fact by SEO'ing free software to their commercial site. Let me explain how unethical this is. It is like if you google for "wikipedia" and it opens encyclopedia britannica as the first thing and offers you a subscription only option to read the contents. So, if you have lost files on a disk, try cgsecurity.org first. https://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/ These instructions work for mac except you type the following into the Terminal brew install testdisk and then sudo photorec /dev/disk6 or whatever the drive number is of the drive. In my cas

Apple Mail does not search

 Apple mail searches using "Envelope Index" database files. These are located in  ~/Library/Mail/V#/MailData where # is some number. 1. Quit mail 2. In the Terminal, just type: find ~/Library/Mail/V?/MailData -name "Envelope Index*" -delete 3. Re-open mail. It should re-index.

Force Mac OS X 10.13 to install

 These days when you download the 10.13 installer ( https://apps.apple.com/us/app/macos-high-sierra/id1246284741?mt=12 ) it complains that the installer is corrupted or broken and won't install. Really what has happened is Apple doesn't sign the installer anymore and so the certificate is invalid. However, certificates are date-sensitive. So, simply unplug your target machine from internet so that it doesn't automatically talk to Apple or reset its date/time, and set the time manually like so. Make sure the installer has quit first. 1. Open Terminal 2. Type:     date -s  0711141518 or any other date in 2018 or earlier.  3. Open the installer again. You should now be able to install 10.13.

Enabling apache

Mac OS X used to have a sharing function which turned apache (webserver) on so you could make websites on your machine. However, they turned that off, for whatever unknown reason. To enable apache now, do the following. First, let's find out your username. Open /Applications/Utilities/Terminal.app It will come up with a terminal screen Type: whoami The machine will answer with your login name. Note what it is. Let's say it's " bob " for now. Now type: sudo vi /etc/apache2/httpd.conf This will start you off editing the apache webserver configuration file ( https://www.youtube.com/watch?v=dFUlAQZB9Ng ). Yes, this is a unix machine. The way you edit it is not by mousing, contrary to what we see in Jurassic Park(tm), but by typing in and editing text files. To search for the necessary lines, type a forward-slash (/) Type what you want to search for, in this case, php . Press enter after typing php as the search. You will find a line like this: #LoadModule php7_modul

Dropbox never finishes spinning

If Dropbox never finishes spinning on your Mac, it means there are some files it can't transfer, or is repeatedly transferring.  Sometimes this is because your network is too slow and your files are too big. Maybe check that first. Generally, if you have files over 1 GB in size that you are trying to back up, you probably want to have over 50 Mbps network speed. If however it is not filesize that is the issue, in order of drasticness, try the following: 1. Rebuild privileges a. Click on the dropbox menu icon b. Click on your personal avatar/icon c. Click on Preferences d. Alt-click on Account e. It will bring up a bunch of buttons one of which is repair privileges. Click it. f. It will ask your admin password. Give it. Depending on how many files you have, this will take a few minutes. I have about 1m files (really) and it takes about 10 minutes. 2. Find and delete linkfiles a. Open a Terminal b. Type: cd ~/Dropbox ; find ./ -type l -delete where "l" is an ELL, not a One.