17
Jan

Updating PHP (or adding modules)

   Posted by: dave   in Techie Stuff

My first instinct when wanting to add a module to PHP is to hit the shell.  However, in cPanel, this is somewhat harder to do.  Especially as on my CentOS 5.4 x_64 build, yum appears to be broken irretrievably – I’ve installed the EPEL repo, but cannot select any software to install from it (I was after the php-mbstring package, I understand).

However, cPanel to the rescue.  Hit WHM as your root user, and go to “Software”.  In there, is an “Easy Apache” section.  Go through the “wizard” presented, and fill in the details you want (I’d base the settings on the existing build if I were you).  In step 5, use the “exhaustive options list” and select all the modules you want.

Having filled in the configuration filename, description and extended description boxes, push the “build” button and let cPanel chunter away for a bit.  You’ll then be asked about suExec and default PHP handlers for .php types.  Accept the defaults (or the settings you had last time if you’re conservative, although for me, these were the same) and away you go.  I’ve now got mysqli and mbstring (why aren’t these default modules anyway?) installed on the server.  No yum needed, Hurrah!

27
Dec

Linux clipboards.

   Posted by: dave   in Linux

Linux has – for historical reasons – two clipboards.  One is the one that old X hands will know and love, the other is the new one.  And the two are completely separate.  If you put text in the copy-buffer (the X windows style clipboard), then you attempt to paste out into a new-style application, nothing will happen.  Likewise the other way around, copy out of an application that uses the new style clipboard and the X applications won’t know there’s any text in the clipboard.  Because there isn’t.

So.  How to get around this problem?  On debian/ubuntu, there’s a package (which isn’t installed by default) available to install.  autocutsel.  It’s a background application which knows about both styles of clipboard and attaches to both.  When one changes, it’ll synchronise the two clipboards.

Downside?  If you’re used to two clipboards and know which applications use which clipboard (and you exploit this mercilessly) then you’re going to lose the contents of the “other” clipboard with this running.  Enough of a bummer to stop me using it?  Nope.  It’s a beautiful little application which allows me to copy and paste between all my applications – including those pesky mono applications.  Yay!

30
Nov

The problem with Linux and proprietary modules

   Posted by: dave   in Linux

A kernel upgrade (from 3.5.0-18 to 3.5.0-19) has just borked my two binary modules that I load.  The video card and the wireless network. So absolutely nothing to worry about there then. Just the two most important pieces of a modern Linux system.

The video card problem manifested by the window manager (compiz) crashing, so there were no title bars, the launcher had gone and the task panel was absent. Absolute PITA getting anything to run, and god help you if X decided that the window you wanted to type into just isn’t going to accept focus!

Firstly, after a kernel upgrade, one always needs the correct kernel headers to compile the wrappers for the modules:

apt-get install linux-headers-$(uname -r)

The wireless network card was taken care of by the following two commands:

/usr/bin/apt-get purge bcmwl-kernel-source broadcom-sta-common broadcom-sta-source
/usr/bin/apt-get install b43-fwcutter firmware-b43-installer

The ATI module was done by just running the ATI proprietary driver installer again (which I had lying about in my home directory).

All from a text-console, of course. I was lucky in that my laptop has both wired and wireless. If you’ve only got wireless network connectivity, you’ll need to download the .deb files that apt gets above and install them manually with dpkg.

sudo update-rc.d /etc/init.d/<scriptname> defaults

Also, for those newfangled keyboards without a numlock key (irritating, isn’t it?) then you need the numlockx binary, from debian/ubuntu package numlockx.

Just run “numlockx toggle” to toggle the current state of the numlock key – or “numlockx on” or “numlockx off” to set the state explicitly.

Now, combine that with the startup script hint above, and you’ve got a numpad again.  Top stuff…

Alternatively, you can – it seems – go to the system settings tab in Ubuntu, choose Keyboard, choose “Layout Settings”, click “Options” and in “Miscellaneous compatibility options”, select the “Numeric keypad keys always enter digits (as in Mac OS)”.  This has much the same effect.  But you don’t learn anything about the ubuntu startup scripts this way :P

27
Oct

Ubuntu 12.04 post-install tweaks.

   Posted by: dave   in Linux

Uninstall gnome-screensaver, install ubuntu packages:
xscreensaver
xscreensaver-data
xscreensaver-data-extra
xscreensaver-gl
xscreensaver-gl-extra
xscreensaver-screensaver-bsod
xscreensaver-screensaver-dizzy
xscreensaver-screensaver-webcollage
rss-glx

After installing rss-glx, you’ll need to run glx_install to install the rss screensavers. And that’s Really Slick Screensavers, not RSS

You’ll also need to setup the screensaver to auto-start when you log-in.  Search for “Startup” in Unity, then add an item in that utility, pointing to /usr/bin/xscreensaver

Additionally, you’ll (probably) want to remove the unity-lens-shopping package too – it slows the unity search panel down massively, and – for me at least – will never do anything useful. If I want to search amazon, I’d be on the amazon website.

Other packages you’ll be wanting at some point:

keepass2
mono-complete (required by keepass2; don’t just install the ‘mono’ package)

There’s massive kinks involved with keepass2 on linux (because of mono) – and the fact that Ubuntu has a script to start keepass2 (/usr/bin/keepass2 is a shell script, and so is not what you configure the keefox plugin for the location of KeeFox (that’d be /usr/lib/keepass2 instead).

Add another auto-startup for keefox by adding /usr/bin/keefox2 in the startup programs (like you did for xscreensaver, above).

I’m sure there’s more, but that’ll do for now. When something occurs to me, I’ll put it up here.

So far, though, Ubuntu 12.04 has just workedTM for me on this HP laptop.

26
Aug

Winbox and Virtual Machine network adaptors

   Posted by: dave   in General

Simple explanation:

Winbox and VM network adaptors don’t work together. This is confirmed by me with Oracle VirtualBox, but others have the same problem with other VM providers too.
Took me the best part of three hours to find this out.
Officical confirmation here.

17
Aug

Gah, Damn, Sod It.

   Posted by: dave   in General

Microsoft Visual Studio (up to 2008, don’t have 2010 so can’t test it) don’t support unicode correctly.
They expect to see UTF-16LE encoded text (must have the correct format BOM too).
If you present them with UTF-16BE (with the correct BOM) then they corrupt the file by assuming it’s LE encoded.
This means that a file written using perl with the :encoding(utf-16) will not be read correctly, you’ll get garbage in the editor, and the compiler will emit strange errors.
If the file is output from perl using the :encoding(utf-16le) method, then the file is *still* corrupt. However, this time it’s Perl’s fault as it’s not written out the BOM to the file.
This last point is relatively easily worked-around in perl, but it’s still bad that it’s not standards compliant, just like Visual Studio isn’t.

Gah! We can’t win.

29
Jun

Windows 7 & ipv6

   Posted by: dave   in General, Software, Techie Stuff

My windows 7 has been native ipv6 (dual stacked with legacy ip addresses) for quite some time. I’ve only just discovered how to get it to use a static IPv6 address over the autoconfigured IPv6 address (the reason is that the statically allocated ipv6 address is way more memorable than the MAC address of the windows 7′s wireless adapter).

Anyway; basically Windows 7 likes to use the autoconfigured ipv6 address in preference; we need to tell the stupid thing that the static one should be the default.
In an administrator command prompt, type:

netsh interface ipv6 show interfaces

And look for the interface name for the adapter that’s currently connecting you to the internet.

Using this name, type in the command:

netsh interface ipv6 sey interface "<interface name>" advertise=enable managed=enable

Replace <interface name> with the name you found in step 1.  Keep the quotes, lose the angle brackets.

This will tell windows that you really know what you’re doing, and it can use the ipv6 address in the network connection’s ipv6 static dialog box (which you’d already configured fully, right?) and forget about that monstrousity it auto generated from the MAC address.  Job done.

Clicky

The link gives all information required to change where windows 7 looks to find out what the status of the currently connected network is.
I wish I’d have thought of doing this earlier – it occurred to me that it *must* be sending probes out somewhere, but I never followed the thought up :(

4
Jan

Testing syntax highlighter

   Posted by: dave   in General

1
2
3
4
5
6
#include <streams>
 
int main(int argc, char * argv[])
{
   cout << "Hello World!\n";
}

Well, that works ok. Except that wordpress seems to insert a space between the stream output operator characters. And also thinks that <stream> is an HTML tag that needs closing. So it’s a bit of a nightmare really. But I think it’s workable. Not that I’m planning to put code up here, of course…
EDIT: Solved. Use the attribute ‘escaped=”true”‘ and use only HTML entities in the source. Coolio. Excellent plugin. WP-Syntax

7
Jul

Spammer accounts deleted.

   Posted by: dave   in General

Some of you may now be account-less, for which I’m sorry. A load of spammers just created 360 accounts on this blog and I’ve had to do a bulk-erase. Any of you that have had your accounts deleted by accident, I’m sorry.

12
Apr

IPv6 is here – happy days!

   Posted by: dave   in Techie Stuff

Well, ipv6 works. This may not come as a big surprise to some of you, but more specifically, I’ve got native IPv6 working on my ADSL line. Thanks to my ISP, I’ve managed to set up the ADSL modem to be bridged, and my main router uses PPPoE to connect to them to achieve connectivity.
The router is an RB750 which for 40 quid all-in is quite a bargain, by the way – and in version 5 of the OS it runs, it’ll do ipv6 over ppp! So I got the allocation from the ISP, plugged in the relevant things into the router (not forgetting the all important ::/0 default route to direct packets up the PPPoE link, thanks to Michael for the tip) and it’s all working.
ipv6.google.com resolves, connects, and displays a page.
Even better, so does http://www.ipv6porn.co.nz/

6
Apr

IPv6 on the horizon

   Posted by: dave   in Techie Stuff

In the latest of the sporadic updates, I’m preparing my home internet for IPv6 with the little routerbox. I’ve enabled PPPoE logins, and my ISP is preparing a set of IPv6 addresses to route at me. With any luck, I’ll be IPv6 enabled by next week. This site is hosted elsewhere, I’ve got no idea when they’re going to do their migration, but all my sites hosted at home will be available on the next gen internet protocol.

Oh, and advice to ZyXEL P660R-D1 ADSL modem owners: If you’re thinking of going from routing mode to bridging mode (for PPPoE clients behind the modem), do a modem reset beforehand – my device failed to work in PPPoE bridging mode until I’d factory reset it. I suspect that this was down to the fact I’d got static routing rules in the device, but I can’t be sure about that, and I am disinclined to debug the kit.

Good times!

15
Sep

New router update

   Posted by: dave   in Techie Stuff

The Routerbox 750 has arrived, and is now configured.  The packets that comprise this post are flowing through it now :D

It’s different enough from anything I’ve seen before that the specifics of it threw me for a bit, but it’s all configured and works.  And it’s way faster than the old firebrick was – I’m seeing webpages load a lot faster than they did before, it’s actually a very noticeable speedup.

The only thing I need to say to anyone getting one is that the default gateway is a pig to make work – it’s not just good enough to put in the IP address, you have to also populate the interface too.  But that done, it’ll work like a champ.

I’m a happy camper :D

10
Sep

New router

   Posted by: dave   in Techie Stuff

I’m in the market for a new router at the end of the month, I think; the one I’ve got is yonks old and it’s routing speed isn’t brilliant.  Superb web configuration, dead easy to use, but it’s throughput is limited to 10Mbit/S.  This was plenty fast enough in the days of ADSL, when 8Mbit/S was all we could get into the home, but these days it’s a little bit slow, what with line speeds being up to 21Mbit/S (on BT’s ADSL anyway).

I think I’ve narrowed the choice down to one of these routers from mikrotik.com; there’s a couple of resellers in the UK.  Couple that board with one of their wifi adapters and it’s a neat little 197Mbit/S router – should be futureproof unless I get fiber to the home at some point ;)

Ok, it’s a bit DIY, but I don’t have a problem with that.  I quite fancy a nice handmade teak box for the thing…

UPDATE: One of the UK distributors is selling the RB750 for £39 including a box, the OS, PSU, P&P and VAT. For that price, I’ve bought one.  It’s slower than the 433AH (above) but it’s still in the same ballpark.  Good enough for what I want, and cheaper if I don’t like it, and end up getting rid…

Most of you aren’t going to care about this post, you can safely ignore it, but I need a semi-permanent place to store such vital information so that I’ve got it available in future.  Sorry people ;)

In the 64 bit kernel debugging session, issue the command:

!load wow64exts.dll

Then, to switch between the 32 bit and 64 bit contexts, issue:

!sw

Simples!

5
Aug

w00t!

   Posted by: dave   in General

ADSL2+ has been enabled on my phone line (last night, interrupting a chat with a friend on MSN, grrrrr) so I’m now looking at 13.5Mbit/S download and 1.8Mbit/S upload.  For no extra cost, in fact it works out cheaper as my peak time allowance has been raised by a gigabyte.

I’m a Happy Bunny.

EDIT: The line has now stabilised at 21Mbit/S down.  And I’d misread the “up” figure before.  It’s actually 992Kbit/S.

4
Aug

Handy camera gadget

   Posted by: dave   in Photography & Cameras

For those of you with older cameras, although the affliction seems to be limited to Canon DSLRs, you may be finding the price and size of CF cards to be a bit, well, inflated.  The final nail in the coffin was that my new laptop has got an integrated SD card reader in it, and whilst I have a USB CF card reader, it’s a pain in the neck to use properly.

So, enter the CF to SD adapter.  It’s the size of a Type II CF card (the big one, with the step on the top; you know, the slot type used by the IBM microdrives), and it has a slot in the side that takes an SD card.

Twenty quid from Maplins, part number A47FF

And in the camera (Canon EOS 40D) I’ve got, it works with an 8GB  SD-HC card, despite what the staff answer to a question said.

7
Nov

“Finally!” I hear you cry.

   Posted by: dave   in General

I got bored of the plain old theme on the website.

This one seems a little more interesting.  We’ll see how long it takes me to get bored of it.

4
Oct

Tomtom GO 720 not finding mp3 files?

   Posted by: dave   in Techie Stuff

Couldn’t find this on any forum on t’internet, so thought I’d post it here just in case it helps someone.

If your tomtom go 720 won’t find MP3 files after having copied them onto either the onboard flash disk, or an SD card (IMHO the most sensible thing to do), then there’s every chance you’ve been stuffed by the new ID3 tag formatting.  The new format just simply isn’t recognised.

The solution?  Download mp3tag and use it to remove the new ID3 tag, leaving behind a version of ID3 tag no more than version 2.3; this is the version of ID3 tag that I’ve currently got, and all MP3s are recognised by the tomtom.  It’s a bit of a pain in the neck, but at least there is a solution.