Skip to content

Instantly share code, notes, and snippets.

@philroche
philroche / aws_ec2_describeInstanceTypes.py
Created September 2, 2020 16:50 — forked from rcj4747/aws_ec2_describeInstanceTypes.py
Play with AWS EC2 describe_instance_types
"""
Play with AWS EC2 describe_instance_types
"""
from boto3.session import Session
sess = Session()
ec2c = sess.client('ec2')
resp = ec2c.describe_instance_types()
@philroche
philroche / oscap-manifest.txt
Created March 30, 2021 09:58 — forked from ThinGuy/oscap-manifest.txt
OpenSCAP OVAL Scanning Ubuntu Manifest Files
#!/bin/bash
##############################################################################
# ossa.sh - Open Source Security Assessment
#
#
# Author(s): Craig Bender <craig.bender@canonical.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
@philroche
philroche / healthchecks.sh
Created May 14, 2021 14:43 — forked from rcj4747/healthchecks.sh
Run a command and report status to https://healthchecks.io
#!/bin/bash -eu
set -o pipefail
# Run a command and report status to https://healthchecks.io
usage() {
echo "Usage: $0 <healthchecks.io UUID> <command>"
exit 1
}
trap usage EXIT
@philroche
philroche / configure-nodes-for-ssh-access.sh
Last active October 21, 2021 12:23
Configure SSH for access across nodes - 2021 PTG directord hackfest
# Get SSH-config for nodes
vagrant ssh-config node0 > node0.ssh-config
vagrant ssh-config node1 > node1.ssh-config
# get teh SSH key path from the ssh-config
node0_ssh_key=$(ssh -F ./node0.ssh-config -G node0 | grep -m1 -oP "(?<=identityfile ).*")
echo ${node0_ssh_key}
node1_ssh_key=$(ssh -F ./node1.ssh-config -G node1 | grep -m1 -oP "(?<=identityfile ).*")
echo ${node1_ssh_key}
@philroche
philroche / bash-to-zsh-hist.py
Created January 17, 2022 08:58 — forked from muendelezaji/bash-to-zsh-hist.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@philroche
philroche / launch-qcow2-image-qemu-40G.sh
Created November 8, 2023 08:39
launch-qcow2-image-qemu-40G.sh
#!/bin/bash -eu
LAUNCHPAD_USER=""
LAUNCHPAD_USER_STRING=""
GIT_HUB_USER=""
GIT_HUB_USER_STRING=""
SSH_KEY=""
SSH_KEY_STRING=""
CREATE_BACKDOOR_USER="false"
PLAIN_TEXT_PASSWORD=""
@philroche
philroche / ubuntu_package_download_deb.py
Last active February 26, 2024 19:44
Download a deb from launchpad for a specific package version and architecture
#!/usr/bin/env python3
import faulthandler
import functools
import logging
import sys
import click
from debian import debian_support