Thursday, 8 October 2020

iPhone black screen of death

So your iPhone is stuck with a white Apple logo stuck on a black background. You've searched the Internet and somehow ended up here...

I've found that if you try the following you can get it restart again ok:

1) Put the device into restore mode 

2) Hold down the power button till it reboots

3) Once it starts rebooting try clicking the power button and/or home button for a few seconds at a time

4) It either restarts normally, or try again - go back to step 1/2

I know it seems a bit random but it can work if nothing else does. Though it probably indicates there's a hardware problem with your device if this keeps happening even after you do a full restore or two...

Update (Oct22): If you're seeing a black screen on a newer iPhone (e.g. 10+ onwards) with only three buttons (i.e. power, volume up and down) then you can try the hard reset sequence:

1) Tap on volume up

2) Tap on volume down

3) Hold down on the power button until it reboots


Thursday, 1 October 2020

UKC19TRACING - What is it?

If you've been taken here after scanning a UK COVID venue QR code - your device offering to search for "UKC19TRACING" - then to make use of this QR code you'll need to load the UK NHS COVID19 app on your device so you can "check in" to the visited venue where the QR code is displayed. This is the app that is based on the purportedly privacy preserving Apple and Google Exposure Notification system so in theory your 'check-in' is anonymous and probably preferable to writing down your address/phone at said venue.

On an Apple iPhone/iPad when you scan these QR codes from the lock screen camera it will attempt to search for "UKC19TRACING" - which why you may have arrived here. Curiously this doesn't happen when the device is not locked and instead says "No usable Data found". 

If you extract the content from one of these [big!] QR codes (with one of the many QR code scanning apps) it starts with "UKC19TRACING" and is then followed ":1:" and after that the main section is encoded in JSON Web Signature (JWS) [See RFC7515] format. Basically this consists of the following; after the "UKC19TRACING:1:" part there's three sequences of base64 separated by a dot("."), the second of which contains the venue name and postcode, and the other contain the signature and associated details - see here for more details.

If you're interested in creating a QR code for your venue see the the relevant gov.uk site.

Friday, 30 August 2019

cat: -: No such file or directory

A weird error that took me a while to track down. I came across it in the iproute2 configure script which was setting the TMPDIR environment variable before using a cat heredoc statement (e.g. when you include some data in a shell script which demarked using markers - in this case 'EOF'):
TMPDIR=$(mktemp -d config.XXXXXX)
cat >test.c <<EOF
stuff and more stuff
EOF 
The problem is that the TMPDIR variable is used by the cat command. And in this case the TMPDIR is set to the output of mktemp which creates a temporary directory in the current working directory, but this is not usable by the cat command and results in the above error - it seems that cat command will only accept a TMPDIR if it is in /tmp and fails if it is set to another base directory?! According the man page mktemp is supposed to default to using /tmp but it's not working on Linux - It works fine on MacOS. Anyway so one just need to make the following change:
TMPDIR=$(mktemp -d /tmp/config.XXXXXX)

Monday, 26 March 2018

Fix: Text message (SMS) Not Delivered

So your iPhone/Phone is unable send text messages - It shows a red exclamation mark (!) beside the message and says Not Delivered - you've tried to send an SMS (Green coloured message boxes) to a few people over a few days and it's still not working. You've tried Settings->General->Reset->Reset Networking Settings Settings->General->Reset->Reset All Settings, restarting your iPhone, pulling the SIM in/out and read Apple's help page  - all to no avail.

Then the problem may be down to an issue with the Short Message Service Centre (SMSC) setting on your phone - which is used when sending SMS messages. It can be checked/modified from the normal Phone app - type in the the following codes into the keypad and hitting the call button to see what the current SMSC setting is:
*#5005*7672#
You should then see a grey box fill the screen with a message:

Setting Interrogation Succeeded
Service Centre Address

Immediately below this text you'll see the number that your phone is using as your SMSC. You can search the Internet for your operator's SMSC and if it doesn't match the one you see above then you can set it to the correct one using the following general code - you'll need replace in the SMSCNUMBER with your operator's SMSC (to the get the plus(+) symbol you need to hold your finger down on the zero key):
**5005*7672*SMSCNUMBER#

 e.g.: For Talk Talk UK:
**5005*7672*+447785011324#
 e.g.: For Vodafone UK:
**5005*7672*+447785016005#
e.g.: For O2 Prepay UK:
**5005*7672*+447802092035#

After you hit the call button it will bring up another grey box saying:

Setting succeeded
Service Centre Address
No Address

This means it's done and SMS/texting should work now - Try it and see!  (If not then revisit my suggestions in the first paragraph).

For other phones (e.g. Android) the above should work, but you can also apparently bring up a special Phone information screen where you can check and modify your SMSC by typing this code on the Phone keypad:
*#*#4636#*#*

The SMSC is usually stored in the SIM card on your phone - for SIM card reader folk (see my other article on SIM readers): it's at EF SMSP (short message service parameters), the full path to the file is 7F10 / 6F42 or using AT commands: AT+CSCA?

As to why the SMSC might have changed - feel free to comment on that!

Monday, 3 July 2017

Websites (e.g. TfL) not working in Firefox

Have you been trying use websites, like Transport for London (TfL) journey planner, in Firefox recently (or for a while) and found that they seem broken - e.g. TfL only shows the bus route?! Well you're not the only one. Since Firefox version 42 Mozilla has enabled Tracking Protection which is generally a very good thing (as there's way too many trackers out there keeping tabs on where/when/what you're up to). Sadly some sites aren't designed to cope with that so they fail to work properly - like TfL and others.

Fortunately it's easy to fix once you know how: When Firefox blocks tracking elements it helpfully puts an additional 'shield' icon in the URL bar to indicate the fact. If you click on the shield icon it shows a button to 'Disable protection for this site' - which disables tracker blocking for that site - you'll then see a line drawn through the shield to indicate this.

One other thing is that if you also use other blocker plugins/extensions in Firefox (e.g. uBlock, Ghostery, AdBlockPlus) you may also need exempt the site in those too.

Thursday, 10 November 2016

Delete pending Calander invites - without notifying sender

So we all get these calendar (iCal) invites which the MacOS/OSX Calendar app then notifies us about in its badge icon and on the '+' button in the app. But what if you don't want to accept or reply to these invites - annoyingly enough there is no way to just delete them without sending some form of notification.

So how to go about getting rid of them? Well there's actually a way to do it - You create a new Calender (File->New Calendar->iCloud) and just leave the default 'untitled' name, then you find those pesky invites and right click on them and assign them to this new 'untitled' calendar. Then you right click on the untitled calendar and select delete - it then finally asks you if you want to delete without notifications! Gone. Done.

Tuesday, 7 June 2016

Regenerate missing modules.dep.bin

If you're seeing a problem with a missing modules.dep.bin or modules.dep file(s) on your Linux/Ubuntu/Arch box (e.g. libkmod: ERROR ../libkmod/libkmod.c:XXX kmod_search_moddep: could not open moddep file '/lib/modules/kernel_release/modules.dep.bin'), then it may be rebuilt using the depmod command:
sudo depmod

Monday, 2 May 2016

Fix Handbrake crash on OSX(10.11) El Capitan

I just tried to use Handbrake (version 0.99) to rip a DVD on OS X 10.11.4 and it crashed halfways through so I ran Handbrake's update (0.10.5) but it still crashed ;( It turns out that OSX El Capitan has removed a software library that is used to decrypt DVDs (libdvdcss) from the system - so if you've got an older dodgier version (of libdvdcss) lying around it works but crashes. Either that or Handbrake fails to find anything on the DVD you're trying to rip, as mentioned on Reddit.

To fix the problem you need to install an up to date version of libdvdcss - either by downloading a slightly old version and copying it into the /usr/loca/lib e.g. if the downloaded library file is in Downloads:
sudo cp ~/Downloads/libdvdcss.2.dylib /usr/local/lib
Or you can build/install the latest version using Macports, homebrew, or from source. If you use Macports then you may need to link the macports installed version to /usr/local/lib (so that Handbrake can find it):
sudo ln -s /opt/local/lib/libdvdcss.2.dylib /usr/local/lib
Now start Handbrake and you should be good to go...

Friday, 29 April 2016

Using cheap SIM card readers

I ordered one of those cheap SIM (Smart card) card readers (often in blue plastic) that take a while to arrive from China. When it showed up I plugged it into my on Linux box and it was recognised as:
$ lsusb
Bus 001 Device 017: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
...
And it had created a serial device: /dev/ttyUSB0. So how do you actually use the thing? It ships with a dodgy mini-CD full of some apparently even dodgier Windows software - not much use. If you try to connect to the serial port using minicom etc you don't get much.

However it is possible to use it on Linux (Whilst OSX has shipped with the relevant deamon pcscd for a while, it seems that openct is not fully supported so it may not work with this little blue one - unless someone ports it). There are two ways to use it - the simplest way is to use apps that can talk directly to the serial port and communicate with the device such as pysimreader or pysim.

The second more advanced way requires some setup on Linux - so you'll need to install a few packages:
$ sudo apt-get install pcscd openct pcsc-tools
Then to get the SIM reader going you need to add the following to the openct config file (/etc/openct.conf) - so it knows where to find the SIM reader (it's known as a "phoenix" style reader):
reader phoenix {
    driver = phoenix;
    device = serial:/dev/ttyUSB0;
};
And uncomment the following lines in openct config file for pcscd (/etc/reader.conf.d/openct) - so that it recognises openct devices:
FRIENDLYNAME     "OpenCT"
DEVICENAME       /dev/null
LIBPATH          /usr/lib/openct-ifd.so
CHANNELID        0
Then you make sure the SIM reader is plugged in and restart the daemons:
$ sudo /etc/init.d/openct restart
sudo /etc/init.d/pcscd restart
Then you should be good to go. You can check the device has been recognised by using the pcsc_scan utility - and you should see it find the OpenCT Reader as below:
$ pcsc_scan 
PC/SC device scanner
V 1.4.22 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.10
Using reader plug'n play mechanism
Scanning present readers...
0: OpenCT 00 00

Fri Apr 29 16:25:33 2016
Reader 0: OpenCT 00 00
  Card state: Card inserted, Shared Mode, 
  ATR: .....

Then you can try out apps like cardpeek and others - install it using apt-get:
$ sudo apt-get install cardpeek

One can use it to read any compatible smart card chip using the reader. If you want to try reading a credit card you'll need to chop out the smart card section to make it into a SIM shape so it can fit into the unit. There's a bunch of more esoteric apps/libs on Github for this stuff like card, simLAB, etc. It is also possible to use the device to authenticate to EAP-SIM/AKA WiFi (thanks to this guy for his blog post that helped me on some of the above).

Note: If you find that the apps aren't working properly (check the logs for weird behaviour - enable logging - in openct edit /etc/openct.conf and add/modify debug = 9, for pcscd start it manually: sudo pcscd -a -d and then you'll have them both log to syslog) you may have a buggy version of openct (I had a problem with openct 0.6.20-1.2ubuntu1) so you'll need to get the latest version from the openct site and install that instead. Note that you'll probably need to build it from source e.g:
$ git clone https://github.com/OpenSC/openct.git
cd openct
./bootstrap
./configure --enable-pcsc
make
sudo make install
Then you'll need to edit the openct config file for pcscd (/etc/reader.conf.d/openct) - so that it uses the newly installed version of openct in /usr/local:
 LIBPATH          /usr/local/lib/openct-ifd.so
Then restart things:
$ sudo /etc/init.d/openct stop
sudo /usr/local/sbin/openct-control init 
sudo /etc/init.d/pcscd restart
Now you should be on track again.
[Updated: 5may16: Adding simple serial apps]

Wednesday, 24 February 2016

Headphone jack stopped working on your iPad?

The headphone jack on my iPad just stopped working - i.e. when I plugged in my headphones sound still came out of the built-in speakers and I heard nothing in my headphones (the plug was fully inserted). Darn it the jack must have finally broken...?! But then again it could just be a software issue (iOS9.2.1) - so I powered off my iPad and then switched it on again. Low and behold the headphone jack was back to normal! (This fix may also work for iPhones...).

Tuesday, 23 February 2016

Sharepoint access fixed in Office 2016 for Mac

Some people may have noticed that the previous Office update (15.18 (160109)) broke their 'Online Locations' access to Microsoft SharePoint woskspace servers on Word, Excel and Powerpoint. The latest update (15.19.1 (160212)) fixes this problem - Get it by going to Help->Check for Updates.

Tuesday, 1 December 2015

The iPhone “...” cannot be synced because there is not enough free space to hold all the selected items

When you start syncing your iDevice in iTunes and then you get this annoying message (especially when it tells you it needs like 1.4MB and there is 300MB available?!): 'The iPhone/iPad “iPhone(insert name)” cannot be synced because there is not enough free space to hold all the selected items'. What do you do?

Basically the problem, in many cases, seems to be that iTunes thinks it has too many updates to install on your iPhone/iPad and it isn't smart enough to load them one at a time when there's not enough space to do them all??

Fortunately it can often be side-stepped by just taking your iPhone/iPad and clicking on the App Store app,  then tapping on the Updates tab, and then tapping on 'Update All' at the top right. If that  complains that there's not enough space you can let do some updates then try again (and again) and will update the rest of the apps. Then the sync should be fine with iTunes.

Wednesday, 25 November 2015

iOS9 on older devices

The performance of iOS9 (9.0.2,9.1) on older devices iPad mini 1,2 is terrible (and to a less degree the iPhone 4s) - no amount of settings tweaks (like Settings-Accessibility->'Reduce Motion' off, Background refresh off, Hard reset etc) as mentioned across the Internet make much difference. There is a substantial lag in performance and speed as compared to iOS8.4.1 or earlier. Don't upgrade if you haven't already!

Note: It's no longer possible to revert to iOS8.4.1 (or 9.0.2 for that matter) as Apple is not signing older versions of iOS prior to iOS 9.1. To explain: Apple cryptographically signs iOS on every single device it is installed onto provide for enhanced security and integrity protection - and secure booting - as detailed in their iOS Security Guide.

Update[May16]: iOS 9.2/3 does improve things somewhat on the older devices (but I'd still advise staying with 8.4.1 unless you need particular iOS9 features/fixes).

Wednesday, 30 September 2015

MythTV on Kodi (XBMC)

I've been playing with Kodi (once known as XBMC) which is a slick open-source media centre system that runs on almost everything (OSX, Linux, Raspberry Pi, Android, Windowz, even [jailbroken] iOS). I wanted to connect it to MythTV, which is rather a handy open-source DVR for TV streaming and recording. So in Kodi (v15.1) I went to System->Settings->Add-ons->My Add-ons->PVR Client->MythTV PVR Client and then added the IP address of my MythTV server. That's all then I thought... so how does it work...?

It's not entirely obvious - but very simple when you know how - you then need to go to System->Settings->TV->Enable and just enable it! Then a new TV menu item appears on the main screen with various options for interacting with MythTV - like watching live TV, or recorded shows etc.

Also it seems that one can reduce the CPU load when running Kodi with the current versions by switching off the RSS display on the main screen by going to System->Appearance->Show RSS news feeds and disabling the option.

Thursday, 20 August 2015

Apple Bluetooth keyboard problems

If you've got an Apple Bluetooth Keyboard it may be working fine then one day it just seems to stop working (in a variety of ways such as; the caps/shift lock light not coming on, certain keys working (like alphanumeric) whilst others do (e.g. arrows keys)). So you search the Internet for 'Apple keyboard reset' or 'Apple keyboard fix problem' etc. There's a bunch of pages out there suggesting to just take out the batteries on the keyboard and then put then back in and reconnect the keyboard over Bluetooth.

But it can also be caused by [temporary] software issues on your computer (with the Bluetooth drivers) - so try rebooting your machine (or iPad etc) and try again. It may well fix the problem - as the lack of a caps lock light etc isn't necessarily due to the keyboard itself.

Monday, 13 July 2015

Stopping iPhone Voice Control appearing (so much)

Does the iPhone's Voice Control keeping appearing when you hit the home button? It's annoying as it is basically useless. So how does one disable it?? Well unfortunately without a jailbreak you can't (With a jailbreak you can install the Activator app and set the 'long hold' action on the home button to no action).

However I've found that if you have the triple click Accessibility Shortcut enabled (for stuff like Invert Colours, Greyscale, Assistive Touch etc) then Voice Control seems to pop up a lot more. So if you want Voice Control to appear less often then try switching off the Accessibility shortcut - by going to Settings->General->Accessibility->Accessibility Shortcut and unticking all options. I think I've also noticed a slight overall responsiveness on the phone too (this is under iOS8.3 on ye olde iPhone 4S).

Friday, 30 January 2015

How stop an iOS app from being upgraded by iTunes

So there's that app that you like the current version and newer ones just suck but iTunes doesn't make it easy to stop arbitrary apps from being upgraded. The problem with trying stop an old app from being upgraded is that it's all or nothing - you can either switch off automatic updates or you have to manually select the apps you want to upgrade every time.

The way to stop this is to change the permissions on the app so that it's can't be deleted (nor upgraded) by iTunes - first locate the app (e.g. /Users/test/Music/iTunes/Mobile\ Applications/Twitter\ 2.19.ipa ) Then you set the immutable flag on the app from the Terminal:

chflags uchg /Users/test/Music/iTunes/Mobile\ Applications/Twitter\ 2.19.ipa

When iTunes tries to update the app it tries to delete and replace it with the newer version but it fails ('Saying the original file can't be found'). But you can ignore that warning.

If you want to upgrade it at another point you'll need to just delete it and rerun iTunes so that it fetches the new version.


Note: That apps are unique to your user ID so you can't just copy an app (an .ipa file) from someone else an install it on your device, though you can with if you have older copies of an app for your device installed with that user ID.

Update:27nov15: Unfortunately it's not clear that this technique does stop iTunes from upgrading the apps in all situations;(

Update:23feb16: If this doesn't work you can copy the desired version of the app ipa file elsewhere and then delete the app from iTunes and then copy in the older version and sync again.

Thursday, 15 January 2015

iTunes stopped syncing with iPhone?

The other day - as had happened a few times before - when I plugged my iPhone/iPad into my Mac iTunes failed to automatically start. Indeed iTunes didn't even seem recognise that my iPhone was plugged in - neither when directly plugged into USB nor when trying to 'sync over WiFi'. Another odd symptom was that my iPhone suddenly started to ask if I wanted to Trust this computer (that I have always synced to the past). A reboot had usually fixed this in the past but that's a pain so I snooped around for other answers - The usbmuxd daemon seemed to be complaining about weird stuff in the logs so I figured lets try and kill it! And low and behold that fixed the problem - usbmuxd restarted (probably care of launchd) and all was well again - iTunes saw my devices and wanted to talk to them again - a handy quick fix.

Here's the command line way to kill it - to be safe quit iTunes and unplug your iPhone beforehand:
sudo killall usbmuxd 

Wednesday, 9 July 2014

Hide twitter app worldcup menu

Since the World Cup started the Twitter app has been suggesting I look at the latest World Cup game. I'm not that interested anymore but it keeps on bothering me. 

The good news is that you can disable or hide the world cup menu in the Twitter app by tapping and holding on the world cup banner till you get an option to "Hide" or "Never Show Again", or "Cancel". Choose Hide or never show again and it's gone forever.

Tuesday, 8 July 2014

Spotlight not working?

You just tried to use Spotlight and it found nothing apart from a dictionary word?! Spotlight seems to shut itself down for a variety of reasons  - one being lack of disk space - it seems to need about 5% of your disk space to free to operate effectively. Here's one way to fix it.

Firstly you can check if Spotlight has indeed stopped (from a terminal):
mdutil -s /
If it says: "No index." then you can re-enable it again - making sure you have about 25GB free if you have a 500GB hard drive - you'll need to type in your password as it requires root privileges:
sudo mdutil -i on /
It should say "Indexing enabled" - sometimes you have repeat this last step a couple of times until it says "Indexing enabled".

If you have no joy enabling it you can go one step further and try erasing and rebuilding the Spotlight index:
sudo mdutil -E /

Or as a last resort try removing it manually - firstly you should disable Indexing:
sudo mdutil -i off /
And then remove the index:
rm -rf /.Spotlight-V100
And finally re-enable Indexing:
sudo mdutil -i on /

Once you have enabled Indexing again be prepared to wait for a few hours before it's finished (it'll tell you roughly how long if you click on the Spotlight icon). However you can actually use Spotlight whilst it is building the index - it starts to provide some results fairly soon after it begins indexing.