<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.2">Jekyll</generator><link href="https://pcblues.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://pcblues.com/" rel="alternate" type="text/html" /><updated>2026-06-12T23:25:05+10:00</updated><id>https://pcblues.com/feed.xml</id><title type="html">pcblues.com</title><subtitle>pcblues.com contains the works and ideas of Mark Daniel Osborne
</subtitle><author><name>Mark Daniel Osborne</name></author><entry><title type="html">Which Photos are Actually Documents?</title><link href="https://pcblues.com/linux/photos/2026/05/05/identifying-document-photos.html" rel="alternate" type="text/html" title="Which Photos are Actually Documents?" /><published>2026-05-05T00:00:00+10:00</published><updated>2026-05-05T00:00:00+10:00</updated><id>https://pcblues.com/linux/photos/2026/05/05/identifying-document-photos</id><content type="html" xml:base="https://pcblues.com/linux/photos/2026/05/05/identifying-document-photos.html"><![CDATA[<p>I had the removable hard disk from an old friend.<br />
<br />
I wanted to pass the photos and videos on to someone else.<br />
<br />
Unfortunately, it was also full of documents and private information.<br />
<br />
It’s easy to get rid of the documents that can be identified by filename extension.<br />
<br />
But what about photos of documents?<br />
<br />
I could manually look at each of them, but there are more than 100,000 images!<br />
<br />
<br />
This is how I did it. Note I am using the zsh shell.</p>

<!--more-->
<p><br />
<br />
When I approach this kind of problem, I imagine script wizards who write a single long line of ridiculous bash, run it, and the job is done.<br />
<br />
I am not that person. I am, however, someone who can break a job down into single steps, test them on small batches, then kick off long-running jobs while I work on the next script down the chain.<br />
<br />
That is an efficient, effective, accurate and testable approach to the problem. It might not yield the fastest runtime, but I was happy to spend a day or two writing the scripts and a day or two to run them in parallel.<br />
<br />
That was still going to be a LOT faster than manually checking the photos!<br />
<br />
I can also identify problems more easily if only one requirement is addressed at a time.<br />
<br />
<br /></p>
<h3 id="1-establish-reversability">1. Establish Reversability</h3>
<p>The most important thing with any project is be able to reverse any action.<br />
<br />
Everyone has learnt this the hard way. Often more than once.<br />
<br />
I made a copy of the entire archive and put it to one side.<br />
<br />
<br /></p>
<h3 id="2-identify-non-media-files-and-delete-them">2. Identify Non-media Files And Delete Them</h3>
<p>I identified the media files (movies and images) by extension that I wanted to keep (after expanding any zip files).<br />
<br />
Then I removed the rest. Find is very powerful and can do a lot (efficiently) in a single command.<br />
<br /></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
# find non-media files
find . -not -name "*.jpg" -not -name "*.JPG" -not -name "*.HEIC"  
-not -name "*.json" -not -name "*.mp3" -not -name "*.mpg" -not -name "*.MOV"  
-not -name "*.GIF" -not -name "*.PNG" -not -name "*.bmp" -not -name "*.wma"  
-not -name "*.jpeg" -not -name "*.AVI" -not -name "*.jpg" -not -name "*.m4a"  
-not -name "*.wmv" -not -name "*.gif" -not -name "*.png" -not -name "*.TIF"  
-not -name "*.MP3" -not -name "*.mov" -not -name "*.MPG" -not -name "*.avi"  
-not -name "*.3gp" -not -name "*.BMP" -not -name "*.WMV" -not -name "*.mp4"  
-not -name "*.mpeg" -not -name "*.wav" -not -name "*.ogg" -not -name "*.m4v"  
-not -name "*.dxf" -not -name "*.svg" -not -name "*.eps" -not -name "*.ai"  
-type f &gt; out.txt

# find non-media files and copy
find . -not -name "*.jpg" -not -name "*.JPG" -not -name "*.HEIC"  
-not -name "*.json" -not -name "*.mp3" -not -name "*.mpg" -not -name "*.MOV"  
-not -name "*.GIF" -not -name "*.PNG" -not -name "*.bmp" -not -name "*.wma"  
-not -name "*.jpeg" -not -name "*.AVI" -not -name "*.jpg" -not -name "*.m4a"  
-not -name "*.wmv" -not -name "*.gif" -not -name "*.png" -not -name "*.TIF"  
-not -name "*.MP3" -not -name "*.mov" -not -name "*.MPG" -not -name "*.avi"  
-not -name "*.3gp" -not -name "*.BMP" -not -name "*.WMV" -not -name "*.mp4"  
-not -name "*.mpeg" -not -name "*.wav" -not -name "*.ogg" -not -name "*.m4v"  
-not -name "*.dxf" -not -name "*.svg" -not -name "*.eps" -not -name "*.ai"  
-type f -exec cp --parents {} /NonMediaFiles \;

# delete non-media files
find . -not -name "*.jpg" -not -name "*.JPG" -not -name "*.HEIC"  
-not -name "*.json" -not -name "*.mp3" -not -name "*.mpg" -not -name "*.MOV"  
-not -name "*.GIF" -not -name "*.PNG" -not -name "*.bmp" -not -name "*.wma"  
-not -name "*.jpeg" -not -name "*.AVI" -not -name "*.jpg" -not -name "*.m4a"  
-not -name "*.wmv" -not -name "*.gif" -not -name "*.png" -not -name "*.TIF"  
-not -name "*.MP3" -not -name "*.mov" -not -name "*.MPG" -not -name "*.avi"  
-not -name "*.3gp" -not -name "*.BMP" -not -name "*.WMV" -not -name "*.mp4"  
-not -name "*.mpeg" -not -name "*.wav" -not -name "*.ogg" -not -name "*.m4v"  
-not -name "*.dxf" -not -name "*.svg" -not -name "*.eps" -not -name "*.ai"  
-type f -exec rm {}  \;      

</code></pre></div></div>

<p><br />
<br />
After this process, I removed any directories that were left empty.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
# find empty directories 
find . -empty -type d &gt; emptydirs.txt

# delete empty directories 
find . -empty -type d -delete 
</code></pre></div></div>

<p>Next we need OCR. I installed Tesseract OCR, <a href="https://tesseractocr.org/">https://tesseractocr.org/</a>.<br />
<br />
Depending on your linux installation, you may or may not need to also choose a language pack from about fifty.<br />
<br />
I picked the one that ended with -en for English.<br />
<br />
<br /></p>
<h3 id="3-identify-the-dimensions-of-the-job">3. Identify the Dimensions of the Job</h3>
<p>We can run tesseract like this.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># tesseract usage
tesseract inputfile outputfilename
</code></pre></div></div>
<p>This creates outputfilename by default as <inputfile>.txt  
<br />
I only want to OCR image files so I identified them with this script.</inputfile></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#!/bin/bash
#scango.sh
# get images, not movies, etc
find . -type f -exec sh -c '
  for file do
    if file --mime-type -b "$file" | grep -q "image/"; then
      echo "$file"
    fi
  done
' sh {} + &gt; $1

</code></pre></div></div>

<p>I ran the script from the top directory of the archive and got a count of the number of files I have to run OCR on (about 110,000).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/scripts/scango.sh allfiles.lst
wc -l allfiles.lst

</code></pre></div></div>

<p>I created a little script to run against each image file in a list.<br />
In testing, I discovered double-quotes were needed around $arg to handle filenames with spaces in them.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#!/bin/bash
#tessgo.sh
while read arg; do
  tesseract "$arg" "$arg"
done
</code></pre></div></div>

<p>Then I created a few tests to estimate the length of time of the OCR process.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># testing one file with imagefiles1.txt
~/scripts/tessgo.sh &lt; imagefiles1.lst

# testing a few files with imagefiles.txt
~/scripts/tessgo.sh &lt; imagefiles.lst
</code></pre></div></div>

<p>tessgo.sh seemed to process about three files per second.<br />
So this process would take about 10 hours.<br />
Still better than manually checking the files.<br />
<br /></p>
<h3 id="4-kick-off-the-ocr-job">4. Kick off the OCR job</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># start main job while continuing to work on other scripts
# expect finish about 10pm
~/scripts/tessgo.sh &lt; allfiles.lst
</code></pre></div></div>
<p>This job produces a txt file for every image file throughout the directory structure.<br />
<br /></p>
<h3 id="5-processing-the-output">5. Processing the Output</h3>
<p>The OCR was amazing. It identified a photo as containing words even if they were just a few words on a toy box in the background of the image.<br />
<br />
While I waited for the OCR to finish, I wrote and tested little scripts to inspect the output txt files, and remove any images that were potential documents.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#!/bin/bash
# countwords.sh
while read arg; do
  wc -l "$arg"
done


#!/bin/bash
# wcountfilter.sh
minwords="$1"
#echo $minwords
while read arg; do
  wcarr=($(wc "$arg")) 
  words=${wcarr[1]}
  if [ $words -ge $minwords ]; then
    echo $arg
  fi
done


#!/bin/bash
# renamefiles.sh
#echo $minwords
while read arg; do
  fname=$arg
  imgfname=${fname:0:-4}
  echo $imgfname
done


#!/bin/bash
# delimgfiles.sh
while read arg; do
  rm "$arg"
done

# check word count in each file
~/scripts/countwords.sh &lt; textfiles.lst

# test parameter + input file
~/scripts/wcountfilter.sh 15 &lt; textfiles.lst

# if more than 15-25, write file to deltextfiles.lst 
~/scripts/wcountfilter.sh 25 &lt; textfiles.lst &gt; deltextfiles.lst

# write list of files with .txt removed
~/scripts/renamefiles.sh &lt; deltextfiles.lst &gt; delimgfiles.lst

# delete image files after spot checking
~/scripts/delimgfiles.sh &lt; delimgfiles.lst

# remove all text files 
find . -name "*.txt" -delete
</code></pre></div></div>
<p>With over 100,000 photos I could afford to lose a few rather than let an important document slip through. I set my threshold word count appropriately after testing.  <br />
<br />
<br />
And there it is. A sanitized directory tree with over 100,000 image files, plus many thousand more home video files.</p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="linux" /><category term="photos" /><summary type="html"><![CDATA[I had the removable hard disk from an old friend. I wanted to pass the photos and videos on to someone else. Unfortunately, it was also full of documents and private information. It’s easy to get rid of the documents that can be identified by filename extension. But what about photos of documents? I could manually look at each of them, but there are more than 100,000 images! This is how I did it. Note I am using the zsh shell.]]></summary></entry><entry><title type="html">CYOA (Choose Your Own Adventure) Patterns</title><link href="https://pcblues.com/gaming/2025/01/13/cyoa-patterns.html" rel="alternate" type="text/html" title="CYOA (Choose Your Own Adventure) Patterns" /><published>2025-01-13T00:00:00+10:00</published><updated>2025-01-13T00:00:00+10:00</updated><id>https://pcblues.com/gaming/2025/01/13/cyoa-patterns</id><content type="html" xml:base="https://pcblues.com/gaming/2025/01/13/cyoa-patterns.html"><![CDATA[<p>One of my go-to daily sites for news of computing is <a href="https://news.ycombinator.com/news">Hacker News</a>. This article discusses the various story structures of interactive fiction.</p>

<!--more-->
<p>I find it interesting when the structures of interactive fiction can be reduced to a number of repeating patterns. These are likely to be structures that writers are able to adhere to, and players are likely to be able to make sense of.</p>

<p>As a workmate once said to me, “The difference between real life and fiction is that fiction has to make sense.”</p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="gaming" /><summary type="html"><![CDATA[One of my go-to daily sites for news of computing is Hacker News. This article discusses the various story structures of interactive fiction. I find it interesting when the structures of interactive fiction can be reduced to a number of repeating patterns. These are likely to be structures that writers are able to adhere to, and players are likely to be able to make sense of. As a workmate once said to me, “The difference between real life and fiction is that fiction has to make sense.”]]></summary></entry><entry><title type="html">Free Backup for Linux</title><link href="https://pcblues.com/linux/2023/09/19/kopia-for-backup.html" rel="alternate" type="text/html" title="Free Backup for Linux" /><published>2023-09-19T00:00:00+10:00</published><updated>2023-09-19T00:00:00+10:00</updated><id>https://pcblues.com/linux/2023/09/19/kopia-for-backup</id><content type="html" xml:base="https://pcblues.com/linux/2023/09/19/kopia-for-backup.html"><![CDATA[<p>I have been looking for a decent backup for the odd VPS (Virtual Private Server) linux system I have been building over the last twenty or so years.<br />
<!--more--></p>

<p>This is just a bookmark for myself. I’ll report back if it ever actually SAVES me.</p>

<p>Until then, it is no better than any other backup system ;)</p>

<p><a href="https://kopia.io/">Kopia</a></p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="linux" /><summary type="html"><![CDATA[I have been looking for a decent backup for the odd VPS (Virtual Private Server) linux system I have been building over the last twenty or so years.]]></summary></entry><entry><title type="html">Short Fiction - Carolling</title><link href="https://pcblues.com/shortfiction/2018/10/01/short-fiction-carolling.html" rel="alternate" type="text/html" title="Short Fiction - Carolling" /><published>2018-10-01T00:00:00+10:00</published><updated>2018-10-01T00:00:00+10:00</updated><id>https://pcblues.com/shortfiction/2018/10/01/short-fiction-carolling</id><content type="html" xml:base="https://pcblues.com/shortfiction/2018/10/01/short-fiction-carolling.html"><![CDATA[<p>Heinrick Jones stretched half-waking, suddenly eyes wide in confusion and panic. The first time in his new abode. The panic of waking up in a sealed coffin. Scream rising from the depths then dissolving with realisation and relief. Deep breath and a long sigh.</p>

<!--more-->

<p>“Away in a manger, no crib for a bed,” he sang to no one. The sofa was too short. “But at least I am not weightless.”</p>

<p>He opened his eyes and sat up, no harness needed. The Agency had decided that putting centrifugal spin on their craft was cheaper than developing technologies to contain the effects of zero-gravity nausea. It contained the vomiting. Less food and liquid was required per person per day. Less waste disposal and clever air filter design was demanded. It also contained a blackmailing media. No more bribes were necessary to hide the sordid unromantic details of space travel from a fickle public.</p>

<p>“Well, that wouldn’t be a cost now, anyway,” Heinrick chuckled to himself.</p>

<p>The space program was a delicate balancing act of public opinion and government support. Sensing this, the press made away with a sizeable slice of taxpayers’ involuntary contributions to the space program. That was until Heinrick Jones suggested to the Agency that they should focus on developing technology that reduced the overall cost of space travel.</p>

<p>Impossibly, he had also improved the other side of the Agency’s accounting ledger. The Agency was making sales. Television companies climbed over each other to host pay-per-view television events of space flights. And the public was paying in droves. The space program was liquid.</p>

<p>“The cattle are lowing, the baby awakes” he hummed as he moved to his teak desk and sat in a comfortable leather chair. Irony heaped upon irony. Public opinion insisted the interior of spacecraft looked as much as possible like a room in a normal house on Earth. The Viewers wanted something familiar. Not like the cells of missions past. There were no windows, though. The spinning stars would drive anyone mad. But that was a small price to pay for spinning the whole ship. A faux window frame was attached to one wall surrounding a lovely photographed poster of the stars - taken from Earth.</p>

<p>A clock on the desk read one hour and counted down. Time for his shot at fame. Time for his shot of the latest drug developed by the Agency. Opening the top desk drawer, he withdrew a syringe and injected himself with courage.</p>

<p>“But little Lord Jesus, no crying he makes.”</p>

<p>Eventually the viewers would tire of this schtick and demand new entertainment. But for now, serious space research was being funded. A rushing sound in his ears like the sound of a long wave breaking along a shore was accompanied by a relaxing numbness in his mind and well-being in his body. He sat and waited.</p>

<p>A red light came on above the desk. The show began. Millions tensed.</p>

<p>Heinrick stood up and walked to the fake window. He placed his hands on it and could hear a sizzling sound as smoke rose from around his fingers and palms. He unpeeled his hands, looked at them, and smiled. Turning around, he held his hands up to the camera. Oozing blisters waved across space to his captive audience. Walking to the other side of the room, he pressed his face to the wall and waited for a satisfying popping sound and half-blindness. It did not take long. Facing the camera again, he danced a little. He sat on the sofa and kicked off his shoes. He stood and walked over to the desk, each step leaving a burning, smoking mark of flesh stuck to the frying pan floor. He slouched on the chair, and passed out.</p>

<p>Soon after, his skin began to blister and melt. The window poster ignited. His hair burst into flame. The desk caught fire. Flames ate the room. The walls melted, and the last brief camera shot was of a huge sun.</p>

<p>“And take us to heaven, to live with Thee there.”</p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="shortfiction" /><summary type="html"><![CDATA[Heinrick Jones stretched half-waking, suddenly eyes wide in confusion and panic. The first time in his new abode. The panic of waking up in a sealed coffin. Scream rising from the depths then dissolving with realisation and relief. Deep breath and a long sigh.]]></summary></entry><entry><title type="html">Efficiently uploading your website from a mac</title><link href="https://pcblues.com/macos/jekyll/scp/expect/2017/08/23/efficient-uploading-Copy.html" rel="alternate" type="text/html" title="Efficiently uploading your website from a mac" /><published>2017-08-23T00:00:00+10:00</published><updated>2017-08-23T00:00:00+10:00</updated><id>https://pcblues.com/macos/jekyll/scp/expect/2017/08/23/efficient-uploading%20-%20Copy</id><content type="html" xml:base="https://pcblues.com/macos/jekyll/scp/expect/2017/08/23/efficient-uploading-Copy.html"><![CDATA[<p>Jekyll is a cool way to quickly produce web content. You can view your site locally running this command from the root of your jekyll site:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>jekyll serve
</code></pre></div></div>

<!--more-->

<p>It also automatically updates when files change.</p>

<p>Now I needed an efficient way to upload the website to my host.</p>

<p>Difficulty: no rsync or ssh keys.</p>

<p>My new hosting service didn’t provide rsync or the ability to use SSH keys to upload changes to my website without entering a password every time.</p>

<p>I wanted to keep things fairly secure so no password could be stored in a file (it could be made public in a git repository), passed as a parameter to a script (it could be seen in a call to ps), or shown on the screen (it could be seen by another person).</p>

<p>I created two scripts. One calls Jekyll to compile the website and get just the files I need into a directory structure. The other is an expect script that manages the upload using scp.</p>

<script src="https://gist.github.com/pcblues/fddcd82810803d3ac337875d8f16f38a.js"></script>

<p>Here is a line by line break-down of what the scripts do:</p>

<p>3. I use Oh-my-zsh which provides some nice out-of-the-box colouring and macros.<br />
4. This method doesn’t delete files you don’t want anymore. You have to delete these manually at present.<br />
5. Jekyll compiles your site.<br />
6. Remove the staging directory that we will use to upload with scp.<br />
7. Create the staging directory fresh.<br />
8. Recursively copy the generated Jekyll site.  <br />
9. Delete all the files that are older than 2 weeks.<br />
10. Call the Expect script to do the upload.</p>

<p>13. This is a script in the Expect language.<br />
14. Hide the user output so that our password is not visible.<br />
15. Calls a command that displays the password as saved previously in  Keychain Access under the name xxxxx.<br />
16. Matches anything that is returned that has at least one character.<br />
17. Set the returned password to a variable whose name doesn’t sound like “password”.  <br />
18. Run SCP to connect to my website and copy the changed files. Note that you have to run a shell that can expand your * wildcard in the copy command. Expect can’t do it on its own.
19. Wait for the prompt to enter the password.<br />
20. Send the password to the prompt.<br />
21. Turn on user output.<br />
22. Makes the output of the SCP command visible.</p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="macos" /><category term="jekyll" /><category term="scp" /><category term="expect" /><summary type="html"><![CDATA[Jekyll is a cool way to quickly produce web content. You can view your site locally running this command from the root of your jekyll site: jekyll serve]]></summary></entry><entry><title type="html">Script to list your package managers</title><link href="https://pcblues.com/package/manager/pm/macos/2017/07/19/what-package-manager.html" rel="alternate" type="text/html" title="Script to list your package managers" /><published>2017-07-19T00:00:00+10:00</published><updated>2017-07-19T00:00:00+10:00</updated><id>https://pcblues.com/package/manager/pm/macos/2017/07/19/what-package-manager</id><content type="html" xml:base="https://pcblues.com/package/manager/pm/macos/2017/07/19/what-package-manager.html"><![CDATA[<p>Created a script to list the package managers installed on my mac.</p>

<!--more-->

<p>Feel free to add to the checks.</p>

<p><a href="https://github.com/pcblues/scripts/blob/master/listpms">listpms</a></p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="package" /><category term="manager" /><category term="pm" /><category term="macos" /><summary type="html"><![CDATA[Created a script to list the package managers installed on my mac.]]></summary></entry><entry><title type="html">In 2017, learn *every* language</title><link href="https://pcblues.com/programming/2017/01/23/learn-every-language.html" rel="alternate" type="text/html" title="In 2017, learn *every* language" /><published>2017-01-23T21:56:58+10:00</published><updated>2017-01-23T21:56:58+10:00</updated><id>https://pcblues.com/programming/2017/01/23/learn-every-language</id><content type="html" xml:base="https://pcblues.com/programming/2017/01/23/learn-every-language.html"><![CDATA[<p>I’m finding myself on the path to doing this. Might take 20 years though :)</p>

<!--more-->

<p><a href="https://blog.bradfieldcs.com/in-2017-learn-every-language-59b11f68eee#.axqdvhql3">Source: In 2017, learn <em>every</em> language</a></p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="programming" /><summary type="html"><![CDATA[I’m finding myself on the path to doing this. Might take 20 years though :)]]></summary></entry><entry><title type="html">Programming Training</title><link href="https://pcblues.com/programming/2016/09/12/programming-training.html" rel="alternate" type="text/html" title="Programming Training" /><published>2016-09-12T00:00:00+10:00</published><updated>2016-09-12T00:00:00+10:00</updated><id>https://pcblues.com/programming/2016/09/12/programming-training</id><content type="html" xml:base="https://pcblues.com/programming/2016/09/12/programming-training.html"><![CDATA[<p>These are a few websites I have practised programming on:</p>

<p><a href="https://www.codingame.com/home">https://www.codingame.com/home</a><br />
<a href="https://www.codeeval.com/">https://www.codeeval.com/</a><br />
<a href="https://www.hackerrank.com/">https://www.hackerrank.com/</a><br />
<a href="https://www.codewars.com/dashboard">https://www.codewars.com/dashboard</a></p>

<!--more-->

<p>Here are a few more of interest to me:</p>

<p><a href="https://www.reddit.com/r/dailyprogrammer">https://www.reddit.com/r/dailyprogrammer</a><br />
<a href="http://up-for-grabs.net/#/">http://up-for-grabs.net/#/</a> <br />
<a href="https://www.topcoder.com/">https://www.topcoder.com/</a></p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="programming" /><summary type="html"><![CDATA[These are a few websites I have practised programming on:]]></summary></entry><entry><title type="html">Macbook Pro Repeated Boot Kernel Panic Scare</title><link href="https://pcblues.com/computing/2015/04/17/macbook-kernel-panic.html" rel="alternate" type="text/html" title="Macbook Pro Repeated Boot Kernel Panic Scare" /><published>2015-04-17T00:00:00+10:00</published><updated>2015-04-17T00:00:00+10:00</updated><id>https://pcblues.com/computing/2015/04/17/macbook-kernel-panic</id><content type="html" xml:base="https://pcblues.com/computing/2015/04/17/macbook-kernel-panic.html"><![CDATA[<p>I was computing away on the train this morning, when suddenly I couldn’t use Evernote any more because of an invalid security certificate. This was not what it seemed, and sure enough Safari started showing a bunch of blank security certificates. I closed down the computer and restarted. And received a kernel panic about 10 seconds into the boot before it restarted continually.</p>

<p>tl;dr - Problem solved!</p>

<!--more-->

<p>Thankfully that I had backed up on Time Machine the night before, I booted off the backup drive and went into the Disk Utility. I couldn’t repair the SSD because I couldn’t unmount it. The Unmount button didn’t work.  The computer wouldn’t boot into safe mode.</p>

<p>I rebooted from a Recovery DVD (although I could have done it the boot from the Time Machine too)</p>

<p>What unmounted it was selecting the disk in Disk Utility and selecting Info to get the name of the disk - for me it was disk0s2.</p>

<p>Closed Disk Utility and select Utilities » Terminal</p>

<p>cd /
cd dev
umount -fv disk0s2
I could now run Repair Disk and Repair Permissions in Disk Utility.</p>

<p>I had no problems with the Repair Disk (phew!) but there were permissions that were unable to be repaired by Disk Utility and the computer still kernel panicked when I booted.</p>

<p>Rebooted with Time Machine to the Terminal, unmounted the hard disk as above, and tried to restore from Time Machine Backup.</p>

<p>The system failed to see the hard disk.</p>

<p>Erased the partition, and it gave me a formatter error.</p>

<p>Tried to restore again from the Time Machine for the hell of it.</p>

<p>It couldn’t erase the disk.</p>

<p>I took out the SSD, and loaded it in a USB slot with a cable, then booted from the Recovery DVD and erased and reformatted the SSD. Success.</p>

<p>(6 hours later)</p>

<p>It then restored successfully from the Time Machine backup.</p>

<p>Moral of the story? Have recent backups and a Recovery DVD around (but I think the SSD or its cable might be on its way out :)</p>

<p>update: problem recurred. Will try a new Sata cable as suggested in numerous places on the internet.</p>

<p>(several days later)</p>

<p>update: new cable did the trick.</p>

<p>The clue that it wasn’t the SSD drive was that it didn’t have any errors on it when I ran Repair Disk in the Disk Utility. Phew!</p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="computing" /><summary type="html"><![CDATA[I was computing away on the train this morning, when suddenly I couldn’t use Evernote any more because of an invalid security certificate. This was not what it seemed, and sure enough Safari started showing a bunch of blank security certificates. I closed down the computer and restarted. And received a kernel panic about 10 seconds into the boot before it restarted continually.]]></summary></entry><entry><title type="html">Recovering from a Broken WordPress Theme</title><link href="https://pcblues.com/websites/2015/04/14/recovering-from-wordpress-theme.html" rel="alternate" type="text/html" title="Recovering from a Broken WordPress Theme" /><published>2015-04-14T00:00:00+10:00</published><updated>2015-04-14T00:00:00+10:00</updated><id>https://pcblues.com/websites/2015/04/14/recovering-from-wordpress-theme</id><content type="html" xml:base="https://pcblues.com/websites/2015/04/14/recovering-from-wordpress-theme.html"><![CDATA[<p>If you assign your WordPress site to a theme that is broken, it could make every page show white.</p>

<!--more-->
<p>If you have access to the files of your WordPress site, navigate to wp-content/themes/ and either delete or change the name of the directory that contains the theme you selected.</p>

<p>This will revert the WordPress site to the default theme and you will be able to start to work out what happened.</p>]]></content><author><name>Mark Daniel Osborne</name></author><category term="websites" /><summary type="html"><![CDATA[If you assign your WordPress site to a theme that is broken, it could make every page show white.]]></summary></entry></feed>