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 El Capitan (10.11)

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 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 simple way is try to use an 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 cardpeek
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:
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 - or you can use it to authenticate to EAP-SIM/AKA WiFi (thanks to this guy for his blog post that helped me on some of the above). It is possible to read any smart card chip using the reader - though you'll need to chop up a credit card to make it into a SIM shape so it can be fitted into the unit. There's a bunch of more esoteric apps/libs on Github for this stuff like card, simLAB, etc.

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
./configure --enable-pcsc
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.