strace -e trace=file -fp PID
(file) or strace -e trace=desc -fp PID
(file descriptors)
Common calls:
access
close
– close file handlefchmod
– change file permissionsfchown
– change file ownership
AWSTemplateFormatVersion: '2010-09-09' | |
Description: > | |
SSM Automation Document run a custom SSM Command Document | |
against a fleet of target instances. | |
Parameters: | |
AutomationDocumentName: | |
Type: String | |
Description: Name of created SSM Automation Document | |
Default: MyAutomation |
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
LoggingBucket: | |
Description: The name of the S3 bucket that contains your AWS logs | |
Type: String | |
Resources: | |
GlueDatabase: | |
Type: AWS::Glue::Database |
#!/bin/bash | |
# This script cleans all cache for Microsoft Teams on Linux | |
# Tested on Ubuntu-like, Debian by @necrifede, Arch Linux by @lucas-dclrcq and Manjaro with flatpak by @danie1k. Feel free to test/use in other distributions. | |
# Tested Teams via snap package. | |
# Tested Teams via flatpak package. | |
# | |
# How to use in terminal: | |
# ./clear_cache_MS_Teams.sh ( deb-stable | deb-insider | snap | flatpak ) | |
# or |
# I was looking for a rate limiting library to call rate limited apis as closely | |
# as possible to their enforced limits. I looked at the first few python libraries | |
# that I found, and when I glanced at the source, they were all clearly broken. | |
# Curious how this could be, I took all the top google and pip search results for: python rate limiting | |
# and tried to get them to do the wrong thing and fail to rate limit in situations that could come up | |
# in normal use (though in some cases very specific use) | |
# https://github.com/tomasbasham/ratelimit | |
# Where broken: |
AbortDocumentVersionUpload | |
AbortEnvironmentUpdate | |
AbortMultipartUpload | |
AbortVaultLock | |
AcceptAccountMapping | |
AcceptCertificateTransfer | |
AcceptDelegate | |
AcceptDirectConnectGatewayAssociationProposal | |
AcceptFxPaymentCurrencyTermsAndConditions | |
AcceptHandshake |
#!/usr/bin/env python | |
import getpass | |
import json | |
import requests | |
import sys | |
import urllib | |
import boto3 |
http://forked.yannick.io/ |
Sometimes you want to retrieve EC2 insntances' region information.
You can query that information through instance metadata(169.254.169.254).
$ curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document
{
"privateIp" : "172.31.2.15",
"instanceId" : "i-12341ee8",
"billingProducts" : null,
"instanceType" : "t2.small",
""" This is a convenient way to monkeypatch a method or attribute of a Python | |
object. This is great for situations where you want to modify a global | |
object within a limited scope, i.e., your typical class or module when | |
testing. This was tested and works with Python 2.7 and 3.4. """ | |
import contextlib | |
@contextlib.contextmanager | |
def monkeypatched(object, name, patch): | |
""" Temporarily monkeypatches an object. """ |