show code js

2022年11月23日 星期三

Fail2Ban With Ubuntu

 Fail2Ban


1. sudo apt install fail2ban -y

2. sudo systemctl status fail2ban.service

3. cd /etc/fail2ban

4. sudo cp jail.conf jail.local

5. sudo nano jail.local

modify bantime, findtime and maxretry

modify enabled = false to true

find [sshd] after add line: enabled = true

find [nginx-http-auth] after add line: enabled = true 

6. sudo systemctl enable fail2ban.service

7. sudo systemctl start fail2ban.service

8. sudo systemctl status fail2ban.service


if u start with error

1. sudo rm jail.local

2. sudo nano jail.local 

[sshd]

enabled  = true

port     = ssh

filter   = sshd

logpath  = /var/log/auth.log


maxretry = 5

findtime = 60m

bantime  = 60m


from: 

https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-ubuntu-20-04

AWS VPS

Create AWS Account


Getin Free project

https://aws.amazon.com/tw/free/


Choose one of EC2 and Active

1、setting name

2、choose ubuntu

3、Storage can setting 30GB(Max) for free

4、Create certificate*


Active

1、SSH Client

2、use ssh to login and use certificate*


Frist 

1、sudo apt clean

2、sudo apt update -y

3、sudo apt upgrade -y

4、sudo apt-get clean

5、sudo apt-get update -y

6、sudo apt-get upgrade -y

7、sudo apt-get dist-upgrade -y

8、sudo apt-get autoremove -y


Install Editor

1、sudo apt-get install nano -y


Comfirm Version

lsb_release -a


2022年8月25日 星期四

iRedMail White List

  • Postfix
    nano /etc/postfix/helo_access.pcre
    Add below:
    /\.domain\.com$/ OK
    /\.domain\.com\.tw$/ OK
  • iRedApd
    goto /opt/iredapd/tools
    run below:
    python wblist_admin.py --add --whitelist IP @domain.com @.domain.com user@domain.com
  • fail2ban
    nano /etc/fail2ban/jail.local
    add IPs after  ignoreip = IP1 IP2 IP/8 IP/16 IP/24 IP/32

2022年3月3日 星期四

HPE 5120 Storm

 2 Way (1) Storm constrain (2) Port managenet

We had 2 area need to limit this. so.... we use (2)


Open Port Managenemt, Config Storm Suppression

Broadcast use kbps and set it 2000

Multicast use ratio and set it 80%

Unicast use pps and set 2000

Add 2 Port(Area) , Click Apply and Save

cmd check code in file

 @echo off

@cls


for /F "delims= tokens=1" %%i in (C:\code.txt) do (


IF /I %%i==your_code ( GOTO ISOK ) ELSE ( GOTO ISNG )

)


@echo Check Error


GOTO ISEND


:ISOK


@echo Check Pass


GOTO ISEND


:ISNG


@echo Check Fail


:ISEND


@echo Done

windows event clear

 @wevtutil cl Security

@wevtutil cl Application

@wevtutil cl Setup

@wevtutil cl System

@wevtutil cl "DFS Replication"

@wevtutil cl "Windows PowerShell"

cmd use ping to do something

 @echo off

@cls

@set subject=[Subject Title]

@setlocal enabledelayedexpansion

@set logfile=log_%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%.txt

@echo ================== >> %logfile%

@echo %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2% Begin %subject% >> %logfile%


for /F "delims=; tokens=1" %%i in (C:\list.txt) do (

@ping -n 1 %%i | find "最小值"

@if !ERRORLEVEL!==1 (

                @echo %%i is down >> %logfile%

) else (

                @echo %%i is life >> %logfile%

@shutdown -s -t 0 -m \\%%i

)

@echo --------- >> %logfile%

)


@echo %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2% End %subject% >> %logfile%

@echo ================== >> %logfile%


list.txt like below:

IP

IP

IP

......


2022年2月8日 星期二

NFT is barcode on public network

有人在玩nft嗎

其實有玩遊戲的朋友 你一直都在用nft

為什麼呢 因為你在遊戲中的任何道具 都是在資料庫有一個唯一的代碼,而道具可以在交易中心再規則下進行交易,交易金額會隨著需求變化,雖然道具同類型的會有很多,但這個道具在資料庫中仍會是唯一的。只是你不知道他的編號是多少。

而且他只在特定的遊戲裡面使用及交易,並沒有公開、開放非玩家交易,如此而已。


可以想像,你的郵件也是NFT的一種喔!只是你看不到也無法交易,但不代表以後不能交易喲!

然而,新的遊戲就會有新的風險,如果這個NFT被入侵、被駭客修改或是倒閉,那麼你的NFT還會有多少價值與公信力呢?