Skip to content

Instantly share code, notes, and snippets.

Puppteer

Install

# npm i puppeteer

Use

DNS

  • 使用udp協定 ,port=53 不加密
  • 進行名稱解析
  • Domain name > IP(正向解析)
  • IP > Domain name(反向解析)
  • DNS Spoofing(DNS詐騙 駭客在client端查詢Ip時,攔截封包,並傳假的封包回去假ip)
  • DNS也可以用作DDos攻擊(偽裝成被害者的ip,不斷送出DNS request,DNS會一直送封包給被害者的電腦,直到被攻陷)
  • 智能DNS
  • Linux Bind

DNS 紀錄

Load Balancing(LB)

  • 常使用方式
  1. LVS
  2. haproxy
  3. nginx (easy to use)
  4. keepalived (health check)

Docker

  1. Docker-compose
  2. Docker-SWAM

Python problem

numpy

  • numpy.linspace
  • 參考網站
  • 問題:endpoint = False 是怎麼算出差距是0.9的?
>>> import numpy as np
>>> np.linspace(1, 10, 10)

Stop all thing

# systemctl stop firewalld
# systemctl disable firewalld
# vim /etc/selinux/config  // 將eforcing 改為 disabled
# yum install 
# systemctl enable sshd
# reboot

Install dhcp server

  • 伺服器設定
# yum install dhcp dhcp-devel -y
# ip addr add 192.168.10.254/24 brd + dev enps08
# gedit /etc/dhcp/dhcpd.conf 
# iptables -t nat --append POS -s 192.168.10.0/24 -o enp0s3 -j MASQUERADE
# echo "1" > /proc/sys/net/ipv4/ip_forward

Form

  • Form submit return false fail if use async
<!DOCTYPE html>
<html>
<head>
 

Install node.js

apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
apt-get install nodejs
nodejs -v //判斷版本
npm -v