原创 DNS協議 : RFC1035 中文
RFC1035 中文 一、域名和資源記錄的定義 1、Name space definitions 2、資源記錄定義(RR definitions) 2.1 格式 後面分析報文的時候詳細解釋。
原创 *.pyc文件無法執行
python生成*.pyc文件後執行出錯的問題: $./*.py 運行成功; $./*.pyc 運行失敗; 解決: 運行.pyc文件要通過python *.pyc來執行: $python *.pyc 運行成功;
原创 chapcrack編譯過程中的python錯誤
from passlib.utils import des ImportError: No module named passlib.utils apt-get install python-passlib from dpkt
原创 Linux下struct的成員對齊問題-結構體實際大小
1 、自然對界 struct 是一種複合數據類型,其構成元素既可以是基本數據類型(如int、long、float 等)的變量,也可以是一些複合數據類型(如array、struct、union 等)的數據單元。對於結構體,編譯器會
原创 c++ 遍歷目錄下文件
function:遍歷目錄下所有文件,返回文件總數,子文件夾總數 #include "stdlib.h" #include "direct.h" #include "string.h" #include "io.h"
原创 libpcap error.
error1: include<pcap.h> no such file sudo apt-get install libpcap-dev error2: sniffer.c:(.text+0x43): undefined
原创 C語言在TXT文件中搜索字符串
方法一: bool CBrowseDir::SearchTXT(const char *filename) { string filename1( filename ); string keyword( "word
原创 直接用編譯器按ctrl+F5運行和Release、Debug下雙擊運行結果不一樣
是因爲進程權限的問題,需要添加下面的代碼: BOOL EnableDebugPrivilege() { HANDLE hToken; BOOL fOk=FALSE; if(OpenProcessToken(GetCurrentPr
原创 Ubuntu下安裝Freetds,並編程連接MSSQL
1. 環境 Ubuntu14.04.05 freetds-stable.tar.gz 2. 安裝freetds 下載freetds : http://www.freetds.org 解壓 :
原创 Windows平臺下fwrite函數0x0A變成0x0D 0x0A
在Windows環境下,用fwrite向文件中寫數據時,當寫入0x0A時,其前面總會被加上一個0x0D。後來發現出現這個問題的原因是fwrite 在以文本方式寫文件時,碰到0x0A,會自動在前面加上0x0D,以夠成回車換行符,因爲
原创 Ubuntu14.04 運行程序錯誤,調試記錄
Ubuntu14.04上運行程序出現如下錯誤: 運行 ./program no such file 提示沒有那個文件或目錄 分析:程序爲32位程序,uname –m查看系統爲x86_64,64位系統,不兼容。 安裝ia32
原创 ftp上傳文件失敗,大小始終爲0
主機:win7 虛擬機:ubuntu14.04 ubuntu中安裝vsftpd,配置writing_enable=yes以及其它配置。 上傳文件大小始終爲0。 原因:磁盤空間被佔滿,沒有空間寫入: df -lh 查看磁盤空間
原创 mysql.h: No such file or directory
error 1: mysql.h: No such file or directory 解決: apt-get install libmysqlclient-dev find /usr/ -name ‘mysql.h’
原创 清除本地DNS
cmd下運行: ipconfig/flushdns 錯誤: Windows IP Configuration Could not flush the DNS Resolver Cache: Function
原创 tcpdump抓取TCP協議、GRE協議數據
tcpdump抓取tcp數據 1、tcpdump -i eth0 port 11751 and src host 192.168.1.34 -x -s0 tcpdump: verbose output suppressed, u