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.