Mounting Windows Shares with cifs in Debian Squeeze

openlogo-ndI run Debian Squeeze with Gnome 3 on a laptop. I mainly use this to offload my e-mail from the main machine, where I can concentrate my workflow across two screens without the constant need to ALT-Tab. This means that there is a need to share files between the Windows desktop machine and Laptop, using regular windows file shares.

I had a series of “bookmarks” that allowed me to access various Samba shares. These bookmarks (GVFS mounts) are configured in Nautilus, and really simple to set up. Unfortunately, they are not so easy to use; you can’t drag and drop a file from a GVFS share into a non-supporting application (such as Google Chrome), and they don’t usually generate file previews in nautilus either. This could be due to the fact that they use protocol addresses (e.g. smb://)? That means that I was having to copy files—from the shares to a local directory—before being able to work with them.

Filed under Tutorials

I’m Taking Part in Movember 2013

MO13 Primary Logo Ranged NEG copyThis year I am participating in Movember. I know a few people who have done so in the past, however it’s a team effort with everybody at Juicy Media taking part. Participation is not at all difficult, I don’t have to run (or walk) a marathon, so there was no excuse but to sign up and get on with it. The only downside is taking those awful “selfie” photos; vanity aside my front-facing camera seems to be awful for the purpose.

Filed under News

Disconnecting EGit from a Project in Eclipse

Eclipse LogoI have been using Git a lot more recently. Eclipse PDT is my editor of choice, and EGit has eased the transition to a version control centric workflow. Some of my project development environments are accessed via a Samba network share; unfortunately Git over Samba is sub-optimal at best. For a larger project I have been working on, a full repository refresh could take up to 30 minutes. This is obviously unacceptable, especially if you hope to commit often or create / switch feature branches.

Filed under Tutorials

Twitter Widget for WordPress

Twitter LogoI switched to the Jetpack Twitter Widget a year or so ago. Since Twitter fully switched to API version 1.1, as many developers know they now require OAuth for integration. This means that the Jetpack Twitter Widget is no longer supported. I’m not a fan of the “official” JavaScript  Twitter widget, for a few reasons;

  • It requires JavaScript
  • It’s ugly as hell
  • It’s everywhere

There is also the timeline widget, which is also implemented as the successor to the original in Jetpack, but this isn’t a 1:1 replacement either. So I wondered how easily an OAuth-enabled version would be to both manage and implement.

Filed under Development, News

Responsive Layout for WordPress

WordPress LogoI’ve been working on a few tweaks to improve accessibility on mobile devices. Since obtaining a shiny new Samsung Galaxy Note 2, I’m finding myself using my mobile device more than ever. The redesign earlier last year allowed me to introduce some initial steps toward a responsive layout, but it was and still is an unfinished product.

I have finally got round to implementing sidebar folding at low resolution. I’m the using adjacent sibling selector (+), the :checked pseudo-selector, and HTML <input> hacks (<label>, radio and check-box <input> elements). This technique also works great for folding the main navigation at low resolution using a check-box.

Filed under Mobile

API Callback URLs and HTTP Authentication

When developing web applications that use APIs, it is usually necessary to have the development site accessible for API callback URLs. A good example would be when working with payment gateway systems, which typically post back success or failure of transactions. In this event it is convenient to use HTTP authorisation to prevent outside access (users, crawlers, etc.). The issue with this is that API systems don’t always work with the http://[user]@[password]:[url] method of manually passing through this authentication method.

Filed under Development, Snippets

Installing XHProf on Debian Squeeze

I was working on a project which was randomly failing to load certain views outside the development environment. It turns out that the system was running out of memory. After searching some of the error messages output by the script, I stumbled upon the xhprof PHP module. It was originally created by Facebook, and released under an open source license.

Filed under Servers, Snippets

Blueberry Slider with slideToggle workaround

I recently worked on a responsive design which required an image slider, with a toggle to “minimise” the block. Blueberry is a great responsive jQuery slider, keeping everything scaled correctly at any resolution I threw at it.

I needed to assign a slideToggle to the slider block, allowing the slider to be ‘minimised’. Unfortunately this exposes an issue where if you first minimise the slider, resize the browser window (causing ‘onresize’ to recalculate the slider dimensions), then slideToggle it back open, it will have calculated a zero height for the slider and will refuse to maximize until you resize the browser window again.

To trigger the slider’s size calculation, you need to trigger the ‘onresize’ event in the callback for slideToggle.

jQuery(button).click(function (e) {
	$this = jQuery(this);
		.slideToggle(250,function() {

This solution makes the transition noticeably less-smooth in the ‘opening’ toggle. It’s most likely down to the fact that the slider has zero height until after the transition, after which the resize kicks in and restores the slider to full size.

Filed under Snippets

Disabling Apache Server Signature

I have been trying to disable the server signature for a while, but I found that turning off the ServerSignature directive didn’t work for all servers. The signature might read something like:

Apache/2.2.X (Ubuntu) mod_ssl/2.X.X OpenSSL/0.X.X

If your server exposes this information, it’s easier for an attacker to compromise a system based on flaws in a particular server software version (especially if your server software is allowed to become outdated, or your distribution is slow to release security updates). By default, it will display this on error pages in plain text, and also present it as a Server header on every request.

To disable completely, you should set the following directives in your Apache configuration:

ServerSignature Off
ServerTokens Prod

via Nixtechnica

Filed under Snippets

Optimising WordPress: Caching

WordPress LogoMaking your site as cache-able as possible is vital to ensure a smooth browsing experience. WordPress in it’s basic form is quite efficient, when you compare it to code-bases such as Magento. Adding functionality such as plug-ins, media, themes and widgets all have a negative effect on performance. As part of the process of making this domain as efficient as possible, a number of caching techniques have been considered and employed.

Filed under Articles, Development, Web