Skip to main content

Deploying a react app to azure blob storage websites with azure devops

Back in August of this year Microsoft announced static websites for azure blob storage. So this is the same feature AWS' S3 has had for years. Essentially make a blob storage folder public, and redirect / paths to /index.html internally. Also, register 404 pages. Before we had this we use to deploy our files to App Service or do some weirdness with functions to rewrite urls. For static pages this can really bring costs down in the cloud

Continue Reading

Making alexa skills in .net

Ok so I've been in the alexa skills market recently, and obviously amazon wants you to use AWS Lambda for your skills. If you are like me, you have a ton of stuff in azure app service (the PaaS of azure). Azure app service supports nodejs, java, python, and of course .net. The two sdk's amazon ships (node, java) do not tie in with a web stack, and are obviously thought of as being used with Lambda.

Continue Reading

Parsing cli arguments in dotnet core Console App

tl;dr view this gist

So its 2016, and we are still making console apps/cli's. In fact I would say there has been a surge in popularity of these types of tools. I think we have come to the realization that buttons on forms are not automatable, and that the command line doesn't have to be scary.

I recently started writing an app in dotnet core, which is the new runtime for dotnet. In the past I have often used command line parser, but as of this writing it does not support core.

I was really lost trying to find an arguments parsing library when I realized the dotnet cli was open sourced.

After much struggle, failing to bingle. I started ripping through the Entity Framework, and dotnet cli's code hoping to find a gem. Thats when I stumbled across a diamond. You see many dotnet projects use Microsft.Extension.CommandLineUtils to do cli parsing.

Continue Reading

Migrating Ghost blog to hexo

I recently ported my ghost blog to hexo, and it was pretty easy.

Checkout my other hexo blogs:

Getting Started with hexo

To get started with hexo run the following commands:

  • npm install -g hexo-cli
  • hexo init
  • npm install

This will drop many files, and folders. The primary one we are going to talk about is the _config.yml. You will want to start by filling out the _config.yml file. Name your blog, give a descripton, etc.

Porting your blogs over

To get your data over you will need to go to this url: http://yourblog.com/ghost/settings/labs/ and click the export button. Place the json file at the root of your hexo blog, then run.

  • npm install hexo-migrator-ghost --save
  • hexo migrate ghost NameOfYourExportFile.json

Your posts should drop in the posts folder, but the tags will need fixing. Open atom (or another editor that can do find replace in a directory) and replace tags: | with tags: in all the files.

Now that it is done we need to fix the paths to your images. Download your images (if you are using azure you can get them via ftp), and place the folder in the source directory.

Now run hexo server, browse to port 4000. Your blogs should appear.

Backward compat. urls

We need to make some modifications to make sure the urls are backward compatible.

Set the tag_dir to tag, in ghost the path to tags is /tag.

if your post urls were just /Title then put :title/ in the permalink setting. Otherwise adjust the urls for the proper date format.

RSS

You will want to have an rss feed. You will want to npm install hexo-generator-feed --save

You can then add the following to your config.yml

feed:
    type: rss2
    path: rss
    limit: 0

If you were like me you registered your ghost rss feed to /rssinstead of /rss.xml. I have no perfect answer to fix this, but I used azure's Url redirect to redirect /rss to /rss.xml.

<configuration>
  <system.webServer>
    <rewrite>
          <rules>
              <rule name="SpecificRewrite" stopProcessing="true">
                  <match url="^rss$" />
                  <action type="Rewrite" url="public/rss.xml" />
              </rule>
          </rules>
  </system.webServer>
</configuration>

If you are using github pages you can use the jekyll-redirect-from gem.

Continue Reading

Hosting hexo in azure webapps

If you have read this blog for any length of time, you know I am a fan of Azure. I thought about using github pages with hexo, but github pages only supports 1 doman name. I could start 301 redirecting my other domains, but I really didn't want to do that.

Continue Reading

Why I moved from Ghost to Hexo

Blogging right? I can't believe I somehow stuck with it all this time. Even when I took a long break I still kinda blogged. I got started after being ~~convinced~~ inspired by a coworkers passion to start blogging. To say the least he, and I have very similar tastes, and he turned me on to ghost, and the ghostium theme. After a year and a half of Ghost blogging I have left Ghost.

Continue Reading

Saying goodbye to my VPS (..and my opinions of cloud providers)

I have used Linode for quite a long time now. My blog was hosted on linode, as was my StarBound server. My linode was the CentOS Pet I always wanted. Full of manual Fail2Ban configs, I make sure I fed my VPS every day. I even used cowsay to give me a cool message from my pet every login.

The major reason I moved my things away from Linode, was not the devops story itself. I could have stuck with linode, and used chef or something to manage my former friend. I decided to host everything in Azure Web apps. Now before I give you my long ramblings why I like azure; I must tell you. I put everything in azure, because my MSDN gave me free credits. There was no huge scientific analysis behind this. The simple fact that I got free money in Azure was the only reason why I started using it.

Continue Reading

New Series: Windows myths debunked!

Over the last 8 years the demand to scale has ever increased.

We have gone from curating machines like your favorite pets, and started spinning up, and destroying VM's at an ever increasing pace.

As engineers the Unix like platforms, have always been easier to work with. Personally I enjoy linux, I love package managers, I love ssh, and configurations are much easier. That being said, lately I have been interacting a lot with Windows servers.

Continue Reading