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
* | select | |
ts_predicate_ar(timestamp, value, 2, 10) | |
limit 110 |
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
# データの生成 | |
ar_data = generate(1.4, -0.48, 5, 0.5, 100) | |
# データをアップロードしやすい形式に変換 | |
timestamps = sorted(range(0, 100)) | |
contents = [] | |
for timestamp in timestamps: | |
contents.append([ | |
("timestamp", str(timestamp)), # 必ず文字列に変換すること | |
("value", str(ar_data[timestamp])) |
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
from aliyun.log import * | |
from aliyun.log.util import base64_encodestring | |
# アップロード用の関数を定義 | |
def put_logs(client, project, logstore, contents, compress=False): | |
topic = '' | |
source = '' | |
logitemList = [] # LogItem list | |
for c in contents: | |
logItem = LogItem() |
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
def generate(phi_1, phi_2, c, sigma, size): | |
# 期待値 | |
mu = c/(1-phi_1-phi_2) | |
# 乱数のseedを固定 | |
np.random.seed(17) | |
# データの生成 | |
ar_data = np.zeros(size) | |
ar_data[0] = mu + np.random.normal(0, sigma) |
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
image_name = "YOUR_CONTAINER_IMAGE_NAME" | |
network_name = "YOUR_DOCKER_NETWORK_NAME" | |
c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator' | |
from jupyter_client.localinterfaces import public_ips | |
c.JupyterHub.hub_ip = public_ips()[0] | |
c.JupyterHub.port = 8888 | |
from dockerspawner import DockerSpawner |
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
FROM jupyter/scipy-notebook | |
USER root | |
RUN mkdir -p /root/workspace/personal /root/workspace/project | |
WORKDIR /root/workspace | |
CMD ["jupyterhub-singleuser", "--allow-root"] |
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 slackweb | |
def lambda_handler(event, context): | |
slack = slackweb.Slack(url="YOUR WEBHOOK URL PUTS HERE") | |
slack.notify(text="Hello, World!!", channel="#YOUR CHANNEL HERE", username="USERNAME HERE", icon_emoji=":smiling_imp:") | |
return "succeeded" |
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
exports.handler = function (event, context, callback) { | |
var https = require('https'); | |
var AWS = require('aws-sdk'); | |
var imsi = 'PUT YOUR IMSI'; | |
var to_mail_addr = 'PUT YOUR MAIL ADDRESS YOU RECIEVED ALERT MAIL'; | |
var from_mail_addr = 'PUT YOUR MAIL ADDRESS YOU SEND ALERT MAIL(SES)'; | |
var soracom_key = 'PUT YOUR SORACOM API KEY' | |
var soracom_token = 'PUT YOUR SORACOM 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
$header = @{ | |
"X-IIJmio-Developer" = "XXXXXX"; | |
"X-IIJmio-Authorization" = "XXXXX"; | |
} | |
$result = Invoke-WebRequest -Headers $header https://api..jp/mobile/d/v1/log/packet/ | |
$content = $result | ConvertFrom-Json | |
Write-Host $result | |
Write-Host $content | |
foreach ($line in $content.packetLogInfo) {iijmio | |
Write-Host $line.hddServiceCode |
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
$targets = @("08-00-27-9A-AB-94") | |
$nics = Get-NetAdapter | |
foreach ($nic in $nics) { | |
if ($targets -contains $nic.MACAddress) { | |
New-NetIPAddress -InterfaceIndex $nic.IfIndex -IPAddress "192.168.0.1" -AddressFamily IPv4 -PrefixLength 24 | |
} | |
} |