Skip to content

Instantly share code, notes, and snippets.

View narutaro's full-sized avatar
:octocat:
On vacation

narutaro narutaro

:octocat:
On vacation
View GitHub Profile
@narutaro
narutaro / gist-as-a-blog-platform.md
Last active November 8, 2024 00:37
Gist as a blog platform

Gistをブログプラットフォームとして使う

いろいろ試した結果、Web上になんか書く時には,とりあえずGistに書いておいて,それをGitHub pagesで束ねるだけでこんな風にそれなりにブログっぽくなっていいんじゃないかと思うにいたったので,そのことについて書こうかと思う.ソースはこちら

やったこと

GitHub pagesを設定する

GitHub Pagesにコンテンツをホストする方法はいろんなところに書かれているので省略.今回はHTMLにビルドしてからpushするのではなくて,.mdファイルのままpushして,GitHub pagesのJekyllにビルドを任せるやり方.

テーマまわり

  1. GitHub pagesのデフォルトテーマの一つをとってきて,ちょっといじる.デフォルトデーマはレスポンシブでiPhoneで見るときもいい感じ.
  2. サイトの記事部分は埋め込みGistを使うので,埋め込みGistのCSSをいじって(上書きして)サイトのテーマになじませる
  3. テーマはJekyllのお作法に合わせ_layoutにおく
@narutaro
narutaro / Quick setup - vagrant with virtualbox.md
Last active October 10, 2016 07:24
Quick setup - vagrant with virtualbox

/Users//Library/Application Support/Karabiner

Ctrl + HJKL to Left/Down/Up/Right private.ctrl_hjkl __KeyToKey__ KeyCode::H, ModifierFlag::CONTROL_L, KeyCode::CURSOR_LEFT __KeyToKey__ KeyCode::J, ModifierFlag::CONTROL_L, KeyCode::CURSOR_DOWN __KeyToKey__ KeyCode::K, ModifierFlag::CONTROL_L, KeyCode::CURSOR_UP
@narutaro
narutaro / gist.rb
Last active May 3, 2016 22:45
Sample of getting gists which is newly added since last time fetched.
#!/usr/bin/env ruby
class Gist
attr_reader :last
def initialize
require 'rest-client'
require 'date'
@token = "token <your_token_here>"
@user = '<username>'
@narutaro
narutaro / flow_to_gephi.rb
Last active March 28, 2016 18:31
convert nfdump csv output to gephi csv
#!/usr/bin/env ruby
if ARGV.empty?
puts "Usage: #{$0} <nfdump_csv_file>"
exit
end
require 'csv'
csv_file = ARGV[0]
@narutaro
narutaro / suricata.md
Last active March 24, 2016 22:44
Suricata

Suricata

sudo suricata -c /usr/local/etc/suricata/suricata.yaml  -v -i eth0
/usr/local/etc/suricata$ tree
.
├── classification.config
@narutaro
narutaro / Regular expression for IPv4, IPv6, URL and domain.md
Last active May 5, 2020 23:27
Regular expression for IPv4, IPv6, URL and domain

Regular expression for IPv4, IPv6, URL and domain

IPv4 address

select source from table where source ~ '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' limit 10;

IPv6 address

@narutaro
narutaro / How to decode NetFlow version with tcpdump.md
Last active June 13, 2019 14:31
How to decode NetFlow version with tcpdump

Here you go.

sudo tcpdump -i <if> -n udp port <port_num> -T cnfp

You see:

05:10:47.244695 IP (tos 0x0, ttl 56, id 28920, offset 0, flags [none], proto UDP (17), length 1484)
@narutaro
narutaro / netflow_generator_hands_on.md
Last active September 1, 2021 03:17
Comparing NetFlow generators

Comparing NetFlow generators

Sharing my hands-on experience on some of the free NetFlow generators. I use Paessler NetFlow Generator for quick test, Flowalyzer™ NetFlow Generator for complicated flow creation and flowgen for automated performance testing.

Screenshot:

image

Pros:

@narutaro
narutaro / Cypher I have written.md
Last active February 9, 2016 23:46
Cypher I have written

Cypher I have written

Two common connections

match (l {name: '54.230.141.207'})<-[r1]-(n)-[r]->(m {name: '184.25.56.107'}) return l, r1, n, r, m;
match (l {name: '54.230.141.207'})<-[r1]-(n)-[r]->(m {name: '54.230.141.216'}) return n;
match (l {name: '54.230.141.207'})<-[r1]-(n)-[r]->(m {name: '54.230.141.216'}) return n.name;

Search by a property