วันศุกร์ที่ 1 ธันวาคม พ.ศ. 2560

Proxmox restore from LZO backup

Proxmox restore from LZO backup

I recently had to restore a KVM disk image from a LZO archive on a new proxmox server. I chose to do this via the command line, instead of the web interface.
First of make sure that there’s enough space on the server where you are going to restore. It will need to hold the vma file as well as the extracted image.
lzop -d vzdump-qemu-100-2015_09_01-01_00_00.vma.lzo
This will extract the vma file from the lzo archive. Change the file name to whatever your actual file name is.
vma extract vzdump-qemu-111-2013_06_12-11_43_15.vma -v /tmp/restore
This will extract the VM image file as well as the configuration to the directory /tmp/restore. You can change this path to whatever is appropriate. The directory restore will be automatically created.
You can now mount this disk as a block device using NBD for QCOW2 images.

วันพุธที่ 22 พฤศจิกายน พ.ศ. 2560

Blocking Client ROUTER Access

Blocking Client ROUTER Access


ttl
As requested by a virtual friend, who have a small network in a rural area with lower amount of bandwidth, & he wanted to block access to client who are using WIFI / Client ROUTER and doing sharing with other members. For this reason the operator is loosing ‘POTENTIAL’ customers. Following trick worked like a charm in order to block client router access.
At your main router, add following rule,
1
2
/ip firewall mangle
add action=change-ttl chain=forward comment="Block Client NAT/Router  / zaib" disabled=no in-interface=LAN new-ttl=set:1 passthrough=no
The above rule will decrement the TTL by value 1 . This way when the packet will move towards client router, it will not go beyond that point to client. BUT if the client uses normal PC, he will be able to access the internet.
1- block client router
↓
DISCLAIMER:
Do remember one point, the above method is not 100%. There are always workaround for about anything. None of any security is 100% fool proof.
If client uses Mikrotik Router, he can create another mangle rule which can increment TTL value then above restrictions will be useless.Something like following
1
/ip firewall mangle add action=change-ttl chain=prerouting in-interface=WAN new-ttl=increment:1
lolz
But you can create a script that can keep tracking of another mikrotik box on your network by mikrotik discovery protocol, as only very few admins secure there Mikrotik Router at full extent by blocking discovery, change winbox default ports, block any access on WAN port etc etc.
Happy Fire-walling !!! Jz
↓

วันพุธที่ 1 พฤศจิกายน พ.ศ. 2560

How to remove subscription notification from Proxmox VE 5

How to remove subscription notification from Proxmox VE 5

This guide will show you how to easily remove the “No Valid Subscription” nag from Proxmox VE 5.* that pops up every time you log in.

Introduction and Disclaimer

In order to apply this “hack” to a Proxmox installation, you require SSH or console access with administrative/sudo privileges. This guide assumes that you have the appropriate privileges. (If you’re reading this guide then, let’s face it, you probably do).
By following this guide you agree that you do so at your own risk. I take no responsibility for any damage that occurs as a result of this guide.

Steps

1) Log in to your Proxmox machine via SSH or via the VNC console available from within the web UI.
2) Navigate to the following directory where the PVE manager configuration files are stored
/usr/share/pve-manager/js/
3) Make a backup of the Javascript file pvemanagerlib.js
cp pvemanagerlib.js pvemanagerlib.js.bkp
4) Now open the file you just backed up with your favourite editor and find the following lines of code:
if (data.status === 'Active') {
    Ext.Msg.show({
      title: gettext('No valid subscription'),
      icon: Ext.Msg.WARNING,
      msg: PVE.Utils.noSubKeyHtml,
      buttons: Ext.Msg.OK,
      callback: function(btn) {
          if (btn !== 'ok') {
              return;
          }
          orig_cmd();
      }
    });
} else {
    orig_cmd();
}
5) Replace the first if() string with if(false), like so:
if (false) {
    Ext.Msg.show({
      title: gettext('No valid subscription'),
      icon: Ext.Msg.WARNING,
      msg: PVE.Utils.noSubKeyHtml,
      buttons: Ext.Msg.OK,
      callback: function(btn) {
          if (btn !== 'ok') {
              return;
          }
          orig_cmd();
      }
    });
} else {
    orig_cmd();
}
6) Restart the node – make sure you shut down your running VMs properly first!
7) Navigate back to your web UI (log out first if you’re still logged in) and hard refresh your browser. Log back in, no more nag! Do note that this may be overwritten by subsequent updates. If you update your machine and the nag returns simply follow this guide again.

วันอาทิตย์ที่ 29 ตุลาคม พ.ศ. 2560

ทดสอบ WTSever

ทดสอบ WTSever โปรแกรมเซิร์ฟเวอร์สำเร็จรูปลักษณะโอเพ่นซอร์ส พัฒนาขึ้นในรูปแบบสแต็ก (Web Server Solution Stack) สำหรับติดตั้งบนระบบปฏิบัติการวินโดวส์
WTServer เป็นโปรแกรมที่มีขนาดเล็กมีความสามารถสูง ภายในใช้ Ngnix เป็นเว็บเซิร์ฟเวอร์ที่ได้รับความนิยมมากขึ้นเรื่อยๆ มาแทน Apache อีกทั้งใช้งานทรัพยากรน้อยกว่า XAMPP และ WAMP ที่ใช้งานในปัจจุบัน
WTServer - Nginx MariaDB Redis Php development stack for Windows
A lightweight, fast and stable server stack for developing php mysql applications on windows, based on the excellent webserver Nginx. A lighter alternative to XAMPP and WAMP.

ไม่มีข้อความกำกับภาพอัตโนมัติ
ไม่มีข้อความกำกับภาพอัตโนมัติ

ไม่มีข้อความกำกับภาพอัตโนมัติ

ไม่มีข้อความกำกับภาพอัตโนมัติ

วันจันทร์ที่ 11 กันยายน พ.ศ. 2560

คู่มือการบล็อค BitTorrent ด้วยอุปกรณ์ MikroTik

คู่มือการบล็อค BitTorrent ด้วยอุปกรณ์ MikroTik








คู่มือการบล็อค BitTorrent ด้วยอุปกรณ์ MikroTik

คำถาม


อยากทราบวิธีการ Block BitTorrent ด้วย MikroTik จะต้องตั้งค่าอย่างไรบ้าง ?

คำตอบ




Before - ทดสอบโหลดบิท Torrent

โหลดบิทได้เต็มสปีดเน็ต




ทำการ block โดยก็อป Code ใส่ใน Terminal

1. ดาวน์โหลด ไฟล์ Code
- 2560-05-01-block-bit

2. กดปุ่ม Control+A เพื่อทำการ copy ทั้งหมด





/ip firewall layer7-protocol

add comment="P2P WWW web base cnoetent Matching / Sys2u.online" name=p2p_www regexp=\

"^.*(get|GET).+(torrent|thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|vertor|h33t|zoozle|bitnova|bitsoup|meganova|fulldls|btbot|fenopy|gpirate|commonbits).*\$"

add comment="P2P DNS Matching / Sys2u.online" name=p2p_dns regexp=\

"^.+(torrent|thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|vertor|h33t|zoozle|bitnova|bitsoup|meganova|fulldls|btbot|fenopy|gpirate|commonbits).*\$"

  

/ip firewall mangle

add action=mark-packet chain=postrouting comment="p2p download" disabled=no layer7-protocol=p2p_www new-packet-mark="p2p download" passthrough=no

add action=mark-packet chain=postrouting disabled=no layer7-protocol=p2p_dns new-packet-mark="p2p download" passthrough=no

  

/ip firewall filter

add action=drop chain=forward comment="Block P2p_www Packets / Sys2u.online" disabled=no layer7-protocol=p2p_www

add action=drop chain=forward comment="Block P2p_dns Packets / Sys2u.online" disabled=no layer7-protocol=p2p_dns

add action=drop chain=forward comment="TORRENT No 1: Classic non security torrent" disabled=no p2p=all-p2p

add action=drop chain=forward comment="TORRENT No 2: block outgoing DHT" content=d1:ad2:id20: disabled=no dst-port=1025-65535 packet-size=95-190 protocol=udp

add action=drop chain=forward comment="TORRENT No 3: block outgoing TCP announce" content="info_hash=" disabled=no dst-port=2710,80 protocol=tcp

add action=drop chain=forward comment="TORRENT No 4: prohibits download .torrent files. " content="\r\nContent-Type: application/x-bittorrent" disabled=no protocol=tcp src-port=80

add action=drop chain=forward comment="TORRENT No 5: 6771 block Local Broadcast" content="\r\nInfohash:" disabled=no dst-port=6771 protocol=udp











3. เข้า Winbox
เมนู terminal คลิกขวา เพื่อ Paste




หน้าจอแสดง Code เรียบร้อย




4. ตรวจสอบ Firewall ว่ามีการติดตั้งเรียบร้อย
เมนู IP > Firewall แท็ป Filter Rules

- ทดสอบบน Mikrotik RouterOS v.6.38.3 (filter rule ปกติ)




- ทดสอบบน Mikrotik RouterOS v.6.39
* ( เนื่องด้วย version 6.39 มีการปิด p2p ของ filter rule ทำให้โค้ดที่ป้อนเป็นสีแดง ไม่เป็นไร block ได้อยู่ )




เมนู IP > Firewall แท็ป Mangle




เมนู IP > Firewall แท็ป Layer 7 Protocols




After - ทดสอบโหลดบิท Torrent

* ตอนทดสอบ ควรปิดและเปิดโหลดใหม่ (เนื่องด้วย connection เดิมที่เชื่อมอยู่ จะไม่ถูกตัดน่ะครับ)

โหลดไม่ขึ้น นิ่งสนิท แต่ออกเน็ตใช้งานอื่นๆได้ปกติ