Skip to content

Instantly share code, notes, and snippets.

View Jlaird's full-sized avatar

Jeremy Laird Jlaird

  • Endeavor Business Media
  • Fort Atkinson
View GitHub Profile
# Query on id and return id, name and created date.
query
{
content(input:{id:21085626}) {
id
name
created
}
}
#!/bin/bash
set -o errexit
main () {
local url=$1
if [[ -z "$url" ]]; then
echo "ERROR:
An URL must be provided.
<?php
namespace Cygnus\ApplicationBundle\Command;
use Cygnus\ModlrBundle\Api\ModlrApi;
use Cygnus\ApplicationBundle\Utils\Helpers\ModelHierarchy;
use Cygnus\PlatformBundle\Kernel\PlatformKernel;
use Cygnus\ModlrBundle\Component\Utility;
use Aws\CloudSearchDomain\CloudSearchDomainClient;
use Algolia\AlgoliaSearch\SearchClient as SearchClient;
@Jlaird
Jlaird / Mongo-list-databases.js
Created September 5, 2019 14:29
List the content and asset counts
var dbs = db.runCommand('listDatabases').databases.filter(({ name }) => name.contains('_platform')).map(({ name }) => name)
dbs.forEach((name) => {
var content = db.getSiblingDB(name).getCollection('Content').count();
var assets = db.getSiblingDB(name).getCollection('Asset').count();
print(`${name}: ${content} content, ${assets} assets`);
})
/* 1 */
{
"_id" : ObjectId("5d2e28bc3e04b1e60e8b45aa"),
"model" : {
"id" : NumberLong(21078428),
"type" : "Platform\\Content\\Ebook"
},
"date" : ISODate("2019-07-16T19:42:52.664Z"),
"event" : "created",
"fields" : {
2019-05-02T18:19:47.192+0000 I WRITE [conn970] update ebm_ww_website.Redirects query: { from: "/about-us.html" } planSummary: COLLSCAN update: { $set: { from: "/about-us.html", to: "/page/about-us" } } keysExamined:0 docsExamined:157088 nMatched:0 nModified:0 upsert:1 keysInserted:1 numYields:1227 locks:{ Global: { acquireCount: { r: 111893, w: 111893 } }, Database: { acquireCount: { w: 111893 } }, Collection: { acquireCount: { w: 111803 } }, Metadata: { acquireCount: { w: 90, W: 90 } }, oplog: { acquireCount: { w: 90 } } } 71ms
2019-05-02T18:19:47.262+0000 I WRITE [conn970] update ebm_ww_website.Redirects query: { from: "/newsletter.html" } planSummary: COLLSCAN update: { $set: { from: "/newsletter.html", to: "/suscribe/email" } } keysExamined:0 docsExamined:157089 nMatched:0 nModified:0 upsert:1 keysInserted:1 numYields:1227 locks:{ Global: { acquireCount: { r: 113123, w: 113123 } }, Database: { acquireCount: { w: 113123 } }, Collection: { acquireCount: { w: 113032 } }, Metadata: { acquireCount: { w:
#!/bin/bash
# Total number of lines in file
filelines=$(wc -l < $2)
# Number of chunks in the array
split=$1
# Loop counter
counter=0
# Figures out skip based on lines and split
chunk=$(($filelines / $split))
@Jlaird
Jlaird / base-cms_add_DNS.sh
Last active May 23, 2022 16:20
Setup the default DNS for the new sites.
#!/bin/bash
if [ -z "$1" ]
then
read -p 'Please enter a domain: ' domain
else
domain=$1
fi
#########################################################
@Jlaird
Jlaird / add_newrelic_synthetics.sh
Created March 15, 2019 16:48
Adds domains into Newrelic Synthetics, just set your api key
#!/bin/bash
domains=(
"https://www.waterworld.com/industrial-water.html"
"https://www.waterworld.com/index.html"
"https://www.waterworld.com/water-and-wastewater-international.html"
"https://www.utilityproducts.com/index.html"
"https://www.dentaleconomics.com/index.html"
"https://www.dentistryiq.com/index.html"
"https://www.perioimplantadvisory.com/index.html"
#!/bin/bash
months=(
"01"
"02"
"03"
"04"
"05"
"06"
"07"