Skip to content

Instantly share code, notes, and snippets.

View dandye's full-sized avatar

DanDye dandye

View GitHub Profile
@dandye
dandye / gcp_detections_on_iaas.json
Created February 20, 2024 19:54
GCP Detections on ATT&CK Enterprise IaaS
{
"name": "GCP_Detections",
"versions": {
"attack": "14",
"navigator": "4.9.1",
"layer": "4.5"
},
"domain": "enterprise-attack",
"description": "",
"filters": {
{
"name": "GCP_Detections",
"versions": {
"attack": "14",
"navigator": "4.9.1",
"layer": "4.5"
},
"domain": "enterprise-attack",
"description": "",
"filters": {
@dandye
dandye / Makefile
Last active December 30, 2021 12:58
make target to quickly find and update shebangs
update_shebangs:
grep -m1 -r -l '^#!.*python' venv/bin/ | while read -r filename; do \
echo "$${filename}"; \
head -n1 "$${filename}"; \
sed -i -e '1 s|^#!.*python|#!/opt/rh/rh-python38/root/bin/python|' "$${filename}"; \
head -n1 "$${filename}"; \
done

Keybase proof

I hereby claim:

  • I am dandye on github.
  • I am dandye (https://keybase.io/dandye) on keybase.
  • I have a public key ASA-gPRwMft8T6zm3iIHKh2VSVhf1naW-T-xvApafZesnQo

To claim this, I am signing this object:

python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < .travis.yml
@dandye
dandye / aws_reports.py
Created February 6, 2018 01:32 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
function splitDate(date) {
var rdate = /(\d+).(\d+).(\d+)/
return rdate.exec(date)
}
var [ , year, month, day] = splitDate('2015-11-06')
@dandye
dandye / mount_edge.sh
Last active May 25, 2017 11:57
VBox Shared Folder mount script
#!/bin/bash
#
# Mount a MacOS Directory via VirtualBox Shared Folder
# and open port 8000 for Django development server
#
# Args:
# ${1} mount name (optional; default: "edge_dev")
#
# Usage:
# sudo ./mount_edge.sh edge_dev
@dandye
dandye / lxc_centos.sh
Created May 20, 2017 17:46
LXC CentOS
[admin@edge ~]$ sudo yum install lxc lxc-templates
...
[admin@edge ~]$ rpm -qil lxc-templates | grep centos
/usr/share/lxc/config/centos.common.conf
/usr/share/lxc/config/centos.userns.conf
/usr/share/lxc/templates/lxc-centos
[admin@edge ~]$ sudo lxc-create -t centos -n c1