Skip to content

Instantly share code, notes, and snippets.

View l1ahim's full-sized avatar
🎯
Focusing

Catalinux l1ahim

🎯
Focusing
  • Timisoara
View GitHub Profile
@l1ahim
l1ahim / assume_role.py
Created April 24, 2020 12:18 — forked from DaisukeMiyamoto/assume_role.py
AWS Boto3 Assume Role example
import boto3
from boto3.session import Session
def assume_role(arn, session_name):
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role"""
client = boto3.client('sts')
account_id = client.get_caller_identity()["Account"]
print(account_id)
@l1ahim
l1ahim / EC2-Tag-Assets-Lambda.py
Created July 23, 2020 07:56 — forked from mlapida/EC2-Tag-Assets-Lambda.py
A lambda function that will copy EC2 tags to all related Volumes and Network Interfaces. A full writeup can be found on my site http://mlapida.com/thoughts/tagging-and-snapshotting-with-lambda
from __future__ import print_function
import json
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
@l1ahim
l1ahim / tf-docker-install-parrot.sh
Created September 2, 2020 21:37
Install Terraform 0.13 and docker engine on Parrot OS
# install terraform and docker
# https://docs.docker.com/engine/install/debian/
# Parrot $PATH contains .local from user home location
curl -O https://releases.hashicorp.com/terraform/0.13.2/terraform_0.13.2_linux_amd64.zip && unzip terraform_0.13.2_linux_amd64.zip -d ~/.local/bin
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
@l1ahim
l1ahim / readme.sh
Created September 3, 2020 13:21
Rancher k3s installation and group configuration
# API server: nodes should be able to reach k3s server tcp port 6443
# flannel vxlan: udp port 8472 for nodes to communicate (server and agents)
# metrics server: it collects resource metrics from kubelets and exposes them in k8s api server through metrics api. tcp port 10250
# https://rancher.com/docs/k3s/latest/en/installation/install-options/
# run the installation script
curl -sfL https://get.k3s.io | sh -
# create k3s group and add user to avoid using always sudo
sudo groupadd k3s
@l1ahim
l1ahim / findPwnedDB.py
Created November 24, 2020 07:37 — forked from n0x08/findPwnedDB.py
Find compromised NoSQL & Docker systems from Shodan JSON export
#!/usr/bin/env python
# findPwnedDB.py
#
# Last update: 1/13/2020
#
# Added:
# CassandraDB support
# Additional DBs
# Docker XMR mining flags (Thanks Unit42!)
# https://unit42.paloaltonetworks.com/graboid-first-ever-cryptojacking-worm-found-in-images-on-docker-hub/