PowerShell, DigitalOcean and WordPress

Categories: PowerShell Projects

Back in May (2014) I decided to start up a blog, again. I decided to keep it simple and just get a off the shelf hosting package rather then going to extremes like I normally do – configuring a VPS or even a Dedi server! I ended up going with CS New Media – it was just their lite Linux package which I signed up for 3 months. I was tempted to stick with what I know and go with Mythic-Beasts like I normally but I like to tinker and try new things so I went with CS New Media after a failed attempt to spend my dosh with NameCheap – when it came to entering my card details, it just failed to connect to “their” backend and their response was, well it works for me, try another browser – by the time I phoned them I had already tried different browsers, internet connections, computers so at that point I just walked away.

Anyway fast forward two months and I was getting ichy to move away from CS New Media – nothing wrong with them, a bit of downtime, but nothing major and it was all stupid-o-clock, performance was ok, nothing special and support – well I never used it so, can’t comment. Using Plesk was a blast from the past – that was the first web control panel I ever used, so it was nice to see how it’s improved.

Problem was, where do I go, well Mythic-Beasts had fitted SSDs into their web servers since I’ve hosted with them, tempting. Then DigitalOcean did it. They announced a new data centre. In London. With IPv6. And they have that sexy API. Ooo and I have credit with them for some reason or other, happy days. I decided to take it slow and script the whole process – I’ve been playing with PowerShell lately, so I created a PowerShell script that creates the DNS records, builds the droplet. I’ve even managed to get it to convert the Putty public SSH key into OpenSSH format so DigitalOcean will accept it and I can use SSH keys to connect to the server. I was planning on scripting the build process of installing the LEMP stack – but I lost interest to be honest and enough already exist.

Net result, it’s got my PowerShell knowledge up – all the codes in my GitHub repository. One of the off-shot projects of the project was a PowerShell function to generate secure passwords, the idea was my DigitalOcean PowerShell script would generate passwords for your newly created droplet – MySQL root password for example, store it as say CSV on your local machine and only pass the password as an argument to the stack install script over SSH – so it wouldn’t get stored on the remote server discs.