diff --git a/README.md b/README.md index 4f6c5c7..5e384c3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## 说明 - 这个仓库是由rangersly在实践中慢慢积累出来的,原是个人使用性质,所以做的比较粗糙,朋友们可以自由参考,如果有认为有误或不足的地方欢迎大家提出 Issue 或提交 PR 哦. -- 仓库主要收录的是与计算机相关的内容,甚至(打算)包括电子信息,无线电等领域的知识 +- 主要收录与计算机相关的内容 --- diff --git a/electronic/parameter.md b/electronic/parameter.md deleted file mode 100644 index cc78f73..0000000 --- a/electronic/parameter.md +++ /dev/null @@ -1,10 +0,0 @@ -# 电子硬件参数 - -## index -- [电阻](#) -- [电容](#) -- [电感](#) -- [微控制器](#) -- [逻辑器件](#) -- [晶体管](#) - diff --git a/hardware/io/usb.md b/hardware/io/usb.md deleted file mode 100644 index b76fe13..0000000 --- a/hardware/io/usb.md +++ /dev/null @@ -1,63 +0,0 @@ -# USB - -![usb speed](../../pic/usb.png) -![usb sign](../../pic/usb3.png) -![雷电](../../pic/usb2.png) - ---- - -- USB 1.0分为两个版本: -- USB 1.0 Low Speed理论最高速率为1.5Mbit/s或0.1875MBytes/s。 -- USB 1.0 Full Speed理论最高速率为12Mbit/s或1.5MBytes/s。 - ---- - -- USB 1.1(即USB 1.0 Full Speed)理论最高速率为12Mbit/s或1.5MBytes/s。 - ---- - -- USB 2.0分为两个版本: -- USB 2.0 Full Speed(即USB 1.1)理论最高速率为12Mbit/s或1.5MBytes/s。 -- USB 2.0 Hi Speed理论最高速率为480Mbit/s或60MBytes/s。 - ---- - -- USB 3.0的理论最高速率为5Gbit/s或600MBytes/s。 - ---- - -- USB 3.1分为两个版本: -- USB 3.1 Gen 1(即USB 3.0)理论最高速率为5Gbit/s或600MBytes/s。 -- USB 3.1 Gen 2理论最高速率为10Gbit/s或1250MBytes/s。 - ---- - -- USB 3.2分为三个版本: -- USB 3.2 Gen 1(即USB 3.1 Gen 1)理论最高速率为5Gbit/s或600MBytes/s。 -- USB 3.2 Gen 2(即USB 3.1 Gen 2)理论最高速率为10Gbit/s或1250MBytes/s。 -- USB 3.2 Gen 2×2(即USB 3.1 Gen 2双通道,仅限Type-C接口)理论最高速率为20Gbit/s或2500MBytes/s。 - ---- - -- USB 4分为两个版本: -- USB 4 v1.0(仅限Type-C接口)的理论最高速率为40Gbit/s或5000MBytes/s。 -- USB 4 v2.0(仅限Type-C接口)的理论最高速率为80Gbit/s或10000MBytes/s。 - ---- - -- 雷电(Thunderbolt)分为五个版本: -- 雷电1代(Thunderbolt 1)理论最高速率为10Gbit/s或1250MBytes/s。 -- 雷电2代(Thunderbolt 2)理论最高速率为20Gbit/s或2500MBytes/s。 -- 雷电3代(Thunderbolt 3)理论最高速率为40Gbit/s或5000MBytes/s。 -- 雷电4代(Thunderbolt 4)理论最高速率为40Gbit/s或5000MBytes/s。 -- 雷电5代(Thunderbolt 5)理论最高速率为80Gbit/s或10000MBytes/s。 - -- __注意:实际传输速度取决于很多方面,而且很难达到理论速度。__ - -1. 单位换算:1Byte=8bit。 -2. 软件方面要求必须正确安装相关驱动。 -3. 硬件要求连接的双方都必须支持同种版本的USB或雷电(Thunderbolt)接口,若不同,传输速度则以速度低的一方为基准。 -4. 即使连接的双方USB或雷电(Thunderbolt)接口版本相同,不同的存储介质,其速度也不一样。 -5. 基于闪存(Flash芯片)存储设备的速度取决于Flash芯片的类型(SLC/MLC/TLC/QLC)和等级、主控芯片、缓存等因素。普通机械硬盘的读写速度取决于盘片的数量、转速和缓存等因素。 -6. USB接口有多种颜色,黑色USB接口是USB2.0接口,蓝色USB接口是USB3.0接口(USB 3.1 Gen 1),青绿色和红色USB接口是USB 3.1 Gen 2接口,黄色USB接口是支持关机充电的USB2.0接口,叫做Powered USB。 -7. USB接口的外形有Type-A(常见于电脑)、Type-B(常见于打印机)、Type-C(常见于新型号电脑和手机)和Mini USB(Mini-B接口常见于扫描仪)、Micro USB(Micro-B接口常见于安卓手机)等。 diff --git a/os/linux/arch/command.md b/linux/arch/command.md similarity index 100% rename from os/linux/arch/command.md rename to linux/arch/command.md diff --git a/os/linux/arch/install.md b/linux/arch/install.md similarity index 100% rename from os/linux/arch/install.md rename to linux/arch/install.md diff --git a/os/linux/command.md b/linux/command.md similarity index 99% rename from os/linux/command.md rename to linux/command.md index 8066293..6680039 100644 --- a/os/linux/command.md +++ b/linux/command.md @@ -43,7 +43,8 @@ - [which](#which):查找命令 - [whoami](#whoami) - [uname](#uname):系统内核版本等信息 -- [objdump](../../program/tool/objdump) +- [objdump](../program/tool/objdump.md) : 可自行文件反汇编 +- [readelf](../program/tool/readelf.md) : 观察elf文件结构 - [index](#index) @@ -122,7 +123,7 @@ - [curl](#curl) - [wget](#wget) - [NetworkManager](#networkmanager) - +- [nmap](#nmap) - [index](#index) diff --git a/os/linux/config/.bashrc b/linux/config/.bashrc similarity index 100% rename from os/linux/config/.bashrc rename to linux/config/.bashrc diff --git a/os/linux/config/backup.sh b/linux/config/backup.sh similarity index 100% rename from os/linux/config/backup.sh rename to linux/config/backup.sh diff --git a/os/linux/knowledge/Huge_Page b/linux/knowledge/Huge_Page similarity index 100% rename from os/linux/knowledge/Huge_Page rename to linux/knowledge/Huge_Page diff --git a/os/linux/knowledge/elf.md b/linux/knowledge/elf.md similarity index 100% rename from os/linux/knowledge/elf.md rename to linux/knowledge/elf.md diff --git a/os/linux/knowledge/file_system_struct.md b/linux/knowledge/file_system_struct.md similarity index 100% rename from os/linux/knowledge/file_system_struct.md rename to linux/knowledge/file_system_struct.md diff --git a/os/linux/knowledge/keybroad.md b/linux/knowledge/keybroad.md similarity index 88% rename from os/linux/knowledge/keybroad.md rename to linux/knowledge/keybroad.md index 0f1ffed..56faad8 100644 --- a/os/linux/knowledge/keybroad.md +++ b/linux/knowledge/keybroad.md @@ -1,6 +1,9 @@ # linux键盘高级操作技巧 man readline -> 光标移动 + +--- + +- 光标移动 + C a # 到行首 + C e # 到行末 + C f # 下一个字符 @@ -10,16 +13,22 @@ man readline + A b # 上一个词 ___按住Ctrl的同时按方向键可以快速移动___ -> 文本修改 +--- + +- 文本修改 + C t # 与上一个字符互换 + A t # 与上一个词互换 -> 批量处理 +--- + +- 批量处理 + C k # 剪切到行尾 + C u # 剪切到行首 + C y # 粘贴 -> 命令 +--- + +- 命令 + C p # 上一个命令 + C n # 下一个命令 + C j # 复制 diff --git a/os/linux/knowledge/proc/proc b/linux/knowledge/proc/proc similarity index 100% rename from os/linux/knowledge/proc/proc rename to linux/knowledge/proc/proc diff --git a/os/linux/knowledge/proc/proc_pid_filesystem b/linux/knowledge/proc/proc_pid_filesystem similarity index 100% rename from os/linux/knowledge/proc/proc_pid_filesystem rename to linux/knowledge/proc/proc_pid_filesystem diff --git a/miscellaneous/OrdinaryHeroChronicles.md b/miscellaneous/OrdinaryHeroChronicles.md deleted file mode 100644 index 8a0105f..0000000 --- a/miscellaneous/OrdinaryHeroChronicles.md +++ /dev/null @@ -1,20 +0,0 @@ -# 谨以此表,以记平凡的英雄们 - -# 华中农业大学学术造假事件发起联合举报的11位学子 - 黄飞若教授学术造假 - 2024年1月16日 11位学生联合举报黄飞若为首的学术造假事件 - 虽螳臂当车吾亦往矣(举报pdf结语) - 星星之火,可以燎原,把这枚火种,传下去! - -# 雨希不想画画 up 2006/11/9--2024/2/22 - 2024年2月21日下午5点54分, - 放学后外出吃饭的过程中为救一位小孩被车碾压,次日抢救无效离世 - 被救的小朋友并无生命危险,仅伤到腿 - 雨希以生命为代价救下了这位小朋友 - -# 永城市实验高级中学5.14事件全体学生 - 2015年5月14日 - 起因 食堂条件差,且食堂经理殴打买茶叶蛋师娘,校领导不作为 - 学生强烈抗议,打砸食堂 - 事件过后领头学生被叫到校领导办公室处置,学生发起二次冲锋 - 结果 校领导被撤销党内职务,行政撤职处分 diff --git a/os/linux/knowledge/bash/Simple-concurrency.sh b/os/linux/knowledge/bash/Simple-concurrency.sh deleted file mode 100644 index f9084a3..0000000 --- a/os/linux/knowledge/bash/Simple-concurrency.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# 并行运行多个命令 -command1 & -command2 & -command3 & - -# 等待所有后台任务完成 -wait - -echo "所有任务执行完毕" diff --git a/os/linux/knowledge/bash/format.sh b/os/linux/knowledge/bash/format.sh deleted file mode 100644 index 0ed819d..0000000 --- a/os/linux/knowledge/bash/format.sh +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright(c) 2024 ely. All rights reserved. -# -# Name: format.sh v1.0 -# -# Program: -# Shell Script format -# -# History: -# 2024/07/24 e0x1a new commit -# -# AUTHOR: -# e0x1a "e0x1a@aliyun.com" -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH diff --git a/os/windows/bat/查询视频.bat b/os/windows/bat/查询视频.bat deleted file mode 100644 index 6999a8a..0000000 --- a/os/windows/bat/查询视频.bat +++ /dev/null @@ -1,2 +0,0 @@ -dir /s/a/b/os 此电脑\HONOR 20 PRO\内部存储*.mp4 -pause \ No newline at end of file diff --git a/pic/usb.png b/pic/usb.png deleted file mode 100644 index 0154e3b..0000000 Binary files a/pic/usb.png and /dev/null differ diff --git a/pic/usb2.png b/pic/usb2.png deleted file mode 100644 index 4ba09ad..0000000 Binary files a/pic/usb2.png and /dev/null differ diff --git a/pic/usb3.png b/pic/usb3.png deleted file mode 100644 index 90b9dc6..0000000 Binary files a/pic/usb3.png and /dev/null differ diff --git a/program/algorithms/P1009_string.cpp b/program/algorithms/P1009_string.cpp deleted file mode 100644 index 975cdca..0000000 --- a/program/algorithms/P1009_string.cpp +++ /dev/null @@ -1,61 +0,0 @@ -//string + * -#include -using namespace std; -string operator *(string a,string b) -{ - string c; - int al=a.length(),bl=b.length(),cl=0; - int *ci; - ci=new int[al+bl+5]; - for(int i=0;i<(al+bl+5);i++)ci[i]=0; - for(int i=0;ibl?al:bl; - c.resize(l+3); - for(int i=0;i=0)c[i]=a[al-i-1]+c[i]; - if((bl-i-1)>=0)c[i]=b[bl-i-1]+c[i]; - } - for(int i=0;i<(l+2);i++)//处理进位 - { - c[i+1]+=c[i]/10; - if(c[i+1]!=0)cl=i+1; - c[i]=c[i]%10+48; - } - if(c[cl]<10)c[cl]+=48; - char t; //c反转 - for(int i=0;i<=cl/2;i++){t=c[i];c[i]=c[cl-i];c[cl-i]=t;} - c.resize(cl+1); - return c; -} -int main() -{ - string a,b; - cin>>a>>b; - cout< -using namespace std; -bool zs(int a) -{ - for(int i=2;i*i<=a;i++)if(a%i==0)return false; - return true; -} -int main() -{ - int l,max=0; - cin>>l; - for(int i=2;l'9'){if(data!=0)break;}else data=data*10+(int)(ch-48);} - return data; -} +/* 使用宏进行快读,使用时尽量注意,不要使用表达式作为参数 */ +#define FAST_READ(data) do{ + data=0; char ch; + do{ch = getchar();}while(ch<'0' || ch>'9'); + do{data = data * 10 + (ch - '0'); ch = getchar();} while(ch > '0' && ch < '9'); +} while(0); int main() { diff --git a/program/algorithms/xds_mod.cpp b/program/algorithms/xds_mod.cpp deleted file mode 100644 index 5bfd399..0000000 --- a/program/algorithms/xds_mod.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2024 e0x1a.ly. All rights reserved. -#include -using namespace std; -class Node -{ -public: - Node(){c_l=c_r=c_max=c_sum=c_lag=0;tl=NULL;tr=NULL;} - - void build(int *arr,int l,int r) - { - c_l=l;c_r=r; - if(l==r) {c_max=arr[l];c_sum=arr[l];} - else { - tl=new Node;tr=new Node; - tl->build(arr,l,(l+r)/2); - tr->build(arr,(l+r)/2+1,r); - c_max = tl->c_max > tr->c_max ? tl->c_max:tr->c_max; - c_sum = tl->c_sum + tr->c_sum; - } - } - - void print(int cnt=1) - { - printf("%5d---%5d---%5d\n",cnt,c_max,c_sum); - if(c_l != c_r) - { - tl->print(cnt+1); - tr->print(cnt+1); - } - } - - - int ask_max(int l,int r) - { - if(c_l >= l && c_r <= r) - return c_max; - int t_max1=0,t_max2=0; - if((c_l+c_r)/2 < r) t_max1=tr->ask_max(l,r); - if((c_l+c_r)/2+1 > l) t_max2=tl->ask_max(l,r) ; - return t_max1 > t_max2 ? t_max1 : t_max2; - } - - int ask_sum(int l,int r) - { - if(c_l >= l && c_r <= r) - return c_sum; - int t_sum1=0,t_sum2=0; - if((c_l+c_r)/2 < r) t_sum1=tr->ask_sum(l,r); - if((c_l+c_r)/2+1 > l) t_sum2=tl->ask_sum(l,r) ; - return t_sum1 + t_sum2; - } - - void change(int x,int value) - { - if(c_l == x && c_r == x) - c_max=c_sum=value; - else { - if((c_l+c_r)/2+1 >x) tl->change(x,value); - else tr->change(x,value); - c_max = tl->c_max > tr->c_max ? tl->c_max:tr->c_max; - c_sum = tl->c_sum + tr->c_sum; - } - } - - void add(int l,int r,int value) - { - if(c_l >= l && c_r <= r) - { - if(c_l==c_r) - c_sum=c_max+=value; - else { - c_lag+=value; - } - } else if(c_l != c_r){ - if(l <= (c_l+c_r)/2) tl->add(l,r,value); - if(r > (c_l+c_r)/2) tr->add(l,r,value); - c_max = tl->c_max > tr->c_max ? tl->c_max:tr->c_max; - c_sum = tl->c_sum + tr->c_sum; - } - } - -private: - int c_l,c_r,c_max,c_sum,c_lag; - Node *tl,*tr; -}; - -int main() -{ - Node s; - int *arr,n; - cin>>n; - arr=new int[n+1];arr[0]=n; - for(int i=1;i<(n+1);i++) - cin>>arr[i]; - s.build(arr,1,n); - s.print(); - while(1) - { - int x,y,v; - cin>>n; - if(!n)break; - switch(n) - { - case 1: cin>>x>>y;s.change(x,y);break; - case 2: cin>>x>>y;cout<>x>>y>>v;s.add(x,y,v);break; - case 4: cin>>x>>y;cout< +#include + +#ifdef DEBUG + /* 字符串检查宏,输出字符串的每一位数据*/ + #define POINT_STR(str, len) size_t _len = (size_t)len; \ + printf("%s\033[0m\n", str); \ + for(int i = 0; i < _len; i++) { \ + printf("%d --- %2x \n", i, (char)str[i], (unsigned char)str[i]);} + + /*输出调试错误报错信息,辅助定位错误地点*/ + #define PERROR(str) printf("%s:%d:%s:\n%s\n", __FILE__, __LINE__, __func__, str); exit(0) +#else + #define POINT_STR(str, len) + #define PERROR(str) +#endif + diff --git a/program/c_cpp/library/self/log/log.c b/program/c_cpp/mylib/log/log.c similarity index 100% rename from program/c_cpp/library/self/log/log.c rename to program/c_cpp/mylib/log/log.c diff --git a/program/c_cpp/library/self/log/log.h b/program/c_cpp/mylib/log/log.h similarity index 100% rename from program/c_cpp/library/self/log/log.h rename to program/c_cpp/mylib/log/log.h diff --git a/program/c_cpp/library/self/offsetof.h b/program/c_cpp/mylib/offsetof.h similarity index 100% rename from program/c_cpp/library/self/offsetof.h rename to program/c_cpp/mylib/offsetof.h diff --git a/program/c_cpp/library/self/string_hash.c b/program/c_cpp/mylib/string_hash.c similarity index 100% rename from program/c_cpp/library/self/string_hash.c rename to program/c_cpp/mylib/string_hash.c diff --git a/program/c_cpp/library/self/thread-pool.cpp b/program/c_cpp/mylib/thread-pool.cpp similarity index 100% rename from program/c_cpp/library/self/thread-pool.cpp rename to program/c_cpp/mylib/thread-pool.cpp diff --git a/program/c_cpp/library/libs.md b/program/c_cpp/universal/libs.md similarity index 98% rename from program/c_cpp/library/libs.md rename to program/c_cpp/universal/libs.md index 2ec1a36..0a1062b 100644 --- a/program/c_cpp/library/libs.md +++ b/program/c_cpp/universal/libs.md @@ -5,9 +5,9 @@ ## index - [C](#c) - - [输入/输出 stdio](../universal/io.md) + - [输入/输出 stdio](./io.md) - [资源管理和系统交互 stdlib](#stdlib) - - [字符串处理 string](../universal/cstring.md) + - [字符串处理 string](./cstring.md) - [数学函数 math](#math) - [字符处理 ctype](#ctype) - [时间/日期 time](#time) @@ -30,11 +30,12 @@ - [STL](../STL/) - [POSIX](#unistd) - [SELF](#self) - - [offsetof](./self/offsetof.h) - - [string hash](./self/string_hash.c) - - [thread pool](./self/thread-pool.cpp) - - [BIT](./self/bit.h) - - [LOG](./self/log/log.h) + - [offsetof](../mylib/offsetof.h) : 计算结构体成员相对结构体首地址的偏移度 + - [string hash](../mylib/string_hash.c) + - [thread pool](../mylib/thread-pool.cpp) + - [BIT](../mylib/bit.h) + - [LOG](../mylib/log/log.h) + - [dbtools](../mylib/dbtools.h) --- @@ -42,7 +43,7 @@ ### 动态内存管理 -- [看这里哦](../universal/dynamic-memory.md) +- [看这里哦](./dynamic-memory.md) ### 程序终止与控制 diff --git a/program/tool/sdcc.md b/program/tool/sdcc.md new file mode 100644 index 0000000..377bca0 --- /dev/null +++ b/program/tool/sdcc.md @@ -0,0 +1,52 @@ +# sdcc + +--- + +## index + +- [编译流程](#编译流程) +- [特殊语法](#特殊语法) +- [优化选项](#优化选项) +- [调试工具](#调试工具) +- [](#) +- [](#) + +--- + +### **编译流程** +- **输出文件**: + - `main.ihx`:Intel Hex 格式的固件文件(可直接烧录)。 + - `main.asm`:生成的汇编代码(便于调试)。 + - `main.lk`:链接器脚本。 + - `main.map`:内存映射和符号表。 + - `main.rel` : 参与连接的文件 +--- + +### **特殊语法** + +针对8051单片机 + +- **内存类型修饰符** +- `__code` : 将变量存储在代码区 ROM +- `__data`:将变量存储在内部 RAM(直接寻址区)。 +- `__xdata`:将变量存储在外部 RAM(扩展 XDATA 区)。 +- `__bit`:定义位变量(仅限 8051 的位寻址区)。 + +--- + +### **优化选项** +- **常用编译选项**: + - `--model-`:指定内存模型(如 `--model-small`、`--model-large`)。 + - `--opt-code-size`:优化代码大小。 + - `--nogcse` : 按需选择,避免未使用的 函数/变量 占用空间 + - `--stack-auto`:自动分配堆栈(适用于函数调用)。 + - `--nooverlay`:禁用函数参数和局部变量的覆盖优化。 + - `--verbose`:显示详细编译过程。 + +--- + +### **调试工具** +- **生成调试信息** +```bash +sdcc --debug main.c # 生成 .cdb 调试文件 +``` diff --git a/radio/antenna.md b/radio/antenna.md deleted file mode 100644 index 3990a05..0000000 --- a/radio/antenna.md +++ /dev/null @@ -1,37 +0,0 @@ -# 天线相关 - -## index -- [极化](# 极化) - -## 极化 -在无线电通信中,垂直极化和水平极化是两种常见的天线极化方式,它们的区别主要体现在电磁波的振动方向、传播特性以及应用场景上。以下是具体对比: - -### **1. 极化方向** -- **垂直极化**:电磁波的电场分量(E-field)与地面垂直振动,天线通常垂直于地面放置(如直立杆状天线)。 -- **水平极化**:电磁波的电场分量与地面平行振动,天线通常水平架设(如水平拉长的偶极天线)。 - -### **2. 传播特性** -- **地面反射影响**: - - 垂直极化波在地面反射时相位变化较小,更适合地面波传播(如AM广播、车载通信)。 - - 水平极化波的地面反射可能导致信号抵消(尤其在仰角较低时),但对天波传播(如短波通信)更有利。 -- **抗干扰能力**: - - 垂直极化更容易受到地面物体(如建筑物、树木)的反射干扰。 - - 水平极化受地面干扰较小,但在城市环境中可能受多径效应影响。 - -### **3. 应用场景** -- **垂直极化**: - - **移动通信**(如车载天线、对讲机):便于安装,适应移动设备姿态变化。 - - **低频段通信**(如30MHz以下):地波传播效率高。 -- **水平极化**: - - **电视广播**(传统地面电视):减少地面反射干扰,覆盖更稳定。 - - **卫星通信**:减少电离层对极化旋转的影响(常与圆极化结合使用)。 - - **短波通信**:利用电离层反射时效率更高。 - -### **4. 天线安装与兼容性** -- **极化匹配**: - - 收发天线极化方式需一致,否则会导致严重信号衰减(如垂直天线无法有效接收水平极化波)。 - - 特殊场景(如卫星通信)可能采用圆极化以避免极化失配。 - -### **总结选择依据** -- **优先垂直极化**:移动通信、地波传播、简化安装。 -- **优先水平极化**:固定点对点通信、减少地面干扰、高频段应用。 diff --git a/program/tool/docker.md b/tool/docker.md similarity index 100% rename from program/tool/docker.md rename to tool/docker.md diff --git a/miscellaneous/markdown.md b/tool/markdown.md similarity index 100% rename from miscellaneous/markdown.md rename to tool/markdown.md diff --git a/tool/net/curl b/tool/net/curl deleted file mode 100644 index 5c7bf7e..0000000 --- a/tool/net/curl +++ /dev/null @@ -1,20 +0,0 @@ -curl [URL] #默认GET请求 - -curl -X -POST [URL] #POST请求 -== curl -XPOST [URL] - -curl [URL] -d 'data' #添加数据 -curl -XPUT [URL] -d 'data_new' #更新数据 -curl -XDELETE [URL] #删除数据 - -curl -I [URL] #返回首部 - -curl -O [URL] #下载资源 - -o [name] #自定义文件名 - -curl --limit-rate [速度] -o [name] -O [URL] #限速下载 - -curl -C - -o [name] [URL] #中断下载后继续 - -curl [...] -L #跟随重定向 -curl -v [...] #显示底层连接信息 diff --git a/tool/net/nmap b/tool/net/nmap deleted file mode 100644 index 3d7d674..0000000 --- a/tool/net/nmap +++ /dev/null @@ -1,20 +0,0 @@ -# 一般探测步骤 -# 1.主机发现 -# 2.端口扫描 - - -nmap -p- [目标] # 扫描全部TCP端口 -nmap -p [端口] # 扫描指定TCP端口 - -nmap -sT # 使用TCP扫描 , 完成握手流程 -nmap -sU # 使用UDP扫描 -nmap -sS # 不完成整个握手过程 -nmap -sUV # UDP + 版本探测 确认目标主机状态 -nmap -sUV --top-ports 100 # 扫描常用的100端口 - -# UDP 由于探测不稳定性高,采用多次探测,因此速度慢 - -nmap -sn [目标] # ping 可用'-' 进行范围探测,内网ARP,外网ICMP包(会被windows server拦截) -nmap -sn 192.168.0.1-100 -nmap -Pn [目标] # 可以绕过防火墙(慢) 不用Ping - diff --git a/tool/net/ssh/config b/tool/ssh/config similarity index 100% rename from tool/net/ssh/config rename to tool/ssh/config diff --git a/tool/net/ssh/ssh.md b/tool/ssh/ssh.md similarity index 77% rename from tool/net/ssh/ssh.md rename to tool/ssh/ssh.md index 67e5776..c5220fc 100644 --- a/tool/net/ssh/ssh.md +++ b/tool/ssh/ssh.md @@ -1,11 +1,11 @@ # ssh 隧道转发 -> 本地转发 +- 本地转发 + 本地端口转发到远端服务器 - + ssh -L local_port:remote_host:remote_port user@ssh_server + + `ssh -L local_port:remote_host:remote_port user@ssh_server` -> 远程转发 +- 远程转发 + 远程转发到本地 - + ssh -R remote_host:local_host:local_port user@ssh_server + + `ssh -R remote_host:local_host:local_port user@ssh_server` @@ -16,22 +16,23 @@ SSH免密登录是一种使用SSH协议进行身份验证的方法,它允许 ssh-keygen -t rsa -b 4096 2. **复制公钥到远程服务器**: - 使用`ssh-copy-id`命令将公钥复制到远程服务器。例如: - ssh-copy-id user@remote_host + `ssh-copy-id user@remote_host` - 这将自动将你的公钥添加到远程服务器的`~/.ssh/authorized_keys`文件中。 3. **配置SSH客户端**: - 确保你的SSH客户端配置文件`~/.ssh/config`正确设置,以便使用私钥进行身份验证。例如: 4. **禁用密码登录**: - - /etc/ssh/sshd_config + - `/etc/ssh/sshd_config` - 设置PasswordAuthentication no 5. **测试免密登录**: 6. **注意事项**: - 确保远程服务器的SSH服务配置允许密钥认证。通常在`/etc/ssh/sshd_config`文件中设置。 - 确保本地和远程的SSH配置文件没有错误,并且权限设置正确。 -以上步骤应该可以帮助你设置SSH免密登录。如果你遇到任何问题,可以查看SSH的日志文件或使用`-v`参数进行调试,例如: - ssh -v user@remote_host +遇到任何问题,可以查看SSH的日志文件或使用`-v`参数进行调试 +- `ssh -v user@remote_host` # ssh: config 文件 +```config Host iaalai HostName api.iaalai.cn #连接地址 User e0x1a #连接用户名 @@ -40,3 +41,4 @@ Host iaalai IdentitiesOnly yes #仅使用密钥 ServerAliveInterval 60 #每60s发一个空包保持连接 ServerAliveCountMax 3 #3次未响应断开 +``` diff --git a/miscellaneous/web.md b/tool/web.md similarity index 100% rename from miscellaneous/web.md rename to tool/web.md diff --git a/os/windows/Windows+R.txt b/windows/Windows+R.txt similarity index 100% rename from os/windows/Windows+R.txt rename to windows/Windows+R.txt diff --git a/os/windows/cmd/cmd.txt b/windows/cmd/cmd.txt similarity index 100% rename from os/windows/cmd/cmd.txt rename to windows/cmd/cmd.txt diff --git a/os/windows/vbs/VBS.txt b/windows/vbs/VBS.txt similarity index 100% rename from os/windows/vbs/VBS.txt rename to windows/vbs/VBS.txt diff --git a/os/windows/vbs/nv.vbs b/windows/vbs/nv.vbs similarity index 100% rename from os/windows/vbs/nv.vbs rename to windows/vbs/nv.vbs diff --git a/os/windows/vbs/vbs整人小脚本.txt b/windows/vbs/vbs整人小脚本.txt similarity index 100% rename from os/windows/vbs/vbs整人小脚本.txt rename to windows/vbs/vbs整人小脚本.txt diff --git a/os/windows/vbs/小秘密.vbs b/windows/vbs/小秘密.vbs similarity index 100% rename from os/windows/vbs/小秘密.vbs rename to windows/vbs/小秘密.vbs diff --git a/os/windows/快捷键.txt b/windows/快捷键.txt similarity index 100% rename from os/windows/快捷键.txt rename to windows/快捷键.txt diff --git a/os/windows/注册表.txt b/windows/注册表.txt similarity index 100% rename from os/windows/注册表.txt rename to windows/注册表.txt