2023年4月18日 星期二
2023年3月26日 星期日
2023年3月18日 星期六
[C][string] printf/printk文字上色
上色
30(黑色)、31(红色)、32(綠色)、 33(黄色)、34(藍色)、35(桃红)、36(青色)、37(白色)
30(黑色)、31(红色)、32(綠色)、 33(黄色)、34(藍色)、35(桃红)、36(青色)、37(白色)
printf("\033[1;31m%s = %s\033[0m\n", key, value); printk("\033[1;31m%s = %d\033[0m\n", key, value);僅linux可用
[C][string] fprintf/sprintf用法
●fprintf: 輸入格式化的文字到文件中
file printf
#include <stdio.h> #include <stdlib.h> int main(void) { FILE *fPtr; int age = 20; fPtr = fopen("test.txt", "w"); if (!fPtr) { printf("open file fail\n"); return 0; } fprintf(fPtr, "I am %d years old.\n", age ); fclose(fPtr); return 0; }
2023年3月7日 星期二
[Linux] ar vs. gcc-ar
gcc-ar的意思是多包了--plugin=/path/to/liblto_plugin.so
所以 gcc-ar = ar --plugin=/path/to/liblto_plugin.so
2023年2月23日 星期四
2023年2月22日 星期三
[Linux] iptables無法過濾URL問題
假設今天用iptable drop www.google.com
iptable command:
iptables -I FOEWARD -m string --string “google.com" --algo bm -j DROP
但卻無法擋住(drop)www.google.com ...
- HTTP2.0: DNS Query → TCP handshake → TLS handshake
- HTTP3.0: DNS Query → QUIC handshake
訂閱:
意見 (Atom)