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 sys | |
import re | |
import pexpect | |
class Connect: | |
def __init__( | |
self, host = '', protocol = 'telnet', username = '', password = '', | |
): |
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
test |
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
# -*- coding: utf-8 -*- | |
""" | |
これはSlackにメッセージを投稿する際に、ChannelIDやTokenがあっているかを確認するためのもの。 | |
IncomingWebhookではなく、レガシートークンの正常性確認。 | |
""" | |
import requests | |
import json | |
url = 'https://slack.com/api/chat.postMessage' | |
channelid = "CC0000AA8" ## room id |
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
# -*- coding: utf-8 -*- | |
import json | |
import requests | |
# user settings (target site) | |
user_name = 'user' | |
user_pass = 'password' | |
target_url = 'http://127.0.0.1/zabbix/api_jsonrpc.php' |
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
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import json | |
import csv | |
from datetime import datetime | |
wd_path = os.getcwd() | |
json_file = os.path.join(wd_path, 'event.json') |
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
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import json | |
import csv | |
from datetime import datetime | |
wd_path = os.getcwd() | |
json_file = os.path.join(wd_path, 'event.json') |
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 | |
set -x | |
############################# | |
# require module | |
# curl | |
# jq | |
############################# | |
if [[ $# -ne 2 ]]; then |
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 | |
set -x | |
### get token ### | |
user_name=ajitama | |
user_pass=kuntama | |
zabbix_url=http://### ZABBIX-SERVER IP ###/zabbix/api_jsonrpc.php | |
json_data='{"auth":null,"method":"user.login","id":1,"params":{"user":"'${user_name}'","password":"'${user_pass}'"},"jsonrpc":"2.0"}' |
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 | |
### sequential read block size 4k | |
fio -filename=/var/test2g -direct=1 -rw=read -bs=4k -size=2g -numjobs=64 -runtime=10 -group_reporting -name=file1 | |
rm -f /var/test2g | |
### sequential write block size 4k | |
fio -filename=/var/test2g -direct=1 -rw=write -bs=4k -size=2g -numjobs=64 -runtime=10 -group_reporting -name=file1 | |
rm -f /var/test2g |
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
# coding: utf-8 | |
from logging import getLogger, StreamHandler, FileHandler, Formatter, WARN, DEBUG | |
from slackclient import SlackClient | |
slack_client = SlackClient("xoxb-000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx") | |
alluser_dict = {} | |
def getusername(userid): | |
if userid in alluser_dict.keys() : |
NewerOlder