原创 use vs require in Perl5

Perl5 的程序執行分爲兩個階段:compilation time & run time。而 use 與 require 依次發生在這兩個不同的階段。 值得注意的是:Parser對use的處理等同如下: use strict;

原创 px in pt dp(dip) sp in Android

px Pixels - corresponds to actual pixels on the screen. in Inches - based on the physical size of the screen. 1 In

原创 How a Perl5 program works

運行一個Perl5 程序分爲兩個階段:Complication time & Run time 。 Complication time 如下圖所示,由Source code最終解析成特定的數據結構 optree 。中間可以利用 B

原创 [Perl] $SIG{HUP}

Scenarios: 爲daemon process重新加載配置 Solution: 可通過接收SIGHUP,並定義操作。如下實現了向 a daemon process 發送SIGHUP,並restart該process。當然,也可以是

原创 [Python]Compare __repr__ & __str__

__repr__, callsed by built-inrepr(), return string representation of a set __str__, called by built-instr() Phython S

原创 [Perl]$SIG{INT}

Scenarios: 在程序運行過程中,受到外界終端干擾,如Ctrl+C,導致意外中斷 Solution: 可通過 $SIG{INT} 接受 SIGINT 並處理中斷,如回收臨時文件 [root@localhost tmp]# perl

原创 [Platform]Phantom -- Programmable Security Controller

簡介 2016 RSA conference 明星產品,可以將其認爲是一個整合企業內部所使用的安全工具或產品的管理平臺。初次使用,總結如下: 主要功能 Phantom platform (Programmable Security Co

原创 [Perl]繼承SUPER,-norequire,use parent

parent package Baz; use parent qw(Foo Bar); is equivalent to: package Baz; BEGIN { require Foo; require Bar; push

原创 ARP spoofing 實驗與分析

定義 ARP spoofing, ARP cache poisoning, or ARP poison routing, is a technique by which an attacker sends (spoofed) Addre

原创 Ruby notes #1 Environment setup on Win32 platform

正式學習Ruby on Rails之前,首先在 Windows 7 平臺上進行環境搭建。以下會按照搭建順序進行展開,當然在安裝過程中碰到的 issues 也一併附上。需要下載的安裝文件如下: rubyinstaller 1.9.3 De

原创 [Perl]REAPER

場景 在程序中遇到耗時較長的操作(如等待用戶響應,連接remote server),通常會想到創建 Child process 去處理。在Perl 中 使用fork() ## fork a child process die "$@" u

原创 HTTP header

HTTP基於TCP協議之上的應用層協議,服務於Web瀏覽器和Web服務器的通信。是通用的、無狀態的面向對象的協議。 PS: 無狀態指的是同一個客戶端的多次請求沒有對應關係。 HTTP header HTTP headers主要可分爲:Re

原创 [Python note] Namespaces & scope

Namespaces Everything in Python is an object. A name helps Python to invoke the object that it refer to. A namespace i

原创 [Perl] $SIG{ALRM}

Scenarios: 可能出現hang的操作,如 connect remote server… Solution: 設置alarm,並通過SIGALRM終止操作 local $@; eval { local $SIG{ALRM

原创 [Reaver] crack wireless AP

About WPS What WIKI says: Created by the Wi-Fi Alliance and introduced in 2006, the goal of the protocol is to allow h