Skip to content

Instantly share code, notes, and snippets.

@GedowFather
GedowFather / apt_package_update.py
Last active March 8, 2016 02:52
S3にDEBがアップロードされたらレポジトリを更新するLambdaスクリプト
import json
import urllib
import boto3
import os
import re
# constants
image_id = 'ami-a21529cc' # ubuntu-trusty-14.04-amd64-server-20160114.5
subnet_id = 'subnet-example'
instance_profile_name = 'InstanceProfileName'
#!/bin/env python
#
# Usage:
# ./dump.py
# - It will stop after period specified seconds or after getting max size.
# - log is sent to s3 bucket.
# - notification
# > EC2 needed profile (s3 put)
# > You need edit INFRA s3 bucket policy.
#
@GedowFather
GedowFather / SqlLogger.py
Last active August 8, 2021 04:48
Python scirpt for counting slow query log and sort it.
#
# スロークエリログをユニーク化整理します
#
import re
import hashlib
class counterSlowQuery:
init_keep_info = {
'unix_time' : None,
'src_ip' : None,
#!/usr/bin/env python3
import os
import json
import hashlib
import glob
#
# Config
#