各次培训记录

理论培训

时间 名称 部门 老师
2024-7-2 我院护理现状及护理学科发展 护理部 黄华平
2024-7-2 临床护理中的伦理问题 护理部 李桂蓉
2024-7-2 护士规范化培训管理规范及实施细则 护理部 李桂蓉
2024-7-2 护士职业生涯规划 护理部 唐喻莹
2024-7-2 护士礼仪与沟通 护理部 邱云
2024-7-3 护理不良事件的预防和处置 护理部 李红
2024-7-3 临床危机值报告和处置 护理部 何晓春
2024-7-3 护理质量与安全-护理核心制度 护理部 李希西
2024-7-3 危重患者病情观察 护理部 罗敏
2024-7-3 常见检验检查的准备与配合要点 护理部 黄莉莉
2024-7-4 患者风险评估与防范 护理部 王邦俊
2024-7-4 静脉输液操作技术规范 护理部 杨静
2024-7-4 临床输血操作技术规范 护理部 王静
2024-7-4 患者十大安全目标 护理部 蒲静
2024-7-4 护理文件书写及法律法规 护理部 李小玉
2024-7-5 医生眼中的护士-护士应具备的能力和修养 护理部 马燕飞
2024-7-5 当压力来敲门-压力应对与调节 护理部 唐毅
2024-7-5 医院志愿服务文化 护理部 王晓燕
2024-7-5 护理应急预案 护理部 曾晓红
2024-7-15 激昂青春 不负韶华 院级 周良学
2024-7-15 医德医风与廉洁文化 院级 杨艳
2024-7-15 铭记初心,不忘使命 院级 党委办公室
2024-7-15 人才管理与制度 院级 人力资源科
2024-7-15 宣传安全与自媒体管理 院级 宣传科
2024-7-15 依法执业与医疗质量安全 院级 医务科
2024-7-15 临床科员思维养成 院级 科技科
2024-7-15 继续教育及教学相关要求 院级 教学科
2024-7-15 新员工上岗前医保政策培训 院级 医保科
2024-7-15 医院信息系统操作 院级 信息中心
2024-7-16 院办工作与临床工作的连接点 院级 院办公室
2024-7-16 运营管理科及医院运营管理体系简介 院级 运营管理科
2024-7-16 医院感染预防 院级 医院感染管理科
2024-7-16 职业防护 院级 公共卫生和预防保健科
2024-7-16 医患关系 院级 医患关系办公室
2024-7-16 新员工入职心理调适 院级 心身医学科
2024-7-16 治安/消防/生产安全 院级 安全保卫科
2024-7-16 行万里路,初心如一-我从医的平凡之路 院级 段劲风
2024-7-16 医者微光,温暖明亮-我的勇毅行医之路 院级 李燕华
2024-7-16 赓续传承,砥砺奋进-我与医院的不解“情缘” 院级 李琳
2024-7-16 脚踏实地,仰望星空-我与科研相伴而行 院级 徐蓓
2024-7-16 青春正当时 院级 院团委
2024-7-24 异常心电图的识别及处理 内科部 肖烨
2024-7-24 《护理文书书写规范》解读 内科部 曾鑫
2024-7-25 四川省护理学会2024年护理科普会议学习汇报 感染科 林双双
2024-7-25 患者被困电梯导致病情加重 感染科 谭利
2024-7-25 住院患者如何体现护理人文关怀 感染科 舒淼
2024-7-25 四川省护理学会2024年感染性疾病护理年会学习汇报 感染科 劣杰
2024-7-25 《老年人误吸的预防》团体标准解读 感染科 聂玉婷
2024-7-25 护理质量及安全会议 感染科 杜宁莉
2024-7-25 《中国护理质量大会》学习汇报 感染科 杜宁莉
2024-8-21 感染科入科教育培训 感染科 谢俊华
2024-8-21 护理文件书写 感染科 张一霏
2024-8-22 普通外科常见手术及围手术期护理 护理部 尚建英
2024-8-22 压力性损伤的分期预防及护理 护理部 张燕
2024-8-27 肺癌的内科护理 呼吸内科 杨爱萍
2024-8-27 肺癌的外科护理 心胸外科 谢明秀
2024-9-11 黄疸待查 感染科 王琴
2024-9-11 病毒性肝炎的护理 感染科 王琴
2024-9-18 标本采集法 护理部 邱勤
4/9(1组) 11/9(2组)
18/9(3组) 25/9(4组)
2024-9-24 血气分析解读 呼吸内科 向宇
2024-9-24 特发性肺纤维化的护理 呼吸与危重症医学科 黄亚梅
2024-9-24 护理质量与安全会议 感染科
2024-9-24 药品安全管理常见问题及对策 感染科 李林隅
2024-9-24 9S环境质量 感染科 曹冬梅
2024-9-24 病区环境管理质量 感染科 王佳
2024-9-24 住院患者心理护理质量 感染科 陈昌群
2024-9-24 查对制度落实合格率数据收集表及操作相关质量督导 感染科 杜宁莉
2024-9-24 肝衰竭病人的护理 感染科 曹冬梅
2024-9-24 人工肝治疗 感染科 曹冬梅
2024-9-26 血透导管的维护 内科部 赵兰
2024-9-27 管道护理 护理部 曾鑫
2024-9-27 心血管常见疾病及护理要点 护理部 蒋洪
2024-10-17 重症肺炎的护理 感染科 谭丽
2024-10-17 COPD患者的护理 感染科 谭丽
2024-10-23 重症肺炎 感染科 杜宁莉
2023-10-23 感染科常见化验结果临床意义 感染科 杜宁莉
2024-10-23 无创正压通气临床应用 呼吸与危重医学科 赵静
2024-10-24 VTE防控管理的现状和改进对策 内科部 许琴
2024-10-25 医务人员职业暴露与防护 护理部 万丽
2024-10-25 成人血液系统常见疾病及护理 护理部 王静

操作培训

时间 名称 部门 老师1 老师2
2024-7-8 操作示范及练习:口腔护理 护理部 闫晓玲 曾鑫
2024-7-8 操作示范及练习:导尿术 护理部 龙海丽 李玮
:2024-7-8 操作示范及练习:留指针静脉输液 护理部 刘忠丽 刘莎莎
2024-7-8 操作示范及练习:鼻导管吸氧 护理部 何海燕 罗银娟
2024-7-9 操作示范及练习:胃肠减压 护理部 向冬梅 孙薇
2024-7-9 操作示范及练习:无菌技术 护理部 文方 谢小芳
2024-7-9 操作示范及练习:洗手法、肌肉注射 护理部 何玲 宾姝
2024-7-9 操作示范及练习:皮内注射、皮下注射 护理部 秦小英 邱勤
2024-7-10 操作示范及练习:心电监护 护理部 李红梅 雷利梅
2024-7-10 操作示范及练习:静脉采血 护理部 朱华 王小艳
2024-7-10 操作示范及练习:生命体征测量 护理部 张燕 江婷
2024-7-10 操作示范及练习:血糖监测 护理部 李佳琪 闵涛
2024-7-11 操作示范及练习:心肺复苏 护理部 张玲玲 许晨
2024-7-11 操作示范及练习:穿脱隔离衣 护理部 胡海燕 曹冬梅
2024-8-14 静脉注射 \ 患者约束 护理部 严凤霖
7/8 (1组)
14/8(2组)
江婷
21/8(3组)
28/8(4组)
2024-8-21 隔离衣穿脱演示 感染科 王佳
2024-8-27 胸腔闭式引流术 心胸外科 田林洁
2024-9-11 灌肠术 感染科 王琴
2024-9-18 标本采集法 护理部 邱勤
4/9(1组)
11/9(2组)
苟敏
18/9(3组)
25/9(4组)
2024-9-24 动脉血气标本采集 感染科 谭丽
2024-10-16 物理降温法 护理部 谭娜娜
9/10(1组)
16/10(2组)
李小玉
23/10(3组)
30/10(4组)

志愿活动

时间 活动名称 部门 老师 参与同学
2024-7-27 永兴镇永发社区义诊 感染科 杜宁莉 1. 陈泓霞
2. 胥桐

linux_lib_time

linux lib time

<time.h>头文件

  • 数据类型

    • time_t (long)存储从1970年1月1日 00:00:00 UTC以来的秒数

    • struct tm{

      • int tm_sec 秒 0~59
      • int tm_min 分钟 0~59
      • int tm_hour 小时 0~23
      • int tm_mday 一个月中的天数 1~31
      • int tm_mon 月 0~11
      • int tm_year 从1970年开始的年份
      • int tm_wday 星期0~6
      • int tm_yday 一年中的天数 0~365
      • int tm_isdst 夏令时标志

      }

    • struct timespec{

      • time_t tv_sec 秒数
      • long tv_nsec 纳秒

      }

    • clockid_t 用于标识时钟的类型,CLOCK_REALTIME & CLOCK_MONOTONIC

    • 常量

      • CLOCK_REALTIME 表示系统当前的实时时间
      • CLOCK_MONOTONIC 表示系统启动以来的时间,不受系统时间的改变
  • 库函数

    • time()
      • time_t time(time_t *tloc);
      • tloc非NULL,当前时间被存储到tloc指向的变量中
      • return 从1970年1月1日00:00:00 UTC到当前的秒数
    • localtime()
      • struct tm* localtime(const time_t *timer);
      • timer 指向time_t的指针
      • return struct tm结构体,表示本地时间
    • gmtime()
      • struct tm* gmtime(const time_t *timer);
      • timer 指向time_t的指针
      • return struct tm结构体,表示utc时间
    • mktime()
      • time_t mktime(struct tm* tm);
      • tm 指向struct tm的指针 ,表示要转换的时间
      • return 转换后的time_t 时间
    • difftime()
      • 计算两个time_t时间值之间的差值
      • double difftime(time_t end, time_t start);
      • end 结束时间 start 开始时间
      • return end-start的差值,秒为单位
    • strftime()
      • size_t strftime(char *s, size_t max, const char *fomat, const struct tm *tm);
      • s指向字符串的指针,用于存储格式化的结果
      • max 格式化字符串
      • format格式
        • 日期格式
          • %Y 年份 2024
          • %y 年份 24
          • %m 月份 数字 01~12
          • %B 完整的月份名称 January
          • %b 缩写的月份名称 Jan
          • %d 月份中的第几天 01~31
          • %A 完整的星期几 Monday
          • %a 缩写的星期几 Mon
          • %j 一年中的第几天 001~365
        • 时间格式
          • %H 24小时制度
          • %I 12小时制
          • %M 分钟
          • %S 秒
          • %p AM或PM
          • %Z 时区名称或缩写
          • %z 时区的数字形式 如 +0200
        • 日期时间混合
          • %c 标准日期和时间字符串 Wed Oct 18 16:54:00 2024
          • %x 标准日期字符串 10/18/2024
          • %X 标准时间字符串 16:54:00
        • 其他
          • %% 表示 %
      • tm 指向struct tm的指针
      • return 成功写入字符串的字符数不包括终止符,失败return 0
    • asctime()
      • char * asctime(const struct tm* tm);
      • tm 指向struct tm的结构体
      • return 格式化之后的字符串
    • ctime()
      • char * ctime(const time_t *timer);
      • timer 指向time_t 的指针
      • return 格式化之后的时间字符串
    • clock()
      • clock_t clock(void);
      • return 程序从启动到当前所消耗的时间,单位时钟周期。

sys/time.h 头文件

  • 主要数据类型

    • struct timeval{

      • time_t tv_sec; 秒数1970-01-01 00:00:00 后的秒数
      • suseconds_t tv_usec;微妙数

      }

    • struct timezone{

      • int tz_minuteswest; 西方时区与utc的时差 分钟
      • int tz_sdttime; 夏令时标志 默认0

      }

    • fd_set

      • 与select()函数一起 使用时,与时间相关的等待操作有密切关系。是用于文件描述符集合的数据类型。 select()函数通过它来监测多个文件描述符的I/O状态。
      • 常用宏
        • FD_ZERO(fd_set *set); 将文件描述符集合set清空
        • FD_SET(int fd, fd_set *set); 将fd添加到set中
        • FD_ISSET(int fd, fd_set *set); 判断fd是否已经添加到set中
        • FD_CLR(int fd, fd_set *set); 将fd 从set中移除。
  • 函数

    • gettimeofday() 获取当前时间,精确到微秒

      • int gettimeofday(struct timeval *tv, struct timezone *tz);
      • tv 指向struct timeval结构体
      • tz 指向struct timezone结构体
      • return 0表示成功, return -1表示失败
    • settimeofday() 设置系统时间

      • int settimeofday(const struct timeval *tv, const struct timezone *tz);
      • tv指向struct timeval结构体
      • tz指向struct timezone结构体
      • return 0 表示成功, -1 表示失败
    • timersub() 宏 用于将两个struct timeval结构体相减的宏

      • void timersub(struct timeval* a, struct timeval *b, struct timeval *result);
    • timeradd() 宏 用于将两个struct timeval 结构体相加的宏

      • void timeradd(struct timeval *a, struct timeval *b, struct timeval *result);
      • a 指向 struct timeval
      • b 指向 struct timeval
      • result 指向 struct timeval
    • timercmp() 宏

      • int timercmp(struct timeval a, struct timeval b, CMP);
      • a b 指向struct timeval
      • CMP 比较操作符 < > == 等
    • select() 多路io操作 ,也可以用于实现高精度的超时等待

      • int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
      • nfds 文件描述符的数量 通常为fd_set中最大文件描述符的值加1
      • readfds 用于监控可读事件的文件描述符集合
      • writefds 用于监控可写事件的文件描述符集合
      • exceptfds 用于监控异常事件的文件描述符集合
      • timeout 指定超时时间NULL表示无限等待,timeout指向一个struct timeval结构。
      • return 就绪的fd个数 超时return 0 出错return -1 并设置errno
    • setitimer() 用于设置计时器,并在计时器到期时发送信号,可以用于定时任务的实现

      • int setitimer(int which, const struct itimerval *new_value, struct itimerval *old_value);

      • which 选择定时器的类型

        • ITIMER_REAL 实时时钟,计时器到期时发送SIGALRM信号
        • ITIMER_VIRTUAL 进程消耗的虚拟事件,计时器到期发送SIGALRM信号
        • ITIMER_PROF 进程执行事件与系统调用时间之和,计时器到期后发送SIGPROF信号
      • new_value 指向 struct itimerval用于设置定时器的初始值和间隔值

        • struct itimerval{

          • struct timeval it_value{

            • time_t tv_sec
            • suseconds_t tv_usec

            }

          • struct timeval it_interval{

            • tv_sec
            • tv_usec

            }

          }

      • odl_value 如果部位null, 存储先前的定时器值

      • return 0 成功, return -1 失败 设置errno

ntp_linux

linux 时间同步

  • 在windows中,系统时间设定后,机器关机、重启时系统时间会自动保存在Bios的时钟里面。启动计算机的时候会自动在bios里面读取硬件时间,以保证时间的不间断。
  • 在linux下,默认情况,系统时间和硬件时间不会自动同步。在linux运行过程中,系统时间和硬件时间互不干扰。硬件时间是靠bios电池来维持,系统时间是靠cpu tick来维持。

linux时间与时区

  • 概念:

    • 系统时间 system time

      • linux操作系统运行时的时间,存储在内存中,内核会持续更新这个时间。在系统重启后,系统时间从硬件时钟中读取并加载到内存中,操作系统使用系统时间作为主要的时间源。
    • 硬件时间hardware time, RTC(Real-Time Clock)

      • 硬件时间是主板上的实时时钟RTC提供的时间信息,它在系统关闭时仍然保持运行,确保时间不会丢失。硬件时钟是杜立德,不以来操作系统的运行,系统关机后依然记录时间。
      • 系统启动时,内核会读取硬件时间,并设置系统时间。
      • 系统关机或重启时,通常会将系统时间写回到硬件时间,以确保下一次启动时硬件时间是最新的。
      • 系统运行期间,系统时间会定期同步或手动同步,不会直接影响硬件时间。
    • 时区 Timezone

      • 时区是定义时间相对于标准时间UTC的偏移量。时区定义了一个地理区域的标准时间,linux系统允许用户设置本地失去,以便显示本地时间。

      • UTC vs 本地时间

        • 在linux系统中默认使用UTC(universal Time Coordinated),来存储和计算时间。如果设置了本地时区,系统会在显示时将UTC时间转换为指定时区的本地时间。

        • 时区文件: 时区信息保存在 /etc/localtime文件中, 这个文件是一个指向具体时区信息的符号链接,时区数据存储在 /usr/share/zoneinfo/目录中。可以通过链接到指定区域的时区文件来临更改系统的时区。

          1
          sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
        • timedatectl命令

          1
          2
          3
          4
          5
          6
          7
          8
          9
          10
          11
          12
          13
          14
          15
          16
          17
          18
          19
          20
          ## 查看当前时区
          timedatectl
          # Local time: Mon 2024-10-18 12:34:56 CST
          # Universal time: Mon 2024-10-18 04:34:56 UTC
          # RIC time: Mon 2024-10-18 04:34:56
          # Time zone: Asia/Shanghai (CST, +0800)
          #System clock synchronized: yes
          # NTP serveice: active
          # TRC in local TZ: no ## RTC是否以本地时区存储

          ## 设置时区
          sudo timedatectl set-timezone Asia/Shanghai

          ## 将硬件硬件时钟设置为UTC:
          sudo timedatectl set-local-rtc 0

          ## 将硬件时钟设置为本地时区:
          sudo timedatectl set-local-rtc 1
          # windows的做法,如果同一台机器装了linux和windows需要这样做

linux 系统时间的设定

  • date命令

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    ## 查看命令
    date
    #2024年10月19日星期五 18:00:32 CST

    ## 设置命令
    date -set="2024-10-19 00:01"
    #2024年10月19日星期五00:00:01 CST

    ## 设置命令
    date 101900012004.35
    #2004年10月19日00:01:35 CST

linux 硬件时间的设定

  • hwclock命令

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    ## 查看命令
    hwclock --show
    #2024-10-18 18:11:13.147770+08:0

    ## 查看命令
    hwclock
    #2024-10-18 18:11:13.147770+08:0

    ## 设置命令
    hwclock --set --date="10/19/23 00:00:01"
    #2023年10月19日 00:00:01 cst

    ## 根据系统时间设置硬件时间
    hwclock -w

linux系统时间和硬件时间的同步

  • hwclock命令

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    ## 根据系统时间设置硬件时间 
    hwclock --systohc # sys time to hadr clock

    ## 根据系统时间设置硬件时间
    hwclock -w

    ## 根据硬件时间设置系统时间
    hwclock -hctosys # hadr clock to sys time

    ## 根据硬件时间设置系统时间
    hwclcok -s

linux 不同机器间的时间同步

  • 为了避免主机因长时间运转下所导致的时间偏差,进行时间同步synchronize的工作是非常必要的。linux系统下,一般使用ntp服务器来同步不同机器的时间,一台机器可以同时是ntp客户端和ntp服务器。

  • ntpdate命令 强制将系统时间设置为ntp服务器时间

    1
    2
    3
    ntpdate [-nv] [NTP IP/hostname]
    ntpdate time.ntp.org
    ntpdate 192.168.0.2

    这样的同步只是强制性的将系统时间设置为ntp服务器时间,如果cpu tick有问题,只是指标不治本。所以一般配合cron命令,来进行定期同步设置。在crontab中添加0 12 * * * * /usr/sbin/ntpdate 192.168.0.1,这样会在每天12点同步一次时间。 ntp服务器ip为192.168.0.1

  • ntpd有一个自我保护设置:如果本机与ntp服务器时间差距太大,ntpd将不会运行。新设置的时间服务器一定要先ntpdate从上源取得时间初值。然后启动ntpd服务。ntpd服务先是每64秒与ntp服务器同步一次,根据每次同步时测得的时间差值经复杂计算逐步调整自己的时间,随着误差减小,逐步增加同步的间隔,每次跳动都会重复这个过程。

  • ntpd服务

    • ntp安装
    1
    sudo pacman -S ntp # archlinux
    • 配置文件/etc/ntp.conf

      1
      2
      3
      4
      server 0.pool.ntp.org iburst # iburst客户端无法立即连接到服务器时,允许快速发送几个同步请求 
      server 1.pool.ntp.org iburst #pool.ntp.org通用的ntp服务器
      server 2.pool.ntp.org iburst
      server 3.pool.ntp.org iburst
    • 启动ntpd

      1
      2
      3
      sudo systemctl start ntpd
      sudo systemctl status ntpd
      sudo systemctl enable ntpd
    • 手动同步时间

      1
      2
      sudo ntpd -gq 
      ## -g 允许时间进行大幅度调整,-q ntpd调整完后立即退出而不作为守护进程
    • 查看ntp同步状态

      1
      2
      3
      4
      5
      ntpq -p 
      # remote refid st t when poll reach delay offset jitter
      # =======================================================================
      # time.cloudflare .CFCD. 3 u 60 64 1 50.236 -12.345 5.678
      # ntp1.ntp.org .GPS. 1 u 30 64 1 32.586 0.234 1.234

      第一个当前使用的服务器 time.cloudflare

      第二个备选服务器ntp1.ntp.org

      st 层级 stratum

      delay 客户端和服务器之间的延迟

      offset 本地时钟和远程时钟之间的时间差

      jitter 时间抖动(时间的波动)

cut_linux_command

  • cut命令用于从文件或标准输入中提取指定部分的文本行。主要通过列、字符或字段来分割文本。
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    cut -c 1-5 filename.txt
    #提取每行的第1到第5个字符

    cut -b 1-5 filename.txt
    #提取每行的第1到第5个字节

    cut -d ':' -f 2,4 filename.txt
    #提取用','分隔的第2和第4个字段

    cut -d ',' -f 1,3 --output-delimiter=":" filename.txt
    #使用冒号作为分隔符提取使用逗号分隔的第1和第3个字段

tar command

  • tar command creates tar files by converting a group of files into an archive. It also can extract tar archives, display a list of the files included in the archive, add additional files to an existing archive, and various other kinds of operations.
  • tar was designed for creating archives to store files on magnetic tape, which is why its name “Tape Archive”
  • There are two versions of tar, BSD tar and GNU tar, with some functional differences. Most linux systems come with GNU tar pre-installed by default.

tar syntax

  • tar [operation_and_options] [archive_name] [file_name(s)]
  • operation
    • –create (-c) == create a new tar archive
    • –extract (-x) == extract the entire archive or one or more files from an archive
    • –list (-t) == display a list of the files included in the archive
  • options
    • –verbose (-v) == show the files being processed by the tar command
    • –file=archive-name (-f archive-name) == specifies the archive name

creating tar archive

  • tar supports a vast range of compression programs such as gzip, bzip2, lzip, lzma, lzop, xz, compress.
  • It is an accepted convention to append the compressor suffix to the archive file name.
  • e.g. an archive has been compressed with gzip, it should be named archive.tar.gz
1
2
3
4
5
6
7
8
9
10
11
12
#create an archive named archive.tar with file1 - 3
tar -cf archive.tar file1 file2 file2 file3
tar --create --file=archive.tar file1 file2 file3

#create an archive named backup.tar of the /home/user directory
tar -cf backup.tar /home/usr

#create tar gz archive, the '-z' option tells tar to compress the archive using the gizp
tar -czf archive.tar.gz file1 file2

#create tar bzip archive file
tar -cjf archive.tar.bz2 file1 file2

listing tar archives

1
2
tar -tf archive.tar
tar -tvf archive.tar

extracting tar archive

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
tar -xf archive.tar

#extract the archive contents to the /opt/files directory
tar -xf archive.tar -C /opt/files

#extracting files from compressed archive
tar -xvf archive.tar.gz
tar -xvf archive.tar.bz2

#extracting specific files from a tar archive
tar -xvf archive.tar file1 file2

#extracting specific directory from a tar archive
tar -xvf archive.tar dir1 dir2

#extracting files from a tar archive using wildcard
#switch and quote the pattern to prevent the shell from interpreting it
#to extract files whose names end in .js
tar -xvf archive.tar --wildcards '*.js'

adding files to existing tar archive

1
2
#use the --append(-r) operation
tar -rvf archive.tar newfile

removing files from a tar archive

1
2
3
#use the --delete operation to remove files from an archive
#remove the file1 from archive.tar
tar --delete -f archive.tar file1

链接

静态库

  • archive 通过 ar(用于archive的使用工具)来创建和更新
  • 静态哭约定在他们的文件名中使用”.a”的扩展名
1
2
3
4
5
6
7
#首先将代码文件编译为目标文件.o
gcc -c staticMath.c
#使用ar工具打包成.a的静态库文件
ar -crv libstaticmath.a staticMath.o

#使用静态库, -L指定静态库的搜索路径 -l指定静态库名 不需要lib前缀和.a后缀
gcc TestStaticMath.c -L../StaticLibrary -lstaticmath

动态库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#使用-fPIC生成目标文件 
gcc -fPIC -c DynamicMath.c
#使用连接器选项-shared生成动态库 .so shared object
gcc -shared -o libdynmath.so DynamicMath.o


#两步可以合二为一
gcc -fPIC -shared -o libdynmath.so DynamicMath.c

#使用动态库编译成可执行文件
gcc TestDynamicLibrary.c -L../DynamicLibrary -ldynmath
#将libdynmath.so安装在/lib或/usr/lib目录下
#或在/etc/ld.so.conf文件加入库目录所在的路径名
#ldconfig 运行ldconfig重建/etc/ld.so.cache文件

##查看一个可执行程序以来的共享库
ldd a.out

## nm命令可以打印出库中的涉及到的所有符号
nm libhello.h
#T表示 库中定义的函数
#W表示 在库中被定义,可能被其他库中的同名符号覆盖
#U表示 在库中被调用,单并没有在库中定义(需要其他函数库支持)

tmux-command

Session

create session

1
2
3
4
5
6
7
8
#不指定session的名称
tmux

#指定session的名称为hello
tmux new -s hello

#查看创建的session
tmux ls

detach session

1
2
3
4
#^b d 快捷键可以脱离当前会话 

#使用命令
tmux detach

attach session

1
2
#重新连接到之前脱离的会话 
tmux attach -t hello

kill session

1
2
3
4
#关闭会话hello
tmux kill-session -t hello

#^d 快捷键也可以关闭当前的会话

switch session

1
2
#从当前会话切换到其他会话 
tmux switch -t hello

rename session

1
2
3
4
#将hello会话重命名为haa
tmux rename-session -t hello haa

#^b $来重命名当前会话

Pane

split window

1
2
3
4
5
6
7
8
9
#将当前工作区划分为上下两个窗口 
tmux split-window

#将当前工作区划分为左右两个窗口
tmux split-window -h

#^b % 快捷键左右切割

#^b " 快捷键上下切割

select pane

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#把当前光标移动到上方的窗口 
tmux select-pane -U

#把当前光标移动到下方的窗口
tmux select-pane -D

#把当前光标移动到左方的窗口
tmux select-pane -L

#把当前光标移动到右方的窗口
tmux select-pane -R

#^b <arrow key> 方向键控制

#^b ; 光标切换到上一个窗口
#^b o 光标切换到下一个窗口

swap pane

1
2
3
4
5
#将当前窗口向上移动 
tmux swap-pane -U

#将当前窗口向下移动
tmux swap-pane -D

other

1
2
3
#^b z  放大当前窗口  继续出发还原

#^b t 在当前的窗口显示时间

Window

create window

1
2
3
4
#创建一个名字为hello-win的窗口 
tmux new-window -n hello-win

#^b c 快捷键快速创建一个窗口出来

slect window

1
2
3
4
5
6
7
#在有多个窗口的条件下,可以快速进入指定的窗口 
tmux select-window -t hello2-win


#^b w 可以通过j k 进行上下选择
#^b n 快速切换到下一个窗口
#^b p 快速切换到上一个窗口

rename window

1
2
3
4
#将当前窗口的名字命名为new-window
tmux rename-window new-window

#^b 快捷键可以重命名窗口

shutdown window

1
2
3
4
#删除名为hello-win的窗口 
tmux kill-window -t hello-win

#^b & 可以关闭当前的窗口

tmux.conf

  • 在tmux中可以通过^b ?来查找tmux的帮助文档,可以查询一些功能键的快捷键信息
  • .tmux.conf配置文件, 默认放置在目录下, 没有可以在下创建一个.tmux.conf文件
  • 可以在配置文件中将^b 改为 ^x

openssl command

openssl genrsa

1
2
3
openssl genrsa #生成私钥,输出到控制台
openssl genrsa -out plaint-private.pem 2048 #密钥长度2048 输出文件plaint-private.pem
openssl genrsa -aes192 -passout pass:123456 -out passwd-private.pem 2048 #指定密码

openssl rsa

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
openssl rsa -in plaint-private.pem -pubout -out plaint-public.pem
#从未加密的私钥中提取公钥

openssl rsa -in passwd-private.pem -passin:12345 -pubout -out plaint-public.pem
#从加密的私钥中提取公钥

openssl rsa -in plaint-private.key -pubout
#从未加密的私钥中提取公钥输出到控制台

openssl rsa -in plaint-private.pem -des3 -passout pass:123456 -out passwd-private.pem
#使用des3加密私钥

openssl rsa -inform pem -in plaint-private.pem -outform der -out plaint-private.der
#私钥格式转换pem -> der

openssl rsa -in plaint-private.pem -check -noout
#校验私钥的完整性

openssl rsautl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
openssl rsautl -encrypt -inkey plaint-public.pem -pubin -in plaintext.txt -out ciphertext.txt
#使用公钥加密文件

openssl rsautl -decrypt -inkey plaint-private.pem -in ciphertext.txt -out plaintext.txt
#使用私钥进行解密

openssl rsautl -sign -inkey plaint-private.pem -in plaintext.txt -out signature.txt
#使用私钥进行签名

openssl rsautl -verify -inkey plaint-public.pem -in signature.txt -out verified.txt
#公钥验签

openssl rsautl -encrypt -inkey test-public.cer -certin -in plaintext.txt -out ciphertext.txt
#证书加密, -certin密钥文件为证书

openssl rsautl -decrypt -inkey test-key.pem -in ciphertext.txt -out decrtpted.txt
#使用私钥解密加密证书


openssl rsautl -sign -inkey text-key.pem -in plaintext.txt -out sinature.txt
#使用私钥签名

openssl rsautl -verify -inkey test-public.cer -certin -in signature.txt -out verified.txt
#使用证书验签

openssl genpkey

1
2
3
4
5
6
7
8
openssl genpkey -algorithm rsa 
#生成私钥,输出到控制台 指定算法为rsa

openssl genpkey -algorithm rsa -out plaint-private.pem -pkeyopt rsa_keygen_bits:2048
#指定使用rsa算法产生2048位私钥

openssl genpkey -algorithm rsa -pass pass:123456 -out passwd-private.pem 2048
#使用密码123456加密私钥

openssl pkey

1
2
3
4
5
6
7
8
9
10
11
12
13
14
openssl pkey -in plaint-private.pem -pubout -out plaint-public.pem 
#提取公钥

openssl pkey -in passwd-private.pem -passin pass:123456 -pubout -out plaint-public.pem
#从加密的私钥中提取公钥

openssl pkey -in plaint-private.pem -pubout
#提取公钥,输出到控制台

openssl pkey -in plaint-private.pem -des3 -passout pass:123456 -out passwd-private.pem
#私钥加密

openssl pkey -inform pem -in plaint-private.pem -outform der -out plaint-private.der
#私钥格式转换,pem--->der格式

openssl pkeyutl

1
2
3
4
5
6
7
8
9
10
11
openssl pkeyutl -encrypt -inkey plaint-public.pem -pubin -in plaintext.txt -out ciphertext.txt
#使用公钥加密文件

openssl pkeyutl -decrypt -inkey palint-private.pem -in ciphertext.txt -out decrypted.txt
#使用私钥进行解密

openssl pkeyutl -sign -inkey plaint-private.pem -in palintext.txt -out signature.txt
#使用私钥进行签名

openssl pkeyutl -verifyrecover -inkey plaint-public.pem -pubin -in signature.txt -out virified.txt
#使用公钥进行验证

openssl req

1
2
3
4
5
6
7
8
9
10
11
12
13
14
openssl req -new -key plaint-private.pem -out palint-request.csr -subj "/C=CN/ST=ZJ/L=HZ/O=RX/OU=ZG/CN=RXCA"
#创建请求证书 -new 创建请求证书, -key使用文件中的私钥, -subj 设置请求证书主题

openssl req -in plaint-request.csr -pubkey -nouut > plaint-public.pem
#提取公钥

openssl req -in plaint-request.csr -subject -noout
#提取主题

openssl req -verify -in plaint-request.csr -noout
#校验请求证书签名是否合法

openssl req -newkey rsa:2048 -nodes -keyout ca-key.pem -out ca-request.csr -subj "/C=CN/ST=ZJ/L=HZ/O=RX/OU=ZG/CN=RXCA"
#创建私钥和请求证书文件,-newkey 创建私钥并指定算法, -nodes 输出私钥不加密 -keyout 指定私钥文件

openssl x509

1
2
3
4
5
6
7
8
9
10
11
12
13
14
openssl genrsa -out ca-key.pem 2048
openssl req -new -key ca-key.pem -out ca-request.csr -subj "/C=CN/ST=ZJ/L=HZ/O=RX/OU=ZG/CN=RXCA"
openssl x509 -req -in ca-request.csr -days 3650 -signkey ca-key.pem -out ca-root.cer
#创建根证书 自签名证书 -req 输入请求证书文件 -signkey 指定自签名证书私钥

openssl genrsa -out test-key.pem 2048
openssl req -new -key test-key.pem -out test-request.csr -subj "/C=CN/ST=ZJ/L=HZ/O=RX/OU=ZG/CN=RXCA"
openssl x509 -req -in text-request.csr -days 365 -CA ca-root.cer -CAkey ca-key.pem -CAcreateserial -out test-public.cer
#创建通信证书 -req 输入请求证书文件 -CA 指定根证书 -CAkey 指定根证书的私钥

openssl x509 -in test-public.cer -dates -issuer -subject -email -noout
#提取证书信息 -dates 证书的可开始和结束的时间 -issuer 发行人主题 -subject 证书主题 -email 邮件信息

openssl x509 -in test-public.cer -pubkey -noout > plaint-public.pem

ignore some package update

禁止某些安装包升级

1
2
3
4
5
6
7
8
#查找要禁止更新的包名
sudo pacman -Qe | grep 'name_of_package'

#在/etc/pacman.conf文件中IgnorePkg行添加 包名 空格隔开
sudo vim /etc/pacman.conf
IgnorePkg = nvidia nvidia-utils nvidia-cg-toolkit

sudo pacman -Syyu

降级安装包

1
2
yay -S downgrade
downgrade eclipse