Skip to content

Instantly share code, notes, and snippets.

View konz's full-sized avatar

Konrad Hosemann konz

  • Berlin, Germany
View GitHub Profile
@konz
konz / delete-users.py
Created February 1, 2017 12:29
Delete all IAM users with dependencies
#!/usr/bin/env python
import boto3
users_to_retain = {"bla", "blub"}
iam = boto3.client('iam')
existing_users = set([u['UserName'] for u in iam.list_users(MaxItems=1000)['Users']])
users_to_delete = existing_users - users_to_retain
@konz
konz / threads.py
Created October 13, 2016 16:05
Python threading
from random import randint
from threading import Thread
from time import sleep
class DoSomething(Thread):
def run(self):
for i in range(1, 10):
print(i)
sleep(1)