随笔分类 -  Linux开发

摘要:#!/bin/sh curuser=`w -h | awk 'NR==1' | awk '{print $1}'` su - $curuser -c /etc/profile.d/xxxx.sh 阅读全文
posted @ 2022-12-22 11:31 ziwuxian 阅读(276) 评论(0) 推荐(0)
摘要:编写一个HelloWorld程序 #include <stdio.h> #include <stdlib.h> int main(int argc,char **argv) { while(1) { printf("hello world\n"); sleep(2);//2s } } gcc编译生成 阅读全文
posted @ 2021-06-18 14:07 ziwuxian 阅读(325) 评论(0) 推荐(0)
摘要:#include <ft2build.h> #include FT_FREETYPE_H #include <freetype/freetype.h> #include <freetype/ftglyph.h> int main() { FT_Library pFTLib = NULL; FT_Fa 阅读全文
posted @ 2021-01-12 11:27 ziwuxian 阅读(485) 评论(0) 推荐(0)
摘要:sudo apt install libxrandr-dev 阅读全文
posted @ 2020-11-10 16:09 ziwuxian 阅读(3509) 评论(0) 推荐(2)
摘要:1. 使用gcc -g 参数编译生成可调试的程序app gcc main.c -o app -g 2. 启动gdb调试程序 gdb app 如果需要给程序传递参数的话,在gdb启动后使用set args传参: set args xxx xxx xxx 启动调试: run #或缩写:r 3. gdb启 阅读全文
posted @ 2020-06-04 22:01 ziwuxian 阅读(2604) 评论(0) 推荐(0)
摘要:一、安装 .NET Core 2.1 运行时:dotnet-runtime-2.1,需要CentOS 7以上版本。 sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm sud 阅读全文
posted @ 2020-05-22 16:56 ziwuxian 阅读(235) 评论(0) 推荐(0)
摘要:1 编写头文件 test.h代码: #ifndef __TEST_H_ #define __TEST_H_ void sayHello(void); #endif 2 编写库代码 test.c的代码: #include <stdio.h> #include "test.h" void sayHell 阅读全文
posted @ 2020-03-28 21:00 ziwuxian 阅读(550) 评论(0) 推荐(0)
摘要:1 编写头文件 test.h代码: #ifndef __TEST_H_ #define __TEST_H_ void sayHello(void); #endif 2 编写代码 test.c代码: #include <stdio.h> #include "test.h" void sayHello( 阅读全文
posted @ 2020-03-28 20:34 ziwuxian 阅读(284) 评论(0) 推荐(0)
摘要:CFLAGS = -Wall -g -o CC = gcc src=$(wildcard ./*.c) obj=$(patsubst %.c, %.o, $(src)) target=app $(target):$(obj) $(CC) $^ $(CFLAGS) $@ %.o:%.c $(CC) $ 阅读全文
posted @ 2020-03-28 20:06 ziwuxian 阅读(95) 评论(0) 推荐(0)
摘要:1 make make 是Linux自带的构建器,构建的规则在makefile文件中 2 makefile文件名 makefile 或 Makefile 3 makefile中的规则 makefile的规则有三部分:目标,依赖,命令; makefile有一条或多条规则组成; 第一个目标是makefi 阅读全文
posted @ 2020-03-28 16:37 ziwuxian 阅读(276) 评论(0) 推荐(0)
摘要:直接运行: sed -i "s/原文本/替换后的文本/g" `grep -rl 原文本 ./` sed -i : 直接修改文件内容 grep -l : 查找到匹配字符串的文件 (注意, 是含有匹配字符串的文件,也就是含有原文本的文件) 阅读全文
posted @ 2019-11-15 17:12 ziwuxian 阅读(378) 评论(0) 推荐(0)
摘要:<%@ page language="java" import="java.util.*,java.io.*" pageEncoding="UTF-8"%> <% //java运行Linux命令:Runtime.getRuntime().exec("/bin/bash 命令"); Runtime.g 阅读全文
posted @ 2019-06-17 11:37 ziwuxian 阅读(1114) 评论(0) 推荐(0)