OSX: Using the second monitor while in full screen mode

I have an old macbook pro (circa 2008 I think) running 10.8 with an external monitor. Today I started running Avatron’s Air Display on it (a wonderful piece of software by the way), which runs in full screen mode. This left the laptop display itself useless, displaying that grey cloth background which apparently means “This is how OSX fullscreen works – get used to it”.

Anyway, I wanted to run Terminal.app on the main laptop screen, while running Air Display fullscreen on the external monitor. Apparently there are two ways:

1. It seems that you can “trick” OSX to allow this, by using the trackpad to slide between spaces, and opening Terminal.app (via spotlight) mid-slide. I couldn’t get this to work however, as my trackpad doesn’t do multi-touch (it’s too old), and it seems you need it. Works for a lot of other people though.

See this hint on macworld for details.

2. You can modify Terminal.app’s Info.plist file to make it a background app. Then, if you open Terminal.app (again, via spotlight) while viewing the fullscreen app, it won’t switch out of fullscreen mode.

To do this:
* Quit Terminal.app if running.
* Right-click on it, and Show Package Contents.
* Open the file Contents/Info.plist, and add the bold text below at the end (before the last “</dict>”):


Note that this has some serious side-effects! Most notably, the terminal will no longer appear as running in the dock, and you won’t be able to ALT-TAB to it.

(some general info regarding LSUIElement is available here)

That’s it. I’d be interested in hearing if there are other (easier!) ways.

, ,

No Comments

SEP.cnf.xml for a Cisco 7975G with chan-sccp-b

This is an annotated/censored copy of the SEPxxx.cnf.xml I use with my 7975G and chan-sccp-b/asterisk.

Read the rest of this entry »

, , , ,


MySQL: moving innodb tables out of ibdata1

Note-to-self style post again.

MySQL’s innodb will store all table data in one file called ibdata1, unless you tell it to do otherwise. This can become an issue sometimes, particularly when the file gets really big.

Thankfully there’s a way to fix it.

Add innodb_file_per_table to my.cnf


Update the running server with the same value
SET GLOBAL innodb_file_per_table=1;

ALTER TABLE tablename ENGINE=Innodb;
for each table to move it out of the ibdata1 file.

Alternatively, you can use this little bit of trickery to generate the sql needed to do it for all tables:


Then paste the result as sql and run it (it may take some time though).


No Comments

Building goaccess on OSX 10.8.2

Title says it all really. Copy/paste of what was needed to build goaccess on 10.8.2, without pissing around with brew et al.

tar -zxvf goaccess-0.5.tar.gz
cd goaccess-0.5

curl -L http://ftp.gnu.org/pub/gnu/gettext/gettext- -o gettext-
tar -xf gettext-
cd gettext-
./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E"
echo '--- gettext-tools/gnulib-lib/stpncpy.c.orig 2007-10-07 23:29:35.000000000 +0300' > gettext.patch
echo '+++ gettext-tools/gnulib-lib/stpncpy.c 2011-03-11 23:34:40.000000000 +0200' >> gettext.patch
echo '@@ -24,7 +24,7 @@' >> gettext.patch
echo ' #include ' >> gettext.patch
echo ' ' >> gettext.patch
echo ' #ifndef weak_alias' >> gettext.patch
echo ' -# define __stpncpy stpncpy' >> gettext.patch
echo ' +//# define __stpncpy stpncpy' >> gettext.patch
echo ' #endif' >> gettext.patch
echo ' ' >> gettext.patch
echo ' /* Copy no more than N bytes of SRC to DST, returning a pointer past the' >> gettext.patch
patch -p0 < gettext.patch
make -j2
sudo make install

curl -L http://ftp.gnome.org/pub/gnome/sources/glib/2.27/glib-2.27.0.tar.bz2 -o glib-2.27.0.tar.bz2
tar -xf glib-2.27.0.tar.bz2
cd glib-2.27.0
./configure --with-libiconv=native

echo '--- glib-2.27.0-orig/glib/gconvert.c2010-09-17 17:33:50.000000000 -0500' > glib.patch
echo '+++ glib-2.27.0/glib/gconvert.c 2010-10-27 00:01:39.000000000 -0500' >> glib.patch
echo '@@ -61,9 +61,6 @@' >> glib.patch
echo ' #if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)' >> glib.patch
echo ' #error GNU libiconv in use but included iconv.h not from libiconv' >> glib.patch
echo ' #endif' >> glib.patch
echo '-#if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H)' >> glib.patch
echo '-#error GNU libiconv not in use but included iconv.h is from libiconv' >> glib.patch
echo '-#endif' >> glib.patch
echo ' ' >> glib.patch
echo ' /**' >> glib.patch
echo ' * SECTION:conversions' >> glib.patch
sudo make install

cd ..
sudo make install



Sickbeard Fork: Feature Summary

Note: Since this post was written, TvTumbler was born. Going forward, all new development will be in TvTumbler.

Well I’ve been working on and off on Sickbeard for the last few weeks, and the list of additions is starting to grow. So it’s probably time for a summary of the main additions.

Sickbeard Integrated Torrent ClientIntegrated Torrent Client

Uses libtorrent-rasterbar to provide a very simple (but very fast!) integrated torrent client. Manages queueing, priority, seeding, and deleting of torrent automatically. No need to use blackhole or watch dirs (but of course you can use those if you wish). If libtorrent rasterbar is not available on your system, this feature simply won’t show. You can continue to use your existing torrent client without issue.

Custom RSS Torrent feedCustom Torrent RSS Providers

Add one or more custom torrent providers. Any torrent source with an RSS feed should work for this.
See this post for more info (including some recommended feeds).


New Torrent Search Providers

I’ve added all the useful/reliable torrent providers I know as search options (at least the ones that you don’t need invites/accounts for). These are:

  • ShowRSS: This appears to be very reliable, but their show naming is not always smart, and their backlog can be limited.
  • Kickass Torrents: Includes solid backlog support.
  • DailyTvTorrents: Again, appears reliable, and includes solid backlog support (thanks to lylej for the heads-up on this one).(sadly, this is now gone)
  • BBC iPlayer support (via the perl get_iplayer script): See here for instructions on how to set this up.
  • Support for magnet links.
  • PublicHD support: No backlog yet, their RSS is *extremely* limited.
  • And additionally, EZRSS has been “fixed” so that it will continue to work (by using the twitter feed, tpb feed, and a feedburner feed as backups) even when the site goes down (which happens a lot!)


Custom Scene Names

The edit show page now includes a box into which you can type ‘custom’ show names (or ‘Scene Names’). These will be searched for in addition to the tvdb show name. This is incredibly useful for picking up on minor variations in show names.


Custom Scene Numbering

Anyone who has used sickbeard for any length will know how annoying this is: The scene decides that the first episode was a double, but tvdb (from which sickbeard gets its numbering) thinks otherwise. Or they include a special in the numbering. Or they disagree on season numbers. Or they call the “special” episode “SxE00″, where tvdb calls it “S00E56″.

Well this gives you the facility to work around this problem, without having to manually “fix” everything sickbeard downloads (or tolerate the duplicates it creates). You can now manually enter a season/episode number for each episode, and this is what sickbeard will search for when trawling the internet. And it will renumber it correctly once it’s downloaded to your PVR.

The code will also regularly check thexem.de for the known variations between scene and tvdb numbering – so in most cases you probably won’t even need to correct the episode numbers, sickbeard will do so itself (but of course it will respect your numbering if you have specified it manually).


Installation Instructions

These now have a wiki page of their own. See How to Install Sickbeard for Torrents on github.

And I do believe that this time, I’m really finished. These are the main things that have annoyed me about sickbeard since I’ve started using it, and it took far more work than it should have to actually fix them (all-in, I’ve probably spent a full day on this). If I feel tempted to add features to this in the future, I think I’ll start by doing a re-write: it will save time in the long run (and imo sickbeard is badly in need of a rewrite).

As always, the full source is available from https://github.com/bricky/Sick-Beard.


Update/Please Note: I don’t intend to add any more features to this – so please stop asking for them! Sickbeard is, as far as I’m concerned, broken – and I don’t have the time to fix it, or write a replacement.
I will generally keep this up to date however, until I find a better system (or actually do the rewrite).

(if someone else wishes to start a rewrite however, please let me know – I may be able to contribute)

Update (Sept 2013): I’m doing the rewrite: TvTumbler, an addon for XBMC with the same basic functionality. I’d encourage any new users (who also use XMBC) to try TvTumbler instead.

Having Issues?: Please use the github issue tracker (and include a debug log, or your issue will likely be ignored)

, , , , , , ,


Air Video addon for XBMC

Air Video logoThis is simple enough really: an addon for XBMC that allows you to browse (and stream) from an Air Video server.

Download Air Video Plugin for XBMC

To install this in XBMC, download the zip file above, save it somewhere you can find it, then

System -> Settings -> Addons -> Install from zip file

and browse for the file you just downloaded
Be sure to configure the “Location” in the preferences before use (this should be the ip address of your air video server).

I can take very little credit for this. Most of the Air Video code comes from Jeremy Debate’s port of JP Hastings-Spital’s ruby library for interacting with Air Video, with some minor modifications here and there to get it to work from within XBMC.

Note that I’ve only tested this on Frodo, the latest development build. I would expect it to work without issue in Eden also however.

UPDATE: Please note that if you open a video by simply selecting/clicking it, it will not be transcoded (xbmc will simply attempt to play the file as-is). Transcoding requires opening the file via the context menu/right-click/’C’-key, and does not appear to work correctly in current versions of XBMC due to lack of support for the stream format. Please read the comments below for further details.
(Thanks for signorRossi for this information).



Sickbeard support for ShowRSS & Kickass Torrents

This fork has moved on a bit since this was posted. See here for details.

Sickbeard is a simply wonderful piece of software, but its only real torrent support is for ezrss, which is often (and currently) broken. There’s no real technical reason to restrict it to just this feed (at least none that I could see), so I’ve forked it and added support for another feed called showRSS.


That is all.

Update: Now also includes the ability to add your own scene exceptions through the web UI, and uses twitter rss as a backup for ezrss when it fails.

Update 2: Now also includes support for kat.ph (aka Kickass Torrents), which provides a much wider range of shows (and also, apparently, backlog support).

, , ,


dd-wrt and 802.11d woes

In Argentina it’s quite difficult to buy a wifi router which is configured correctly for use in this country (with the exception of those that come “free” with your cable etc.).  The majority of network equipment that you find here is bought (over the counter) in other countries, and imported through “unofficial” channels.  This presents a problem with wifi routers, which are often configured for another regulatory domain — as generally those who use them don’t bother (or don’t know how) to fix them.

I live in an highly congested wifi zone (a kismet scan run from my laptop yesterday found an incredible 4200 distinct stations!).  A few hundred of these are access points, most have 802.11d enabled, and many of these transmit a country code that is not AR (i.e. Argentina).  Aside from probably being immoral, that’s not such a big deal.  But …

Enter Mac OS X.

Read the rest of this entry »

, , , ,


Excel function to calculate numerology number

Function below to calculate the numerology number (reduced to 2 digits) for a name in Excel:

=SUM( 1* CHOOSE( CODE( MID( LOWER(A1); ROW( INDIRECT("1:" & LEN(LOWER(A1)))); 1))-96; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8))

Press Ctrl+Shift+Return to have Excel treat it as an array function (it will enclose it in curly braces { and }).  A1 is the cell reference containing the name.


Me versus the Argentine Ants

Since we moved into our new apartment (about 6 months ago) we’ve had incredible problems with insects:

  • First it was mosquitoes.  Literally hundreds of them would be wandering around our bedroom each night (we used to vacuum them!), until we found the (several) places they were coming in.
  • Next it was cockroaches, large and small, to be found in the most unexpected of places.  Roaches are standard fare in this city however, so a few visits from the exterminator to the building put an end to them (at least for the present).
  • And lastly, we’ve had ants.

The Argentine AntTiny Argentine Ants, maybe 2 to 3 millimetres in length, turning up everywhere that there’s food exposed.  We’d find them in the sink every morning if we didn’t do the washing-up the night before.  In cakes (even when in a supposedly airtight container), in the rubbish bin, in the bathroom (very often in the bath for some reason?  I guess they’re easier to see there), and finally, the other day, feasting on our medialunas on the living-room table.

We took to following them (they make these hilarious little trails) and blocking the hole they came through with a little silicone gel.  This stopped them for a short while, but they quickly find another route.

Other common remedies (washing their trails with soapy water, spraying with vinegar, salt barriers, coffee grounds) also offered brief respite.

Happily now however, it appears that we have found a solution (although I say that very tentatively, it’s early days yet) – boric acid.  This wondrous substance (used for cleaning apparently) works as a slow-acting poison which allows the ants to bring the foodstuff (with which it is mixed) back to the nest before killing them (and hence destroying the ants in the nest also).

We tried two different mixtures:

  1. 50% boric acid + 50% sugar, diluted in water (enough to dissolve the sugar).  Soak kitchen paper towels in the solution and place on a small plate (the sugary solution will makes a mess otherwise).
  2. 25% boric acid + 75% honey, mixed until the boric acid dissolves.
Boric Acid + Honey solution

Ants eating the Boric Acid & Honey solution.

Although both mixtures were effective (the ants ate both), the honey mixture (b) was much more popular (so popular in fact, that many of the ants drowned themselves in it).

To give an idea of scale in the picture on the left: the piece of plastic that contains the honey solution is part of a light switch – about the size of a 2 euro coin.

The ants found the mixtures after about 2 hours (which we placed in 4 different locations around the apartment).  For the next 12 hours or so we had a continuous stream of guests (around 30 eating at time), then the numbers started to gradually decrease, down to around 5 after 24 hours.  And now, after about 48 hours there is usually just one or two.

Of course we can’t be sure yet if this will be a permanent solution (there is still a question whether the ants made it back to the nest(s) alive), but it is certainly looking positive for the present.

Argentine ants are quite unique by the way: they share nests, never fight amongst themselves, and have several queens.  Well worth reading about.

Edit (5 days later): Well the ants stopped coming to these particular buffet lunches, however we noticed that they are still very much present elsewhere in the apartment – so it seems that they became aware of the poison and have started avoiding it.

A little googling turned up this (authoritative-sounding) document which states that

For boric acid or borate baits, the concentration of active ingredient that will be most effective in killing the colony (rather than just stopping the ant trail) is between 0.5% and 2%. Higher concentrations may be used to quickly eliminate ants indoors.

So our 25% to 50% concentration was insane overkill!

It also states that,

The optimum sugar concentration in liquid bait is 25%.

So, again, our 50% to 75% sugar content was somewhat overzealous :)

Back to the drawing board then.  We’ve mixed new traps, this time with 1% Boric Acid, 25% sugar, and the remainder water.  We’ve placed these (4 of them) in (new) strategic locations around the apartment.  Interest in them has been very poor so far: they’ve been down for about 12 hours now, and on the few occasions that we’ve checked we’ve had no more than 2 ants at any one trap (often none).

We’ll give it some time though and see how it goes :)

Update (6 weeks later): Well the ants did express an interest in the new traps.  For a week or two the numbers held at about 5 to 10 ants per trap at any one time (and even the corpses building up around the traps didn’t seem to deter then), and gradually the numbers reduced to maybe one at a time.

We were considering removing the traps (now littered with ant corpses), when suddenly the numbers jumped significantly about a week ago, up to 10 or 15 at a time.  These appeared to be new ants, often bigger than the previous ones (if only very slightly), who were re-exploring all the tracks that the other ants had used previously (even the dead-ends).

Now this new batch has begun to reduce in number also, and the ants arriving are getting smaller – so it would appear that the traps are having the desired effect on this nest also (or at least the ants have communicated to one another that the traps should be avoided).

The plan currently is to leave the traps in place for another few weeks – until they no longer receive visitors.

, ,


“Order By” for Zend Db findDependentRowset()

This is another one of those note-to-self style posts.

Design decisions on Zend Db’s “Zend_Db_Table_Row_Abstract” class prevent the inclusion of an ‘order by’ clause directly in the (incredibly useful) “findDependentRowset” function.

But you can pass in the order by clause indirectly through a select statement as follows.

What you want would be something like:

$depRows = $row->findDependentRowset('DEP_TABLE_NAME', /*order by=*/'SORT_ORDER ASC');

and you get this by doing the following:

$depTable = new DEP_TABLE_NAME();
$depRows = $row->findDependentRowset($depTable, null, $depTable->select()->order('SORT_ORDER ASC'));


1 Comment

AppleScript desktop dialer for Asterisk

Asterisk Desktop Dialer

This is an incredibly simple idea – but incredibly useful: a desktop application (written in applescript) where you copy/paste the number you wish to dial, it connects to your local asterisk server via its management interface, and dials the number on your phone.

You’ll need a mac (obviously), a desktop phone (even more obviously), and an asterisk server (most obviously), preferably on your lan, which you can configure to allow network access to the AMI (Asterisk Manager Interface).
Read the rest of this entry »

, , , ,

1 Comment