原创 windows 7掛載samba

1.  在linux系統上安裝配置samba, 並啓動 2.  計算機---鼠標右鍵---映射網絡驅動器                                  

原创 linux 內核調用用戶程序

實驗環境: CentOS Linux release 7.4.1708,3.10.0-693.el7.x86_64   參考: 內核 API,第 1 部分:從內核調用用戶空間應用程序 https://www.ibm.com/develop

原创 ts文件解密+python腳本m3u8下載

通過m3u8下載視頻文件, 下載完成後無法播放。查看m3u8文件,發現視頻文件被加密,所以直接下載後不能直接播放。 這裏使用了AES-128加密,並且有IV, 所以是cbc模式。 解密方法: (1) 下載key, 16字節數據。 使用o

原创 bash腳本運行爲守護進程

bash腳本運行爲守護進程 setsid myscript.sh >/dev/null 2>&1 < /dev/null &  

原创 拆輪子之redis list

這裏用的是redis5.0.5 在不修改源文件的情況下,拷貝以下文件: adlist.c  adlist.h  atomicvar.h  config.h  mytest  zmalloc.c  zmalloc.h   編寫測試代碼:

原创 ICMP host administratively prohibited記錄

        非阻塞raw  socket ,發送icmp報文, 當發送完某些包後, socket一直是可讀狀態,但進行recv時異常, [Errno 11] Resource temporarily unavailable。 EAGA

原创 linux內核線程kthread

demo: 創建一個內核線程,每隔1000毫秒打印一次my_thread running sample.c #include <linux/module.h> #include <linux/kthread.h> #include <l

原创 c語言 #define 中"##" 的作用

define 中的##用來連接 ## 之前和之後的內容   #define aaa(arg) hello_ ## arg int main(void) { int hello_i = 11; prin

原创 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7 in position 126: invalid continuation byte

python3 在讀文件時,用到了字符串處理方法, 所以將讀出的內容轉爲str decode()默認轉爲utf-8編碼,但當文件包含其他編碼格式內容時,可能就會出錯。所以通過制定編碼不是一個好的解決辦法。 可以:      (1)  l_

原创 警告:計算出的值未被使用warning: value computed is not used [-Wunused-value]

gcc 編譯警告 warning: value computed is not used [-Wunused-value] #include <stdio.h> int fun(int *data) { *data ++;

原创 MySQLdb User's Guide

MySQLdb is an interface to the popular MySQL database server that provides the Python database API.   https://mysqlclie

原创 chroot 的作用和它帶來的好處

https://www.ibm.com/developerworks/cn/linux/l-cn-chroot/    

原创 linux進程狀態 Ss,Ss+,D,R+,S

ps -aux Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display

原创 ts文件解密

通過m3u8下載視頻文件, 下載完成後無法播放。查看m3u8文件,發現視頻文件被加密,所以直接下載後不能直接播放。 這裏使用了AES-128加密,並且有IV, 所以是cbc模式。 解密方法: (1) 下載key, 16字節數據。 使用o

原创 pyuv 實現 tcpping 問題記錄

使用pyuv實現tcpping功能, 發現連接成功率偶爾會很低,但抓包發現實際的成功率要比探測結果高。 程序流程: 創建pyuv.Timer, 進行週期連接以及判斷超時。創建socket, 添加到pyuv.loop中,進行可寫事件監聽,