David Huby’s Blog Technical and business stuff

2Nov/090

Forgot the root password on a Debian box?

The author points out that using single user mode on Debian is not the solution - but this is very simple and straightforward if you are able to edit the boot configuration in grub on your Debian box.

http://www.debianadmin.com/how-to-change-root-password-in-debian.html

Tagged as: No Comments
21Oct/090

Smarty’s nl2br How to replace newlines with HTML breaks

Replacing newlines with breaks is as easy as
{$variable|nl2br}

http://www.smarty.net/manual/en/language.modifier.nl2br.php

Tagged as: , No Comments
13Oct/090

Match a keyword recursively in php files

grep -R --include=*php my-keyword .

Tagged as: No Comments
12Oct/090

archive (tar and gzip) with timestamp in bash

#!/bin/bash
tar zcf "$1-archive-$(date + '%F-%H-%M').tar.gz" "$1"

Filed under: Sysadmin No Comments
27Mar/090

OpenOffice Calc, numbers blue and formulae green!?

With so many shortcuts come many opportunities to execute a command unintentionally. At some stage in the last few days I hit Ctrl+F8 in OpenOffice's Calc application, and all the numbers on my spreadsheet turned blue, and all formulae turned green. I was wondering what had happened for a while, I hope this post saves someone time.

You can turn off the feature by pressing Ctrl+F8 or clicking on "Value Highlighting" in the View menu.

Filed under: Uncategorized No Comments
25Mar/090

Windows Powershell recursing, regular expressions, and sorting

On a project I'm currently working on, I was looking for unused JavaScript files in the scripts/ subdirectory. The easiest way to do this was by checking for references to these files in all other files in the project.

PS E:\projects\source\tickets\trunk> Get-ChildItem Website\* -recurse | Select-String -pattern "scripts\/.+js" |% { [regex]::Replace($_, ".*(scripts/.+js).*", "`$1" ); } | sort -unique

Tagged as: No Comments
15Mar/090

Wireframes considered harmful … under some circumstances

Web Standards Group Sydney presentation: On the 11th of March 2009 Tom Voirol spoke about an alternative development process for websites.

Tom said wireframes are harmful. But he didn't really mean it. What he was trying to say was that you shouldn't present the customer with wireframes and expect them to understand them in the same way we do as designers and developers. Customers don't speak the language of wireframes.

Tom suggested that we should create high fidelity prototypes to present to our customers.

Slides

15Mar/091

Raphael Vector graphics in Javascript

Web Standards Group Sydney presentation: On the 11th of March 2009 Dmitry Baranovskiy presented Raphael, a vector graphics library for JavaScript.

  • supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ (via SVG)
  • supports Internet Explorer 6.0+ (via VML)
  • works in Chrome but it is quite buggy
  • Website
  • Twitter
Tagged as: , 1 Comment
1Mar/090

Apache displaying PHP source – update httpd.conf

If Apache is displaying the source of your PHP files, try adding something similar to your MIME module in httpd.conf:

Note - this refers to PHP5 & Apache 2.2. Ensure you are using the correct binary (php5apache2_2.dll) for your php / apache combination.

LoadModule php5_module "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin\php5apache2_2.dll"

AddType application/x-httpd-php-source .phps

AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt
Filed under: Sysadmin No Comments
22Feb/092

Subversion bindings for Trac – Windows installer

It took me a while to find the Windows installer for the subversion bindings for Trac...

Apache 2.2 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100

Apache 2.0 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91

Filed under: Uncategorized 2 Comments