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 / nprobe.md
Created January 23, 2016 01:42
nprobe
nprobe --collector-port 6789 --dump-path /nprobe
@narutaro
narutaro / table test.md
Last active February 28, 2016 21:55
table test

Gistlog supports github markdown style table. A table looks like this.

ft-Aligned Center Aligned Right Aligned
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1
@narutaro
narutaro / vim tips.md
Created February 5, 2016 06:45
vim tips

write a read-only file after modifiying some

:w !sudo tee % > /dev/null
@narutaro
narutaro / Python vs. Ruby.md
Last active February 12, 2016 22:25
Grumbles of a rubyist who tries to learn python

Grumbles of a rubyist who tries to learn python

Create a unique list of lists/array of arrays - the winner is ruby

ruby

[1] pry(main)> a = [[1, 2],[1,2],[3,4]]
=> [[1, 2], [1, 2], [3, 4]]
[2] pry(main)> a.uniq
=> [[1, 2], [3, 4]]
@narutaro
narutaro / cron with rbenv.md
Last active April 14, 2022 09:26
cron with rbenv

cron does not work with rbenv?

If your cron does not work, in many cases, that's because enviromental value.

Check your environmental values

You use rbenv and created some ruby scripts. Now you want to set it to cron.

43 19 * * * ruby your_ruby_script.rb
@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

@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 / 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 / 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 / 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