hexo missing the generate and server commands

Today I thought I’d try hexo on a new project. A few minutes in and I’d stumbled across a strange problem that took me 20 minutes too long to figure out.

If I ran $ hexo init my-project I could run $ hexo generate and get a compiled version of a new site just fine. The issue was I wanted to use hexo in an existing git project and so copied across the files I thought I needed manually.

Having moved and merged all the files I ran $ hexo generate but rather than getting a shiny compiled set of .html files, I got this:

$ hexo generate

Usage: hexo <command>

  help     Get help on a command.
  init     Create a new Hexo folder.
  version  Display version information.

Global Options:
  --config  Specify config file instead of using _config.yml
  --cwd     Specify the CWD

Ah, no generate command!! I Googled for the answer but came up short. I resorted to doing a diff on a clean hexo project v.s. my repository. The difference was that my package.json file had no “hexo” property.

A quick copy/paste of the hexo property and I was in business:

$ hexo generate

Usage: hexo <command>

  clean     Removed generated files and cache.
  config    Get or set configurations.
  deploy    Deploy your website.
  generate  Generate static files.
  help      Get help on a command.
  init      Create a new Hexo folder.
  list      List the information of the site
  migrate   Migrate your site from other system to Hexo.
  new       Create a new post.
  publish   Moves a draft post from _drafts to _posts folder.
  render    Render files with renderer plugins.
  server    Start the server.
  version   Display version information.

Global Options:
  --config  Specify config file instead of using _config.yml
  --cwd     Specify the CWD

TLDR: If your hexo generate/server command is missing, make sure package.json contains “{ hexo: { version: “x.x.x” } }”.

Error running dcpromo.exe, “The remote procedure call failed”

Its not something I do very often, but I had to replace a windows 2k3 server with a new 2008 one today. When running dcpromo I kept getting the same error, something along the lines of “Failed installing active diretory service binaries, failed with error: the remote procedure call failed.”.

There was nothing in the logs giving much away, but I did see that TrustedInstaller.exe kept crashing! Because of the RPC error I went down that route, checking the servers could communicate properly and that I had sufficient access rights for running dcpromo.

After a few hours messing around, I tried to run a windows update and got an error about being out of space. The server was only 10% full!!? This led me to the problem, it turns out the windows update service and dcpromo run under the same user, which has a quota of only 3GB. I increased the quota to 80gb and hey presto, I had a new domain controller on the domain! 🙂

phpMyDiff – Compare mysql database schema and data

At work I’ve been maintaining a number of development areas and needed a way to compare database changes so that I didn’t overwrite a clients changes with my new/updated data from developing a new feature.

There seemed to be many ways of comparing the schema of two databases, but nothing to compare the changes in data (unless I was looking in the wrong places). I decided to write something that would help me out and have released it publicly.

You provide the connection details of two databases (server, username, password, name),  select the tables you would like to compare and hit “Compare”. The resulting page is a list of all schema and data changes.

There are plans to style the application (at the moment its simple blocks and tables) and more importantly, allow you to select which differences you would like to apply before creating a .sql diff file.

If its something you’re interested in, trying check out the google code page for the project. Its currently in beta with better performance, stability and functionality to come!

phpMyDiff at Google Code

Change volume key step size in Ubuntu

At work we often listen to music off of my computer, so when the phone rings I have to quickly adjust the volume. Using the volume keys on my keyboard I could have the music either really loud or too quiet.

So, to change the effect the volume keys have:

  1. Press Alt+F2 to bring up the “Run” box.
  2. Type in “gconf-editor” and press enter.
  3. Select “Apps > gnome_settings_daemon
  4. On the right hand side you’ll have a single option named “volume_step
  5. Change the numerical value (6 by default) to a lower one (3 seems pretty good)


Ubuntu 9.10 Rhythmbox requires GStreamer element autoaudiosink to play mp3’s

I recently upgraded my work PC to Ubuntu 9.10 and in doing so lost the ability to play mp3s in Rhythmbox. When trying to play an mp3, rhythmbox would ask for a new plugin, but after looking, say it couldn’t find “GStreamer element autoaudiosink”.

After reinstalling gstreamer and rhythmbox a few times I turned to the Ubuntu Forums. The answer is in the following thread, but I missed it on first glance so thought I’d post it here: [ubuntu] rhythmbox 9.10 mp3

To save you reading through all the posts, to fix the problem after upgrading to 9.10 (not from a clean install), you need to delete your gstream preferences. Open up the terminal and type the following:

rm -rf ~/.gconf/system/gstreamer
rm -rf ~/.gstreamer-0.10

If you log off and back on again now, you should have mp3 playback in rhythmbox again. If that doesn’t work, take a look at the other suggestions in the ubuntu forum thread.