This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# Docker環境構築(Amazon Linux 2023用) | |
# locale | |
localectl set-locale LANG=ja_JP.UTF-8 | |
# timezone | |
echo 'ZONE="Asia/Tokyo"' > /etc/sysconfig/clock | |
rm -f /etc/localtime | |
ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import boto3 | |
import time | |
import logging | |
# Constants | |
LOG_GROUP_NAME = '/aws/lambda/test-filter-log-events' # Log group name of CloudWatch Logs | |
NUM_CHARS_TO_PRINT = 10 # Number of characters to print from log message | |
DELAY_OF_START_MS = 5000 # Initial delay before starting the log fetching process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import socket | |
def send_broken_pipe(): | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect(("localhost", 8082)) | |
request = "POST / HTTP/1.1\r\n" | |
request += "Content-Length: 123\r\n" | |
request += "\r\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for addr3 in $(seq 0 4); do | |
for addr4 in $(seq 1 255); do | |
ip addr add 172.32.${addr3}.${addr4}/16 dev eth0 | |
done | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import socket | |
import datetime | |
now = datetime.datetime.now().strftime('%b %d %H:%M:%S') | |
msg = '<34>%s testhost TestTCP: aaa111' % now | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(('127.0.0.1', 514)) | |
sock.sendall(msg.encode('utf-8')) | |
sock.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import socket | |
import time | |
import datetime | |
import threading | |
import sys | |
from selectors import DefaultSelector, EVENT_WRITE, EVENT_READ | |
message = '%s ERROR %s:' % (datetime.datetime.now().time(), '-' * 100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE_SIZE = 10485760 | |
LINE_TEXT = '1234567890' * 10 | |
write_size = 0 | |
while write_size < FILE_SIZE: | |
print(LINE_TEXT) | |
write_size += len(LINE_TEXT) + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- psql -p 24001 -U hinemos -f create-trigger-sample.sql | |
CREATE OR REPLACE FUNCTION log_cc_cfg_facility_relation_delete() RETURNS TRIGGER AS $$ | |
BEGIN | |
RAISE LOG 'DELETE cc_cfg_facility_relation: % %', | |
OLD.parent_facility_id, OLD.child_facility_id; | |
RETURN NULL; | |
END | |
$$ LANGUAGE plpgsql; | |
CREATE TRIGGER trg_cc_cfg_facility_relation_delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[string]$FilePath = 'C:\work\dummy10m.txt' | |
[long]$FileSize = 10485760 | |
$ErrorActionPreference = 'Stop' | |
Add-type -AssemblyName System.Web | |
[long]$WriteSize = 0 | |
$file = New-Object System.IO.StreamWriter($FilePath, $false) | |
while($WriteSize -lt $FileSize){ | |
$String = "this is dummy row`r`n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
for i in range(100000): | |
subprocess.check_call('touch dummyfile%08d.txt' % i, shell=True) |
NewerOlder