Skip to content

Instantly share code, notes, and snippets.

View trangnth's full-sized avatar
🐄
love heals all

Trang Nguyen trangnth

🐄
love heals all
  • University of Engineering and Technology
  • Hanoi, Vietnam
View GitHub Profile
@trangnth
trangnth / keybase.md
Last active September 11, 2019 16:58
keybase.md

Keybase proof

I hereby claim:

  • I am trangnth on github.
  • I am tranguet (https://keybase.io/tranguet) on keybase.
  • I have a public key ASAHOVHzQLmglkEBA2pxXU5BbEnsORfXjsn4m_GaotN9-wo

To claim this, I am signing this object:

@trangnth
trangnth / wazuh-nmap-autoscan.md
Last active November 12, 2021 09:53
Wazuh auto scan and alert IP and port with Nmap

Cấu hình wazuh - nmap auto scan

Mô tả

  • Cảnh báo mỗi một host mới tham gia hoặc không tham gia vào dải ip được quét
  • Cảnh báo mỗi khi một port bất kỳ của host mở hoặc đóng (thay đổi trạng thái)
  • Thực hiện cấu hình trên wazuh server

Tham khảo

@trangnth
trangnth / wazuh-alert-telegram.md
Created December 6, 2019 08:41
Config wazuh alert via telegram
@trangnth
trangnth / mysql_query_log.md
Created December 20, 2019 02:09 — forked from joseluisq/mysql_query_log.md
How to enable the MySQL/MariaDB general query logs

How to enable the MySQL/MariaDB general query logs

  1. Enter to MySQL/MariaDB server command-line tool (change root with your username and password):
mysql -u root -proot
  1. Set the general log file path:
SET GLOBAL general_log_file='/var/log/mysql/mycustom.log';
@trangnth
trangnth / prometheus.yml
Created May 7, 2020 04:12 — forked from reachlin/prometheus.yml
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace

Quick cheat sheet of helpful tmux commands

  1. tmux new - Create and attach to a new session.
  2. tmux new -s NAME_HERE - Create and attach to a new session named NAME_HERE.
  3. CTRL-b, d - Detach (i.e. exit) from the currently-opened tmux session (alternatively, tmux detach). Note, this means press and hold CTRL, press b, release both, press d.
  4. tmux ls - Show list of tmux sessions.
  5. tmux a - Attach to the previously-opened tmux session.
  6. tmux a -t NAME_HERE - Attach to the tmux session named NAME_HERE.
  7. CTRL-d - Delete (i.e. kill) currently-opened tmux session (alternatively tmux kill-session).
  8. CTRL-b, [ - Enter copy mode, and enable scrolling in currently-opened tmux session. Press q to exit.
  9. CTRL-b, " - Split window horizontally (i.e. split and add a pane below).
@trangnth
trangnth / auth.pl
Created April 27, 2021 08:42 — forked from mmriis/auth.pl
IMAP/POP3 proxy authentication script for nginx. See http://www.whatastruggle.com/nginx-as-an-imappop3-proxy-part-2.
#!/usr/bin/perl
use Digest::HMAC_MD5 qw/ hmac_md5_hex /;
use DBI;
use URI::Escape;
use CGI;
print "Content-type: text/html\n";
my $q = CGI->new;
@trangnth
trangnth / header_filter_by_lua_example.md
Created April 28, 2021 09:40 — forked from ejlp12/header_filter_by_lua_example.md
nginx, openresty, transform/modify response body, header_filter_by_lua
@trangnth
trangnth / RabbitMQ.md
Last active June 4, 2021 04:10
RabbitMQ

upgrade rabbitmq từ 3.6.x -> 3.8.16

backup lại user password

Listing users
monitor [monitoring]
openstack       [None]
guest   [administrator]
@trangnth
trangnth / kafkacat.md
Created June 7, 2021 03:16
kafka_note
  • list messages trong 1 partition
kafkacat -b 10.5.69.6:9092 -t imap-2 -p 1
  • Metadata listing:
root@trangnth-kafka:/opt/confluent# kafkacat -L -b 10.5.6.6:9092 -t imap-2 
Metadata for imap-2 (from broker 1: 10.5.6.6:9092/1):