跳到主要內容

刪除 iptables 裡的規則



1. 找出行號,方便刪除
root@cw2-netflow:~# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination        
1    sshguard   all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination        

Chain sshguard (1 references)
num  target     prot opt source               destination        
1    DROP       all  --  219.229.222.4        anywhere            
2    DROP       all  --  95.211.149.200       anywhere            
3    DROP       all  --  hosted-by.ecatel.net  anywhere            
4    DROP       all  --  refresh-bulleted.funfew.com  anywhere            
5    DROP       all  --  112.65.229.76        anywhere            
6    DROP       all  --  hosted-by.ecatel.net  anywhere            
7    DROP       all  --  222.77.190.33        anywhere            
8    DROP       all  --  195-154-133-119.rev.poneytelecom.eu  anywhere            
9    DROP       all  --  111.73.46.231        anywhere            
10   DROP       all  --  hosted-by.blazingfast.io  anywhere

2. 刪除 sshguard Chian 中的第一條規則
    說明:
      --delete  -D chain rulenum
                Delete rule rulenum (1 = first) from chain

     root@cw2-netflow:~# iptables -D sshguard 1

    就刪掉囉

留言

這個網誌中的熱門文章

Goose - a database migration tool for Go 資料庫遷移工具

Goose Go 語言下,好用的資料庫遷移工具。特別是跟同事協同開發時,做好資料庫版本管理的好幫手。除了用 SQL 外,你也可以自己產生對映的 Go 程式。 Goose is a database migration tool. Manage your database schema by creating incremental SQL changes or Go functions. github repo. (程式庫連結) https://github.com/pressly/goose Install (安裝) $ go get -u github.com/pressly/goose/cmd/goose Usage (語法) kz@KZ ~/Blogger/bloggerfiles (master) $ goose Usage: goose [OPTIONS] DRIVER DBSTRING COMMAND Drivers: postgres mysql sqlite3 redshift Examples: goose sqlite3 ./foo.db status goose sqlite3 ./foo.db create init sql goose sqlite3 ./foo.db create add_some_column sql goose sqlite3 ./foo.db create fetch_user_data go goose sqlite3 ./foo.db up goose postgres "user=postgres dbname=postgres sslmode=disable" status goose mysql "user:password@/dbname" status goose redshift "postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db" status Options: -dir string dire...

iOS 11 - 新功能介紹,「螢幕錄製」- 用你的 iPhone 輕鬆錄操作畫面

工作上常要測試公司開發的手機 APP 過往都要把 iPhone 接上 Macbook 才能錄製操作畫面,再分享給相關同事。 現在,  iOS 11 提供了方便的作法。 你可以在 iOS 的「設定」>「控製中心」>「自訂控製項目」裡面 找到「螢幕錄製」這一項,然後按左邊綠圈,加進「控製中心」選單 這樣,你就自由的錄製操作畫面,分享給同事。 或是家中有長輩,不會操作手機時,也可以錄製給他們看。

Arduino 切換開關點亮 LED - 處理 Bounce 問題

原來機械式開關還存在所謂的「彈跳 (Bounce)」問題 解決方式: 1. 延遲時間 (輪詢式) 2. 使用程式庫 Bounce2       官方出了新版的 library Bounce2      參考官方文件作法,調整為 #include <Bounce2.h> #define SERIAL_BAUDRATE 19200 #define LED_PIN 11 #define SWITCH_PIN 7 Bounce bouncer = Bounce(); boolean led_status; void setup() {   Serial.begin(SERIAL_BAUDRATE);   pinMode(LED_PIN, OUTPUT);   pinMode(SWITCH_PIN, INPUT);   // After setting up the button, setup the object   bouncer.attach(SWITCH_PIN);   bouncer.interval(5);      led_status = LOW;   digitalWrite(LED_PIN, led_status); } void loop() {      if(bouncer.update() == true && bouncer.read() == HIGH){     led_status = !led_status;     digitalWrite(LED_PIN, led_status);   } } 3. 延遲時間 (硬體中斷) 參考資料: 1. Arduino 輕鬆入門-範例分析與實作設計  葉難 著  博碩  2015.07 初版3刷 !!! 支持台灣本土作者、支持 TAAZE 讀冊生活 !!!