Skip to content

Instantly share code, notes, and snippets.

@shunkino
shunkino / styles.less
Created November 30, 2018 03:47
My atom styles.less
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@shunkino
shunkino / convert_colorscale_function.py
Created November 28, 2018 05:42
Function to convert colorscale format. for my blog.
import numpy as np
import colorlover as cl
def convert_colorscale_format(colorscale):
plotly_colorscale = []
for index, sec_value in enumerate(np.linspace(0, 1, len(colorscale))):
plotly_colorscale.append([sec_value, colorscale[index]])
return plotly_colorscale
@shunkino
shunkino / error_colorscale.py
Last active November 28, 2018 05:40
error occurs... for my blog
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import numpy as np
import colorlover as cl
N = 10000
cluster_id = [np.random.randint(N/1000) for val in range(N)]
trace = go.Scattergl(
x = np.random.randn(N),
@shunkino
shunkino / show_colorscale.py
Created November 28, 2018 05:38
for my blog
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import numpy as np
N = 10000
cluster_id = [np.random.randint(N/1000) for val in range(N)]
trace = go.Scattergl(
x = np.random.randn(N),
y = np.random.randn(N),
mode = 'markers',
marker = dict(
@shunkino
shunkino / convert_colorscale.py
Created November 28, 2018 05:36
color scale converter file for my blog
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import numpy as np
import colorlover as cl
def convert_colorscale_format(colorscale):
plotly_colorscale = []
for index, sec_value in enumerate(np.linspace(0, 1, len(colorscale))):
plotly_colorscale.append([sec_value, colorscale[index]])
return plotly_colorscale
# %%
@shunkino
shunkino / elasticsearch_moloch_query.py
Last active November 27, 2018 18:01
query to moloch example for my blog
from elasticsearch import Elasticsearch
es = Elasticsearch(['elasticsearch:9200'])
response = es.search(
index="sessions2-181016",
body={
"size": 0,
"query": {
"bool": {
"filter": {
"bool": {
@shunkino
shunkino / kibana.yml
Created November 7, 2018 13:52
kibana setting form my blog
server.host: "0.0.0.0"
elasticsearch.url: "http://elasticsearch:9200"
@shunkino
shunkino / packet_analysis_conda.yml
Created November 6, 2018 05:47
Anaconda env for packet analysis
name: base
channels:
- anaconda
- activisiongamescience
- conda-forge
- defaults
dependencies:
- geoip2=2.2.0=py36_0
- libmaxminddb=1.1.4=0
- maxminddb=1.2.0=py36_0
@shunkino
shunkino / Tutorial.md
Last active November 3, 2018 23:58
Hands-on for RAM

About

11/3に行うRAMにて実施するTutorialです.

Index

全体の流れは以下に示すとおりです.

  • Dockerを使ってElasticsearch
  • Dockerを使ってMoloch
  • Molochでpcapを解析
  • 解析結果を眺める
@shunkino
shunkino / docker-compose.yml
Last active November 6, 2018 01:54
docker-compose file for elasticsearch blog. This is for newer versions of elasticsearch
version: '2'
services:
kibana:
image: docker.elastic.co/kibana/kibana:6.4.2
container_name: kibana
volumes:
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
ports:
- 5601:5601
networks: