Thursday, 5 July 2012

Field Test App on the iPhone 4

So it seems Apple keep chopping and changing whether they provide the [secret?!] Field Test App....But anyway it is in iOS5.1.1 (and iOS6) and works on iPhone 4S & 4, and probably 3GS (but not tested). You kick it off by typing the magic code (*3001#12345#*) into the Phone dialpad and then hitting Call. Note: It doesn't work if you add it as a contact and try to call it.

When it starts up it presents a pretty basic interface where you can navigate to find out various info about your GSM and UMTS/3G (and presumably CDMA) connections. It also changes the signal strength icon (top left) for a number - the smaller the negative the number the higher the signal (e.g. -44 represents a better/stronger signal than -99). If you tap the number it changes between the bars and the numbers again.

What the heck can you do with it? I guess it is handy sometimes to have numeric signal strength... And check up on some of the other parameters.

One thing you can do is find out the mobile base station your phone is attached to and then potentially match that with an actual cell location. It's a bit long winded.....In the UK the regulator Ofcom has created a fairly useful web page that provides the position of most cell towers overlaid onto a Google map. So to find out which cell you're attached to firstly check if you're on 3G or not (i.e. 3G icon showing or not - you'll need to turn off wifi to see if it is on though it doesn't affect the app):
If you are on 3G then you tap on:
'UMTS Cell environment'->'UMTS RR Info'->'Downlink Frequency'
The number on that line is the frequency in MHz your phone is using to communicate with the UMTS base station.
If you're not on 3G then you tap on:
'GSM Cell environment'->'GSM Cell Info'->'GSM Serving Cell'->'ARFCN'
If your ARFCN is between 1-124 then your phone is on 900MHz band 128-251, then it's using the 800/850MHz band, and if it is between  512-880, then your phone is using the 1800MHz or 1900MHz bands. A few sites give more details like this one on GSM/LTE, or there's GSM list from the gnu radio folks.

Once you've got this far then you can go look up your location in the UK use the the Ofcom sitefinder (or equivalent in your country) and find the cells near you. Then you have click on each on and find your providers ones and then locate the GSM or UMTS cell towers and then match up the frequencies used by those towers. Blimey that was a bit tedious but you should have got there! If you don't find any cell towers nearby or matching then maybe you've found an undocumented cell tower - report it to OfCom on their pages!

[30oct12: Added iOS6 info, and other minor tweaks]

Tuesday, 12 June 2012

iCloud deleted/moved All on My Mac contacts?!

So I just tried adding my iCloud email to Apple Mail on my Mac and kept the 'contacts' checkbox ticked when Mail asked me to create the account setup. My iCloud account worked fine in Mail.

Then I went to Address Book and noticed that 'All on My Mac' contacts had been replaced with 'iCloud' on the first page of the address book (click on the red bookmarky thing on contacts to see it). Where had my 'All on My Mac' contacts gone??!! Well they had been copied over to iCloud with asking me.... So I thought I'd go and disable the iCloud account in Address Book - and 'All on My Mac' contact returned but they were completely EMPTY?! I don't necessarily want all my stuff synced to some [US] server farm - especially when I'm not even asked about it.

I sat back for a moment and thought about it... I then tried deleting the iCloud account and then it asked me if I wanted to delete all my contacts... or Keep them. I kept them and low and behold my contacts returned to 'All on My Mac'!

Tuesday, 17 January 2012

OSX application firewall not working: FIXED

Recently I encountered problem with the OSX Application Firewall getting confused on Lion (and maybe even on Snow Leopard) - it basically blocks services (e.g. ssh) even when they appear to be set up with 'allow incoming connections' in the Advanced... section of the Firewall, under Security and Privacy, in System Preferences.

I managed to reset mine by doing the following (with the firewall off):
sudo rm /Library/Preferences/com.apple.alf.plist
Then reboot.

When the machine has rebooted in the Firewall advanced settings you should only see the system services that were already enabled (e.g. SSH). Any other entries will have gone, but when you start network based applications that need to accept incoming connections through the OSX firewall - you will be asked if you want to permit the application or not again.

If for some reason the Advanced firewall settings have not changed then ensure the firewall was off when you removed the file and also you could try killing the process named 'writeconfig' (which actually opens that config file) - however you should reboot soon as there may be unexpected consequences.

For more info Apple's Application Firewall see here. Also note that Apple's application firewall is different to the old BSD/Dummynet ipfw firewall - which maybe controlled via the ipfw command (see the man page - e.g. man ipfw). ipfw provides lower level firewalling and can provide for more general network restrictions and control.

Thursday, 1 December 2011

Linux traffic Control (tc)

The world of Linux's Traffic control is a mysterious thing - you end up spending hours Googling or days reading source code.

For some nitty gritty on tc see an earlier post of mine on tc rate limiting and pitfalls.

TC Queuing Disciplines (qdisc)

Creating:
E.g Add a tbf qdisc on eth0:
sudo tc qdisc add dev eth0 root tbf rate 10mbit burst 100kb latency 50ms

Listing:
E.g. Show qdiscs on all interfaces:
tc qdisc show

Delete:
E.g. Delete all qdiscs on eth0 interface:
sudo tc qdisc delete dev eth0 root


TC Filters

Creating:
Here's some good info on the u32 filter (here and here). Some more with a quick overview from LARTC mail list (the source of most useful info on tc etc). Someone put together a tc manual.

Listing:
E.g. Show filters on eth0 interface:
sudo tc filter show dev eth0 root

Here's some example output:
filter parent ffff: protocol ip pref 49152 u32

Deleting:
To delete the above example filter (bold section copied from filter show output):
sudo tc filter del dev eth0 parent ffff: protocol ip pref 49152 u32

[updated:17feb12, 5,6jul12,29jan20: more explanations+archive.org link for 1st link as it's gone MIA, link to older article of mine; Added TC qdisc cmds]

Wednesday, 14 September 2011

OSX Lion #fails (plus some good stuff)

So I thought OSX Lion sounded interesting and I went and upgraded... Only to find out there's a bunch of stuff removed and changed for worse - not made that clear in the reviews/press. Also the claimed 'new' features are few. So here's a list of a few gripes I have with it so far:
  • No colour icons in the Sidebar - Not a big deal but it just makes it less use-able
    • Here's a way to fix it!
  • Quick look video preview slow - It's performance is now so bad that my fan kicks in when viewing (it seems to use WAY more CPU than the Quicktime app)
  • 'Full Screen' is no different from Apple-F in the previous OSX versions as far as I can see (though some additional apps have it now like Terminal).
  • Never seen the need for the iphone-esk 'LauncherPad' - a bit of a waste of time.
  • Frontrow removed - It was handy for viewing a bunch of movies
  • 'Leather' look for iCal and Address Book - That is seriously Cheesy style?! (Fortunately it can be tweaked away...but with hackery)
On the plus side there are some benefits but so far not many:
  • Resize handles on every side of a window (not the just the bottom right)
  • Slightly more helpful searching in folders - it prompts you with 'filename'
  • Terminal finally has full screen (but I gave up on it years ago for iTerm2, as Apple's Terminal still doesn't work with vim and others properly)
  • Air Drop anyone? (not managed to try it yet.... but it sounds nice: Wifi file transfer)

    Friday, 19 August 2011

    iPhone3G SSL bug fix

    If you've got an old iPhone 3G and you've heard about the SSL bug which Apple don't seem interested in fixing for older iPhones then here's a fix - though you've gotta be running a jail broken iPhone. This bug is a bit nasty as it means that you could potentially be misled into connecting to a site that you think is a trusted site (e.g. your bank) but in actual fact it is a scam site. This can occur due to the fact that the iPhone's SSL stack doesn't check any site's SSL certificate properly - and the certificate is normally the thing that tells you you're connected to who you think you are.

    Apple have recently released a fix for newer iPhones/iPads in iOS 4.3.5, but if you've got an old iPhone3G then the latest version of iOS it can run is 4.2.1 so you're a bit stuck. So since Apple isn't bothering to provide any more updates you might as well bite the bullet and jail break your phone - then at least you can add some more features and updates. I found redsn0w 0.9.6rc18 to do the job quite well after many failed attempts with greenpois0n.

    Once you have jailbroken your phone you need to run Cydia and search for iSSLfix and install it (as also explained here) - then you're covered.

    [updated:17feb12: Corrected problem description]

    Tuesday, 16 August 2011

    Converting video for DVD players

    Most of today's DVD players will not only playback normal MPEG2 DVD video discs (i.e. normal DVDs) but also other video formats that allow for much more video to be packed onto a writable DVD disc like DIVX and XVID. They are actually very similar formats and are basically ISO MPEG4 video (which is closely related to ITU-T's H.264 video standard). There are loads of dodgy commercial tools out there for conversion but you can do it easily using the very powerful ffmpeg tool (it runs on MacOSX, Windows, Linux and others). So to convert something (e.g. an MP4 video named video.mp4) to XVID use:

    ffmpeg -i video.mp4 -vcodec libxvid -b 800k vid-xvid.avi

    This says compress it using the libxvid codec and set the bandwidth to 800kbits/sec - which looks ok whilst still compressing well - feel free to play with this though don't too high (e.g above 5Mb/s) as DVD players can have trouble playing it back. The name of the output file is vid-xvid.avi. I have found this format to be slightly better supported, although it slower to convert than the DIVX.

    If you want to compress to DIVX use the following:

    ffmpeg -i video.mp4 -vcodec mpeg4 -vtag divx -b 800k vid-divx.avi

    This says use the mpeg4 codec to compress and mark the output video with the DIVX fourcc tag which will let the DVD player know it is DIXV video.

    The the file can be burned to a DVD using your favourite DVD burner app - usually using the operating systems default one. To make it easier on the DVD player use names with 8(.3) characters that are then followed by the .avi suffix.

    [14sept11: Corrected some minor errors]





    Friday, 12 August 2011

    Post mortem: IPv6 Day

    The day seemed to go pretty smoothly in general. Whilst a lot of the main contenders switched IPv6 off again, it was said that 2/3 actually maintained IPv6 functionality after the day (see IETF talk below). Well when I say they switched it off - The visible aspect was to remove their IPv6 addresses (their AAAA records) for their main sites from the Internet's Domain Name Service (DNS) again. However a lot of work went on under the hood: Lots of web helper stuff to notify people if there was a problem, Various mods to custom code, and various dual stack proxies and some tunnels to provide IPv6. The main players do have IPv6 versions of their sites accessible both before and after the day - only they're either on a separate domain name (e.g. ipv6.google.com). A number of these folks put up their own post mortem analysis pages (yes some of them did use some 1337 Hack0r IPv6 names;) : FACE::B00C, Google, C:15C0:D06:F00D, ISOC.Though probably the most in-depth analysis was provided in a presentation (by a combination of key players) at the IETF81 in July at Quebec, with good coverage from Arstechnica.

    It seems that there are browser tricks to speed up IPv6 failover and now even OS level approaches to provide for it - notably OSX Lion has introduced some new black magic for IPv6 path selection.