This file contains 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 logging | |
import sys | |
from nvdloader import NVDLoader | |
def main(): | |
argv = sys.argv | |
if len(argv) != 2 or argv[1] not in ['2', '3']: | |
print('Usage: $ python %s 2|3 (CVSS ver.)' % argv[0]) |
This file contains 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 sys | |
import os | |
import dotenv | |
from slackclient import SlackClient | |
dotenv.load_dotenv('/path/to/.env') | |
def post_slack(text: str, channel: str): | |
slack_token = os.environ['SLACK_API_TOKEN'] |
This file contains 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 | |
DEFAULT_REGION=ap-northeast-1 | |
INSTANCE_ID=`curl -fsSL http://169.254.169.254/latest/meta-data/instance-id/` | |
if [ $? = 0 ]; then | |
echo "instance-id:["$INSTANCE_ID"]" | |
else | |
echo "An unexpected error occurred when trying to get instance-id." | |
exit 1 | |
fi |
This file contains 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
function FindProxyForURL(url, host) { | |
return "SOCKS localhost:10080"; | |
} |
This file contains 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 matplotlib.pyplot as plt | |
import seaborn as sns | |
from collections import Counter | |
def counter_plot(values, max_count=len(set(values)), | |
figsize=(17,5), dpi=80, | |
fontsize=12, rotation=90, | |
xoffset=.05, yoffset=.1): | |
c = Counter(values) | |
l, v = zip(*c.most_common(max_count)) |
This file contains 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
#303E4D,#60a8cc,#0f658a,#64fcda,#546e7a,#eceff1,#40c4ff,#ff5252 |
This file contains 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 | |
# for crontab | |
FILEDIR=/path/to/dir | |
LOGFILE=/var/log/autodel.log | |
DAYS=200 | |
PROCESSES=4 | |
CHUNK=10 | |
# delete files older than 200 days & parallelize |
This file contains 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 os | |
import wget | |
import requests | |
from bs4 import BeautifulSoup | |
# use Tor | |
local_proxy = 'socks5://127.1:9050' | |
socks_proxy = { | |
'http': local_proxy, | |
'https': local_proxy |
This file contains 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 | |
# first, get the image URLs using such as Chrome DevTools | |
# The URLs is assumed to be "xxxxx?page={page number}" | |
URI=("https://path/to/file1" "https://path/to/file2") | |
PAGES=(10 20) | |
RED="" | |
GREEN="" | |
BLUE="" | |
NORMAL="" |
This file contains 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
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); | |
/* to hide the native tabs */ | |
/* #TabsToolbar { | |
visibility: collapse; | |
} */ | |
/* to hide the sidebar header */ | |
#sidebar-header { | |
visibility: collapse; | |
} |