Skip to content

Instantly share code, notes, and snippets.

View ummdorian's full-sized avatar

Dorian Damon ummdorian

View GitHub Profile
@ummdorian
ummdorian / loadtest.sh
Created June 17, 2020 23:02
Concurrent Request Load Testing
#!/bin/bash
count=$1
echo "time | http_code | filesize | url";
seq 1 $count | xargs -n1 -P$count bash -c 'i=$0; rand=$(openssl rand -base64 12); curl -o /dev/null -w "%{time_total} | %{http_code} | %{size_download} | %{url_effective}\n" -s "http://example.com/?${rand}"'
@ummdorian
ummdorian / drush-all.sh
Created May 21, 2020 17:20
Run Drush on all Multisites Script
SITES="docroot/sites"
# Validate and hint if no argument provided.
if [ "${#}" -eq 0 ]; then
echo "- drush-all: missing argument(s)"
echo "EXAMPLE: drush-all cex -y"
else
PWD=${PWD}
cd "${SITES}"
// If we make pages components:
{
"data": {
"route": {
"path": "/news",
"entity": {
"entityBundle": "page",
"entityId": "371",
"entityLabel": "News",
"entityType": "node",
// If we make pages themselves components that know their fields:
query {
route(path: "/news") {
path
... on EntityCanonicalUrl{
entity {
entityBundle
entityId
entityLabel
entityType
{
"data": {
"redirectQuery": {
"entities": [
{
"redirectSource": {
"path": "testing-redirects-source",
"query": []
},
"redirectRedirect": {
{
redirectQuery(filter: {}) {
entities {
... on RedirectRedirect {
redirectSource {
path
query
}
redirectRedirect {
uri
{
"data": {
"taxonomyTermQuery": {
"entities": [
{
"entityId": "2981",
"entityBundle": "override_trail_and_lift_info"
},
{
"entityId": "2986",
query {
taxonomyTermQuery(
filter: {
conditions: [
{
operator: EQUAL,
field: "vid",
value: ["override_trail_and_lift_info"]
}
]