Scratches

Blinded by Science!

SELinux Tips

Updating SELinux Permissions for Nginx ngx_modsecurity_module.so: failed to map segment from shared object: Permission Denied After installing a module in Nginx, /var/log/nginx/error.log can show ...

Vim Tips

Open a second file within same window -ESC- :e $filename Switch back to previous buffer (‘file’) -ESC- :bn

Jenkins Tips

Backup jobs directories with subdirectories but not builds directories tar zcvf jenkins-backup-jobs.tar.gz --exclude "builds" /var/tmp/jenkins/jobs/ Extract archive to /opt/jenkins/, stripping...

Git Tips

Git’s HEAD pointer For me, the key to understanding how git works came when I grasped that the HEAD notation is similar to a window that can slide over a set of commits. The window can be moved to ...

Get Size of S3 Buckets with Boto3

Get Size of S3 Buckets with Boto3 https://www.slsmk.com/getting-the-size-of-an-s3-bucket-using-boto3-for-aws/ import boto3 import datetime now = datetime.datetime.now() cw = boto3.client('cloudw...

Curl Tips

Send ‘Host’ header to localhost with a custom value curl --header "Host: example.com localhost"

AWS Patch Management

AWS Patch Management with SSM Use Patch Manager to patch different SSM-supported OSes. Create a patch baseline and see how it can help maintain and patch a multi-platform infrastructure. Obser...

Use AWS CLI to build a VPC with a Bastion

Create VPC aws ec2 create-vpc --cidr-block $VPC_CIDR --tag-specifications 'ResourceType=vpc,Tags=[{Key="Name",Value="TOOLS_VPC"}]' Create Subnets aws ec2 create-subnet --availability-zone us-west...

Resolve JavaScript error 'cannot add EventListener of null'

this was causing an error ‘cannot add EventListener of null’, until I moved the script tag in index.html to after the element I was listening for document.getElementById("submit").addEventListener...

Combine Two Json API responses into a dict of lists

Take json response for ‘apps’ and combine it with json response for ‘branches’ Makes dictionary of app names, each with a list of app branches in a list def create_dict_appid_to_branches(): SV...