Latest Publications

SCP and filename spaces

An issue that pops up for me occasionally is that scp doesn’t much like copying filenames that contain spaces. When you use the scp command, even in quotes – the result is that scp treats each space as a separate file.

Thankfully, there is a way to easily fix this. You need to enclose the filename in two sets of quotes. I’m guessing that one is for scp itself, and the other is for the target machine to resolve:

scp user@remote-pc:"'/home/user/my long filename'" ./

Notice that the path is wrapped in single quotes, and then the single quotes wrapped in double quotes. This seems to resolve the issue nicely, and still works with directories as well.

Reset your MediaWiki Sysop Password

When you’re stuck without sysop access to MediaWiki because you cannot remember the sysop details then there’s a handy maintenance script that’s available (if you’ve used the package manager) to reset the sysop username and password.

On Ubuntu server you can run the following command:
php /usr/share/mediawiki/maintenance/changePassword.php --user=sysop --password=password
The script will immediately reset your sysop username and password with what you have entered above.

Now you can log in without any problems!

Edit files with Notepad++ From Anywhere on your Network

Notepad++ is a very handy tool. It rocks.

What is annoying is that if you have it installed on a server, then you have to run NPP before opening the intended file that you want to edit.

Well, no more! Using the power of Group Policy Preferences (which also rocks).

First of all, install NPP onto your server but install it into a shared folder that you can access.

Next, open up Group Policy Management and edit the group policy that your user account is in (or those that you want to enable).

Open up User Configuration > Preferences > Windows Settings > Registry.

Crete a new registry setting:

Hive: HKEY_CURRENT_USER
Key Path: Software\Classes\*\Shell\Open in Notepad++\command
Default: ticked
Value type: REG_SZ
Value data: "\\server\share\notepad++.exe" "%1"

Then log onto a computer and right click on all of those files! Yey!

From the BlackBerry!

Just putting in my first post using the official Wordpress for Blackberry software.

About time, too!

Although only a beta version at the moment, it’s working nicely and I think that this will be one of my must have apps when i’m on the move!

IIS and those pesky Flash files

Doesn’t it drive you mad when you set up an IIS server in Windows and you forget to add Flash files to the MIME types? You end up debugging what you think is some scripting problem only to remember about 2 hours later that IIS’s file support out-of-the box leaves a lot to be desired.

Well, I can’t stop you or me not wasting time, but I thought that I’d collect up file types here for reference:

Flash
Extension: .flv
Content type: video/x-flv

7-zip
Extension: .7z
Content type: application/x-7z-compressed

Some Useful Ubuntu Commands

Here’s a useful guide for some IT people that are getting into Linux, and more specifically Ubuntu.

Basically, it’s a reference for Windows users to do Linux-type commands. I’ll be adding to this post as time goes on.

Shell Commands

sudo -i set the command shell to have root privileges

Networking Commands

ifconfig shows network information (ipconfig in Windows)

ifdown eth0 && ifup eth0 restart your network adapter and get new IP address

ifconfig eth0 192.168.99.14 netmask 255.255.255.0 up change your IP address

route add default gw 192.168.99.254 set the default gateway

System Commands

init 0 shutdown

init 6 reboot

dmesg print diagnostic messages from the kernel

Disk tools

df Show a summary of disk usage

du Show a directory tree space usage (some nice modifiers in this :) )

Services

invoke-rc.d service restart Start / Stop a service

update-rc.d service defaults 99 Add service to startup scripts

Flash

sudo dpkg-reconfigure flashplugin-installer Reinstall Adobe Flash