Synology and Drush 8.1.16 – Finally Working

Yep, it’s Tech Monday on a Wednesday again…

Okay, so I’m lumbered with these Fisher Price “My First Server” things.  They run Linux (Yay!) but a strangely butchered and hobbled version (Boo!) and as I need them to run Drupal, I need to get some things working properly.  And, of course, they don’t have APT or RPM on there, that would be too easy.  And by “things”, I mean Drush – essential for command line maintenance of all your Drupal sites.

Apologies for the technical nature of this post, I didn’t have time to paint it or build it to scale.

First thing needed is php7.  Synology has a package for php7, so that’s not a big problem.  It’s currently stuck at 7.0 but I expect we’ll see 7.1 and 2 soon (for a certain definition of “soon”, it took them long enough to get MariaDB 10 on there).  Install that package and you’re good to go forward.  Once the package is installed, nip into the configuration website and enable ALL THE EXTENSIONS EVER.

Drush itself.  First off, I had to create my own home directory as somewhere to put things that stay vaguely safe between DSM updates.  Weirdly, my Synology boxes didn’t create home directories for users (you know, the way normal operating systems do), so there were chunks of things always throwing errors.   Do this for your username…

sudo mkdir /volume1/homes/<username>

Sorted.  Golden.  Etc.  You’ll probably need your root password to do this, then you’ll need to chown it to your user before you can use it properly…

cd into that directory, head over to http://docs.drush.org/en/8.x/install/ and grab the latest 8 release from GitHub.  At time of writing, it’s 8.1.16

Okay.  This is where it gets technical.  More technical, sort of.

Sure, you could just run

php70 ~/drush.phar pm-update

But (a) it’s tedious to type that in all the time and (b) it’ll fail because pm-update calls php pm-updatestatus and that’ll fail because php is not the same as php70 and doesn’t have all the extensions installed.

So we need to perform some surgery in /bin.

Step 1.  Get /bin/php to point to the *right* php.

sudo su
<password>
cd /bin
mv php php56
which php70
(assuming /usr/local/bin/php70, if not then substitute appropriately)
ln -s /usr/local/bin/php70 php
exit
php --version

Now when you run php –version you’ll see a lovely, shiny, 7.0 there instead of the dull, old, tedious 5.6.

Step 2, get Drush in place.

sudo su
cd /bin
cp /volume1/homes/<username>/drush.phar drush
chmod a+x drush
exit

Now you can run drush from anywhere on the server, without having to specify a version of php or a location for the drush.phar file.  Ain’t that a treat!

And if you’re being clever, you’ll see that you could have both drush 8 and 9 installed at the same time – just have different filenames in /bin – you could have “Doctor” running drush 8 and “Master” running 9.  Jeeves and Wooster.  Armstrong and Miller.  Bonnie and Clyde.  Any pairing you like, really.  Or you could be boring and have “drush8” and “drush9”.  Up to you, really.

Word of warning 1 – If you do this to /bin/php it will alter your default command line php for everything.  Shouldn’t be a problem, in fact it will probably make life easier.  But worth bearing in mind if you suddenly start getting weirdness with scripts you’re triggering through cron jobs (and don’t get me started on Synology’s implementation of cron, that makes no sense).

Word of warning 2 – There will come a day when, totally unexpectedly, you’ll type “drush” and your Synology box will reply with “What the f*ck is drush?” Or the Linux equivalent, usually a bit more polite – imagine Jeeves stepping smartly yet unobtrusively forward, coughing politely, whispering “I’m terribly sorry, sir, but I can’t find that command”, then stepping back into the butler’s pantry.  This means your Synology box has updated the Disk Station Manager software and reset ALL of your configuration tweaks.  Go back into php.ini and reset that max_upload_size from 32M again.  Fix those timeout values.  And redo steps 1 and 2, above, assuming you’re lucky enough to still have a home directory with drush.phar in it.

If this has helped you, good.  And I hope you find a way to get to a real server sooner rather than later!

Harira – Moroccan Chicken Soup

There are about as many variations on this recipe as there are families in Morocco, or so I’m told.  This one came to me through a book on world street food and takes a little preparation – but some of that can be short-cutted if you’re in a rush.

It’s rich, hearty, winter-warming, and I can’t make less than a small vat of the stuff.

Serves a family of 7 comfortably.  If you want to make more, use the quantities in brackets to serve a churchful of hungry lent-lunchers and still have enough left over to feed the family that night and over the weekend to come.  Seriously, I can’t seem to make a small quantity of this stuff.

Quick spin round the ingredients, Clive, then back to me.

  • 1 (2) Medium chicken (1.5kg ish)
  • 2 (8) tbsp butter
  • 2 (8) tbsp olive oil
  • 2 (6-7) large onions, sliced
  • 6 (all the garlic in the house) cloves garlic, finely chopped
  • Salt and ground black pepper to taste
  • 1tsp (4) ground turmeric
  • 1tsp (4) ground cinnamon
  • 2 (8) large, ripe tomatoes, diced
  • 1 (4) cup dried chickpeas
  • 1 (2-3) cup short-grained rice
  • 1/2 (2) cup plain flour
  • Parsley
  • 2 (6) eggs
  • Lemons

The night before you want to make the soup…

Pressure cook the chicken.  Put in the pressure cooker with enough water to cover, add a carrot (broken into chunks), a quartered onion (skin still on), 2-3 tsp salt and a dozen or so whole black peppercorns.  I like to sling in a teaspoon or so of ground turmeric at this point.  20 minutes on high pressure, allow to cool.  Strain off the stock and keep it, separate the meat from the bones – shred the meat and save that, all the squidgy bits of carcass (including the soft, pressure-cooked bones) can go to the dog.  He’s now your bestest friend in the whole world EVER.

You can shortcut this by buying cooked chicken and using chicken stock you’ve already got, but if you make your own stock you can control the flavours so much more.

Dissolve the 1/2 cup plain flour in a cup of water and leave it to stand overnight.  Not found a way to shortcut this one.  Answers in the comments below, please!

Put the chickpeas in a bowl and cover with water until they’re about 3-4cm under.  They’re going to absorb the water and expand, so check on them and make sure they’re still covered at some point.  You can bypass this by using 2 tins of chickpeas as they’re pre-soaked for your convenience.

The Main Method

Big, deep, pan.  We’re talking stock pot, jam pan, that sort of thing.  Well, we are if you’ve quadrupled the ingredients.  You can probably get away with something smaller, but not a lot.  Heat the butter and oil, fry the sliced onions and garlic until soft and translucent.  Add the turmeric, cinnamon, salt, pepper, and diced tomatoes.  Simmer this until it reduces to a gorgeous thick sauce.  Smells fantastic at this stage.  Add the drained chickpeas, rice, chicken stock.  Simmer until the chickpeas are cooked through.  This takes about an hour, less if you’re using pre-soaked chickpeas.

If it starts to stick and looks really gloopy, add more stock.  The final consistency is pretty thick and sticky, but you want to serve it by the bowl, not by the slice.  It’s amazing how much liquid the rice soaks up, so just keep adding a cup or 2 of stock as required.  Each time you add stock, check the seasoning of the mix.  Chicken is remarkably bland, it’s amazing what a pinch of salt and a grate of pepper will do.

2 man job, this stage.  One to stir, one to pour.  First, pour in the flour and water mix into the soup in a thin, steady, stream.  The second person at this stage is to keep stirring to ensure it’s thoroughly mixed as it’s added in.  If you can persuade them to keep stirring for the next 15 minutes, go for it.  Otherwise, dismiss them for now, but let them know they’ll be needed again in a quarter of an hour.  Stir frequently throughout the next 15 minutes.

Add the shredded chicken meat back in, mix thoroughly, give it a couple of minutes then take it off the heat.  Chop the parsley, add and mix.  Finally, beat the egg and get your assistant back.  Just as with the flour, pour the beaten eggs into the soup, stirring all the while.

Last, but not least, juice the lemons and stir the juice in.

Serve with chunks of fresh bread.

You can adjust and adapt this recipe with whatever you happen to have on hand.  Got a load a lovely, fresh, chillies?  Add them in!

2018 – Lock and Load

Welcome to 2018.  So far, looks comfortable enough.  Bit of padding around the waist, but nothing that a little diet (and a lot less C2H5OH) won’t solve.

Would’ve written this yesterday but was suffering from a little post-New Year pneumonia (as defined by Grand Tour, Season 2, Episode 1).

Christmas 2017 brought us some fantastic games that we’ve spent the holiday playing – these are games that all the family can play, for a certain definition of “all the family” – we’ve got just the 5 kids, so they’re games that can cope with 7 players, our youngest is 7, eldest is 17, and my wife and I are both significantly north of that so they’ve got quite a spread to keep us interested.  If you’re looking for fast, fun, family games, you can’t go wrong with:

5 Second Rule

Apparently we’ve got the “Junior” edition of this game, so I dread to think how hard the “Adult” version would be!  TL:DR – you’ve got 5 seconds to name 3 things as dictated by the card.  3 Superheroes.  3 things you do at school.  3 bands your parents’ listen to.  That sort of stuff.  Assuming you name 3, you get a point, play moves to the next person, and they’ve got to do the same – only they can’t repeat any answers.  Continue until someone fails completely and draw a new topic.

Now 5 seconds is not a lot of time and your brain can do some wonderfully creative thinking.  For “3 things with wheels” we had “cars, bicycles, er, er, er, buckets”.  For “3 birds” the first answer was “Herring”.

You play until someone scores 15 points, so the game moves along pretty quickly even with 7 playing.

Family score: 5/5

Slamwitch

Somewhere between “Uno”, “Snap”, and “Down the River”, this is a quick and simple card game, the aim of which is to collect all the cards.  Wasn’t helped by Thing 1 having honed her reflexes playing Irish Snap at school with her friends winning pretty damn quickly.  7 players is a bit many and, like “Down the River” when you get to 2 or 3 left in the game it can slow down.  Still, fun enough for the kids to want to play it again.

Family score: 3/5

Sussed – All Sorts

How well do you know your family?  Each player takes turns to read a scenario from their card, with a choice of 3 possible answers – e.g. “What would I most want to do? (a) Sky diving, (b) Llama trekking, (c) Archery”.  They make a note of their answer, everyone else playing picks one.  Move on to the next player.  When everyone’s done the 4 scenarios on their cards, you go back around the table and find out how well you know the rest of the family.  You score points for correct answers.

Turns out, not very!  Well, I don’t seem to know my wife or kids, my kids know my wife and I pretty damn well.

Family score: 4/5

Whot

The neighbours brought this round to play on New Year’s eve.  Another fast-moving card game, similar to Uno but less complicated.  Cards have a suit and a number, there are 4 suits.  7 cards each to start with.  Each turn you play a card that matches either suit or number, or you draw a card if you can’t play. There are “Whot” cards that match everything and allow the player to change the suit.  Play continues until either (a) no-one can play or (b) someone plays all the cards in their hand.  Then you total up the points scores of the cards you’re left with, jot it down, deal passes 1 player left, and you continue until you’ve gone round everyone.  Winner is the person with the lowest score.

Simple?  Yes.  It doesn’t have the reverses or skips of Uno.  Fun?  Definitely!  Cries of anguish when someone changes the suit on you just as you’re about to play your last card!

Family score: 5/5, must get a set ourselves.

Fluxx

We brought this out on NYE after a few rounds of Whot, some Mao (I’ll have to get Thing 1 to explain that) and some poker.

If you don’t know Fluxx, it’s a card game that starts with a very simple rule:  Draw 1 card, play 1 card.  Other cards complicate things by changing the rules, actually setting victory conditions for the game, allowing you to steal cards from other players…  Great fun.

We’ve got “Classic”, “Eco”, and “Family” versions of Fluxx.  Thing 1 has “Cthulhu”.  I’m rather keen to pick up “Dr Who” and “Monty Python”.  They all have their own little variations on the rules, but the classic is just that

Family Score: 4/5

Looking ahead

Got some good gaming ideas for 2018.  We’ve got a couple of games from Christmas that we’ve not had a chance to play yet – Sherlock Holmes, the card game, for one.  We’ve got a few RPGs on the shelf that we need to play – Tales from the Loop, Traveller, Space: 1889, Timewatch.  They’re all going to get outings in 2018.

What are your gaming hauls from Christmas?