Sharepoint solutions - stuck on retracting or deploying

I’m adding this here in the hope it may save someone a few hours of pain and hair-pulling. (i.e., what I’ve just been through.)

If you use solution management in Central Administration in SharePoint - you’ll be fairly used to the whole add-spsolution / install-spsolution / uninstall-spsolution / remove-spsolution stuff that you either run from Powershell or the GUI.

You will also be familiar with the fact that solution management depends on both the SharePoint Timer Service (SPTimerV4) but also the SharePoint Administration service. If either of those services are not running, you will not be able to deploy or retract any solutions. In normal operation, solutions will go in and out like a greased piglet, but, from time to time, things mysteriously stop working. (This is SharePoint after all.)

Read more

HP-Setup wifi network on HP M377dw

This had been bugging me for a long time. I have an HP M377DW laserjet printer and after setting it up on my wifi network there was a spare ‘HP-Setup’ network hanging around in my local area. When I recently added an HP Envy 500 photo printer which did the same thing I resolved to hide them.

I assumed it was something to do with Wifi Direct - a wifi-like protocol that allows you to printer directly to the printer without going through the main LAN. The idea is simple - you connect to the printer’s wifi network and away you go.

Read more

Create SharePoint Content Organiser rules programmatically with lookup fields

I’ve wittered on before about how much I like the content organiser in SharePoint. It’s really pretty handy. Even creating rules that target other content organisers is possible. (With a little trickery.)

But since it’s SharePoint, it’s not without its quirks. I like to do as much as my dev work programmatically as possible. Every now and then you think maybe you’ve hit something you can’t script and you’ll have to resort to adding a deployment step. I was close with this.

Read more

SharePoint + Visual Studio - cannot rename Feature folder

When you Add Feature in Visual Studio, it by default creates a ‘folder’ with some gubbins underneath it. By default this is Feature1.

This is pretty ugly, but you may encounter a scenario where you cannot rename it. It seems to be based on other characters that exist in the path of the solution/project. For instance, we tend to use full stops to delineate a pseudo namespace. Now amount of Right-Click > Rename will sort it.

Read more

MySQL on Raspberry Pi - allow connections from non-localhost

If you want to connect to MySQL from any device in your network that isn’t on localhost, then you may encounter an error:

MySQL error: Could not connect to any of the specified hosts

Bear in mind that e.g., a PHP web app or phpmyadmin will continue to work, since (assuming your web server such as Apache is running on the same server as MySQL) they’re technically running on localhost and will be able to connect.

Read more

Recovering files from broken Raspberry Pi - Part 2

This is the second part of a guide on recovering MySQL data from a broken Raspberry Pi.

Part 1: Rebuild the Raspberry Pi
Part 2: Recover the MySQL data and restore to the new environment.

With a newly functional Raspberry Pi, it was now time to try and recover MySQL data. Clearly this will only work if the SD card in the old Pi itself is actually functional and readable.

The good news is that MySQL stores its data on the file system in a reasonably compact and accessible format. There are a few differences in structure based on whether your database tables are in MyISAM or InnoDB format. This post assumes your tables are in InnoDB format (since that’s what mine were) but as far as I know, the only difference is that if your tables are in MyISAM format, then there’s no need to copy the ibdata* files over.

Read more

Recovering files from broken Raspberry Pi - Part 1

I have a Raspberry Pi 3 which serves solely as a MySQL server. It does have an important (production-esque) purpose but despite that… I didn’t have it backed up properly. Oops.

So when it spectacularly died the other day, and, um… production things… stopped productioning… I worried a little. Well after I changed my pants, I worried a lot.

Not so much about the server, or even in fact the data, but the structure of the databases.

Read more

Chaining Powershell commands - now with email alerts

I recently talked about some simple functionality to chain Powershell commands together so that you can time long-running processes.

I decided to take this concept a little further so that Powershell will send email messages at start and finish so I don’t need to keep checking for when a long-running process has actually finished.

The idea is simple:

  • You send a message when it starts
  • You run the process
  • You send a message when it ends

Note: this assumes you’re in a Windows domain environment with access to an Exchange server. In order to authenticate against Exchange, you obviously need a domain account and be aware, there may be some things about your Exchange environment that does not allow this functionality (e.g., no relaying etc.) If you’re not in an Exchange environment, you’ll need to set the SMTP server of whatever you’re using.

Read more

Quick tip: chaining powershell commands

Let’s say, for example, that you’re doing something that takes a freaking age. You need a long-running process and want to fire and forget, but for analysis purposes, want to know how long it took (without sitting there for hours watching and waiting for it to complete.)

The answer is chaining powershell commands together with get-date.

eg.,

get-date;somelongrunningpowershell.ps1;get-date

In this case, it’s the ; that chains commands together.

OK, that was actually a bad example, because if you’re running a script you’re in control of, then obviously you can do whatever you like and output the timestamps then:

Read more

SharePoint 2010 pain - splitting a large content database

I know, I know. SharePoint 2010. Bad. But here I am.

Much of the pain I have been going through over the last week or so is frankly caused by the biggest mistake that a someone designing a new SharePoint environment can make: not planning for data volumes. It doesn’t matter how many times your client tells you “ah, it’ll never grow that big, we won’t use it much” - ignore them, they are lying.

Read more