![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
tadus_zeng
the world need balance
展开
-
C++符号还原
C++ name mangling由于C++ 有命名空间,函数重载等特性,在原码被编译后会对函数进行重命名cxxabic++应用程序二进制接口// name_demangling.cc#include <cassert>#include <cstring>#include <cxxabi.h>#include <iostream>int main(int argc, char *argv[]) { assert(argc > 1原创 2021-05-18 13:52:26 · 402 阅读 · 0 评论 -
systemtap初棎
官网 https://sourceware.org/systemtap/教程 https://sourceware.org/systemtap/tutorial.pdf安装# centosyum install systemtapstap --version第一个程序#!/usr/bin/stap### hello.stp ###probe begin { log("hello stap") exit()}stap ./hello.stp一个socket监控例子#!.原创 2021-05-17 17:14:27 · 277 阅读 · 0 评论 -
linux上动态追踪技术:bcc
参考动态追踪技术漫谈BCC – 用于Linux性能监视,网络和更多的动态跟踪工具动态追踪技术漫谈《性能之巅》学习笔记之Dtrace安装# 在centos上yum install bcc.x86_64tools 目录ls /usr/share/bcc/toolsargdist compactsnoop ext4dist javaobjnew nodegc profile runqslower tclobjnew t原创 2021-05-17 14:40:07 · 297 阅读 · 0 评论 -
linux定时任务crontab
安装yum install crontabsorapt-get install crontabs语法* * * * * ${shell command} # shell命令- - - - -| | | | || | | | +----- 星期中星期几 (0 - 6) (星期天 为0)| | | +---------- 月份 (1 - 12) | | .原创 2021-05-15 16:34:15 · 69 阅读 · 0 评论 -
shell 字符串处理:截取
${var#word} 删除前缀,最小匹配前缀${var##word} 删除前缀,最大匹配前缀${var%word} 删除后缀,最小匹配后缀${var%%word} 删除后缀,最大匹配后缀例子for i in `ls /public/src/*.so*`;do ln -sf $i /usr/lib/${i##*/} ;done...原创 2021-05-14 16:04:13 · 66 阅读 · 0 评论 -
linux flock简介与简单应用
flock即文件锁,是建议性锁,需要各进程主动去获取与释放。flock适合进程间通信,不适合用作线程间互斥。主要应用在解决文件读写冲突上。linux命令$ flock -hUsage: flock [options] <file|directory> <command> [command args] flock [options] <file|directory> -c <command> flock [options] <file d原创 2021-03-17 16:19:23 · 8115 阅读 · 0 评论 -
linux C/C++ 信号
# 在linux系统下,查看信号的定义,HUP=1 INT=2 QUIT=3 ... $ kill -lHUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH POLL PWR SYS# linux系统下 查看部分快捷键与SIGNAL的关系$ stty -aspeed 3840原创 2021-03-15 15:01:09 · 118 阅读 · 0 评论 -
c/c++ 数组的大小
在C89之前,数组的长度必须是常量,之后的标准里可以使用变量来作为数组的长度,并且占用的是栈空间,并且sizeof可以推断出数组变量的大小。#include <cassert>#include <cstddef>#include <cstdio>#include <cstdlib>#include <cstring>#include <fstream>#include <iostream>#include原创 2021-03-05 18:19:53 · 3952 阅读 · 0 评论 -
Linux下ZeroMQ入门
介绍ZeroMQ(也称为ØMQ、0MQ或ZMQ)是一个高性能的异步消息传递库,旨在用于分布式或并发应用程序。它提供了一个消息队列,但与面向消息的中间件不同,ZeroMQ系统可以在没有专用消息代理的情况下运行。ZeroMQ通过各种传输(TCP、进程内、进程间、多播、WebSocket等)支持常见的消息传递模式(pub/sub、请求/应答、客户机/服务器等),使进程间消息传递与线程间消息传递一样简单。这使您的代码保持清晰、模块化和极易扩展。ZeroMQ是由一个大型贡献者社区开发的。许多流行编程语言都有第三原创 2021-02-23 16:09:31 · 646 阅读 · 0 评论 -
linux下c/c++调用外部程序
system函数// system_exe.cc#include <cassert>#include <spdlog/common.h>#include <spdlog/spdlog.h>#include <string>#include <unistd.h>int main(int argc, char *argv[]) { assert(argc >= 2); spdlog::set_level(spdlog::l原创 2021-02-22 15:09:58 · 5285 阅读 · 0 评论 -
Linux下C/C++ URL转IP
C/C++ URL转IP// url2ip.cc#include <spdlog/spdlog.h>#include <cstring>#include <netdb.h>#include <cassert>#include <netinet/in.h>#include <arpa/inet.h>int main(int argc,char* argv[]){ assert(argc >= 2); hoste原创 2021-02-19 18:01:34 · 667 阅读 · 2 评论