Skip to content

Instantly share code, notes, and snippets.

@tecsyscom
tecsyscom / gist:5259595225e5e09bee1ae02d1c409231
Created May 18, 2017 04:04
in kibana plugin when you got this error bellow when you migrate your app from 5.x to 6.x
Uncaught TypeError: Cannot read property 'get' of undefined
// change your code from
import uiModules from 'ui/modules'
// to
import { uiModules } from 'ui/modules'
// edit your config/elasticsearch.yml
http.cors:
enabled: true
allow-origin: /https?:\/\/localhost(:[0-9]+)?/
@tecsyscom
tecsyscom / gist:a8ae3c561f4c0f74b0f4a50d692c0a6a
Created May 11, 2017 02:32
ELK treak (make your elasticsearch support CORS)
bin/elasticsearch -Ehttp.cors.enabled=true -Ehttp.cors.allow-origin=*
@tecsyscom
tecsyscom / logstash.jboss.web.conf
Created May 9, 2017 09:39
test jboss web logstash config file
#input {
# stdin {
# type => "joss_web"
# }
#}
# filebeat need to add -> index: "filebeat_cm_ar"
input {
redis {
data_type => "list"
return (
<div>
<h1>Ming</h1>
</div>
);
and
return
<div>
@tecsyscom
tecsyscom / gist:36b1718e4e2c73fe62ef420144d9ddc4
Created May 9, 2017 03:48
No 'Access-Control-Allow-Origin' header is present on the requested resource. for Kibana app localhost:8080 to access elasticsearch on port 9200
// start elasticsearch with CORS support
$ bin/elasticsearch -Ehttp.cors.enabled=true -Ehttp.cors.allow-origin=*
// test
$ curl -H "User-Agent: Mozilla" -H "Origin: http://example.com" -i localhost:9200
HTTP/1.1 200 OK
access-control-allow-origin: *
content-type: application/json; charset=UTF-8
content-length: 326
@tecsyscom
tecsyscom / gist:553cefd90f784728e1e2aeb7f4afe038
Created May 9, 2017 03:02
> webpack-dev-server events.js:163 throw er; // Unhandled 'error' event Error: listen EADDRINUSE 127.0.0.1:8080
$ lsof -i tcp:8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 27214 mingderwang 14u IPv4 0x300d2294638a7465 0t0 TCP localhost:http-alt->localhost:57454 (CLOSE_WAIT)
node 27214 mingderwang 17u IPv4 0x300d22946210c275 0t0 TCP localhost:http-alt (LISTEN)
$ sudo kill -9 27214
@tecsyscom
tecsyscom / logstash.audit.conf
Created May 8, 2017 04:42
CentOS audit.log logstash conf file
input { stdin { } }
filter {
grok {
break_on_match => true
named_captures_only => true
match => {
"message" => [
"type=%{WORD:audit_type} msg=audit\(%{NUMBER:audit_epoch}:%{NUMBER:audit_counter}\): pid=%{NUMBER:audit_pid} uid=%{NUMBER:audit_uid} old auid=%{NUMBER:old_auid} new auid=%{NUMBER:new_auid} old ses=%{NUMBER:old_ses} new ses=%{NUMBER:new_ses}",
"type=%{DATA:audit_type}\smsg=audit\(%{NUMBER:audit_epoch}:%{NUMBER:audit_counter}\):.*?( msg=\'(?<sub_msg>.*?)\')?$" ]
@tecsyscom
tecsyscom / README.md
Created May 8, 2017 01:32
Fintech 議題

Fintech 安全問題

  • Blockchian Stability
  • Smart Contract Security

Smart Contract Issues

  • Copyright issues.

UI experiences

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>