Skip to content

Instantly share code, notes, and snippets.

View robconery's full-sized avatar
😍

Rob Conery robconery

😍
View GitHub Profile
@robconery
robconery / jsonb.js
Last active April 21, 2021 08:10
A Simple JSONB Module for Node
const runner = require("./runner");
const transformRecord = function(record) {
if (record) {
const doc = record.doc;
doc.createdAt = record.created_at;
doc.id = record.id;
return doc;
} else {
return null;
@robconery
robconery / ghost_azure.sh
Created April 10, 2019 01:42
Create a complete Ghost Website on Azure with Domain Assignment
RG="BLOG"
APPNAME="conery-ghost"
IMAGE=ghost
DOMAIN="ghost.conery.io"
DB_USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
DB_PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
DB_SERVERNAME=server$RANDOM
#You can get a list of locations by running
#az account list-locations --query [].name
tag:
git tag -l "deploy-$(date +%Y-%m-%d-%T)"
commit:
git commit -am "Deploying $(date +%Y-%m-%d-%T)"
build:
bundle exec middleman build
deploy: build commit tag
@robconery
robconery / azure_ghost.sh
Last active January 28, 2020 10:10
Deploy Ghost to Azure Services
RG="azx"
APPNAME=$RG-ghost
LOCATION="Central US"
#Recommend to keep these random, but if you need to change go for it
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=server$RANDOM #this has to be unique across azure
@robconery
robconery / azure_wordpress.sh
Last active August 24, 2020 19:14
Spin up Wordpress on Azure Using Managed Services
RG="[YOUR RESOURCE GROUP]"
APPNAME=$RG-wordpress #Name what you want
LOCATION="Central US" #put where you like
#Recommend to keep these random, but if you need to change go for it
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=server$RANDOM #this has to be unique across azure
#accepted values for the service plan: B1, B2, B3, D1, F1, FREE, P1, P1V2, P2, P2V2, P3, P3V2, PC2, PC3, PC4, S1, S2, S3, SHARED
@robconery
robconery / azure_postgresql_deploy.sh
Created October 1, 2018 19:32
Deployment script for Azure PostgreSQL
#!/bin/bash
#These are the settings for deployment. The only thing you need to be sure you change is
#the resource group, as that will be the name you will use to destroy things later
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
LOCATION=westus
SERVERNAME=northwind-$RANDOM #this has to be unique across azure
#resource group
@robconery
robconery / azure_postgres_tryout.sh
Created September 14, 2018 23:30
Spin up an Azure PostgreSQL database
#!/bin/bash
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=[YOUR SERVER NAME] #this has to be unique across azure
#resource group
RG=[YOUR RESOURCE GROUP] #you can create these if you need to by uncommenting the lines below
@robconery
robconery / azure_webapp_setup.sh
Last active November 23, 2023 08:31
az webapp creation
#!/bin/bash
USER=deployer
PASS=[pick something]
APPNAME=[your app name]
RG=[your resource group]
SP=[your service plan]
#you can see a list of runtimes using
#az webapp list-runtimes --linux
@robconery
robconery / register.sql
Created December 29, 2017 01:49
A PLPGSQL Register Function
CREATE OR REPLACE FUNCTION register(login varchar(50), email varchar(50), password varchar(50), ip inet)
returns TABLE (
new_id bigint,
message varchar(255),
email varchar(255),
email_validation_token varchar(36)
)
AS
$$
DECLARE
@robconery
robconery / install_dncore.sh
Last active July 1, 2017 16:19
dot net core installer for Cloud9
#!/usr/bin/env bash
############### USAGE ###############
#
# 1. Create a new workspace on Cloud9 using the "Blank" template
#
# 2. Run this command in the console:
# bash <(curl -fsSL https://gist.githubusercontent.com/robconery/aefb86f25ec794a2268cf38d44238352/raw/898f8997220df38de193d48c07c2fb078aede10a/install_dncore.sh)
echo Updating Packages...