Skip to content

Instantly share code, notes, and snippets.

View sarahg's full-sized avatar
🏂

Sarah German sarahg

🏂
View GitHub Profile
update [0.05s] public/ee/user/application_security/dast/checks/798.60.html
update [0.05s] public/ee/user/application_security/dast/checks/798.93.html
update [0.07s] public/ee/user/application_security/dast/checks/798.83.html
update [0.06s] public/ee/user/application_security/dast/checks/798.70.html
update [0.05s] public/ee/user/application_security/dast/checks/798.1.html
update [0.06s] public/ee/user/application_security/dast/checks/798.15.html
update [0.06s] public/ee/user/application_security/dast/checks/798.21.html
update [0.07s] public/ee/user/application_security/dast/checks/798.44.html
update [0.07s] public/ee/user/application_security/dast/checks/16.8.html
update [0.05s] public/ee/user/application_security/dast/checks/798.113.html
@sarahg
sarahg / pan-wp-sec-check.sh
Created January 25, 2022 19:46
Checks all paid WP sites in a given org for plugin security updates.
#!/bin/bash
# This script checks all paid sites in a Pantheon org for security updates.
#
# Usage:
# ./pan-wp-sec-check.sh your-org-id
set -eou pipefail
PANTHEON_ORG_UUID=${1}
#!/bin/bash
# USAGE
# This script checks all sites in a Pantheon org for a given WordPress plugin.
# This may be useful in the event of an urgent security release.
# To run this, copy the file to your local machine and run the following commands:
# chmod +x checkOrgSitesForPlugin.sh
# ./checkOrgSitesForPlugin.sh plugin-slug
@sarahg
sarahg / gist:3ed7794dafa958279ccd7682d523a303
Created April 24, 2020 14:33
Install postgres using Homebrew and load the "dvdrental" demo database on Mac OSX
# Install postgres with Homebrew:
brew update
brew install postgres
brew services start postgresql
/usr/local/opt/postgres/bin/createuser -s postgres
# Import the demo database and import it
# Download database: https://www.postgresqltutorial.com/postgresql-sample-database/
@sarahg
sarahg / postgres
Last active April 24, 2020 14:29
List databases, select a database, show tables, show columns in a table, basic query
┌⚡️ sarahgerman in 📁 ~
└❯ psql
psql (12.2)
Type "help" for help.
sarahgerman=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------+-------------+----------+---------+-------+-----------------------------
dvdrental | sarahgerman | UTF8 | C | C |
MariaDB [pantheon]> SELECT host FROM mysql.user;
+-----------+
| host |
+-----------+
| % |
| 127.0.0.1 |
| ::1 |
| localhost |
+-----------+
4 rows in set (0.036 sec)
# https://www.tag1consulting.com/blog/drupal-loadtest-locust
from locust import HttpLocust, TaskSet, task, events
from bs4 import BeautifulSoup
import random
def is_static_file(f):
if "/sites/default/files" in f:
return True
else:
return False
@sarahg
sarahg / locustfile.py
Created December 12, 2019 03:17
Drupal load test example from Tag1
# https://www.tag1consulting.com/blog/drupal-loadtest-locust
from locust import HttpLocust, TaskSet, task, events
from bs4 import BeautifulSoup
import random
def is_static_file(f):
if "/sites/default/files" in f:
return True
else:
return False
@sarahg
sarahg / blockrange.go
Last active November 29, 2019 23:12
This is a Golang script to generate a MySQL query that you can use to block an IP range in Drupal 8. Run it like this: go run blockrange.go 123.456.789 (in a situation where you need to block 123.456.789.*). For Drupal 7, change the table name in row 12 to blocked_ips.
package main
import (
"fmt"
"strconv"
"os"
)
func main() {
curl -Is --resolve www.example.com:443:23.185.0.3 https://www.example.com/